@Deprecated public abstract class ALcdBeanCustomizerSW extends JPanel implementsILcdPropertySheet, Customizer
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
.
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
ALcdBeanCustomizerSW()
Deprecated.
Default constructor.
|
ALcdBeanCustomizerSW(boolean aButtonPanelVisible)
Deprecated.
Constructor with a flag to indicate if the Apply, OK, Cancel button Panel
has to be visible or not.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener aListener)
Deprecated.
Registers a listener for the PropertyChange event.
|
protected abstract Component |
createCustomizer()
Deprecated.
This method creates a
Component to edit the bean set by setObject . |
String |
feedBackOnPropertyUsages()
Deprecated.
This method generates some useful info when you are in development stage.
|
void |
firePropertyChange(PropertyChangeEvent aPropertyChangeEvent)
Deprecated.
Fires a
PropertyChangeEvent to all registered PropertyChangeListeners. |
String[] |
getAllPropertyNames()
Deprecated.
|
Component |
getComponent()
Deprecated.
|
Object |
getObject()
Deprecated.
|
Component |
getPropertyComponent(String aPropertyName)
Deprecated.
|
Component |
getPropertyComponent(String aPropertyName,
boolean aExpandIfPossible)
Deprecated.
Returns a property component.
|
String |
getPropertyDisplayName(String aPropertyName)
Deprecated.
|
JLabel |
getPropertyLabel(String aPropertyName)
Deprecated.
|
boolean |
isAutoUpdateFromPropertyEditors()
Deprecated.
Tests if the AutoUpdateFromPropertyEditors property is
true or not. |
boolean |
isButtonPanelVisible()
Deprecated.
Tests if the Apply, OK, Cancel button
Panel is currently visible or not. |
boolean |
isEditClone()
Deprecated.
Returns true if this object edits a clone of the bean set by
setObject ,
false otherwise. |
boolean |
isPropertyExpandable(String aPropertyName)
Deprecated.
|
boolean |
isPropertyNameValid(String aPropertyName)
Deprecated.
|
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
removePropertyChangeListener(PropertyChangeListener aListener)
Deprecated.
Removes a listener for the PropertyChange event.
|
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). |
void |
setButtonPanelVisible(boolean aButtonPanelVisible)
Deprecated.
Sets the visibility of the Apply, OK, Cancel button Panel.
|
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setEditClone(boolean aEditClone)
Deprecated.
Set true if you want this object to edit a clone of the bean when using
setObject ,
false otherwise. |
void |
setObject(Object aObject)
Deprecated.
Implements
Customizer.setObject() |
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
updateObjectFromPropertyEditors()
Deprecated.
Updates the properties of the bean set, from the values stored in the
corresponding PropertyEditors.
|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getHelpIDString, setHelpIDString
public ALcdBeanCustomizerSW()
public ALcdBeanCustomizerSW(boolean aButtonPanelVisible)
true
.aButtonPanelVisible
- true if the panel containing the Apply, OK and Cancel buttons should be displayed.public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.public void setTraceOn(boolean aTraceOn)
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.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.public boolean isTraceOn()
true
if tracing is enabled for this class.public boolean isEditClone()
setObject
,
false otherwise.setObject
,
false otherwise.public void setEditClone(boolean aEditClone)
setObject
,
false otherwise.aEditClone
- true if you want this object to edit a clone of the bean when using setObject
,
false otherwise.public Object getObject()
getObject
in interface ILcdBeanEditor
public void setObject(Object aObject)
Customizer.setObject()
setObject
in interface ILcdBeanEditor
setObject
in interface Customizer
aObject
- the object to be customized. If isEditClone() the object must have a public
clone()
method, or an IllegalArgumentException
will be thrown.public Component getComponent()
getComponent
in interface ILcdPropertySheet
public boolean isButtonPanelVisible()
Panel
is currently visible or not.isButtonPanelVisible
in interface ILcdPropertySheet
public void setButtonPanelVisible(boolean aButtonPanelVisible)
setButtonPanelVisible
in interface ILcdPropertySheet
public boolean isAutoUpdateFromPropertyEditors()
true
or not.isAutoUpdateFromPropertyEditors
in interface ILcdBeanEditor
setAutoUpdateFromPropertyEditors(boolean)
public void setAutoUpdateFromPropertyEditors(boolean aBoolean)
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.
setAutoUpdateFromPropertyEditors
in interface ILcdBeanEditor
PropertyEditor.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void updateObjectFromPropertyEditors()
PropertyEditor
(the bean object is then
the value returned by PropertyEditor.getValue()
), the PropertyEditor.setValue()
is called with the updated bean.updateObjectFromPropertyEditors
in interface ILcdBeanEditor
TLcdBeanGUIFactory.updateObjectFromPropertyEditors()
public void addPropertyChangeListener(PropertyChangeListener aListener)
addPropertyChangeListener
in interface ILcdPropertySheet
addPropertyChangeListener
in interface Customizer
addPropertyChangeListener
in class Container
aListener
- an object to be invoked when a PropertyChange event is fired.public void removePropertyChangeListener(PropertyChangeListener aListener)
removePropertyChangeListener
in interface ILcdPropertySheet
removePropertyChangeListener
in interface Customizer
removePropertyChangeListener
in class Component
aListener
- the PropertyChange listener to be removed.public void firePropertyChange(PropertyChangeEvent aPropertyChangeEvent)
PropertyChangeEvent
to all registered PropertyChangeListeners.aPropertyChangeEvent
- contains the information of which the listeners should be notified.protected abstract Component createCustomizer()
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;
public boolean isPropertyNameValid(String aPropertyName)
public boolean isPropertyExpandable(String aPropertyName)
public Component getPropertyComponent(String aPropertyName, boolean aExpandIfPossible)
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.aPropertyName
- the name of the propertyaExpandIfPossible
- whether or not dialogs behind a button should be included directly.public String[] getAllPropertyNames()
public String feedBackOnPropertyUsages()