org.jppf.ui.options
Class FileChooserOption

java.lang.Object
  extended by org.jppf.ui.options.AbstractOptionProperties
      extended by org.jppf.ui.options.AbstractOptionElement
          extended by org.jppf.ui.options.AbstractOption
              extended by org.jppf.ui.options.FileChooserOption
All Implemented Interfaces:
Serializable, Option, OptionElement, OptionProperties

public class FileChooserOption
extends AbstractOption

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:
Serialized Form

Field Summary
static int OPEN
          The file chooser is for opening files.
static int SAVE
          The file chooser is for saving files.
 
Fields inherited from class org.jppf.ui.options.AbstractOption
listeners, persistent, value
 
Fields inherited from class org.jppf.ui.options.AbstractOptionElement
parent, root
 
Fields inherited from class org.jppf.ui.options.AbstractOptionProperties
bordered, componentConstraints, eventsEnabled, finalizer, iconPath, initializer, label, layoutConstraints, name, scripts, scrollable, toolTipText, UIComponent
 
Constructor Summary
FileChooserOption()
          Default constructor.
FileChooserOption(String name, String label, String tooltip, String value, int dialogType)
          Initialize this combo box option with the specified parameters.
 
Method Summary
 void createUI()
          Create the UI components for this option.
 void doChooseFile()
          Select a file using a chooser dialog and according to this option's specifications.
 int getDialogType()
          Get the type of the file chooser dialog.
 String getExtensions()
          Get the list of extensions for the files the user can select.
 void setDialogType(int dialogType)
          Set the type of the file chooser dialog.
 void setEnabled(boolean enabled)
          Enable or disable this option.
 void setExtensions(String extensions)
          Set the list of extensions for the files the user can select.
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.
 
Methods inherited from class org.jppf.ui.options.AbstractOption
addValueChangeListener, fireValueChanged, getValue, isPersistent, layoutComponents, layoutComponents, removeValueChangeListener, setPersistent, setValue
 
Methods inherited from class org.jppf.ui.options.AbstractOptionElement
findAll, findAllWithName, findElement, findFirstWithName, findLastWithName, getChildForName, getParent, getPath, getRoot, getStringPath, setParent, toString
 
Methods inherited from class org.jppf.ui.options.AbstractOptionProperties
getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getName, getScripts, getToolTipText, getUIComponent, isBordered, isEventsEnabled, isScrollable, setBordered, setComponentConstraints, setEditable, setEventsEnabled, setFinalizer, setIconPath, setInitializer, setLabel, setLayoutConstraints, setName, setScrollable, setToolTipText, setUIComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jppf.ui.options.OptionElement
findAllWithName, findElement, findFirstWithName, findLastWithName, getParent, getPath, getRoot, getStringPath
 
Methods inherited from interface org.jppf.ui.options.OptionProperties
getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getName, getScripts, getToolTipText, getUIComponent, isBordered, isEventsEnabled, isScrollable, setComponentConstraints, setEditable, setEventsEnabled, setLayoutConstraints
 

Field Detail

OPEN

public static final int OPEN
The file chooser is for opening files.

See Also:
Constant Field Values

SAVE

public static final int SAVE
The file chooser is for saving files.

See Also:
Constant Field Values
Constructor Detail

FileChooserOption

public FileChooserOption()
Default constructor.


FileChooserOption

public FileChooserOption(String name,
                         String label,
                         String tooltip,
                         String value,
                         int dialogType)
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 Detail

createUI

public void createUI()
Create the UI components for this option.

Specified by:
createUI in class AbstractOptionProperties
See Also:
AbstractOptionProperties.createUI()

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:
setupValueChangeNotifications in class AbstractOption
See Also:
AbstractOption.setupValueChangeNotifications()

setEnabled

public void setEnabled(boolean enabled)
Enable or disable this option.

Parameters:
enabled - true to enable this option, false to disable it.
See Also:
OptionProperties.setEnabled(boolean)

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

public String getExtensions()
Get the list of extensions for the files the user can select.

Returns:
the extensions as a string.
See Also:
setExtensions(java.lang.String)

setExtensions

public void setExtensions(String extensions)
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.


Copyright © 2005-2010 JPPF Team.