Package weka.gui

Class FileEnvironmentField

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyEditor, Serializable, Accessible, EnvironmentHandler, CustomPanelSupplier

public class FileEnvironmentField extends EnvironmentField
Widget that displays a label, editable combo box for selecting environment variables and a button for brining up a file browser. The user can enter arbitrary text, select an environment variable or a combination of both. Any variables are resolved (if possible) and resolved values are displayed in a tip-text.
Version:
$Revision: 14496 $
Author:
Mark Hall (mhall{[at]}pentaho{[dot]}com)
See Also:
  • Constructor Details

    • FileEnvironmentField

      public FileEnvironmentField()
      Constructor
    • FileEnvironmentField

      public FileEnvironmentField(Environment env)
      Constructor
      Parameters:
      env - an Environment object to use
    • FileEnvironmentField

      public FileEnvironmentField(String label, Environment env)
    • FileEnvironmentField

      public FileEnvironmentField(String label, Environment env, int fileChooserType)
      Constructor
      Parameters:
      label - a label to display alongside the field.
      env - an Environment object to use.
      fileChooserType - the type of file chooser to use (either JFileChooser.OPEN_DIALOG or JFileChooser.SAVE_DIALOG)
    • FileEnvironmentField

      public FileEnvironmentField(String label, Environment env, int fileChooserType, boolean directoriesOnly)
      Constructor
      Parameters:
      label - a label to display alongside the field.
      env - an Environment object to use.
      fileChooserType - the type of file chooser to use (either JFileChooser.OPEN_DIALOG or JFileChooser.SAVE_DIALOG)
      directoriesOnly - true if file chooser should allow only directories to be selected
    • FileEnvironmentField

      public FileEnvironmentField(String label, int fileChooserType, boolean directoriesOnly)
      Constructor
      Parameters:
      label - a label to display alongside the field.
      fileChooserType - the type of file chooser to use (either JFileChooser.OPEN_DIALOG or JFileChooser.SAVE_DIALOG)
  • Method Details

    • addFileFilter

      public void addFileFilter(FileFilter toSet)
      Add a file filter to use
      Parameters:
      toSet - the file filter to use
    • setFileFilter

      public void setFileFilter(FileFilter toSet)
      Set the file filter to be the selected one in the drop down box
      Parameters:
      toSet - the file filter to set
    • setCurrentDirectory

      public void setCurrentDirectory(String directory)
    • setCurrentDirectory

      public void setCurrentDirectory(File directory)
    • resetFileFilters

      public void resetFileFilters()
      Resets the list of choosable file filters.
    • removeNotify

      public void removeNotify()
      Overrides:
      removeNotify in class JComponent
    • setEnabled

      public void setEnabled(boolean enabled)
      Set the enabled status of the combo box and button
      Overrides:
      setEnabled in class EnvironmentField
      Parameters:
      enabled - true if the combo box and button are to be enabled
    • getValue

      public Object getValue()
      Specified by:
      getValue in interface PropertyEditor
      Overrides:
      getValue in class EnvironmentField
    • setValue

      public void setValue(Object value)
      Specified by:
      setValue in interface PropertyEditor
      Overrides:
      setValue in class EnvironmentField
    • setAsText

      public void setAsText(String val)
      Specified by:
      setAsText in interface PropertyEditor
      Overrides:
      setAsText in class EnvironmentField