Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.javatools.editor
Interface PopupManager

All Known Implementing Classes:
CodeEditor

public interface PopupManager

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 addPopupManager() in 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.

See Also:
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

showPopup

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. The client is responsible for building/populating the popup menus (if necessary), and making it visible.

Parameters:
editorPane - the editorPane that the user request occurred in
mouseEvent - the mouse event describing the location of the popup request.

hidePopup

void hidePopup(BasicEditorPane editorPane)
Informs the editor client that the popup menu (if showing) should now be hidden. This may be in response to some user input or event.

Parameters:
editorPane - the editorPane for which the popup should be hidden

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

Copyright © 1997, 2011, Oracle. All rights reserved.