public abstract class CustomizationToolbarButton extends 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 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. |
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(DockController controller)
Informs this content about the
DockController in whose realm it is used. |
void |
setDescription(String description)
Sets a text which describes the meaning of the button.
|
void |
setIcon(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(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(DockController controller)
CustomizationMenuContentDockController in whose realm it is used.setController in interface CustomizationMenuContentcontroller - the controller, can be nullpublic Component getView()
CustomizationMenuContentComponent 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 CustomizationMenuContentnull if this item is not bound.public void bind(CustomizationMenuCallback callback)
CustomizationMenuContentbind in interface CustomizationMenuContentcallback - access to more detailed information about the DockStation that is
showing the menuprotected CustomizationToolbarButton.ItemLocation getItemLocation()
Dockable that is described by
this button.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 CustomizationMenuContentpublic void setIcon(Icon icon)
icon - the new icon, can be nullpublic void setText(String text)
icon - the new text, can be nullpublic void setDescription(String description)
description - the description, can be nullprotected 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 existsCopyright © 2018. All rights reserved.