public abstract class CustomizationToolbarButton extends java.lang.Object implements CustomizationMenuContent
CustomizationToolbarButton
is a button that allows to add one
Dockable
to a DockStation
. This button also offers an
indication telling whether the Dockable
is already shown on another
station.Modifier and Type | Class and Description |
---|---|
static class |
CustomizationToolbarButton.ItemLocation
The different locations where a
Dockable can be in respect to
this button |
Constructor and Description |
---|
CustomizationToolbarButton() |
Modifier and Type | Method and Description |
---|---|
void |
bind(CustomizationMenuCallback callback)
Informs this item that is going to be used.
|
protected abstract bibliothek.gui.Dockable |
getDockable()
Gets the element that is put onto a toolbar.
|
protected CustomizationToolbarButton.ItemLocation |
getItemLocation()
Gets the current location of the
Dockable that is described by
this button. |
java.awt.Component |
getView()
Gets a
Component which represents this item. |
protected abstract boolean |
hasDockable()
Tells whether the
Dockable of this button, accessible by calling
getDockable() , is already present. |
void |
setController(bibliothek.gui.DockController controller)
Informs this content about the
DockController in whose realm it is used. |
void |
setDescription(java.lang.String description)
Sets a text which describes the meaning of the button.
|
void |
setIcon(javax.swing.Icon icon)
Sets the icon which should be shown on the button.
|
protected void |
setItemVisible(boolean visible)
Removes the
Dockable from its current parent and maybe appends it
to the owner of this button. |
void |
setText(java.lang.String text)
Sets the text which should be shown on the button.
|
void |
unbind()
Informs this item that it is no longer used.
|
public void setController(bibliothek.gui.DockController controller)
CustomizationMenuContent
DockController
in whose realm it is used.setController
in interface CustomizationMenuContent
controller
- the controller, can be null
public java.awt.Component getView()
CustomizationMenuContent
Component
which represents this item. If #bind()
has not yet
been called, or CustomizationMenuContent.unbind()
has been called, then a result of null
is valid.getView
in interface CustomizationMenuContent
null
if this item is not bound
.public void bind(CustomizationMenuCallback callback)
CustomizationMenuContent
bind
in interface CustomizationMenuContent
callback
- access to more detailed information about the DockStation
that is
showing the menuprotected CustomizationToolbarButton.ItemLocation getItemLocation()
Dockable
that is described by
this button.java.lang.IllegalStateException
- if bind(CustomizationMenuCallback)
was not calledprotected void setItemVisible(boolean visible)
Dockable
from its current parent and maybe appends it
to the owner of this button.visible
- whether the item should be visible or notpublic void unbind()
CustomizationMenuContent
#bind()
.unbind
in interface CustomizationMenuContent
public void setIcon(javax.swing.Icon icon)
icon
- the new icon, can be null
public void setText(java.lang.String text)
icon
- the new text, can be null
public void setDescription(java.lang.String description)
description
- the description, can be null
protected abstract boolean hasDockable()
Dockable
of this button, accessible by calling
getDockable()
, is already present. If the item is not yet
present, then it cannot be visible or selected at this time.Dockable
already existsprotected abstract bibliothek.gui.Dockable getDockable()
Dockable
lazily in the very moment it is used the first time.