Class ALcdBeanCustomizerSW

All Implemented Interfaces:
ILcdBeanEditor, ILcdPropertySheet, ImageObserver, MenuContainer, Customizer, Serializable, Accessible

@Deprecated public abstract class ALcdBeanCustomizerSW extends JPanel implements ILcdPropertySheet, Customizer
Deprecated.
Use a UI builder (e.g. Swing) or binding framework instead.
This is a Customizer for editing the properties of a bean. It provides a complete custom GUI. Therefore you need to create your own subclass of this class, and implement the abstract method createCustomizer.

The setObject method takes a bean as a parameter and analyzes it. From that point on, all utility methods like getPropertyDisplayName, getPropertyComponent, ... can be used.

It makes use of a TLcdBeanGUIFactory instance to perform the bean analysis and find, for each property, a PropertyEditor as well as an AWT or Swing Component to display and edit the property value.

This ALcdBeanCustomizer can have a button Panel with Apply, OK and Cancel buttons. This can be specified by setting the ButtonPanelVisible property.

This class can be set to edit the bean itself or to edit a clone of the bean with the method setEditClone.

See Also:
  • Constructor Details

    • ALcdBeanCustomizerSW

      public ALcdBeanCustomizerSW()
      Deprecated.
      Default constructor.
    • ALcdBeanCustomizerSW

      public ALcdBeanCustomizerSW(boolean aButtonPanelVisible)
      Deprecated.
      Constructor with a flag to indicate if the Apply, OK, Cancel button Panel has to be visible or not. Default is true.
      Parameters:
      aButtonPanelVisible - true if the panel containing the Apply, OK and Cancel buttons should be displayed.
  • Method Details

    • setClassTraceOn

      public static void setClassTraceOn(boolean aClassTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for all instances of this class. If the argument is true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
      Parameters:
      aClassTraceOn - if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
    • setTraceOn

      public void setTraceOn(boolean aTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for this class instance. Calling this method with either true or false as argument automatically turns off tracing for all other class instances for which setTraceOn has not been called. If the argument is false then only the informative, warning and error log messages are recorded.
      Parameters:
      aTraceOn - if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
    • isTraceOn

      public boolean isTraceOn()
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • isEditClone

      public boolean isEditClone()
      Deprecated.
      Returns true if this object edits a clone of the bean set by setObject, false otherwise.
      Returns:
      true if this object edits a clone of the bean set by setObject, false otherwise.
    • setEditClone

      public void setEditClone(boolean aEditClone)
      Deprecated.
      Set true if you want this object to edit a clone of the bean when using setObject, false otherwise.
      Parameters:
      aEditClone - true if you want this object to edit a clone of the bean when using setObject, false otherwise.
    • getObject

      public Object getObject()
      Deprecated.
      Specified by:
      getObject in interface ILcdBeanEditor
    • setObject

      public void setObject(Object aObject)
      Deprecated.
      Implements Customizer.setObject()
      Specified by:
      setObject in interface Customizer
      Specified by:
      setObject in interface ILcdBeanEditor
      Parameters:
      aObject - the object to be customized. If isEditClone() the object must have a public clone() method, or an IllegalArgumentException will be thrown.
    • getComponent

      public Component getComponent()
      Deprecated.
      Specified by:
      getComponent in interface ILcdPropertySheet
    • isButtonPanelVisible

      public boolean isButtonPanelVisible()
      Deprecated.
      Tests if the Apply, OK, Cancel button Panel is currently visible or not.
      Specified by:
      isButtonPanelVisible in interface ILcdPropertySheet
    • setButtonPanelVisible

      public void setButtonPanelVisible(boolean aButtonPanelVisible)
      Deprecated.
      Sets the visibility of the Apply, OK, Cancel button Panel.
      Specified by:
      setButtonPanelVisible in interface ILcdPropertySheet
    • isAutoUpdateFromPropertyEditors

      public boolean isAutoUpdateFromPropertyEditors()
      Deprecated.
      Tests if the AutoUpdateFromPropertyEditors property is true or not.
      Specified by:
      isAutoUpdateFromPropertyEditors in interface ILcdBeanEditor
      See Also:
    • setAutoUpdateFromPropertyEditors

      public void setAutoUpdateFromPropertyEditors(boolean aBoolean)
      Deprecated.
      When this property is true, the property values will be automatically set to the bean set using the setObject method, each time one of its property value has been changed by the corresponding PropertyEditor (the PropertyEditor fires then a PropertyChangeEvent).

      If this property is false, one can make this update manually by calling updateObjectFromPropertyEditors.

      Specified by:
      setAutoUpdateFromPropertyEditors in interface ILcdBeanEditor
      See Also:
    • updateObjectFromPropertyEditors

      public void updateObjectFromPropertyEditors()
      Deprecated.
      Updates the properties of the bean set, from the values stored in the corresponding PropertyEditors. If the bean has been set using a PropertyEditor (the bean object is then the value returned by PropertyEditor.getValue()), the PropertyEditor.setValue() is called with the updated bean.
      Specified by:
      updateObjectFromPropertyEditors in interface ILcdBeanEditor
      See Also:
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener aListener)
      Deprecated.
      Registers a listener for the PropertyChange event.
      Specified by:
      addPropertyChangeListener in interface Customizer
      Specified by:
      addPropertyChangeListener in interface ILcdPropertySheet
      Overrides:
      addPropertyChangeListener in class Container
      Parameters:
      aListener - an object to be invoked when a PropertyChange event is fired.
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener aListener)
      Deprecated.
      Removes a listener for the PropertyChange event.
      Specified by:
      removePropertyChangeListener in interface Customizer
      Specified by:
      removePropertyChangeListener in interface ILcdPropertySheet
      Overrides:
      removePropertyChangeListener in class Component
      Parameters:
      aListener - the PropertyChange listener to be removed.
    • firePropertyChange

      public void firePropertyChange(PropertyChangeEvent aPropertyChangeEvent)
      Deprecated.
      Fires a PropertyChangeEvent to all registered PropertyChangeListeners.
      Parameters:
      aPropertyChangeEvent - contains the information of which the listeners should be notified.
    • createCustomizer

      protected abstract Component createCustomizer()
      Deprecated.
      This method creates a Component to edit the bean set by setObject. To facilitate the creation of this gui, a bunch of utility methods are provided (e.g. getPropertyComponent, getPropertyDisplayName, ...). They can only be used after setObject is invoked.

      There is also a helper class TLcdBeanPanel to which these components can be easily added by name. Note that you don't have to use this helper class, but it makes life easier. The most simple implementation of this method is like this:

      TLcdBeanPanel panel = createNewPanel();
      panel.addProperties( this.getAllPropertyNames() );
      return panel;

      Returns:
      a Component to edit the bean set in setObject.
    • isPropertyNameValid

      public boolean isPropertyNameValid(String aPropertyName)
      Deprecated.
    • isPropertyExpandable

      public boolean isPropertyExpandable(String aPropertyName)
      Deprecated.
    • getPropertyComponent

      public Component getPropertyComponent(String aPropertyName)
      Deprecated.
    • getPropertyComponent

      public Component getPropertyComponent(String aPropertyName, boolean aExpandIfPossible)
      Deprecated.
      Returns a property component. These components are the actual gui modifiers for a certain property (e.g. a text field for a text property, a checkbox for a boolean, a fancy panel with all bells and whistles for your own class, ...). The actual components are retrieved from the with this object associated fBeanGUIFactory. A component has two 'modes': expanded or not. Expand if possible is the default. Expanding is only possible for those components that have a button to show up an extra dialog with the actual editor. Expanding means that instead of popping up an extra dialog, the content of that dialog is put in this gui directly. So no popup button is needed.
      Parameters:
      aPropertyName - the name of the property
      aExpandIfPossible - whether or not dialogs behind a button should be included directly.
      Returns:
      a component to edit a property.
    • getPropertyLabel

      public JLabel getPropertyLabel(String aPropertyName)
      Deprecated.
    • getPropertyDisplayName

      public String getPropertyDisplayName(String aPropertyName)
      Deprecated.
    • getAllPropertyNames

      public String[] getAllPropertyNames()
      Deprecated.
    • feedBackOnPropertyUsages

      public String feedBackOnPropertyUsages()
      Deprecated.
      This method generates some useful info when you are in development stage. For every component that was never referenced, a line is generated. For every component that was referenced more than once, a line is generated. Call this method after you created your gui, otherwise the reference count will be zero for every property.
      Returns:
      information on the specified property descriptors.