public class DockActionItem extends java.lang.Object implements ToolbarItem
DockAction
allowing the action to show up on a toolbar.Modifier and Type | Field and Description |
---|---|
static bibliothek.gui.dock.action.view.ViewTarget<bibliothek.gui.dock.themes.basic.action.BasicTitleViewItem<javax.swing.JComponent>> |
TOOLBAR
A target for converting a
DockAction into a Component that can be shown on
a toolbar. |
Constructor and Description |
---|
DockActionItem(bibliothek.gui.dock.action.DockAction action)
Creates a new dockable showing
action |
Modifier and Type | Method and Description |
---|---|
void |
addMouseInputListener(javax.swing.event.MouseInputListener listener)
Urges this item to add
listener to its component . |
void |
bind()
Informs this item that it is now in use, the result of
ToolbarItem.getComponent() must not be null
and must not change after this method has been called. |
java.awt.Component |
getComponent()
Gets the
Component which is wrapped by this item. |
void |
removeMouseInputListener(javax.swing.event.MouseInputListener listener)
Urges this item to remove
listener from its component . |
void |
setController(bibliothek.gui.DockController controller)
Informs this item about the
DockController in whose realm it is used. |
void |
setDockable(ToolbarItemDockable dockable)
Informs this item about the
Dockable that is using it. |
void |
setOrientation(Orientation orientation)
Tells this item the orientation of the toolbar
|
void |
setSelected(boolean selected)
Informs this item whether it is actually shown or not.
|
void |
unbind()
Informs this item that it is no longer in use, the result of
ToolbarItem.getComponent() can be null
or change after this method has been called. |
public static final bibliothek.gui.dock.action.view.ViewTarget<bibliothek.gui.dock.themes.basic.action.BasicTitleViewItem<javax.swing.JComponent>> TOOLBAR
DockAction
into a Component
that can be shown on
a toolbar. If nothing else is defined, this target will automatically fall back to ViewTarget#TARGET
public DockActionItem(bibliothek.gui.dock.action.DockAction action)
action
action
- the action to show on this dockablepublic void setDockable(ToolbarItemDockable dockable)
ToolbarItem
Dockable
that is using it.setDockable
in interface ToolbarItem
dockable
- the owner of this itempublic void setController(bibliothek.gui.DockController controller)
ToolbarItem
DockController
in whose realm it is used. This method will always
be called before ToolbarItem.bind()
, or after ToolbarItem.unbind()
, is executed.setController
in interface ToolbarItem
controller
- the controller in whose realm this item works, can be null
public void bind()
ToolbarItem
ToolbarItem.getComponent()
must not be null
and must not change after this method has been called.bind
in interface ToolbarItem
public void unbind()
ToolbarItem
ToolbarItem.getComponent()
can be null
or change after this method has been called.unbind
in interface ToolbarItem
public void addMouseInputListener(javax.swing.event.MouseInputListener listener)
ToolbarItem
listener
to its component
. This method
must only be called if ToolbarItem.bind()
was executed.addMouseInputListener
in interface ToolbarItem
listener
- the MouseListener
and MouseMotionListener
that should be addedpublic void removeMouseInputListener(javax.swing.event.MouseInputListener listener)
ToolbarItem
listener
from its component
. This method
must only be called if ToolbarItem.bind()
was executed.removeMouseInputListener
in interface ToolbarItem
listener
- the MouseListener
and MouseMotionListener
that should be removedpublic java.awt.Component getComponent()
ToolbarItem
Component
which is wrapped by this item. The result of this method must not be
null
after ToolbarItem.bind()
has been called, it may not change until ToolbarItem.unbind()
was called.getComponent
in interface ToolbarItem
Component
, can be null
unless ToolbarItem.bind()
was calledpublic void setSelected(boolean selected)
ToolbarItem
setSelected
in interface ToolbarItem
selected
- true
if the item is shownpublic void setOrientation(Orientation orientation)
ToolbarItem
setOrientation
in interface ToolbarItem
orientation
- the orientation of the toolbar