|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.editor.widgets.AbstractUserInputWidget sk.uniba.euromath.editor.widgets.FileSelector
public class FileSelector
Allows user to select a file.
Field Summary | |
---|---|
protected String |
_fileName
Valid after the component is disposed. |
protected Button |
browseButton
Button that allows user to browse for files. |
protected FileBrowserEnum |
browser
A kind of browser that is displayed when the 'browse' button is clicked. |
protected Composite |
composite
Panel where all components are placed. |
protected MessageLevelEnum |
extLevel
What level of validity to signalise when preferredExtension
condition is broken. |
protected Text |
fileNameText
Textbox where the file name may be entered. |
protected Map<FileRequirementsEnum,MessageLevelEnum> |
flags
maps flags to their message level. |
protected ValidityMessages |
lastMessages
Validity messages. |
protected String |
preferredExtension
Ignored if null . |
Fields inherited from class sk.uniba.euromath.editor.widgets.AbstractUserInputWidget |
---|
listeners, msgListeners |
Constructor Summary | |
---|---|
FileSelector(Composite parent,
String preferredExtension,
MessageLevelEnum extLevel,
Map<FileRequirementsEnum,MessageLevelEnum> flags,
FileBrowserEnum browser)
Constructs instance of the widget. |
Method Summary | |
---|---|
boolean |
existsDir()
Checks whether the directory exists. |
boolean |
existsFile()
Checks whether the file exists. |
protected void |
fillData()
Fills the text value and the validity message object. |
Composite |
getComposite()
Returns composite that is encapsulated in this object. |
String |
getFileName()
Returns file name that user entered. |
ValidityMessages |
getMessages()
Checks if data contained in the widget are correct. |
String |
getState()
Returns the state of this widget. |
Class<?> |
getStateClass()
Returns the class of the state that the widget accepts. |
void |
setFileName(String fileName)
Sets the file name. |
void |
setState(Object state)
Sets new state for the widget. |
Methods inherited from class sk.uniba.euromath.editor.widgets.AbstractUserInputWidget |
---|
addMessageListener, addModifyListener, allowModifyEvent, fireDataModified, removeMessageListener, removeModifyListener, suppressModifyEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final String preferredExtension
null
. Otherwise, warning is signalised when
file name does not end with this string. The string should start with a
dot.
protected final MessageLevelEnum extLevel
preferredExtension
condition is broken.
protected Map<FileRequirementsEnum,MessageLevelEnum> flags
protected final FileBrowserEnum browser
protected final Composite composite
protected final Text fileNameText
protected final Button browseButton
protected String _fileName
protected ValidityMessages lastMessages
Constructor Detail |
---|
public FileSelector(Composite parent, String preferredExtension, MessageLevelEnum extLevel, Map<FileRequirementsEnum,MessageLevelEnum> flags, FileBrowserEnum browser)
parent
- parent composite.preferredExtension
- ignored if null
. Otherwise,
warning is signalised when file name does not end with this string. The
string should start with a dot.extLevel
- what kind of validity to signalise when
preferredExtension
condition is broken. If
null
then no extension check is performed.browser
- a kind of browser that is displayed when the 'browse'
button is clicked.flags
- maps flags to their message level.Method Detail |
---|
public final Composite getComposite()
IUserInputWidget
public String getFileName()
public void setFileName(String fileName)
fileName
- file name to set.public boolean existsFile()
true
if the file returned by
getFileName()
exists.public boolean existsDir()
true
if theprotected void fillData()
public ValidityMessages getMessages()
IUserInputWidget
null
if data is correct, or instance of
ValidityMessages
if there is error, warning or info
message.public String getState()
IUserInputWidget
public Class<?> getStateClass()
IUserInputWidget
null
.public void setState(Object state)
IUserInputWidget
state
- the model to set. You may use the construct
setModel(getModel())
to reflect changes made in the model.
Please note that nearly all widgets rejects null
value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |