Class ALcdActionWrapper
- All Implemented Interfaces:
ILcdAction
,ILcdPropertyChangeSource
,ActionListener
,Serializable
,EventListener
Abstract decorator class for an ILcdAction
.
A typical use-case of this class if you want to add some
extra behavior to an existing action. This can be achieved by using this decorator and
override the actionPerformed
method to include the extra behavior.
- Since:
- 2012.1
- See Also:
-
Field Summary
Fields inherited from interface com.luciad.gui.ILcdAction
DEFAULT, LONG_DESCRIPTION, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, VISIBLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Registers the givenPropertyChangeListener
to be notified when this object's properties change.Returns one of this object's properties using the associated key.boolean
void
Sets one of this objects properties.void
De-registers the givenPropertyChangeListener
from receiving property change events for this object.void
setEnabled
(boolean b) Sets/tests the enabled state of theILcdAction
.
-
Constructor Details
-
ALcdActionWrapper
-
-
Method Details
-
getValue
Description copied from interface:ILcdAction
Returns one of this object's properties using the associated key. If the value has changed, aPropertyChangeEvent
will be sent to listeners.- Specified by:
getValue
in interfaceILcdAction
-
putValue
Description copied from interface:ILcdAction
Sets one of this objects properties.- Specified by:
putValue
in interfaceILcdAction
- Parameters:
key
- one of NAME, SHORT_DESCRIPTION, LONG_DESCRIPTION, SMALL_ICON.value
- the value to be used for this action to display it textually using the name, short description or long description or to display it graphically using the icon. Values for NAME, SHORT_DESCRIPTION and LONG_DESCRIPTION should be String objects, values for SMALL_ICON should be ILcdIcon implementations.
-
setEnabled
public void setEnabled(boolean b) Description copied from interface:ILcdAction
Sets/tests the enabled state of theILcdAction
. When enabled, any component associated with this object is active and able to fire this object'sactionPerformed
method.- Specified by:
setEnabled
in interfaceILcdAction
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceILcdAction
-
addPropertyChangeListener
Description copied from interface:ILcdPropertyChangeSource
Registers the given
PropertyChangeListener
to be notified when this object's properties change.In case you need to register a listener which keeps a reference to an object with a shorter life-time than this change source, you can use a
ALcdWeakPropertyChangeListener
instance as property change listener.- Specified by:
addPropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
listener
- The listener to be notified- See Also:
-
removePropertyChangeListener
Description copied from interface:ILcdPropertyChangeSource
De-registers the given
PropertyChangeListener
from receiving property change events for this object.If the listener was added more than once, it will be notified one less time after being removed. If the listener is
null
, or was never added, no exception is thrown and no action is taken.- Specified by:
removePropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
listener
- the listener that should no longer be notified of changes of this object's properties- See Also:
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-