|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbibliothek.gui.dock.themes.basic.action.menu.AbstractMenuHandler<javax.swing.JMenu,MenuDockAction>
bibliothek.gui.dock.themes.basic.action.menu.MenuMenuHandler
public class MenuMenuHandler
A handler that manages a menu. The menu can either be toplevel (like a popup-menu) or a submenu of another menu.
Nested Class Summary | |
---|---|
private class |
MenuMenuHandler.JMenuWrapper
A wrapper JMenu to Menu. |
private class |
MenuMenuHandler.JPopupMenuWrapper
A Wrapper JPopupMenu to Menu. |
private class |
MenuMenuHandler.Listener
A listener to the source of the enclosing handler. |
private static interface |
MenuMenuHandler.Menu
A representation of a menu. |
Field Summary | |
---|---|
private java.util.List<DockAction> |
actions
the actions currently known to this menu |
private java.util.Map<DockAction,ViewItem<javax.swing.JComponent>> |
handlers
the current handlers of the menu |
private MenuMenuHandler.Listener |
listener
a listener to the source |
private MenuMenuHandler.Menu |
menu
the menu to add or remove children |
private DockActionSource |
source
the observed source |
Fields inherited from class bibliothek.gui.dock.themes.basic.action.menu.AbstractMenuHandler |
---|
action, dockable, item |
Constructor Summary | |
---|---|
MenuMenuHandler(DockActionSource source,
Dockable dockable,
javax.swing.JPopupMenu menu)
Creates a new handler |
|
MenuMenuHandler(MenuDockAction action,
Dockable dockable)
Creates a new handler |
Method Summary | |
---|---|
void |
addActionListener(java.awt.event.ActionListener listener)
Adds a listener which will be called if this view is triggered. |
void |
bind()
Connects this handler to its action. |
private ViewItem<javax.swing.JComponent> |
handlerFor(DockAction action)
Creates a new AbstractMenuHandler for action . |
void |
removeActionListener(java.awt.event.ActionListener listener)
Removes a listener from this view. |
private void |
setup(DockActionSource source,
MenuMenuHandler.Menu menu)
Sets up this handler |
void |
unbind()
Disconnects this handler from its action |
Methods inherited from class bibliothek.gui.dock.themes.basic.action.menu.AbstractMenuHandler |
---|
getAction, getDockable, getItem |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private DockActionSource source
private MenuMenuHandler.Menu menu
private java.util.Map<DockAction,ViewItem<javax.swing.JComponent>> handlers
private java.util.List<DockAction> actions
private MenuMenuHandler.Listener listener
Constructor Detail |
---|
public MenuMenuHandler(MenuDockAction action, Dockable dockable)
action
- the observed actiondockable
- the dockable for which items are inserted into the menupublic MenuMenuHandler(DockActionSource source, Dockable dockable, javax.swing.JPopupMenu menu)
source
- the observed sourcedockable
- the dockable for which actions are dispatchedmenu
- the menu where items will be insertedMethod Detail |
---|
private void setup(DockActionSource source, MenuMenuHandler.Menu menu)
source
- the observed sourcemenu
- the menu whose values will be changedpublic void addActionListener(java.awt.event.ActionListener listener)
MenuViewItem
listener
- the new listenerpublic void removeActionListener(java.awt.event.ActionListener listener)
MenuViewItem
listener
- the listener to removepublic void bind()
AbstractMenuHandler
bind
in interface ViewItem<javax.swing.JComponent>
bind
in class AbstractMenuHandler<javax.swing.JMenu,MenuDockAction>
private ViewItem<javax.swing.JComponent> handlerFor(DockAction action)
AbstractMenuHandler
for action
.
action
- an action
action
.public void unbind()
AbstractMenuHandler
unbind
in interface ViewItem<javax.swing.JComponent>
unbind
in class AbstractMenuHandler<javax.swing.JMenu,MenuDockAction>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |