|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.peace_tools.core.AbstractMenuHelper
public abstract class AbstractMenuHelper
The base class for various menu helpers. The base class provides the common infrastructure for all menu helpers in the GUI. In addition, it also serves as a common interface to obtain and use various menu helpers in the core package.
MainFrame.getMenuHelper(org.peace_tools.core.AbstractMenuHelper.HelperType)
Nested Class Summary | |
---|---|
static class |
AbstractMenuHelper.ActionType
Enumeration to enable referring to a specific type of action. |
static class |
AbstractMenuHelper.HelperType
Enumeration to enable convenient identification/classification of menu helper objects. |
Field Summary | |
---|---|
protected java.util.ArrayList<javax.swing.AbstractButton> |
contextItemList
The list of main menu items created by this helper. |
private AbstractMenuHelper.HelperType |
helperType
The type of helper that the derived class represents. |
protected MainFrame |
mainFrame
A convenience reference to the main frame that logically owns this menu helper. |
protected javax.swing.JTable |
table
Reference to the JTable that last requested a selection listener. |
protected javax.swing.JTree |
tree
Reference to the JTree that last requested a selection listener. |
Constructor Summary | |
---|---|
AbstractMenuHelper(AbstractMenuHelper.HelperType helperType,
MainFrame mainFrame)
|
Method Summary | |
---|---|
abstract java.awt.event.ActionListener |
getActionListener()
The action listener to handle actions created by this menu helper. |
AbstractMenuHelper.HelperType |
getHelperType()
Determine the type of helper that this object represents. |
abstract javax.swing.event.ListSelectionListener |
getListSelectionListener(javax.swing.JTable table)
The listener to be used in JTable to update tools & menu items. |
abstract javax.swing.JMenuItem |
getMenuItem(AbstractMenuHelper.ActionType actionType,
boolean mainMenu)
Obtain a main menu item for the given action type. |
abstract javax.swing.AbstractButton |
getTool(AbstractMenuHelper.ActionType actionType,
boolean mainToolBar)
Obtain a tool bar button for the given action type. |
abstract javax.swing.event.TreeSelectionListener |
getTreeSelectionListener(javax.swing.JTree tree)
The listener to be used in JTree to update tools & menu items. |
protected void |
setEnabled(java.lang.String actionCommand,
boolean enabled)
Helper method to update status of all items for a given action command. |
void |
tableChanged(javax.swing.event.TableModelEvent tme)
Default implementation for TableModelListener. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final MainFrame mainFrame
protected java.util.ArrayList<javax.swing.AbstractButton> contextItemList
protected javax.swing.JTree tree
protected javax.swing.JTable table
private final AbstractMenuHelper.HelperType helperType
Constructor Detail |
---|
public AbstractMenuHelper(AbstractMenuHelper.HelperType helperType, MainFrame mainFrame)
Method Detail |
---|
public AbstractMenuHelper.HelperType getHelperType()
public abstract javax.swing.JMenuItem getMenuItem(AbstractMenuHelper.ActionType actionType, boolean mainMenu)
Note: The returned menu item has all the necessary information already filled-in. Do not modify the action command and other properties as it will interfere with correct operation of the menu item.
actionType
- The action type for which a main menu item
is to be created.mainMenu
- If this flag is true, then it indicates that
the menu should be created to be used in the main menu. Otherwise
it is assumed that the menu item will be used in a context
sensitive popup menu.
public abstract java.awt.event.ActionListener getActionListener()
public abstract javax.swing.event.TreeSelectionListener getTreeSelectionListener(javax.swing.JTree tree)
tree
- The JTree to which the tree selection listener is
going to be added. This reference is maintained by the menu
helper to handle tree selection events.
public abstract javax.swing.event.ListSelectionListener getListSelectionListener(javax.swing.JTable table)
Note: The list selection listeners handle only single selection model for the table.
table
- The JTable to which the list selection listener is
going to be added. This reference is maintained by the menu
helper to handle row selection events.
public abstract javax.swing.AbstractButton getTool(AbstractMenuHelper.ActionType actionType, boolean mainToolBar)
Note: The returned button has all the necessary information already filled-in. Do not modify the action command and other properties as it will interfere with correct operation of the too bar button.
actionType
- The action type for which a tool bar button
is to be created.mainToolBar
- If this flag is true, then it indicates that
the tool will be used in the main tool bar in PEACE. Otherwise
it is is assumed that the tool will be used in a view specific
tool bar.
protected void setEnabled(java.lang.String actionCommand, boolean enabled)
actionCommand
- The action command associated with a given set
of items.enabled
- If this flag is true, then the item is enabled. Otherwise
the item is disabled.public void tableChanged(javax.swing.event.TableModelEvent tme)
tableChanged
in interface javax.swing.event.TableModelListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |