|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A PopupManager
is an interface for the editor component
to inform the editor client to show or hide a context-sensitive
popup menu in response to a user's request. The typical request
for a popup is to right-click in the editor.
The reason for the interface is to provide maximum flexibility to
clients in how them implement their own popup menus. For example,
typical Swing applications will create a JPopupMenu
that is used for the popup menu. As another example, the JDev 5.0
framework uses the ContextMenu
object for handling
popup menus.
In order to display popup menus in your own client applications, follow
the example in the editor demo
application. Basically, you need to build an implementation
of PopupManager
that is responsible for showing or hiding
your popup menus, and register it with the editor pane by calling
in addPopupManager()
BasicEditorPane
. When your showPopup()
method is called, build your popup menus (if necessary), and show them.
When your hidePopup()
method is called, hide your popup
menus.
BasicEditorPane
,
oracle.javatools.editor.demo.MainWindow
Method Summary | |
void |
hidePopup(BasicEditorPane editorPane)
Informs the editor client that the popup menu (if showing) should now be hidden. |
void |
showPopup(BasicEditorPane editorPane,
java.awt.event.MouseEvent mouseEvent)
Informs the editor client that the user requested a popup menu in the given editor pane, at the location specified in the mouseEvent. |
Method Detail |
public void showPopup(BasicEditorPane editorPane, java.awt.event.MouseEvent mouseEvent)
editorPane
- the editorPane that the user request occurred inmouseEvent
- the mouse event describing the location of the
popup request.public void hidePopup(BasicEditorPane editorPane)
editorPane
- the editorPane for which the popup should be hidden
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.