@OpenApiAll public class FileProperty extends Property
java.io.File
value.File
Modifier and Type | Field and Description |
---|---|
static int |
DIRECTORIES_ONLY
Instruction to choose only directories.
|
static java.lang.String |
FILE_TYPE_ANY
Deprecated.
|
static java.lang.String |
FILE_TYPE_IMAGE
Deprecated.
|
static int |
FILES_AND_DIRECTORIES
Instruction to choose both files and directories.
|
static int |
FILES_ONLY
Instruction to choose only files.
|
DEFAULT_PROPERTY_RESOURCE_PROVIDER, EDITABLE, mValue, NULL, NULL_ID_PROPERTY_RESOURCE_PROVIDER, UNDEFINED, VALUE
Constructor and Description |
---|
FileProperty()
Default constructor.
|
FileProperty(java.lang.String id,
java.lang.String path)
The property constructor.
|
FileProperty(java.lang.String id,
java.lang.String path,
int selectionMode)
The property constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(PropertyVisitor v)
Accepts the given visitor.
|
FileProperty |
clone()
Clones the property.
|
java.lang.String |
getClassType()
Returns property class type.
|
java.io.File |
getFile(java.lang.String requestFrom)
Returns value as file.
|
java.util.List<java.lang.String> |
getFileExtensions()
Get supported file extensions.
|
java.lang.String |
getFileType()
Deprecated.
|
java.lang.String |
getPathAndExpand(java.lang.String purpose)
Get expanded (using path variables) path.
|
int |
getSelectionMode()
Returns file selection mode.
|
java.lang.String |
getValueStringRepresentation()
Returns value's string representation.
|
boolean |
isDisplayAllFiles()
Returns display all files flag.
|
boolean |
isDisplayFullPath()
Returns display full path flag.
|
boolean |
isUseFilePreviewer()
Returns use file preview flag.
|
void |
setDisplayAllFiles(boolean displayAllFiles)
Sets display all files flag.
|
void |
setDisplayFullPath(boolean displayFullPath)
Sets display full path flag.
|
void |
setFileExtensions(java.util.List<java.lang.String> fileExtensions)
Set supported file extensions.
|
void |
setFileType(java.lang.String fileType)
Deprecated.
|
void |
setPathAndCollapse(java.lang.String path)
Set Path and Collapse it by using path variables.
|
void |
setSelectionMode(int selectionMode)
Sets the file selection mode for this property.
|
void |
setUseFilePreviewer(boolean useFilePreviewer)
Sets use file previewer flag.
|
void |
setValue(java.lang.Object value)
Sets new property value.
|
_isFrozen, _setFrozen, addPropertyChangeListener, addSource, addSources, areValuesEqual, createCellEditor, createTableCellRenderer, equals, firePropertyChange, generateDefaultDescriptionID, getAdditionalProperties, getAdditionalProperty, getDescription, getDescriptionID, getFirstElementFromSources, getGroup, getID, getIntroductoryVersion, getName, getNonEditableReason, getProjectFromSourcesOrActive, getPureDescription, getResourceProvider, getResourceProviderID, getSourceAsElement, getSources, getSourcesAsStream, getUndefinedString, getUndefinedString, getValue, hashCode, isEditable, isUndefinedState, removePropertyChangeListener, setAdditionalProperties, setAdditionalProperty, setDescription, setDescriptionID, setEditable, setGroup, setID, setIntroductoryVersion, setNonEditableReason, setResourceProvider, setResourceProviderID, setSources, setUndefinedState, toString
public static final int FILES_ONLY
public static final int DIRECTORIES_ONLY
public static final int FILES_AND_DIRECTORIES
@Deprecated public static final java.lang.String FILE_TYPE_ANY
@Deprecated public static final java.lang.String FILE_TYPE_IMAGE
public FileProperty()
public FileProperty(java.lang.String id, java.lang.String path)
id
- the ID of property.path
- the file path.public FileProperty(java.lang.String id, java.lang.String path, int selectionMode)
id
- the ID of property.path
- the file path.selectionMode
- the file selection mode - FILES_ONLY, DIRECTORIES_ONLY or FILES_AND_DIRECTORIES.public void setSelectionMode(int selectionMode)
selectionMode
- the file selection mode. Possible values are FILES_ONLY, DIRECTORIES_ONLY
and FILES_AND_DIRECTORIES.public int getSelectionMode()
public java.lang.String getValueStringRepresentation()
Property
getValueStringRepresentation
in class Property
value.
toString()
if property has value.Property.getValueStringRepresentation()
public void accept(PropertyVisitor v) throws java.lang.Exception
accept
in interface PropertyVisitorAcceptor
accept
in class Property
v
- the PropertyVisitor.java.lang.Exception
public java.io.File getFile(@CheckForNull java.lang.String requestFrom) throws com.nomagic.magicdraw.pathvariables.RecursivePathVariableException
requestFrom
- request stringcom.nomagic.magicdraw.pathvariables.RecursivePathVariableException
- in case of errorpublic java.lang.String getClassType()
getClassType
in interface PropertyVisitorAcceptor
getClassType
in class Property
PropertyID.FILE_PROPERTY
public void setValue(@CheckForNull java.lang.Object value)
Property
PropertyChangeEvent
with propertyName - property
ID, newValue and oldValue.setValue
in class Property
value
- a new property value.Property.setValue(java.lang.Object)
public void setPathAndCollapse(java.lang.String path)
path
- Path string.public java.lang.String getPathAndExpand(@CheckForNull java.lang.String purpose) throws com.nomagic.magicdraw.pathvariables.RecursivePathVariableException
purpose
- used in an undefined-path-variable prompt for a user, e.g. 'The path variable <variable> used for <purpose> is not set.com.nomagic.magicdraw.pathvariables.RecursivePathVariableException
- in case of errorpublic void setDisplayFullPath(boolean displayFullPath)
displayFullPath
- - display full path flag.public boolean isDisplayFullPath()
public boolean isUseFilePreviewer()
public void setUseFilePreviewer(boolean useFilePreviewer)
useFilePreviewer
- - use file previewer flag.public boolean isDisplayAllFiles()
public void setDisplayAllFiles(boolean displayAllFiles)
displayAllFiles
- - display all files flag.@Deprecated public java.lang.String getFileType()
getFileExtensions()
@Deprecated public void setFileType(@CheckForNull java.lang.String fileType)
setFileExtensions(java.util.List)
fileType
- - type of the file.@CheckForNull public java.util.List<java.lang.String> getFileExtensions()
public void setFileExtensions(java.util.List<java.lang.String> fileExtensions)
fileExtensions
- file extensions.public FileProperty clone()
Property