Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


oracle.javatools.editor.popup
Class PopupWindowManager

java.lang.Object
  extended by oracle.javatools.editor.popup.PopupWindowManager

All Implemented Interfaces:
java.awt.event.FocusListener, java.beans.PropertyChangeListener, java.util.EventListener, EditorPlugin

public class PopupWindowManager
extends java.lang.Object
implements EditorPlugin, java.awt.event.FocusListener

The PopupWindowManager helps to manage popup windows for a given editor pane. Specifically, it helps to position popups so that they are completely visible without obscuring other popups if possible. Note that the API for this package is still work in progress.


Field Summary
static int EAST
          The constant indicating the west of a given rectangle location (when positining relative to location) or popup window (when positioning relative to popup).
static int NORTH
          The constant indicating the west of a given rectangle location (when positining relative to location) or popup window (when positioning relative to popup).
static int SOUTH
          The constant indicating the west of a given rectangle location (when positining relative to location) or popup window (when positioning relative to popup).
static int WEST
          The constant indicating the west of a given rectangle location (when positining relative to location) or popup window (when positioning relative to popup).

 

Method Summary
 void changePopupContent(PopupWindow popup, java.awt.Component content, boolean focusable)
          Changes the content within the PopupWindow.
 PopupWindow createPopup(java.awt.Component content, boolean focusable)
          Create a new PopupWindow with the given content.
 void deinstall(BasicEditorPane editor)
          Called when the plugin is being removed from the BasicEditorPane (for example when the editor is closed.) This is used to notify plugins that they should unregister any listeners that were attached.
 void dismissPopup(PopupWindow popup)
          Dismisses the popup window and any associated resources.
 void focusGained(java.awt.event.FocusEvent event)
          Invoked when a component gains the keyboard focus.
 void focusLost(java.awt.event.FocusEvent event)
          Invoked when a component loses the keyboard focus.
protected  BasicEditorPane getEditorPane()
          Fetch the editor pane this popup window manager is associated w/.
static PopupWindowManager getPopupWindowManager(BasicEditorPane editor)
          Fetch the PopupWindowManager to use for the given editor pane.
 void install(BasicEditorPane editor)
          Called when this plugin is being installed into the BasicEditorPane.
 void positionPopup(PopupWindow popupWindow, java.awt.Rectangle relativeToLocation, int[] preferredLocations)
          Set the position of the PopupWindow relative to the location specified.
 void propertyChange(java.beans.PropertyChangeEvent event)
          This method gets called when a bound property is changed.
 void showPopup(PopupWindow popup, PopupWindowListener listener)
          Show the PopupWindow.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

WEST

public static final int WEST
The constant indicating the west of a given rectangle location (when positining relative to location) or popup window (when positioning relative to popup).
See Also:
Constant Field Values

EAST

public static final int EAST
The constant indicating the west of a given rectangle location (when positining relative to location) or popup window (when positioning relative to popup).
See Also:
Constant Field Values

NORTH

public static final int NORTH
The constant indicating the west of a given rectangle location (when positining relative to location) or popup window (when positioning relative to popup).
See Also:
Constant Field Values

SOUTH

public static final int SOUTH
The constant indicating the west of a given rectangle location (when positining relative to location) or popup window (when positioning relative to popup).
See Also:
Constant Field Values

Method Detail

getPopupWindowManager

public static PopupWindowManager getPopupWindowManager(BasicEditorPane editor)
Fetch the PopupWindowManager to use for the given editor pane.
Parameters:
editor - the editor pane
Returns:
the popup window manager we can use

getEditorPane

protected BasicEditorPane getEditorPane()
Fetch the editor pane this popup window manager is associated w/.
Returns:
the editor pane

install

public void install(BasicEditorPane editor)
Called when this plugin is being installed into the BasicEditorPane.
Specified by:
install in interface EditorPlugin
Parameters:
editor - the editor pane

deinstall

public void deinstall(BasicEditorPane editor)
Called when the plugin is being removed from the BasicEditorPane (for example when the editor is closed.) This is used to notify plugins that they should unregister any listeners that were attached.
Specified by:
deinstall in interface EditorPlugin
Parameters:
editor - the editor pane

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
This method gets called when a bound property is changed.
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
event - the property change event

createPopup

public PopupWindow createPopup(java.awt.Component content,
                               boolean focusable)
Create a new PopupWindow with the given content. The focusable parameter indicates whether the popup should be allowed to have focus at any time. If not, then if the popup window is brought to the front (i.e., user clicked on it), focus will be automatically moved back to the associated editor. The size of the popup window is automatically based on the size of the content provided.
Parameters:
content - the content to display in the popup
focusable - whether the content is allowed to have focus or not
Returns:
the newly created, not yet visible, popup window

showPopup

public void showPopup(PopupWindow popup,
                      PopupWindowListener listener)
Show the PopupWindow. The listener provided will be notified if the popup is closed, or if focus was lost.
Parameters:
popup - the popup window

positionPopup

public void positionPopup(PopupWindow popupWindow,
                          java.awt.Rectangle relativeToLocation,
                          int[] preferredLocations)
Set the position of the PopupWindow relative to the location specified. The rectangle location specified is assumed to use coordinates relative to the underlying editor pane. The locations specified should be an array, such as "new int[] { NORTH, SOUTH }".
Parameters:
popupWindow - the popup window
relativeToLocation - the location (editor-relative) to position the popup relative to
preferredLocations - the array of preferred locations

changePopupContent

public void changePopupContent(PopupWindow popup,
                               java.awt.Component content,
                               boolean focusable)
Changes the content within the PopupWindow. This will cause the popup to be resized (but not repositioned.) It is up to the caller to reposition the popup window as appropriate.
Parameters:
popup - the popup window
content - the new content to display
focusable - whether the new content should be allowed to have focus

dismissPopup

public void dismissPopup(PopupWindow popup)
Dismisses the popup window and any associated resources.
Parameters:
popup - the popup window

focusGained

public void focusGained(java.awt.event.FocusEvent event)
Invoked when a component gains the keyboard focus.
Specified by:
focusGained in interface java.awt.event.FocusListener
Parameters:
event - the focus event

focusLost

public void focusLost(java.awt.event.FocusEvent event)
Invoked when a component loses the keyboard focus.
Specified by:
focusLost in interface java.awt.event.FocusListener
Parameters:
event - the focus event

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


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