public abstract class ALcdAction extends Object implements ILcdAction
ILcdAction
, that provides
set and get methods for properties common to all actions and support for notifying listeners of changes
to those properties.Modifier and Type | Field and Description |
---|---|
protected PropertyChangeSupport |
changeSupport
Support for firing property change events and registering property change listeners.
|
DEFAULT, LONG_DESCRIPTION, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, VISIBLE
Constructor and Description |
---|
ALcdAction()
Defines an
Action object with a default description string
and default icon. |
ALcdAction(String aName)
Defines an
Action object with the specified description string
and a default icon. |
ALcdAction(String aName,
ILcdIcon aIcon)
Defines an
Action object with the specified description string
and a the specified aIcon. |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener aListener)
Adds a
PropertyChangeListener to the listener list. |
protected void |
firePropertyChange(String aPropertyName,
Object aOldValue,
Object aNewValue)
Notifies all property change listeners that the value of a property has changed.
|
String |
getDisplayName()
Deprecated.
use
getName() instead, which is already a display name.
Returns the text that should be used as a textual display of this action.
Default value is "ALcdAction". |
ILcdIcon |
getIcon()
Returns the graphical representation of this action.
|
String |
getLongDescription()
Returns the long description of this action.
|
String |
getName()
Returns the (display) name of this action.
|
String |
getShortDescription()
Returns the short description of this action.
|
Object |
getValue(String aKey)
Returns a value associated with a aKey for this action
|
boolean |
isEnabled() |
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
putValue(String aKey,
Object aValue)
Associates a value with a aKey for this action and fires a property change event.
|
protected void |
registerInstance() |
void |
removePropertyChangeListener(PropertyChangeListener aListener)
Removes a
PropertyChangeListener from the listener list. |
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setDisplayName(String aDisplayName)
Deprecated.
use
setName(java.lang.String) instead, which is already a display name.
Sets a text to be used for a textual display of this action. |
void |
setEnabled(boolean aEnabled)
Sets/tests the enabled state of the
ILcdAction . |
void |
setIcon(ILcdIcon aIcon)
Sets the graphical representation of this action.
|
void |
setLongDescription(String aLongDescription)
Sets the long description of this action.
|
void |
setName(String aName)
Sets the (display) name of this action.
|
void |
setShortDescription(String aShortDescription)
Sets the short description of this action.
|
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
actionPerformed
protected PropertyChangeSupport changeSupport
public ALcdAction()
Action
object with a default description string
and default icon.public ALcdAction(String aName)
Action
object with the specified description string
and a default icon.aName
- a textual representation of this action.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.protected void registerInstance()
public void setDisplayName(String aDisplayName)
setName(java.lang.String)
instead, which is already a display name.
Sets a text to be used for a textual display of this action.aDisplayName
- a text to be used for a textual display of this action.getDisplayName()
public String getDisplayName()
getName()
instead, which is already a display name.
Returns the text that should be used as a textual display of this action.
Default value is "ALcdAction".setDisplayName(String)
public Object getValue(String aKey)
getValue
in interface ILcdAction
aKey
- the aKey to associate a value with.public void putValue(String aKey, Object aValue)
putValue
in interface ILcdAction
aKey
- the key to associate a value with.aValue
- a value associated with the key.public boolean isEnabled()
isEnabled
in interface ILcdAction
public void setEnabled(boolean aEnabled)
ILcdAction
ILcdAction
. When enabled,
any component associated with this object is active and
able to fire this object's actionPerformed
method.setEnabled
in interface ILcdAction
protected void firePropertyChange(String aPropertyName, Object aOldValue, Object aNewValue)
aPropertyName
- the name of the property that has changedaOldValue
- the old value of the property.aNewValue
- the new value of the property.public void addPropertyChangeListener(PropertyChangeListener aListener)
PropertyChangeListener
to the listener list.
The listener is registered for all properties.
A PropertyChangeEvent
will get fired in response to setting
a bound property, e.g. setFont, setBackground, or setForeground.
Note that if the current component is inheriting its foreground,
background, or font from its container, then no event will be
fired in response to a change in the inherited property.
addPropertyChangeListener
in interface ILcdPropertyChangeSource
aListener
- the PropertyChangeListener
to be added.ALcdWeakPropertyChangeListener
,
ILcdPropertyChangeSource.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener aListener)
PropertyChangeListener
from the listener list.
This removes a PropertyChangeListener
that was registered
for all properties.removePropertyChangeListener
in interface ILcdPropertyChangeSource
aListener
- the PropertyChangeListener
to be removed.ILcdPropertyChangeSource.addPropertyChangeListener(java.beans.PropertyChangeListener)
public String getName()
getValue( ILcdAction.NAME )
.public void setName(String aName)
putValue( ILcdAction.NAME, aName )
.aName
- The name of this action.public ILcdIcon getIcon()
getValue( ILcdAction.SMALL_ICON )
.public void setIcon(ILcdIcon aIcon)
putValue( ILcdAction.SMALL_ICON, aName )
.aIcon
- the graphical representation of this action.public String getShortDescription()
getValue( ILcdAction.SHORT_DESCRIPTION )
.public void setShortDescription(String aShortDescription)
putValue( ILcdAction.SHORT_DESCRIPTION, aShortDescription )
.aShortDescription
- The short description of this action.public void setLongDescription(String aLongDescription)
putValue( ILcdAction.LONG_DESCRIPTION, aLongDescription )
.aLongDescription
- The long description of this action.public String getLongDescription()
getValue( ILcdAction.LONG_DESCRIPTION )
.