public class BasicDropDownButtonHandler extends AbstractBasicHandler<DropDownAction,BasicDropDownButtonModel> implements BasicDropDownButtonTrigger, BasicTitleViewItem<JComponent>
DropDownAction with a BasicDropDownButtonModel
and its view. Clients should call the method AbstractBasicHandler.setModel(BasicButtonModel) to
connect model and handler.| Modifier and Type | Class and Description |
|---|---|
protected class |
BasicDropDownButtonHandler.ButtonView
A view that sends all values directly to the button.
|
protected class |
BasicDropDownButtonHandler.SelectionView
A set of properties which can be set by the selected action.
|
| Constructor and Description |
|---|
BasicDropDownButtonHandler(DropDownAction action,
Dockable dockable)
Creates a new handler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bind()
Binds this item to its action
|
protected BasicDropDownButtonHandler.ButtonView |
getButtonView()
Gets the view which contains information about the currently selected
action.
|
Icon |
getDisabledDropDownIcon()
Gets a disabled version of
getDropDownIcon(). |
Icon |
getDropDownIcon()
Gets an icon that can be used to represent an area that opens the popup menu when clicked.
|
JComponent |
getItem()
Gets this item as component.
|
void |
popupTriggered()
Shows the popup menu
|
protected void |
reset()
Sets all values of the
filter to null. |
void |
setBackground(Color background)
Called by the title that shows this item to tell this item what the
background color of the title is.
|
void |
setForeground(Color foreground)
Called by the title that shows this item to tell this item what the
foreground color of the title is.
|
void |
setOrientation(DockTitle.Orientation orientation)
Informs the item about the orientation of the title that uses this
item.
|
void |
triggered()
Invoked by a
BasicButtonModel when the button, which is monitored
by the model, is clicked. |
void |
unbind()
Unbinds this item from its action
|
protected void |
update()
Updates the
filter. |
void |
updateUI()
Update the look and feel of the menu
|
addBorder, ensureBorder, getAction, getDockable, getModel, isBound, setModelclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAction, getDockablepublic BasicDropDownButtonHandler(DropDownAction action, Dockable dockable)
action - the action to observedockable - the element for which the action is shownpublic void bind()
ViewItembind in interface ViewItem<JComponent>bind in class AbstractBasicHandler<DropDownAction,BasicDropDownButtonModel>public void unbind()
ViewItemunbind in interface ViewItem<JComponent>unbind in class AbstractBasicHandler<DropDownAction,BasicDropDownButtonModel>public Icon getDropDownIcon()
nullpublic Icon getDisabledDropDownIcon()
getDropDownIcon().nullpublic void setBackground(Color background)
BasicTitleViewItemsetBackground in interface BasicTitleViewItem<JComponent>background - the background color of the titlepublic void setForeground(Color foreground)
BasicTitleViewItemsetForeground in interface BasicTitleViewItem<JComponent>foreground - the foreground color of the titlepublic void setOrientation(DockTitle.Orientation orientation)
BasicTitleViewItemsetOrientation in interface BasicTitleViewItem<JComponent>orientation - the orientationpublic JComponent getItem()
ViewItemgetItem in interface ViewItem<JComponent>nullpublic void triggered()
BasicTriggerBasicButtonModel when the button, which is monitored
by the model, is clicked.triggered in interface BasicTriggerpublic void popupTriggered()
popupTriggered in interface BasicDropDownButtonTriggerpublic void updateUI()
protected BasicDropDownButtonHandler.ButtonView getButtonView()
protected void reset()
filter to null.protected void update()
filter. This might change some contents of the button.Copyright © 2017 Docking Frames. All rights reserved.