|
VdexReload 1.1.3 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
uk.ac.reload.dweezil.menu.MenuAction
The Main Menu Action for each Menu Item in the Application. It extends AbstractAction and can be added to a Menu Bar, Toolbar or Menu Popup. It is an abstract parent class for each menu item and button in the Application. It also has a JButton created for it.
Field Summary |
Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
MenuAction()
Default Constructor |
|
MenuAction(java.lang.String text)
Constructor for new MenuAction with no icon |
|
MenuAction(java.lang.String text,
java.lang.String iconPath)
Constructor for new MenuAction |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addMenuActionListener(MenuActionListener listener)
Add a MenuActionListener Listener |
javax.swing.JButton |
getButton()
Get the JButton for this Menu Item |
void |
removeAllMenuActionListeners()
Clear all listeners |
void |
removeMenuActionListener(MenuActionListener listener)
Remove a MenuActionListener Listener |
void |
setButtonIcon(javax.swing.ImageIcon icon)
Set the Icon for the Button |
void |
setButtonText(java.lang.String text)
Sets the text for the menu item |
void |
setEnabled(boolean newValue)
Set the menu item / button enabled or disabled (greyed out) |
void |
setMenuIcon(javax.swing.ImageIcon icon)
Set the Icon on the Menu |
void |
setText(java.lang.String text)
Sets the text for the menu item |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MenuAction()
public MenuAction(java.lang.String text)
text
- The text to displaypublic MenuAction(java.lang.String text, java.lang.String iconPath)
text
- The text to displayiconPath
- The full path of the icon. If this is null no icon will be displayedMethod Detail |
public void setMenuIcon(javax.swing.ImageIcon icon)
icon
- The Icon to setpublic void setButtonIcon(javax.swing.ImageIcon icon)
icon
- the Button Icon to setpublic void setText(java.lang.String text)
text
- The Text to setpublic void setButtonText(java.lang.String text)
text
- The Text to setpublic void setEnabled(boolean newValue)
newValue
- enabled or disabledpublic javax.swing.JButton getButton()
public void addMenuActionListener(MenuActionListener listener)
listener
- The MenuActionListener Listenerpublic void removeMenuActionListener(MenuActionListener listener)
listener
- The MenuActionListener Listenerpublic void removeAllMenuActionListeners()
public void actionPerformed(java.awt.event.ActionEvent e)
|
VdexReload 1.1.3 API | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |