|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.visuals.MenuBar
public class MenuBar
MenuBar is a sub-class of java.awt.MenuBar
that sends out events
when any of the MenuItems on it are triggered. ForwardedActionEvents
and ForwardedItemEvents are sent out. The individual MenuItems
are also accessable from their ActionCommands using this MenuBar.
Notes:
updateMenuItems()
, removeListeners()
,
or addListeners()
.
Field Summary | |
---|---|
protected ForwardedActionListenerList |
forwardedActionListenerList
Manages a list of listeners for ForwardedActionEvent |
protected ForwardedItemListenerList |
forwardedItemListenerList
Manages a list of listeners for ForwardedItemEvent |
protected java.awt.event.ItemListener |
itemListenerList
ItemListener that listens to Item events |
Constructor Summary | |
---|---|
MenuBar()
Constructor, empty and no initializing |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
Handles ActionEvents from the MenuItems on this MenuBar. |
java.awt.Menu |
add(java.awt.Menu m)
Adds the specified menu to the menu bar. |
void |
addForwardedActionListener(ForwardedActionListener listener)
Add an ForwardedActionListener to listen for ForwardedActionEvents on the MenuBar. |
void |
addForwardedItemListener(ForwardedItemListener listener)
Adds a ForwardedItemListener to listen for ForwardedItemEvents on the BaseButton The events are sent whenever an ItemSelectable MenuItem component sends out an ForwardedItemEvent. |
void |
addItemListener(java.awt.event.ItemListener listener)
Adds an ItemListener to listen for ForwardedItemEvents on the MenuBar. |
void |
addListeners(java.awt.MenuItem menuItem,
boolean parseMenu)
Adds event listeners needed to the given MenuItem. |
java.lang.reflect.Method |
getEventMethod(java.lang.reflect.Method lMethod)
Gets the event method. |
java.lang.String[] |
getEventValues(java.lang.reflect.Method lMethod)
Gets a string array of event values. |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
Returns information used by the com.sas.beans.Introspector to
augment the automatically introspected information about this MenuBar. |
java.awt.MenuItem[] |
getMenuItems(java.lang.String cmdStr)
Get the MenuItems that have the specified actionCommand String. |
java.lang.Object[] |
getSelectedObjects()
Here for compatibility with the java.awt.ItemSelectable interface. |
void |
itemStateChanged(java.awt.event.ItemEvent evt)
Handles ActionEvents from the ItemSelectable MenuItems on this MenuBar. |
protected java.util.Enumeration |
parseCommands(java.awt.Menu currentMenu)
Parses the Menu to get and add action commands to an OrderedCollection, and returns enumeration of the action commands |
protected void |
parseMenu(java.awt.Menu currentMenu,
boolean addListeners)
Parses the Menu to add or remove the MenuBar as a listener to any events sent out by MenuItems on the given Menu. |
protected java.util.Enumeration |
parseMenuCommands(java.awt.Menu currentMenu,
java.lang.String cmdStr)
Parses a Menu to find any MenuItems that use the specified actionCommand String. |
protected void |
processForwardedActionEvent(ForwardedActionEvent e)
Process ForwardedActionEvents sent from the MenuBar to its ForwardedActionListeners. |
protected void |
processForwardedItemEvent(ForwardedItemEvent e)
Process ForwardedItemEvents sent from the MenuBar to its ForwardedItemListeners. |
protected void |
processItemEvent(java.awt.event.ItemEvent e)
Process ItemEvents sent from the MenuBar to its ItemListeners. |
void |
removeForwardedActionListener(ForwardedActionListener listener)
Removes a ForwardedActionListener from the list of listeners to be notified of ForwardedActionEvents. |
void |
removeForwardedItemListener(ForwardedItemListener listener)
Removes a ForwardedItemListener from the list of listeners to be notified of an ForwardedItemEvent. |
void |
removeItemListener(java.awt.event.ItemListener listener)
Removes an ItemListener from the list of listeners to be notified of ForwardedItemEvents. |
void |
removeListeners(java.awt.MenuItem menuItem,
boolean parseMenu)
Removes event listeners from the given MenuItem. |
void |
setMenuItemsEnabled(java.lang.String cmd,
boolean enabled)
Sets the MenuItems with the specified actionCommand to the given enabled state. |
boolean |
supportsListenerInterface(java.lang.Class listenerInterface)
Indicates whether the listenerInterface class passed in is a ForwardedActionListener . |
void |
updateMenuItems()
Parses all of the current MenuItems and add the MenuBar as a listener to any events that they send out. |
Field Detail |
---|
protected transient java.awt.event.ItemListener itemListenerList
protected transient ForwardedActionListenerList forwardedActionListenerList
protected transient ForwardedItemListenerList forwardedItemListenerList
Constructor Detail |
---|
public MenuBar()
Method Detail |
---|
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
com.sas.beans.Introspector
to
augment the automatically introspected information about this MenuBar.
public java.awt.Menu add(java.awt.Menu m)
add
in class java.awt.MenuBar
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
evt
- the ActionEvent that occurredpublic void itemStateChanged(java.awt.event.ItemEvent evt)
itemStateChanged
in interface java.awt.event.ItemListener
evt
- the ItemEvent that changedpublic java.lang.Object[] getSelectedObjects()
getSelectedObjects
in interface java.awt.ItemSelectable
public void addForwardedActionListener(ForwardedActionListener listener)
addForwardedActionListener
in interface ForwardedActionSource
listener
- the ForwardedActionListener to send the ForwardedActionEvents to.ForwardedActionEvent
,
ForwardedActionListener
,
removeForwardedActionListener(com.sas.visuals.ForwardedActionListener)
public void removeForwardedActionListener(ForwardedActionListener listener)
removeForwardedActionListener
in interface ForwardedActionSource
listener
- the ForwardedActionListener to stop sending the ForwardedActionEvents to.ForwardedActionEvent
,
ForwardedActionListener
,
addForwardedActionListener(com.sas.visuals.ForwardedActionListener)
public void addItemListener(java.awt.event.ItemListener listener)
addItemListener
in interface java.awt.ItemSelectable
listener
- the ItemListener to send the ItemEvents to.ItemEvent
,
ItemListener
,
removeItemListener(java.awt.event.ItemListener)
public void removeItemListener(java.awt.event.ItemListener listener)
removeItemListener
in interface java.awt.ItemSelectable
listener
- the ItemListener to stop sending the ItemEvents to.ItemEvent
,
ItemListener
,
addItemListener(java.awt.event.ItemListener)
public void addForwardedItemListener(ForwardedItemListener listener)
addForwardedItemListener
in interface ForwardedItemSource
listener
- the ForwardedItemListener to send the ItemEvents to.ForwardedItemEvent
,
ForwardedItemListener
,
removeForwardedItemListener(com.sas.visuals.ForwardedItemListener)
public void removeForwardedItemListener(ForwardedItemListener listener)
removeForwardedItemListener
in interface ForwardedItemSource
listener
- the ForwardedItemListener to stop sending the ForwardedItemEvents to.ForwardedItemEvent
,
ForwardedItemListener
,
addForwardedItemListener(com.sas.visuals.ForwardedItemListener)
protected void processForwardedActionEvent(ForwardedActionEvent e)
e
- the ForwardedActionEvent that needs to be processedprotected void processItemEvent(java.awt.event.ItemEvent e)
e
- the ItemEvent that needs to be processedprotected void processForwardedItemEvent(ForwardedItemEvent e)
e
- the ForwardedItemEvent that needs to be processedpublic java.awt.MenuItem[] getMenuItems(java.lang.String cmdStr)
cmdStr
- the actionCommand String of the MenuItems to return.
public void setMenuItemsEnabled(java.lang.String cmd, boolean enabled)
cmd
- the actionCommand of the MenuItems to findenabled
- the new enabled state of the MenuItems foundprotected java.util.Enumeration parseMenuCommands(java.awt.Menu currentMenu, java.lang.String cmdStr)
currentMenu
- the Menu to parse for MenuItems with cmdStr for their actionCommand String.cmdStr
- the actionCommand String of the MenuItems to return or null to return all MenuItems.
public void updateMenuItems()
protected void parseMenu(java.awt.Menu currentMenu, boolean addListeners)
currentMenu
- the Menu to add or remove the MenuBar as a listener
to all of its MenuItems.addListeners
- if true, add the MenuBar as a listener to the MenuItems on this Menu,
when false, remove the MenuBar as a listener to the MenuItems on this Menu.public void removeListeners(java.awt.MenuItem menuItem, boolean parseMenu)
menuItem
- the MenuItem to remove the MenuBar as a listener.parseMenu
- if true and the menuItem is a Menu instance, remove the MenuBar
as a listener from all sub-MenuItemspublic void addListeners(java.awt.MenuItem menuItem, boolean parseMenu)
menuItem
- the MenuItem to add the MenuBar as a listener.parseMenu
- if true and the menuItem is a Menu instance, add the MenuBar
as a listener to all sub-MenuItemspublic boolean supportsListenerInterface(java.lang.Class listenerInterface)
supportsListenerInterface
in interface MultipleValueEventSourceInterface
listenerInterface
- the class to be tested
true
if listenerInterface is a ForwardedActionListener.public java.lang.reflect.Method getEventMethod(java.lang.reflect.Method lMethod)
getEventMethod
in interface MultipleValueEventSourceInterface
IMethod
- Method
object to get the event method from
public java.lang.String[] getEventValues(java.lang.reflect.Method lMethod)
getEventValues
in interface MultipleValueEventSourceInterface
IMethod
- Method
object to get the event values from
protected java.util.Enumeration parseCommands(java.awt.Menu currentMenu)
currentMenu
- the Menu to get and add action commands to the ordered collection
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |