Package org.jppf.ui.options
Class FileChooserOption
java.lang.Object
org.jppf.ui.options.AbstractOptionProperties
org.jppf.ui.options.AbstractOptionElement
org.jppf.ui.options.AbstractOption
org.jppf.ui.options.FileChooserOption
- All Implemented Interfaces:
Serializable,Option,OptionElement,OptionProperties
This option encapsulates a file chooser control. It is composed of three components:
a label, a text field containing the file name, and a button used to pop up a file
chooser dialog.
- Author:
- Laurent Cohen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe file chooser is for opening files.static final intThe file chooser is for saving files.Fields inherited from class org.jppf.ui.options.AbstractOption
listeners, persistent, valueFields inherited from class org.jppf.ui.options.AbstractOptionElement
parent, rootFields inherited from class org.jppf.ui.options.AbstractOptionProperties
bordered, componentConstraints, detachable, eventsEnabled, finalizer, horizontalScrollbar, iconPath, initializer, label, layoutConstraints, mouseListener, name, scripts, scrollable, toolTipText, UIComponent, verticalScrollbar -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.FileChooserOption(String name, String label, String tooltip, String value, int dialogType) Initialize this combo box option with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateUI()Create the UI components for this option.voidSelect a file using a chooser dialog and according to this option's specifications.intGet the type of the file chooser dialog.Get the list of extensions for the files the user can select.voidsetDialogType(int dialogType) Set the type of the file chooser dialog.voidsetEnabled(boolean enabled) Enable or disable this option.voidsetExtensions(String extensions) Set the list of extensions for the files the user can select.protected voidDefine a selection listener that will forward changes to the chosen file name to all value change listeners that registered with this option.Methods inherited from class org.jppf.ui.options.AbstractOption
addValueChangeListener, fireValueChanged, getValue, isPersistent, layoutComponents, layoutComponents, removeValueChangeListener, setPersistent, setValue, toStringMethods inherited from class org.jppf.ui.options.AbstractOptionElement
findAll, findAllWithName, findElement, findFirstWithName, findLastWithName, getChildForName, getParent, getPath, getRoot, getStringPath, setParentMethods inherited from class org.jppf.ui.options.AbstractOptionProperties
createScrollPane, getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getMouseListener, getName, getScripts, getToolTipText, getUIComponent, isBordered, isDetachable, isEventsEnabled, isHorizontalScrollbar, isScrollable, isVerticalScrollbar, setBordered, setComponentConstraints, setDetachable, setEditable, setEventsEnabled, setFinalizer, setHorizontalScrollbar, setIconPath, setInitializer, setLabel, setLayoutConstraints, setMouseListener, setName, setScrollable, setToolTipText, setUIComponent, setVerticalScrollbarMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.ui.options.OptionElement
findAllWithName, findElement, findFirstWithName, findLastWithName, getParent, getPath, getRoot, getStringPathMethods inherited from interface org.jppf.ui.options.OptionProperties
getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getMouseListener, getName, getScripts, getToolTipText, getUIComponent, isBordered, isDetachable, isEventsEnabled, isScrollable, setComponentConstraints, setEditable, setEventsEnabled, setLayoutConstraints, setMouseListener
-
Field Details
-
OPEN
public static final int OPENThe file chooser is for opening files.- See Also:
-
SAVE
public static final int SAVEThe file chooser is for saving files.- See Also:
-
-
Constructor Details
-
FileChooserOption
public FileChooserOption()Default constructor. -
FileChooserOption
Initialize this combo box option with the specified parameters.- Parameters:
name- this component's name.label- the label displayed with the checkbox.tooltip- the tooltip associated with the combobox.value- the initially selected value of this component.dialogType- determines the type of file chooser dialog, either open or save.
-
-
Method Details
-
createUI
public void createUI()Create the UI components for this option.- Specified by:
createUIin classAbstractOptionProperties
-
setupValueChangeNotifications
protected void setupValueChangeNotifications()Define a selection listener that will forward changes to the chosen file name to all value change listeners that registered with this option.- Specified by:
setupValueChangeNotificationsin classAbstractOption
-
setEnabled
public void setEnabled(boolean enabled) Enable or disable this option.- Parameters:
enabled- true to enable this option, false to disable it.
-
doChooseFile
public void doChooseFile()Select a file using a chooser dialog and according to this option's specifications. -
getDialogType
public int getDialogType()Get the type of the file chooser dialog.- Returns:
- the type as an int value.
-
setDialogType
public void setDialogType(int dialogType) Set the type of the file chooser dialog.- Parameters:
dialogType- the type as an int value.
-
getExtensions
Get the list of extensions for the files the user can select.- Returns:
- the extensions as a string.
- See Also:
-
setExtensions
Set the list of extensions for the files the user can select.- Parameters:
extensions- the extensions as a string with the format ext1; desc1 | ... | extN; descN.
-