Klasse FWFileChooserFormComponent

Alle implementierten Schnittstellen:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, FWObserver

public class FWFileChooserFormComponent extends FWAbstractFormComponent implements ActionListener
Autor:
andi, ckunze Form component that displays a standard dialog to let the user select a file or directory. Multiple selection is not supported. Use a tag in the XML configuration of the enclosing form to make this component select files or use a tag to make it select directories.

The component reckognizes the following parameters in its XML configuration:

Required:

id

Optional:

enabled
Determines, if the value of the component can be changed. Possible values are expressions that evaluate to 0, 1, true or false. The default value is true.
default
An expression that evaluates to a file or directory name. If the component is configured for file selection, this sets the preselected file or the initial directory of the file selection dialog. If the component is configured for directory selection, this sets the preselected directory. Notice that this setting has no effect, if the components initial value is set using a FormFiller! If the component is configured for diectory selection and this parameter is not set, the initial directory will be set to the user's home directory.
required
Default: false.

If the component is used for file selection, the displayed file types can be limited by their extensions using <extension> child elements. Note however, that this does not limit the file types that can be selected! If specified for a directory chooser, these child elements are ignored.

An example configuration might look like this: <file id="mymodel.inputfile" required="true" enabled="true" default="data/myinputfile.dat"> <extension>dat</extension> <extension>txt</extension> </file>

Siehe auch:
  • Konstruktordetails

    • FWFileChooserFormComponent

      public FWFileChooserFormComponent(String aFormId, String aFieldId, boolean aShowBorder, org.jdom2.Element aParameters, FWObservable aObservabal, boolean aIsDirectoryChooser)
      Parameter:
      aFormId -
      aFieldId -
      aShowBorder -
      aParameters -
      aObservabal -
      aIsDirectoryChooser -
  • Methodendetails

    • getValue

      public String getValue()
      If used for file selection, returns the currently selected file or null if the current selection is a directory, does not exist or is not a valid file.

      If used for directory selection, returns the currently selected directory, the parent directory of the currently selected file or null if the current selection does not exist or is not a valid file or directory.

      Angegeben von:
      getValue in Klasse FWAbstractFormComponent
      Gibt zurück:
      value of the implemented component
    • setValue

      public void setValue(Object aValue)
      Constructs a File from aValue and calls @link setValue( File ) with it
      Angegeben von:
      setValue in Klasse FWAbstractFormComponent
      Parameter:
      aValue - of the implemented component
    • setValue

      public void setValue(File aFile)
      Sets aFile as the current value
      Parameter:
      aFile -
    • setValue

      public void setValue(File[] aFiles)
      Parameter:
      aFiles -
    • setEnabled

      public void setEnabled(boolean aNewState)
      Setzt außer Kraft:
      setEnabled in Klasse JComponent
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Display a standard file/directory selection dialog and save the result
      Angegeben von:
      actionPerformed in Schnittstelle ActionListener
    • update

      public void update(FWObservable aObservable, Object aKeyOfParameterChanged)
      Beschreibung aus Klasse kopiert: FWAbstractFormComponent
      updates different functions like enableing of the Component
      Angegeben von:
      update in Schnittstelle FWObserver
      Setzt außer Kraft:
      update in Klasse FWAbstractFormComponent
      Parameter:
      aObservable - the observable object.
      aKeyOfParameterChanged - an argument passed to the notifyObservers method.
      Siehe auch:
    • processFormFiller

      public void processFormFiller()
      Angegeben von:
      processFormFiller in Klasse FWAbstractFormComponent
    • getValueCell

      protected com.lowagie.text.Rectangle getValueCell(int aType)
      Beschreibung aus Klasse kopiert: FWAbstractFormComponent
      returns the value label to use for generating rtf, pdf or html version of the form
      Angegeben von:
      getValueCell in Klasse FWAbstractFormComponent
      Parameter:
      aType -
      Gibt zurück:
      iText Cell