|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.AbstractMenuManager
AbstractMenuManager
class. Abstract implementation of
MenuManager
interface. Extensions need not extend this class.
They should directly use framework provided implementations, such as
the ContextMenu
and Menubar
classes to add menu items
to context menus and pull down menus, respectively.
Field Summary | |
protected java.awt.event.ContainerListener |
containerListener
|
protected javax.swing.event.MenuListener |
menuListener
|
Fields inherited from interface oracle.ide.MenuManager |
ALPHA_SORT_SECTION_KEY, LAST_POSITION |
Constructor Summary | |
protected |
AbstractMenuManager()
Default constructor. |
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. |
void |
componentAdded(java.awt.event.ContainerEvent e)
|
void |
componentRemoved(java.awt.event.ContainerEvent e)
|
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 addinSectionId)
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,
float addinSectionId)
|
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 suitable for insertion into a JDeveloper menu. 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. |
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. |
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,
int index)
Deprecated. Use preferred method add(Component, float) or
add(Component) . |
void |
menuCanceled(javax.swing.event.MenuEvent e)
|
void |
menuDeselected(javax.swing.event.MenuEvent e)
|
void |
menuSelected(javax.swing.event.MenuEvent e)
|
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. |
protected void |
setErrorWeight(java.awt.Component component)
|
protected 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 |
Methods inherited from interface oracle.ide.MenuManager |
getGUI |
Field Detail |
protected javax.swing.event.MenuListener menuListener
protected java.awt.event.ContainerListener containerListener
Constructor Detail |
protected AbstractMenuManager()
Method Detail |
public javax.swing.JMenu createMenu(java.lang.String caption, java.lang.Integer mnemonic)
MenuManager
createMenu
in interface MenuManager
caption
- the localized string to be displayed in the menu bar or
supermenu.mnemonic
- the mnemonic to associate with the resulting JMenu.
MenuManager.add(java.awt.Component)
,
JMenu
public javax.swing.JMenu createMenu(java.lang.String caption, java.lang.Integer mnemonic, float weight)
MenuManager
createMenu
in interface MenuManager
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.
MenuManager.insert(java.awt.Component, java.awt.Component)
,
JMenu
public javax.swing.JMenu createMenu(java.lang.String caption, java.lang.Integer mnemonic, float weight, float addinSectionId)
MenuManager
createMenu
in interface MenuManager
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.addinSectionId
- menu items which are not explicitly added to a menu
section are added to this section.
MenuManager.insert(java.awt.Component, java.awt.Component)
,
JMenu
public javax.swing.JMenu createMenu(java.lang.String caption, java.lang.Integer mnemonic, float weight, float sectionId, float addinSectionId)
public javax.swing.JMenu createSubMenu(java.lang.String caption, java.lang.Integer mnemonic)
MenuManager
createSubMenu
in interface MenuManager
caption
- the localized string to be displayed in the menu bar or
supermenu.mnemonic
- the mnemonic to associate with the resulting JMenu.
MenuManager.insert(java.awt.Component, java.awt.Component)
,
JMenu
public javax.swing.JMenu createSubMenu(java.lang.String caption, java.lang.Integer mnemonic, float weight)
MenuManager
createSubMenu
in interface MenuManager
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.
MenuManager.insert(java.awt.Component, java.awt.Component)
,
JMenu
public javax.swing.JMenu createSubMenu(java.lang.String caption, java.lang.Integer mnemonic, float weight, float sectionId)
MenuManager
createSubMenu
in interface MenuManager
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.
MenuManager.insert(java.awt.Component, java.awt.Component)
,
JMenu
public javax.swing.JMenuItem createMenuItem(ToggleAction action)
ToggleAction
. By
default, the menu weight is MenuConstants.WEIGHT_UNDEFINED
unless the action has a defined menu weight, in which case that value is
used.
createMenuItem
in interface MenuManager
action
- the Action
to associate with the menu item.
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.
createMenuItem
in interface MenuManager
action
- The action for this menu itemmenuWeight
- The menu weight to use to sort this item when
it is added to a menu
createMenuItem(ToggleAction)
,
ToggleAction
,
ToggleAction.setMenuWeight(float)
public void add(java.awt.Component child)
MenuManager
add
in interface MenuManager
child
- the child to add.public void add(java.awt.Component child, float sectionId)
MenuManager
add
in interface MenuManager
child
- the child to add.sectionId
- the menu section to which to add the child. Menu
sections are automatically split by JSeparators.public void insert(java.awt.Component child, int index)
add(Component, float)
or
add(Component)
.
public void insert(java.awt.Component child, java.awt.Component after)
add(Component, float)
or
add(Component)
.
MenuManager
insert
in interface MenuManager
child
- the child to be inserted.after
- the sibling after which the child should be inserted.public void add(java.awt.Component child, javax.swing.JMenu parent)
MenuManager
add
in interface MenuManager
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)
MenuManager
add
in interface MenuManager
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.MenuConstants
public void remove(java.awt.Component child)
MenuManager
remove
in interface MenuManager
child
- the child to be removed.public void remove(java.awt.Component child, javax.swing.JMenu parent)
MenuManager
remove
in interface MenuManager
child
- the child to remove.parent
- the parent from which to remove the child.public final int getIndexOfChild(java.awt.Container parent, java.awt.Component child)
getIndexOfChild
in interface MenuManager
parent
- the Container to search for the child paramchild
- the Component to find
public final int getIndexOfCommandId(java.awt.Container parent, int commandId)
getIndexOfCommandId
in interface MenuManager
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)
MenuManager
getChildById
in interface MenuManager
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)
MenuManager
sortSectionByName
in interface MenuManager
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.protected void setErrorWeight(java.awt.Component component)
protected void sortContainer(java.awt.Container container)
public void menuSelected(javax.swing.event.MenuEvent e)
menuSelected
in interface javax.swing.event.MenuListener
public void menuDeselected(javax.swing.event.MenuEvent e)
menuDeselected
in interface javax.swing.event.MenuListener
public void menuCanceled(javax.swing.event.MenuEvent e)
menuCanceled
in interface javax.swing.event.MenuListener
public void componentAdded(java.awt.event.ContainerEvent e)
componentAdded
in interface java.awt.event.ContainerListener
public void componentRemoved(java.awt.event.ContainerEvent e)
componentRemoved
in interface java.awt.event.ContainerListener
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.