Class FWAbstractFormSubComponent

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
net.simplace.pipe.formcomponents.FWAbstractFormSubComponent
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
FWCheckboxChoiceSubComponent, FWDaySubComponent, FWLabelChoiceSubComponent, FWMonthSubComponent, FWSingleCheckboxChoiceSubComponent, FWTableChoiceSubComponent, FWYearSubComponent

public abstract class FWAbstractFormSubComponent extends JPanel
Abstract class that is supposed to be overwritten by subcomponent implementations. Subcomponents may be used to assemble compound form components (see FWDateFormComponent) or to create form components that have a different appearance, depending on input parameters (see FWChoiceFormComponent). Subcomponents cannot be directly used in forms but can only be contained in a form component that inherits from FWAbstractFormComponent. Form components may register change listeners on subcomponents to get notified of changes. This may be useful to keep several subcomponents synchronized and to keep the form component's value up-to-date. However, it is up to the implementation of the subcomponent to notify listeners by calling fireStateChanged() whenever its value changes!
Author:
Christoph Kunze
See Also:
  • Field Details

    • iObservable

      protected FWObservable iObservable
    • iIsEnabled

      protected boolean iIsEnabled
    • iFormComponentParameterMap

      protected Map<String,Object> iFormComponentParameterMap
  • Constructor Details

    • FWAbstractFormSubComponent

      public FWAbstractFormSubComponent(boolean aIsEnabled, FWObservable aObservable, Map<String,Object> aFormComponentParameterMap)
      Parameters:
      aIsEnabled -
      aObservable -
      aFormComponentParameterMap -
  • Method Details

    • getValue

      public abstract String getValue()
      Returns:
      value of the implemented subcomponent
    • getSelectedValueList

      public abstract List<Object> getSelectedValueList()
      Returns:
      value of the implemented subcomponent
    • isEnabled

      public boolean isEnabled()
      Overrides:
      isEnabled in class Component
    • setEnabled

      public void setEnabled(boolean aEnabled)
      Overrides:
      setEnabled in class JComponent
    • setValue

      public abstract void setValue(String aValue)
      Allows to set the value of the implemented subcomponent
      Parameters:
      aValue - String representation of the value to be set
    • addChangeListener

      public void addChangeListener(ChangeListener aListener)
      Allows form components to register change listeners on subcomponents in order to get notified of changes. Implementations of subcomponents MUST call fireStateChanged() whenever their value changes, so that change listeners get notified.
      Parameters:
      aListener - Change Listener to be registered
    • removeChangeListener

      public void removeChangeListener(ChangeListener aListener)
      Allows form components to unregister previously registered change listeners on subcomponents
      Parameters:
      aListener - The previpusly registered change listener
    • fireStateChanged

      protected void fireStateChanged()
      Notifies change listeners of changes to the subcomponent. This method MUST get called, whenever the value of the subcomponent changes. However, calling it is up to the specific implementation of this abstract class.
    • getChangeListeners

      public ChangeListener[] getChangeListeners()
      Returns:
      An array of all the change listeners that are currently registered on this component
    • getLocaleValue

      protected String getLocaleValue(String aKey)
      This method limits the coding for reading values from the locale.
      Parameters:
      aKey -
      Returns: