|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object bibliothek.gui.dock.themes.basic.action.menu.AbstractMenuHandler<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.
Field Summary |
---|
Fields inherited from class bibliothek.gui.dock.themes.basic.action.menu.AbstractMenuHandler |
---|
action, dockable, item |
Constructor Summary | |
---|---|
MenuMenuHandler(DockActionSource source,
Dockable dockable,
JPopupMenu menu)
Creates a new handler |
|
MenuMenuHandler(MenuDockAction action,
Dockable dockable)
Creates a new handler |
|
MenuMenuHandler(MenuDockAction action,
Dockable dockable,
ViewTarget<? extends MenuViewItem<JComponent>> target)
Creates a new handler |
Method Summary | |
---|---|
void |
addActionListener(ActionListener listener)
Adds a listener which will be called if this view is triggered. |
void |
addChildrenActionListener(ActionListener listener)
Adds a listener to this handler, the listener will be invoked if one of the children of this handler fires an action. |
void |
bind()
Connects this handler to its action. |
protected void |
fireActionEvent(ActionEvent event)
Fires event to all ActionListener s currently known to this handler. |
MenuViewItem<JComponent> |
getViewFor(DockAction action)
Searches for the first view which is used for action . |
protected MenuViewItem<JComponent> |
handlerFor(DockAction action)
Creates a new view for action . |
void |
removeActionListener(ActionListener listener)
Removes a listener from this view. |
void |
removeChildrenActionListener(ActionListener listener)
Removes listener from 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 |
Constructor Detail |
---|
public MenuMenuHandler(MenuDockAction action, Dockable dockable)
action
- the observed actiondockable
- the dockable for which items are inserted into the menupublic MenuMenuHandler(MenuDockAction action, Dockable dockable, ViewTarget<? extends MenuViewItem<JComponent>> target)
action
- the observed actiondockable
- the dockable for which items are inserted into the menutarget
- what kind of view to use on the menupublic MenuMenuHandler(DockActionSource source, Dockable dockable, JPopupMenu menu)
source
- the observed sourcedockable
- the dockable for which actions are dispatchedmenu
- the menu where items will be insertedMethod Detail |
---|
public void addActionListener(ActionListener listener)
MenuViewItem
listener
- the new listenerpublic void removeActionListener(ActionListener listener)
MenuViewItem
listener
- the listener to removepublic void addChildrenActionListener(ActionListener listener)
ActionEvent
will be the
DockAction
which fired the event.
listener
- a new listenerpublic void removeChildrenActionListener(ActionListener listener)
listener
from this handler.
listener
- the listener to removeaddChildrenActionListener(ActionListener)
protected void fireActionEvent(ActionEvent event)
event
to all ActionListener
s currently known to this handler.
event
- the event to firepublic void bind()
AbstractMenuHandler
bind
in interface ViewItem<JComponent>
bind
in class AbstractMenuHandler<JMenu,MenuDockAction>
protected MenuViewItem<JComponent> handlerFor(DockAction action)
action
. The default implementation
uses the ActionViewConverter
and sets the ViewTarget
to
ViewTarget.MENU
.
action
- an action
action
.public MenuViewItem<JComponent> getViewFor(DockAction action)
action
.
action
- some child of this handler
action
, null
if
action
is not found or if this handler is not boundpublic void unbind()
AbstractMenuHandler
unbind
in interface ViewItem<JComponent>
unbind
in class AbstractMenuHandler<JMenu,MenuDockAction>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |