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. |
javax.swing.KeyStroke |
getAccelerator()
Gets the combination of keys that will trigger this action.
|
javax.swing.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.
|
javax.swing.Icon |
getDisabledIcon()
Gets the disabled icon.
|
javax.swing.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.
|
javax.swing.Icon |
getHoverIcon()
Gets the icon which is used if the mouse is hovering over a button that represents this action.
|
javax.swing.Icon |
getIcon()
Gest the icon of this action.
|
javax.swing.Icon |
getPressedIcon()
Gets the icon which is used if the mouse is pressed over a button that represents this action.
|
java.lang.String |
getText()
Gets the text of this action.
|
java.lang.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 |
isAcceleratorGlobal()
Whether this action is listening to global key events.
|
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(javax.swing.KeyStroke accelerator)
Sets the combination of keys that will trigger this action if the
user presses them.
|
void |
setAcceleratorIsGlobal(boolean global)
Tells this action that the
accelerator is global. |
void |
setDisabledHoverIcon(javax.swing.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(javax.swing.Icon icon)
Sets the icon of this action.
|
void |
setDisabledPressedIcon(javax.swing.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(javax.swing.Icon icon)
Sets the icon which is used if the mouse is hovering over a button that represents this action.
|
void |
setIcon(javax.swing.Icon icon)
Sets the icon of this action.
|
void |
setPressedIcon(javax.swing.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(java.lang.String text)
Sets the text of this action, the text will be visible when this
action is shown in a menu.
|
void |
setTooltip(java.lang.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(java.lang.String text)
text
- the textpublic java.lang.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(java.lang.String tooltip)
tooltip
- the tooltippublic java.lang.String getTooltip()
public void setIcon(javax.swing.Icon icon)
icon
- the icon, can be null
public javax.swing.Icon getIcon()
public void setHoverIcon(javax.swing.Icon icon)
icon
- the icon or null
public javax.swing.Icon getHoverIcon()
null
public void setPressedIcon(javax.swing.Icon icon)
icon
- the icon or null
public javax.swing.Icon getPressedIcon()
null
public void setDisabledIcon(javax.swing.Icon icon)
icon
- the disabled iconsetEnabled(boolean)
public javax.swing.Icon getDisabledIcon()
public void setDisabledHoverIcon(javax.swing.Icon icon)
icon
- the icon or null
public javax.swing.Icon getDisabledHoverIcon()
null
public void setDisabledPressedIcon(javax.swing.Icon icon)
icon
- the icon or null
public javax.swing.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(javax.swing.KeyStroke accelerator)
accelerator
- the combination of keys, or null
public javax.swing.KeyStroke getAccelerator()
null
public void setAcceleratorIsGlobal(boolean global)
accelerator
is global.
A global action is executed whenever the accelerator keys are typed anywhere in the scope of
DockingFrames (if for example the keys are typed on some random dialog, DockingFrames will not be
informed about the event).global
- should this action be listening to global key eventspublic boolean isAcceleratorGlobal()
true
if global key events are supported