|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.swing.tool.Tool com.levigo.jadice.swing.tool.PopupMenuTool
public class PopupMenuTool
A Tool
implementation which allows to display context menus on a ViewComponent
.
All entries to the menu must come from instances of MenuContributor
. In particular, the
following contributors are asked for their contributions:
Tool
registered with this Tool
's ToolManager
getFixedContributors()
ViewComponent
this Tool
is linked up to via its ToolManager
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.levigo.jadice.swing.tool.Tool |
---|
Tool.ActivationRequest |
Field Summary |
---|
Fields inherited from class com.levigo.jadice.swing.tool.Tool |
---|
DEFAULT_PRIORITY, MAX_PRIORITY, MIN_PRIORITY |
Constructor Summary | |
---|---|
PopupMenuTool()
|
Method Summary | |
---|---|
List<MenuContributor> |
getFixedContributors()
Returns a List which holds instances of MenuContributor
that will be given the opportunity to contribute entries to the menu
created by this Tool . |
protected void |
handleMouseClicked(MouseEditEvent e,
boolean isActive)
Invoked when the mouse button has been clicked (pressed and released) on a component. |
protected void |
handleMousePressed(MouseEditEvent e,
boolean isActive)
Invoked when a mouse button has been pressed on a component. |
protected void |
handleMouseReleased(MouseEditEvent e,
boolean isActive)
Invoked when a mouse button has been released on a component. |
protected void |
postprocessMenu(BasicMenuBuilder.Menu rootMenu)
After the menu to be displayed has been created, this method is called. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PopupMenuTool()
Method Detail |
---|
protected void handleMouseClicked(MouseEditEvent e, boolean isActive)
Tool
handleMouseClicked
in class Tool
isActive
- whether this tool is currently activeprotected void handleMousePressed(MouseEditEvent e, boolean isActive)
Tool
handleMousePressed
in class Tool
isActive
- whether this tool is currently activeprotected void handleMouseReleased(MouseEditEvent e, boolean isActive)
Tool
handleMouseReleased
in class Tool
isActive
- whether this tool is currently activeprotected void postprocessMenu(BasicMenuBuilder.Menu rootMenu)
rootMenu
- the BasicMenuBuilder.Menu
to be displayed by this toolpublic List<MenuContributor> getFixedContributors()
List
which holds instances of MenuContributor
that will be given the opportunity to contribute entries to the menu
created by this Tool
. Users may add contributors to the
List
being returned, which will afterwards be asked for their
contributions as well. In the same way, those contributors which shall no
longer be asked for contributions may be removed from the list.
This method must be called on the Event Dispatch Thread
.
The List
returned by this method must also be accessed on the
Event Dispatch Thread
exclusively.
List
of MenuContributor
s asked for
contributions when this Tool
is preparing a menu to be
displayed.
IllegalStateException
- if the calling thread is not the
event dispatch thread
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |