|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.action.actions.AbstractStandardDockAction
bibliothek.gui.dock.action.actions.SimpleDockAction
public abstract class SimpleDockAction
A simple implementation of DockAction
. This action uses for
all associated Dockables
the same settings.
Field Summary |
---|
Fields inherited from class bibliothek.gui.dock.action.actions.AbstractStandardDockAction |
---|
listeners |
Constructor Summary | |
---|---|
SimpleDockAction()
|
Method Summary | |
---|---|
protected void |
bound(Dockable dockable)
Invoked by this AbstractStandardDockAction when a Dockable
was bound to this action the first time. |
javax.swing.KeyStroke |
getAccelerator()
Gets the type of KeyEvent that must happen to trigger this
action. |
javax.swing.Icon |
getDisabledIcon()
Gets the icon that is shown when this action is not enabled. |
javax.swing.Icon |
getDisabledIcon(Dockable dockable)
Gets the Icon of this DockAction, when this DockAction is shown together with dockable and 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 . |
javax.swing.Icon |
getIcon()
Gets the default-icon that is shown for this action. |
javax.swing.Icon |
getIcon(Dockable dockable)
Gets the Icon of this DockAction, when this DockAction is shown together with dockable . |
java.lang.String |
getText()
Gets the text that is shown for this action. |
java.lang.String |
getText(Dockable dockable)
Gets the text of this DockActon, when this DockAction is shown together with dockable . |
java.lang.String |
getTooltip()
Gets the first part of the toopltip-text that is shown for this action. |
java.lang.String |
getTooltipText()
Gets the text that should be shown as tooltip of this action. |
java.lang.String |
getTooltipText(Dockable dockable)
Gets a tooltip for this DockActon, when this DockAction is shown together with dockable . |
boolean |
isEnabled()
Gets the enabled-state for this action. |
boolean |
isEnabled(Dockable dockable)
Tells whether this DockAction can be triggered together with the dockable . |
void |
setAccelerator(javax.swing.KeyStroke accelerator)
Sets the type of event that will trigger this action. |
void |
setDisabledIcon(javax.swing.Icon disabledIcon)
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(javax.swing.Icon icon)
Sets the default- icon for this action. |
void |
setText(java.lang.String text)
Sets the text which is shown for this action. |
void |
setTooltip(java.lang.String tooltip)
Sets the first part of the tooltip-text which is shown for this action. |
protected boolean |
trigger(java.awt.event.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. |
Methods inherited from class bibliothek.gui.dock.action.actions.AbstractStandardDockAction |
---|
addDockActionListener, bind, fireActionDisabledIconChanged, fireActionEnabledChanged, fireActionIconChanged, fireActionRepresentativeChanged, fireActionTextChanged, fireActionTooltipTextChanged, getBoundDockables, isBound, removeDockActionListener, unbind |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface bibliothek.gui.dock.action.StandardDockAction |
---|
addDockActionListener, removeDockActionListener |
Methods inherited from interface bibliothek.gui.dock.action.DockAction |
---|
bind, createView, trigger, unbind |
Constructor Detail |
---|
public SimpleDockAction()
Method Detail |
---|
protected void bound(Dockable dockable)
AbstractStandardDockAction
AbstractStandardDockAction
when a Dockable
was bound to this action the first time.
bound
in class AbstractStandardDockAction
dockable
- The Dockable that was not known to this action
before the method was invokedprotected void unbound(Dockable dockable)
AbstractStandardDockAction
AbstractStandardDockAction
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 AbstractStandardDockAction
dockable
- The Dockable which will not by used in any way.public javax.swing.Icon getIcon(Dockable dockable)
StandardDockAction
dockable
.
getIcon
in interface StandardDockAction
dockable
- The Dockable
for which the action-icon
should be chosen.
dockable
, or null
.public java.lang.String getText(Dockable dockable)
StandardDockAction
dockable
.
getText
in interface StandardDockAction
dockable
- The Dockable
for which the action-text
should be chosen.
dockable
, or null
.public java.lang.String getText()
SharingStandardDockAction
getText
in interface SharingStandardDockAction
null
SharingStandardDockAction.setText(String)
public void setText(java.lang.String text)
SharingStandardDockAction
text
which is shown for this action.
setText
in interface SharingStandardDockAction
text
- The text to show, or null
public java.lang.String getTooltipText(Dockable dockable)
StandardDockAction
dockable
.
getTooltipText
in interface StandardDockAction
dockable
- The Dockable
for which the action-tooltip
should be chosen.
dockable
, or null
.public java.lang.String getTooltipText()
SharingStandardDockAction
SharingStandardDockAction.getTooltip()
, but also additional information
like the accelerator
getTooltipText
in interface SharingStandardDockAction
public java.lang.String getTooltip()
SharingStandardDockAction
getTooltip
in interface SharingStandardDockAction
SharingStandardDockAction.setTooltip(String)
public void setTooltip(java.lang.String tooltip)
SharingStandardDockAction
setTooltip
in interface SharingStandardDockAction
tooltip
- The client defined part of the tooltip for this actionpublic boolean isEnabled(Dockable dockable)
StandardDockAction
dockable
.
isEnabled
in interface StandardDockAction
dockable
- The Dockable
for which this action maybe
triggered.
true
if the user should be able to trigger
this action, false
otherwisepublic boolean isEnabled()
SharingStandardDockAction
isEnabled
in interface SharingStandardDockAction
true
if this action can be triggered,
false
otherwiseSharingStandardDockAction.setEnabled(boolean)
public void setEnabled(boolean enabled)
SharingStandardDockAction
setEnabled
in interface SharingStandardDockAction
enabled
- The statepublic javax.swing.Icon getIcon()
SharingStandardDockAction
getIcon
in interface SharingStandardDockAction
null
SharingStandardDockAction.setIcon(Icon)
public void setIcon(javax.swing.Icon icon)
SharingStandardDockAction
icon
for this action. This icon
will be shown when no other icon fits the current states of
the action.
setIcon
in interface SharingStandardDockAction
icon
- The icon, can be null
public javax.swing.Icon getDisabledIcon()
SharingStandardDockAction
getDisabledIcon
in interface SharingStandardDockAction
null
SharingStandardDockAction.setDisabledIcon(Icon)
,
SharingStandardDockAction.isEnabled()
public javax.swing.Icon getDisabledIcon(Dockable dockable)
StandardDockAction
dockable
and is not enabled.
getDisabledIcon
in interface StandardDockAction
dockable
- The Dockable
for which the action-icon
should be chosen.
dockable
, or null
.public void setDockableRepresentation(Dockable dockable)
SharingStandardDockAction
Dockable
which is represented by this DockAction
. Some views of
this DockAction
will register themselves as DockElementRepresentative
representing
dockable
.
setDockableRepresentation
in interface SharingStandardDockAction
dockable
- the new representation, can be null
public Dockable getDockableRepresentation(Dockable dockable)
StandardDockAction
DockAction
represents a Dockable
. If so, the framework
may register views for this action as DockElementRepresentative
.
getDockableRepresentation
in interface StandardDockAction
dockable
- The Dockable
for which this action may be triggered
Dockable
which is represented by this action, can be null
.
Normally dockable
should not be the result.public Dockable getDockableRepresentation()
SharingStandardDockAction
Dockable
which is represented by this DockAction
.
getDockableRepresentation
in interface SharingStandardDockAction
null
StandardDockAction.getDockableRepresentation(Dockable)
public void setDisabledIcon(javax.swing.Icon disabledIcon)
SharingStandardDockAction
setDisabledIcon
in interface SharingStandardDockAction
disabledIcon
- The disabled-icon, can be null
SharingStandardDockAction.setEnabled(boolean)
public javax.swing.KeyStroke getAccelerator()
SharingStandardDockAction
KeyEvent
that must happen to trigger this
action.
getAccelerator
in interface SharingStandardDockAction
null
public void setAccelerator(javax.swing.KeyStroke accelerator)
SharingStandardDockAction
setAccelerator
in interface SharingStandardDockAction
accelerator
- the type of event or null
.protected boolean trigger(java.awt.event.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 event
true
if this action could do anything, false
if this action was not able to react in any way to the event.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |