|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectoracle.ide.controller.MenuManager
Manages the IDE's menus. The MenuManager can be
used to retrieve, create, insert, and remove menus and menu items.
Extension writers should use this API when working with menus in
order to have a complete integration with the IDE's menu management.
| Method Summary | |
void |
add(java.awt.Component child)
Appends a component into the MenuManager's GUI. |
void |
add(java.awt.Component child,
float sectionId)
Adds a component into the MenuManager's GUI. |
void |
add(java.awt.Component child,
javax.swing.JMenu parent)
Appends a component into the given parent. |
void |
add(java.awt.Component child,
javax.swing.JMenu parent,
float sectionId)
Appends a component into the given parent. |
javax.swing.JMenu |
createMenu(java.lang.String caption,
java.lang.Integer mnemonic)
Creates a new menu suitable for insertion into JDeveloper's top level menu bar. |
javax.swing.JMenu |
createMenu(java.lang.String caption,
java.lang.Integer mnemonic,
float weight)
Creates a new menu suitable for insertion into JDeveloper's top level menu bar. |
javax.swing.JMenu |
createMenu(java.lang.String caption,
java.lang.Integer mnemonic,
float weight,
float sectionId)
Creates a new menu suitable for insertion into JDeveloper's top level menu bar. |
javax.swing.JMenuItem |
createMenuItem(ToggleAction action)
Creates a new menu item for the supplied ToggleAction. |
javax.swing.JMenuItem |
createMenuItem(ToggleAction action,
float menuWeight)
Creates a new menu item for the supplied ToggleAction with
the supplied menu weight. |
javax.swing.JMenu |
createSubMenu(java.lang.String caption,
java.lang.Integer mnemonic)
Creates a new menu suitable for insertion into JDeveloper's menu bar or into another menu. |
javax.swing.JMenu |
createSubMenu(java.lang.String caption,
java.lang.Integer mnemonic,
float weight)
Creates a new menu suitable for insertion into JDeveloper's menu bar or into another menu. |
javax.swing.JMenu |
createSubMenu(java.lang.String caption,
java.lang.Integer mnemonic,
float weight,
float sectionId)
Creates a new menu suitable for insertion into JDeveloper's menu bar or into another menu. |
java.awt.Component |
getChildById(java.awt.Container parent,
int commandId)
Returns the child with the specified command id. |
abstract java.awt.Container |
getGUI(boolean create)
Gets the MenuManager's GUI. |
int |
getIndexOfChild(java.awt.Container parent,
java.awt.Component child)
Returns the index of the specified component. |
int |
getIndexOfCommandId(java.awt.Container parent,
int commandId)
Returns the index of the specified command. |
static javax.swing.JMenu |
getJMenu(java.lang.String id)
Gets the main menu with the specified ID. |
static void |
putJMenu(java.lang.String id,
javax.swing.JMenu menu)
Puts the main menu with the specified ID. |
void |
remove(java.awt.Component child)
Removes a child from the MenuManager's GUI. |
void |
remove(java.awt.Component child,
javax.swing.JMenu parent)
Removes a child from the given parent. |
void |
removeMenuManagerMenuListener(javax.swing.JMenu menu)
INTERNAL method. |
void |
sortContainer(java.awt.Container container)
|
void |
sortSectionByName(javax.swing.JMenu menu,
float sectionID)
Sorts the commands in the specified section alphabetically by the menu item name, rather than sorting by weight. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static final javax.swing.JMenu getJMenu(java.lang.String id)
public static final void putJMenu(java.lang.String id,
javax.swing.JMenu menu)
public javax.swing.JMenu createMenu(java.lang.String caption,
java.lang.Integer mnemonic)
caption - the localized string to be displayed in the menu bar or
supermenu.mnemonic - the mnemonic to associate with the resulting JMenu.
JMenu
public javax.swing.JMenu createMenu(java.lang.String caption,
java.lang.Integer mnemonic,
float weight)
caption - localized string to be displayed in the bar or supermenu.mnemonic - mnemonic to associate with the resulting JMenu.weight - a float used to indicate the menu's position in the menu
bar. Menus are sorted in ascending order from the left to right.
JMenu
public javax.swing.JMenu createMenu(java.lang.String caption,
java.lang.Integer mnemonic,
float weight,
float sectionId)
caption - localized string to be displayed in the bar or supermenu.mnemonic - mnemonic to associate with the resulting JMenu.weight - a float used to indicate the menu's position in the menu
bar. Menus are sorted in ascending order from the left to right.sectionId - menu items which are not explicitly added to a menu
section are added to this section.
JMenu
public javax.swing.JMenu createSubMenu(java.lang.String caption,
java.lang.Integer mnemonic)
caption - the localized string to be displayed in the menu bar or
supermenu.mnemonic - the mnemonic to associate with the resulting JMenu.
JMenu
public javax.swing.JMenu createSubMenu(java.lang.String caption,
java.lang.Integer mnemonic,
float weight)
caption - localized string to be displayed in the bar or supermenu.mnemonic - mnemonic to associate with the resulting JMenu.weight - a float used to indicate the menu's position in the menu
bar. Menus are sorted in ascending order from the left to right.
JMenu
public javax.swing.JMenu createSubMenu(java.lang.String caption,
java.lang.Integer mnemonic,
float weight,
float sectionId)
caption - localized string to be displayed in the bar or supermenu.mnemonic - mnemonic to associate with the resulting JMenu.weight - a float used to indicate the menu's position in the menu
bar. Menus are sorted in ascending order from the left to right.sectionId - menu items which are not explicitly added to a menu
section are added to this section.
JMenupublic javax.swing.JMenuItem createMenuItem(ToggleAction action)
ToggleAction. By
default, the menu weight is WEIGHT_UNDEFINED unless the action has a defined menu weight, in which
case that value is used.
ToggleAction,
ToggleAction.setMenuWeight(float)
public javax.swing.JMenuItem createMenuItem(ToggleAction action,
float menuWeight)
ToggleAction with
the supplied menu weight. If the ToggleAction has a defined
menu weight, the supplied weight overwrites it, except in the case where
the supplied menu weight is
MenuConstants.WEIGHT_UNDEFINED then the
menu weight stored in the ToggleAction, if any, is set in
the menu item.
action - The action for this menu itemmenuWeight - The menu weight to use to sort this item when
it is added to a menucreateMenuItem(ToggleAction),
ToggleAction,
ToggleAction.setMenuWeight(float)public void add(java.awt.Component child)
child - the child to add.
public void add(java.awt.Component child,
float sectionId)
child - the child to add.sectionId - the menu section to which to add the child. Menu
sections are automatically split by JSeparators.
public void add(java.awt.Component child,
javax.swing.JMenu parent)
child - the child to be inserted.parent - the parent in which to insert the child.
public void add(java.awt.Component child,
javax.swing.JMenu parent,
float sectionId)
child - the child to add.parent - the parent in which to insert the child.sectionId - a float which indicates the menu section to
which the child will be added. Menu sections are automatically
split by JSeparators. Menu section constants are defined in the
MenuConstants interface.MenuConstantspublic void remove(java.awt.Component child)
child - the child to be removed.
public void remove(java.awt.Component child,
javax.swing.JMenu parent)
child - the child to remove.parent - the parent from which to remove the child.public abstract java.awt.Container getGUI(boolean create)
create - force a creation of the GUI if it does not yet exist.
public int getIndexOfChild(java.awt.Container parent,
java.awt.Component child)
parent - the Container to search for the child componentchild - the Component to find
public int getIndexOfCommandId(java.awt.Container parent,
int commandId)
parent - the Container in which to search for the child commandcommandId - the commandId to find
public java.awt.Component getChildById(java.awt.Container parent,
int commandId)
parent - the Container in which to search for the child commandcommandId - the command id to find
public void sortSectionByName(javax.swing.JMenu menu,
float sectionID)
menu - The menu containersectionID - The section that contains the commands commands
to sort alphabetically. If none of the commands the menu are in the
specified section, the commands will be sorted in the default order.public void removeMenuManagerMenuListener(javax.swing.JMenu menu)
public void sortContainer(java.awt.Container container)
|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Copyright © 1997, 2005, Oracle.All rights reserved.