|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.electric.tool.user.menus.EMenuItem
public abstract class EMenuItem
Generic Electric menu item. It generates real menu buttons and tool buttons with shared state.
Nested Class Summary | |
---|---|
static class |
EMenuItem.CheckBox
A subclass of EMenuItem to represent toggle button. |
Field Summary | |
---|---|
static EMenuItem[] |
NULL_ARRAY
|
static EMenuItem |
SEPARATOR
A constant to represent separator in menus. |
Constructor Summary | |
---|---|
EMenuItem(java.lang.String text)
|
|
EMenuItem(java.lang.String text,
char acceleratorChar)
|
|
EMenuItem(java.lang.String text,
javax.swing.KeyStroke accelerator)
|
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs. |
protected javax.swing.JMenuItem |
createMenuItem()
Creates fresh GUI instance of this generic EMenuItem. |
java.lang.String |
getDescription()
Get a string description of the menu item. |
char |
getMnemonicChar()
Method to return the ALT character that will invoke this menu item. |
java.lang.String |
getText()
Returns hort text description of this EMenuElement. |
java.lang.String |
getToolTipText()
|
boolean |
isEnabled()
Returns enable state of this generic EMenuItem. |
boolean |
isSelected()
Returns selection state of this generic EMenuItem. |
protected void |
registerItem()
Register this menu item in EMenuBar. |
protected void |
registerUpdatable()
Register this item as updatable ( dimmed items or chec box/radio buttons |
static void |
repeatLastCommand()
Repeat the last Command |
abstract void |
run()
Abstract method which executes command. |
static javax.swing.KeyStroke |
shortcut(int keyCode)
Determines which modifier key is the appropriate accelerator key for menu shortcuts. |
static javax.swing.KeyStroke[] |
shortcut(int[] keyCode)
Determines which modifier key is the appropriate accelerator key for menu shortcuts. |
java.lang.String |
toString()
|
protected void |
updateButtons()
Updates GUI buttons after change of state of generic button. |
protected void |
updateMenuItem(javax.swing.JMenuItem item)
Updates appearance of menu item instance before popping up. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final EMenuItem[] NULL_ARRAY
public static final EMenuItem SEPARATOR
Constructor Detail |
---|
public EMenuItem(java.lang.String text, javax.swing.KeyStroke accelerator)
text
- the menu item's displayed text. An "_" in the string
indicates the location of the "mnemonic" key for that entry.accelerator
- the shortcut key, or null if none specified.public EMenuItem(java.lang.String text)
text
- the menu item's displayed text. An "_" in the string
indicates the location of the "mnemonic" key for that entry.public EMenuItem(java.lang.String text, char acceleratorChar)
text
- the menu item's displayed text. An "_" in the string
indicates the location of the "mnemonic" key for that entry.acceleratorChar
- the shortcut char.Method Detail |
---|
public static javax.swing.KeyStroke[] shortcut(int[] keyCode)
keyCode
- key code without modifier.
public static javax.swing.KeyStroke shortcut(int keyCode)
keyCode
- key code without modifier.
public static void repeatLastCommand()
public java.lang.String getText()
public java.lang.String getToolTipText()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getDescription()
Menu | SubMenu | SubMenu | item
protected void registerItem()
protected void registerUpdatable()
protected javax.swing.JMenuItem createMenuItem()
protected void updateMenuItem(javax.swing.JMenuItem item)
item
- item to update.public boolean isEnabled()
public boolean isSelected()
public char getMnemonicChar()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public abstract void run()
protected void updateButtons()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |