A
- the kind of action managed by this CAction
public class CDecorateableAction<A extends CommonDecoratableDockAction> extends CAction
Constructor and Description |
---|
CDecorateableAction(A action)
Creates a new action.
|
Modifier and Type | Method and Description |
---|---|
void |
addDecorateableActionListener(CDecorateableActionListener listener)
Adds the observer
listener to this action. |
KeyStroke |
getAccelerator()
Gets the combination of keys that will trigger this action.
|
Icon |
getDisabledHoverIcon()
Gets the icon which is used if the mouse is hovering over a button that represents this action and
if this action is disabled.
|
Icon |
getDisabledIcon()
Gets the disabled icon.
|
Icon |
getDisabledPressedIcon()
Gets the icon which is used if the mouse is pressed over a button that represents this action and
if this action is disabled.
|
Icon |
getHoverIcon()
Gets the icon which is used if the mouse is hovering over a button that represents this action.
|
Icon |
getIcon()
Gest the icon of this action.
|
Icon |
getPressedIcon()
Gets the icon which is used if the mouse is pressed over a button that represents this action.
|
String |
getText()
Gets the text of this action.
|
String |
getTooltip()
Gets the long description of this action.
|
protected void |
init(A action)
Initializes this action, this method can be called only once.
|
A |
intern()
Gets the internal representation of the action.
|
boolean |
isEnabled()
Tells whether this action can be triggered by the user or not.
|
boolean |
isShowTextOnButtons()
Tells whether the text of this action is shown on buttons.
|
void |
removeDecorateableActionListener(CDecorateableActionListener listener)
Removes the observer
listener from this action. |
void |
setAccelerator(KeyStroke accelerator)
Sets the combination of keys that will trigger this action if the
user presses them.
|
void |
setDisabledHoverIcon(Icon icon)
Sets the icon which is used if the mouse is hovering over a button that represents this action and
if this action is disabled.
|
void |
setDisabledIcon(Icon icon)
Sets the icon of this action.
|
void |
setDisabledPressedIcon(Icon icon)
Sets the icon which is used if the mouse is pressed over a button that represents this action and
if this action is disabled.
|
void |
setEnabled(boolean enabled)
Enables or disables this action, a disabled action can't be triggered
by the user.
|
void |
setHoverIcon(Icon icon)
Sets the icon which is used if the mouse is hovering over a button that represents this action.
|
void |
setIcon(Icon icon)
Sets the icon of this action.
|
void |
setPressedIcon(Icon icon)
Sets the icon which is used if the mouse is pressed over a button that represents this action.
|
void |
setShowTextOnButtons(boolean showTextOnButtons)
Sets whether the text of this action should be shown if this action is shown as a button.
|
void |
setText(String text)
Sets the text of this action, the text will be visible when this
action is shown in a menu.
|
void |
setTooltip(String tooltip)
Sets a tooltip for this action.
|
public CDecorateableAction(A action)
action
- the internal representation, can be null
if init(CommonDecoratableDockAction)
is called laterprotected void init(A action)
action
- the internal representationpublic void addDecorateableActionListener(CDecorateableActionListener listener)
listener
to this action. The observer will be informed
when properties of this CDecorateableAction
changed.listener
- the new observerpublic void removeDecorateableActionListener(CDecorateableActionListener listener)
listener
from this action.listener
- the listener to removeaddDecorateableActionListener(CDecorateableActionListener)
public void setText(String text)
text
- the textpublic String getText()
public void setShowTextOnButtons(boolean showTextOnButtons)
showTextOnButtons
- true
if the text should be shown, false
otherwisepublic boolean isShowTextOnButtons()
true
if the text is shown, false
otherwisesetShowTextOnButtons(boolean)
public void setTooltip(String tooltip)
tooltip
- the tooltippublic String getTooltip()
public void setIcon(Icon icon)
icon
- the icon, can be null
public Icon getIcon()
public void setHoverIcon(Icon icon)
icon
- the icon or null
public Icon getHoverIcon()
null
public void setPressedIcon(Icon icon)
icon
- the icon or null
public Icon getPressedIcon()
null
public void setDisabledIcon(Icon icon)
icon
- the disabled iconsetEnabled(boolean)
public Icon getDisabledIcon()
public void setDisabledHoverIcon(Icon icon)
icon
- the icon or null
public Icon getDisabledHoverIcon()
null
public void setDisabledPressedIcon(Icon icon)
icon
- the icon or null
public Icon getDisabledPressedIcon()
null
public void setEnabled(boolean enabled)
enabled
- true
if this action should be triggerable
by the user.public boolean isEnabled()
true
if this action can be triggeredpublic void setAccelerator(KeyStroke accelerator)
accelerator
- the combination of keys, or null
public KeyStroke getAccelerator()
null