Class FWProcessorButtonFormComponent

All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, net.simplace.core.FWBusyIndicator, net.simplace.core.FWObserver

public class FWProcessorButtonFormComponent extends FWAbstractFormComponent implements ActionListener
Form component that runs a processor (the form element with its class attribute) when the button is clicked, or the function given in the parameter function. With type toggle the button is a toggle button: the first click creates the processor and pipes with value true, the second pipes the same processor with false (e.g. to start and stop a server).
Attributes
Parameter Description
type type of button from static list of types (e.g. go, ok, start, stop, toggle), default: go.
Author:
Andreas Enders
See Also:
  • Constructor Details

    • FWProcessorButtonFormComponent

      public FWProcessorButtonFormComponent(String aFormId, String aFieldId, boolean aShowBorder, org.jdom2.Element aParameters, net.simplace.core.FWObservable aObservabal)
      Parameters:
      aFormId - id of the form the component is placed in
      aFieldId - id of the component; also the locale key of the button text
      aShowBorder - true to show a caption label
      aParameters - the form element (processor definition, attribute type)
      aObservabal - parameters of the functionality
  • Method Details

    • getValue

      public String getValue()
      Specified by:
      getValue in class FWAbstractFormComponent
      Returns:
      "true"/"false" for a toggle button, otherwise an empty string
    • setValue

      public void setValue(Object aValue)
      Sets the state of a toggle button; no effect for other buttons.
      Specified by:
      setValue in class FWAbstractFormComponent
      Parameters:
      aValue - true/false
    • setEnabled

      public void setEnabled(boolean aNewState)
      Overrides:
      setEnabled in class JComponent
      Parameters:
      aNewState - true to enable the button
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Runs the function (parameter function) or the processor (see class description) while showing an animated progress cursor. Note: it runs on the event dispatch thread (the GUI is blocked meanwhile), and the processor is created without pipeline container, so processors needing one (e.g. loop processors) fail with a logged error.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      e - the button event
    • update

      public void update(net.simplace.core.FWObservable aObservable, Object aKeyOfParameterChanged)
      Description copied from class: FWAbstractFormComponent
      Reacts to a changed parameter: re-evaluates enabled and visible (a disabled or hidden component is reset to its default), resets the default value and re-runs the form filler, if the changed parameter is used in them. Changes of the component's own value are ignored.
      Specified by:
      update in interface net.simplace.core.FWObserver
      Overrides:
      update in class FWAbstractFormComponent
      Parameters:
      aObservable - the parameters
      aKeyOfParameterChanged - key of the changed parameter
    • processFormFiller

      public void processFormFiller()
      Description copied from class: FWAbstractFormComponent
      Fills the component from its form filler (e.g. options or a chart); called after initialisation and whenever the jumper rule of the form filler changes.
      Specified by:
      processFormFiller in class FWAbstractFormComponent
    • getValueCell

      protected com.lowagie.text.Rectangle getValueCell(int aType)
      Description copied from class: FWAbstractFormComponent
      Returns the value cell used for generating the RTF, PDF or HTML version of the form.
      Specified by:
      getValueCell in class FWAbstractFormComponent
      Parameters:
      aType - output type, e.g. PrintHelper.TYPE_PDF
      Returns:
      an iText cell (PdfPCell for PDF, Cell otherwise)