VdexReload 1.1.3 API

uk.ac.reload.dweezil.menu
Class MenuAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byuk.ac.reload.dweezil.menu.MenuAction
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable
Direct Known Subclasses:
MenuAction_About, MenuAction_About, MenuAction_CascadeWindow, MenuAction_CascadeWindow, MenuAction_Copy, MenuAction_Cut, MenuAction_DebugSchema, MenuAction_DebugSchema, MenuAction_Delete, MenuAction_EditMetadata, MenuAction_EditSCORM, MenuAction_EditVocabulary, MenuAction_Exit, MenuAction_Exit, MenuAction_ExportOtherVocabulary, MenuAction_ExportZthes, MenuAction_Help, MenuAction_Help, MenuAction_ImportOtherVocabulary, MenuAction_ImportResources, MenuAction_ImportZthes, MenuAction_InternalWindow, MenuAction_LookAndFeel, MenuAction_LookAndFeel, MenuAction_MoveDown, MenuAction_MoveUp, MenuAction_New, MenuAction_NewContentPackage, MenuAction_NewFolder, MenuAction_NewMetadata, MenuAction_NewSCORM1_2Package, MenuAction_NewVocabulary, MenuAction_Open, MenuAction_Paste, MenuAction_Prefs, MenuAction_Prefs, MenuAction_RecentOpen, MenuAction_RecentOpen, MenuAction_Redo, MenuAction_Refresh, MenuAction_RemoveResources, MenuAction_Save, MenuAction_SaveAs, MenuAction_StatusWindow, MenuAction_StatusWindow, MenuAction_TileHorizontalWindow, MenuAction_TileHorizontalWindow, MenuAction_TileVerticalWindow, MenuAction_TileVerticalWindow, MenuAction_Undo, MenuAction_ViewCP, MenuAction_ViewFile, MenuAction_VocabularyHelp, MenuAction_ZipIt

public abstract class MenuAction
extends javax.swing.AbstractAction

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.

See Also:
Serialized Form

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

MenuAction

public MenuAction()
Default Constructor


MenuAction

public MenuAction(java.lang.String text)
Constructor for new MenuAction with no icon

Parameters:
text - The text to display

MenuAction

public MenuAction(java.lang.String text,
                  java.lang.String iconPath)
Constructor for new MenuAction

Parameters:
text - The text to display
iconPath - The full path of the icon. If this is null no icon will be displayed
Method Detail

setMenuIcon

public void setMenuIcon(javax.swing.ImageIcon icon)
Set the Icon on the Menu

Parameters:
icon - The Icon to set

setButtonIcon

public void setButtonIcon(javax.swing.ImageIcon icon)
Set the Icon for the Button

Parameters:
icon - the Button Icon to set

setText

public void setText(java.lang.String text)
Sets the text for the menu item

Parameters:
text - The Text to set

setButtonText

public void setButtonText(java.lang.String text)
Sets the text for the menu item

Parameters:
text - The Text to set

setEnabled

public void setEnabled(boolean newValue)
Set the menu item / button enabled or disabled (greyed out)

Parameters:
newValue - enabled or disabled

getButton

public javax.swing.JButton getButton()
Get the JButton for this Menu Item

Returns:
The Button

addMenuActionListener

public void addMenuActionListener(MenuActionListener listener)
Add a MenuActionListener Listener

Parameters:
listener - The MenuActionListener Listener

removeMenuActionListener

public void removeMenuActionListener(MenuActionListener listener)
Remove a MenuActionListener Listener

Parameters:
listener - The MenuActionListener Listener

removeAllMenuActionListeners

public void removeAllMenuActionListeners()
Clear all listeners


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)

VdexReload 1.1.3 API