Extension SDK

oracle.ide
Class ContextMenu

java.lang.Object
  |
  +--oracle.ide.AbstractMenuManager
        |
        +--oracle.ide.ContextMenu
All Implemented Interfaces:
MenuManager

public class ContextMenu
extends AbstractMenuManager


Fields inherited from class oracle.ide.AbstractMenuManager
containerListener, menuListener
 
Fields inherited from interface oracle.ide.MenuManager
LAST_POSITION
 
Constructor Summary
ContextMenu()
           
ContextMenu(MnemonicSolver solver)
           
 
Method Summary
 void add(java.awt.Component child)
          Appends a component into the MenuManager's GUI.
 void add(java.awt.Component child, boolean fixed)
           
 void addContextMenuListener(ContextMenuListener l)
          Adds a context menu listener.
 void addContextMenuListener(ContextMenuListener l, java.lang.Class cls)
          Adds a ContextMenuListener that is called when the type of the data represented by the current Context is assignable to a variable whose type is of the specified Class.
 void addSeparator()
          Adds a Menu separator to the context menu.
 boolean fireDefaultAction(Context context)
           
 Context getContext()
           
static Context getContext(javax.swing.JMenuItem menuItem)
           
 java.awt.Container getGUI(boolean create)
          Creates the actual popup menu.
 int getMenuCount()
          Returns the number of elements in the menu.
 MnemonicSolver getMnemonicSolver()
          Get the menu item mnemonic solver.
 void insert(java.awt.Component child, java.awt.Component after)
          Inserts a component into the MenuManager's GUI after the given sibling.
 void insert(java.awt.Component child, java.awt.Component after, boolean fixed)
           
 void insert(java.awt.Component child, int index)
          Inserts a component into the MenuManager's GUI at the given index.
 void insert(java.awt.Component child, int index, boolean fixed)
           
 void removeAll()
          Removes all menu items from the popup menu.
 void removeContextMenuListener(ContextMenuListener l)
          Removes a context menu listener.
 void show(Context context)
          Shows the popup menu.
 
Methods inherited from class oracle.ide.AbstractMenuManager
add, createMenu, createMenuItem, createMenuItem, createSubMenu, getChildById, getIndexOfChild, getIndexOfCommandId, insert, insert, insert, remove, remove
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextMenu

public ContextMenu()

ContextMenu

public ContextMenu(MnemonicSolver solver)
Method Detail

add

public void add(java.awt.Component child)
Description copied from interface: MenuManager
Appends a component into the MenuManager's GUI.
Overrides:
add in class AbstractMenuManager
Following copied from interface: oracle.ide.MenuManager
Parameters:
child - the child to be inserted.

insert

public void insert(java.awt.Component child,
                   int index)
Description copied from interface: MenuManager
Inserts a component into the MenuManager's GUI at the given index. Appends the component if the given index is out of bounds.
Overrides:
insert in class AbstractMenuManager
Following copied from interface: oracle.ide.MenuManager
Parameters:
child - the child to be inserted.
index - the insertion location.

insert

public void insert(java.awt.Component child,
                   java.awt.Component after)
Description copied from interface: MenuManager
Inserts a component into the MenuManager's GUI after the given sibling. Appends the component if the given sibling is not an immediate child of the MenuManger's GUI.
Overrides:
insert in class AbstractMenuManager
Following copied from interface: oracle.ide.MenuManager
Parameters:
child - the child to be inserted.
after - the sibling after which the child should be inserted.

add

public void add(java.awt.Component child,
                boolean fixed)

insert

public void insert(java.awt.Component child,
                   int index,
                   boolean fixed)

insert

public void insert(java.awt.Component child,
                   java.awt.Component after,
                   boolean fixed)

addContextMenuListener

public void addContextMenuListener(ContextMenuListener l)
Adds a context menu listener. Context menu listeners listen for notification of when the menu is about to become visible or invisible.
Parameters:
l - the context menu listener.

addContextMenuListener

public void addContextMenuListener(ContextMenuListener l,
                                   java.lang.Class cls)
Adds a ContextMenuListener that is called when the type of the data represented by the current Context is assignable to a variable whose type is of the specified Class.
Parameters:
l - the ContextMenuListener to add.
cls - if non-null, the ContextMenuListener will only be notified if the current Context's data object type is assignable to a variable whose type is of the specified Class.

removeContextMenuListener

public void removeContextMenuListener(ContextMenuListener l)
Removes a context menu listener. Context menu listeners listen for notification of when the menu is about to become visible or invisible.
Parameters:
l - the context menu listener.

getGUI

public java.awt.Container getGUI(boolean create)
Creates the actual popup menu. Callers should store the returned value for use when calling the show method.
Returns:
the newly create popup menu.

getMenuCount

public int getMenuCount()
Returns the number of elements in the menu.

removeAll

public void removeAll()
Removes all menu items from the popup menu.

show

public final void show(Context context)
Shows the popup menu.
Parameters:
context - the current context.

getContext

public final Context getContext()

getContext

public static final Context getContext(javax.swing.JMenuItem menuItem)

addSeparator

public void addSeparator()
Adds a Menu separator to the context menu.

fireDefaultAction

public boolean fireDefaultAction(Context context)

getMnemonicSolver

public MnemonicSolver getMnemonicSolver()
Get the menu item mnemonic solver. This object can be used to make sure that the context menu does not have any conflicting mnemonics. Returns null if none available.

Extension SDK