|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.themes.basic.action.BasicDropDownButtonHandler
public class BasicDropDownButtonHandler
A handler connecting a DropDownAction
with a BasicDropDownButtonModel
and its view. Clients should call the method setModel(BasicDropDownButtonModel)
to
connect model and handler.
Nested Class Summary | |
---|---|
protected class |
BasicDropDownButtonHandler.ButtonView
A view that sends all values directly to the button. |
private class |
BasicDropDownButtonHandler.Listener
A listener to the action that is handled by this handler |
protected class |
BasicDropDownButtonHandler.SelectionView
A set of properties which can be set by the selected action. |
Field Summary | |
---|---|
private DropDownAction |
action
the action to observe and to trigger |
private java.util.List<DockAction> |
actions
the currently known actions |
private BasicDropDownButtonHandler.ButtonView |
buttonView
connection between filter and button |
private Dockable |
dockable
the element for which the action is shown |
private DropDownFilter |
filter
filters the properties of the action and its selection |
private java.util.Map<DockAction,DropDownItemHandle> |
items
the views for the items of actions . |
private BasicDropDownButtonHandler.Listener |
listener
a listener to the model |
private javax.swing.JPopupMenu |
menu
the menu to show when the button is clicked |
private BasicDropDownButtonModel |
model
the model that links to the view |
private DropDownItemHandle |
selection
the currently selected item, can be null |
private BasicDropDownButtonHandler.SelectionView |
selectionView
connection between current selection and filter |
private DockActionSource |
source
the current source of child-actions |
Constructor Summary | |
---|---|
BasicDropDownButtonHandler(DropDownAction action,
Dockable dockable)
Creates a new handler. |
Method Summary | |
---|---|
private void |
add(int index,
DockAction action)
Adds an action into the list of all known actions. |
void |
bind()
Binds this item to its action |
DropDownAction |
getAction()
Gets the action that is represented by this target. |
protected BasicDropDownButtonHandler.ButtonView |
getButtonView()
Gets the view which contains information about the currently selected action. |
Dockable |
getDockable()
|
javax.swing.JComponent |
getItem()
Gets this item as component. |
void |
popupTriggered()
Shows the popup menu |
private void |
remove(int index)
Removes an action from the list of all known actions. |
protected void |
reset()
Sets all values of the filter to null . |
void |
setModel(BasicDropDownButtonModel model)
Sets the model to which this handler sends all properties of the action . |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private DropDownAction action
private DockActionSource source
private Dockable dockable
private BasicDropDownButtonModel model
private BasicDropDownButtonHandler.Listener listener
private DropDownItemHandle selection
null
private java.util.List<DockAction> actions
private java.util.Map<DockAction,DropDownItemHandle> items
actions
. Not all actions have a view.
private javax.swing.JPopupMenu menu
private BasicDropDownButtonHandler.SelectionView selectionView
private BasicDropDownButtonHandler.ButtonView buttonView
private DropDownFilter filter
Constructor Detail |
---|
public BasicDropDownButtonHandler(DropDownAction action, Dockable dockable)
action
- the action to observedockable
- the element for which the action
is shownMethod Detail |
---|
public void setModel(BasicDropDownButtonModel model)
action
.
model
- the model to inform about changespublic void setOrientation(DockTitle.Orientation orientation)
BasicTitleViewItem
setOrientation
in interface BasicTitleViewItem<javax.swing.JComponent>
orientation
- the orientationpublic void bind()
ViewItem
bind
in interface ViewItem<javax.swing.JComponent>
public void unbind()
ViewItem
unbind
in interface ViewItem<javax.swing.JComponent>
private void add(int index, DockAction action)
index
- the location of the actionaction
- the new actionprivate void remove(int index)
index
- the location of the actionpublic DropDownAction getAction()
ViewItem
getAction
in interface ViewItem<javax.swing.JComponent>
null
public Dockable getDockable()
public javax.swing.JComponent getItem()
ViewItem
getItem
in interface ViewItem<javax.swing.JComponent>
public void triggered()
BasicTrigger
BasicButtonModel
when the button, which is monitored
by the model, is clicked.
triggered
in interface BasicTrigger
public void popupTriggered()
public void updateUI()
protected BasicDropDownButtonHandler.ButtonView getButtonView()
protected void reset()
filter
to null
.
protected void update()
filter
. This might change some contents of the button.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |