public abstract class SimpleDockAction extends AbstractStandardDockAction implements SharingStandardDockAction
DockAction. This action uses for
all associated Dockables the same settings.listenersBUTTON_CONTENT_FILTER| Constructor and Description |
|---|
SimpleDockAction(boolean monitorDisabling)
Creates a new action
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
bound(Dockable dockable)
Invoked by this
AbstractStandardDockAction when a Dockable
was bound to this action the first time. |
KeyStroke |
getAccelerator()
Gets the type of
KeyEvent that must happen to trigger this
action. |
Icon |
getDisabledIcon()
Gets the icon that is shown when this action is not enabled.
|
Dockable |
getDockableRepresentation()
Gets the
Dockable which is represented by this DockAction. |
Dockable |
getDockableRepresentation(Dockable dockable)
Tells whether this
DockAction represents a Dockable. |
Icon |
getIcon()
Gets the default-icon that is shown for this action.
|
Icon |
getIcon(ActionContentModifier modifier)
Gets the icon which is shown if the conditions of
modifier are met. |
Icon |
getIcon(Dockable dockable,
ActionContentModifier modifier)
Gets the Icon of this DockAction, when this DockAction is shown
together with
dockable. |
ActionContentModifier[] |
getIconContexts(Dockable dockable)
Gets all the
ActionContentModifiers for which StandardDockAction.getIcon(Dockable, ActionContentModifier) would
return a value other than null. |
String |
getText()
Gets the text that is shown for this action.
|
String |
getText(Dockable dockable)
Gets the text of this DockAction, when this DockAction is
shown together with
dockable. |
String |
getTooltip()
Gets the first part of the tooltip-text that is shown for this action.
|
String |
getTooltipText()
Gets the text that should be shown as tooltip of this action.
|
String |
getTooltipText(Dockable dockable)
Gets a tooltip for this DockAction, when this DockAction is
shown together with
dockable. |
boolean |
isAcceleratorGlobal()
Whether this action is listening to global key events.
|
boolean |
isEnabled()
Gets the enabled-state for this action.
|
boolean |
isEnabled(Dockable dockable)
This method chooses the result according to the current
DisablingStrategy. |
void |
setAccelerator(KeyStroke accelerator)
Sets the type of event that will trigger this action.
|
void |
setAcceleratorIsGlobal(boolean global)
Tells this action that the
accelerator is global. |
void |
setDisabledIcon(Icon icon)
Sets an icon that will be shown when this action is not enabled.
|
void |
setDockableRepresentation(Dockable dockable)
Sets the
Dockable which is represented by this DockAction. |
void |
setEnabled(boolean enabled)
Sets the enabled-state of this action.
|
void |
setIcon(ActionContentModifier modifier,
Icon icon)
Sets the icon that is to be used when the conditions of
modifier are met. |
void |
setIcon(Icon icon)
Sets the default-
icon for this action. |
void |
setText(String text)
Sets the
text which is shown for this action. |
void |
setTooltip(String tooltip)
Sets the first part of the tooltip-text which is shown for this action.
|
protected boolean |
trigger(KeyEvent event,
Dockable dockable)
Called when the user hit the
accelerator. |
protected void |
unbound(Dockable dockable)
Called by this
AbstractStandardDockAction when the Dockable
dockable will not be used in any means by this
action. |
addDockActionListener, bind, fireActionEnabledChanged, fireActionIconChanged, fireActionRepresentativeChanged, fireActionTextChanged, fireActionTooltipTextChanged, getBoundDockables, isBound, removeDockActionListener, unbindclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddDockActionListener, removeDockActionListenerbind, createView, trigger, unbindpublic SimpleDockAction(boolean monitorDisabling)
monitorDisabling - whether the current DisablingStrategy should be monitoredprotected void bound(Dockable dockable)
AbstractStandardDockActionAbstractStandardDockAction when a Dockable
was bound to this action the first time.bound in class AbstractStandardDockActiondockable - The Dockable that was not known to this action
before the method was invokedprotected void unbound(Dockable dockable)
AbstractStandardDockActionAbstractStandardDockAction when the Dockable
dockable will not be used in any means by this
action. Note that the AbstractStandardDockAction.bound(Dockable)-method can be
invoked again with the dockable.unbound in class AbstractStandardDockActiondockable - The Dockable which will not by used in any way.public Icon getIcon(Dockable dockable, ActionContentModifier modifier)
StandardDockActiondockable. This method must ignore the
backup property of modifier.getIcon in interface StandardDockActiondockable - The Dockable for which the action-icon
should be chosen.modifier - how the icon will be useddockable, or null.public String getText(Dockable dockable)
StandardDockActiondockable.getText in interface StandardDockActiondockable - The Dockable for which the action-text
should be chosen.dockable, or null.public String getText()
SharingStandardDockActiongetText in interface SharingStandardDockActionnullSharingStandardDockAction.setText(String)public void setText(String text)
SharingStandardDockActiontext which is shown for this action.setText in interface SharingStandardDockActiontext - The text to show, or nullpublic String getTooltipText(Dockable dockable)
StandardDockActiondockable.getTooltipText in interface StandardDockActiondockable - The Dockable for which the action-tooltip
should be chosen.dockable, or null.public String getTooltipText()
SharingStandardDockActionSharingStandardDockAction.getTooltip(), but also additional information
like the acceleratorgetTooltipText in interface SharingStandardDockActionpublic String getTooltip()
SharingStandardDockActiongetTooltip in interface SharingStandardDockActionSharingStandardDockAction.setTooltip(String)public void setTooltip(String tooltip)
SharingStandardDockActionsetTooltip in interface SharingStandardDockActiontooltip - The client defined part of the tooltip for this actionpublic boolean isEnabled(Dockable dockable)
AbstractStandardDockActionDisablingStrategy.isEnabled in interface StandardDockActionisEnabled in class AbstractStandardDockActiondockable - The Dockable for which this action maybe
triggered.true if the user should be able to trigger
this action, false otherwisepublic boolean isEnabled()
SharingStandardDockActionisEnabled in interface SharingStandardDockActiontrue if this action can be triggered,
false otherwiseSharingStandardDockAction.setEnabled(boolean)public void setEnabled(boolean enabled)
SharingStandardDockActionsetEnabled in interface SharingStandardDockActionenabled - The statepublic Icon getIcon()
SharingStandardDockActiongetIcon in interface SharingStandardDockActionnullSharingStandardDockAction.setIcon(Icon)public void setIcon(Icon icon)
SharingStandardDockActionicon for this action. This icon
will be shown when no other icon fits the current states of
the action.setIcon in interface SharingStandardDockActionicon - The icon, can be nullpublic ActionContentModifier[] getIconContexts(Dockable dockable)
StandardDockActionActionContentModifiers for which StandardDockAction.getIcon(Dockable, ActionContentModifier) would
return a value other than null.getIconContexts in interface StandardDockActiondockable - the Dockable for which the action-icons may be chosen.public Icon getDisabledIcon()
SharingStandardDockActiongetDisabledIcon in interface SharingStandardDockActionnullSharingStandardDockAction.setDisabledIcon(Icon),
SharingStandardDockAction.isEnabled()public void setDisabledIcon(Icon icon)
SharingStandardDockActionsetDisabledIcon in interface SharingStandardDockActionicon - The disabled-icon, can be nullSharingStandardDockAction.setEnabled(boolean)public Icon getIcon(ActionContentModifier modifier)
modifier are met.getIcon in interface SharingStandardDockActionmodifier - the conditions to metnull if not setpublic void setIcon(ActionContentModifier modifier, Icon icon)
modifier are met.setIcon in interface SharingStandardDockActionmodifier - the conditions to meticon - the icon to use or nullpublic void setDockableRepresentation(Dockable dockable)
SharingStandardDockActionDockable which is represented by this DockAction. Some views of
this DockAction will register themselves as DockElementRepresentative representing
dockable.setDockableRepresentation in interface SharingStandardDockActiondockable - the new representation, can be nullpublic Dockable getDockableRepresentation(Dockable dockable)
StandardDockActionDockAction represents a Dockable. If so, the framework
may register views for this action as DockElementRepresentative.getDockableRepresentation in interface StandardDockActiondockable - The Dockable for which this action may be triggeredDockable which is represented by this action, can be null.
Normally dockable should not be the result.public Dockable getDockableRepresentation()
SharingStandardDockActionDockable which is represented by this DockAction.getDockableRepresentation in interface SharingStandardDockActionnullStandardDockAction.getDockableRepresentation(Dockable)public KeyStroke getAccelerator()
SharingStandardDockActionKeyEvent that must happen to trigger this
action.getAccelerator in interface SharingStandardDockActionnullpublic void setAccelerator(KeyStroke accelerator)
SharingStandardDockActionsetAccelerator in interface SharingStandardDockActionaccelerator - the type of event or null.public void setAcceleratorIsGlobal(boolean global)
SharingStandardDockActionaccelerator 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).setAcceleratorIsGlobal in interface SharingStandardDockActionglobal - should this action be listening to global key eventspublic boolean isAcceleratorGlobal()
SharingStandardDockActionisAcceleratorGlobal in interface SharingStandardDockActiontrue if global key events are supportedprotected boolean trigger(KeyEvent event, Dockable dockable)
accelerator.
This method directly calls trigger( dockable ), subclasses
might override this method to further analyze event.event - the triggering eventdockable - the source of the eventtrue if this action could do anything, false
if this action was not able to react in any way to the event.Copyright © 2017 Docking Frames. All rights reserved.