|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.ide.controller.MenuManager
oracle.ide.controller.ContextMenu
public final class ContextMenu
Use ContextMenu to add menu items to context (right click) menus.
Thread Safety: instances of this class are not thread safe. They must be used only from the AWT Event Dispatch Thread. However, ContextMenuListeners can be safely added or removed while events are being dispatched.
Constructor Summary | |
---|---|
ContextMenu() |
|
ContextMenu(MnemonicSolver solver) Creates an instance of ContextMenu that will automatically resolve mnemonic conflicts. |
Method Summary | |
---|---|
void |
add(java.awt.Component child) Appends a component into the MenuManager's GUI. |
void |
add(java.awt.Component child, float sectionId) Add the specified child to the end of this context menu. |
void |
add(java.awt.Component child, float sectionId, boolean fixed) Add the specified child to the end of this context menu. |
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 |
addMenuFilter(MenuFilter menuFilter) This implementation adds a menu filter only to the context menu. |
void |
addSeparator() Adds a Menu separator to the context menu. |
boolean |
fireDefaultAction(Context context) Invoke this method to fire the deault action associated with this context menu. |
Context |
getContext() Gets the current context. |
java.util.List<Pair<java.lang.Class,ContextMenuListener>> |
getContextMenuListeners() Returns a list of ContextMenuListener registered with this ContextMenu. |
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 |
prepareShow(Context context) |
protected void |
registerFilterContainerListener(javax.swing.JMenu menu) |
void |
removeAll() Removes all menu items from the popup menu. |
void |
removeContextMenuListener(ContextMenuListener l) Removes a context menu listener. |
void |
removeMenuFilter(MenuFilter menuFilter) This implementation removes a menu filter only from the context menu. |
void |
show(Context context) Shows the popup menu. |
static Element |
unwrapDecoratedElement(Element elem) Returns the undecorated Element, when the ElementAttributes.DECORATES_DATA_ELEMENT attribute is set. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContextMenu()
public ContextMenu(MnemonicSolver solver)
solver
- an instance of the MnemonicSolver
class. This instance will be used to resolve mnemonic conflicts between context menu items.Method Detail |
---|
public void add(java.awt.Component child)
MenuManager
add
in class MenuManager
child
- the child to add.public void add(java.awt.Component child, float sectionId)
child
to the end of this context menu.add
in class MenuManager
child
- menu item to add.sectionId
- floating point number used to group commands by section. Each section is automatically surrounded with JSeparators.public void add(java.awt.Component child, float sectionId, boolean fixed)
child
to the end of this context menu.child
- menu item to add.sectionId
- floating point number used to group commands by section. Each section is automatically surrounded with JSeparators.fixed
- indicates that the mnemonics used by the specified child should be respected by any active MnemonicSolver
.public void addContextMenuListener(ContextMenuListener l)
l
- the context menu listener.public void addContextMenuListener(ContextMenuListener l, java.lang.Class cls)
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
.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
.public void removeContextMenuListener(ContextMenuListener l)
l
- the context menu listener.public java.util.List<Pair<java.lang.Class,ContextMenuListener>> getContextMenuListeners()
ContextMenuListener
registered with this ContextMenu.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
.public java.awt.Container getGUI(boolean create)
getGUI
in class MenuManager
create
- force a creation of the GUI if it does not yet exist.public int getMenuCount()
public void removeAll()
public final void show(Context context)
context
- the current context. context
cannot be null and the context's event object must be a MouseEvent.java.lang.NullPointerException
- if context is null.public final void prepareShow(Context context)
public final Context getContext()
public void addSeparator()
public boolean fireDefaultAction(Context context)
context
- The current context.public MnemonicSolver getMnemonicSolver()
null
if none available.public static Element unwrapDecoratedElement(Element elem)
public final void addMenuFilter(MenuFilter menuFilter)
addMenuFilter
in class MenuManager
menuFilter
- a menu filter to add for the context menu. Must not be null.public final void removeMenuFilter(MenuFilter menuFilter)
removeMenuFilter
in class MenuManager
menuFilter
- a menu filter to remove.protected void registerFilterContainerListener(javax.swing.JMenu menu)
registerFilterContainerListener
in class MenuManager
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.5.0) E13403-06 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |