NextApp Echo3 Extras
v3.0.b4

nextapp.echo.extras.app.menu
Class AbstractMenuComponent

java.lang.Object
  extended by nextapp.echo.app.Component
      extended by nextapp.echo.extras.app.menu.AbstractMenuComponent
All Implemented Interfaces:
java.io.Serializable, nextapp.echo.app.RenderIdSupport
Direct Known Subclasses:
ContextMenu, DropDownMenu, MenuBarPane

public abstract class AbstractMenuComponent
extends nextapp.echo.app.Component

See Also:
Serialized Form

Field Summary
static java.lang.String ACTION_LISTENERS_CHANGED_PROPERTY
           
static int DEFAULT_ANIMATION_TIME
           
static java.lang.String INPUT_ACTION
           
static java.lang.String MODEL_CHANGED_PROPERTY
           
static java.lang.String PROPERTY_ANIMATION_TIME
           
static java.lang.String STATE_MODEL_CHANGED_PROPERTY
           
 
Fields inherited from class nextapp.echo.app.Component
CHILD_VISIBLE_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
AbstractMenuComponent(MenuModel model, MenuStateModel stateModel)
          Creates a new AbstractMenuComponent displaying the specified MenuModel and using the specified MenuStateModel to provide state information.
 
Method Summary
 void addActionListener(nextapp.echo.app.event.ActionListener l)
          Adds an ActionListener to be notified when a menu item is selected.
 void doAction(OptionModel optionModel)
          Programmatically performs a menu action.
protected  void fireActionPerformed(OptionModel optionModel)
          Notifies ActionListeners that an option was chosen.
 int getAnimationTime()
          Returns the animation time (in milliseconds).
 MenuModel getModel()
          Returns the model
 MenuStateModel getStateModel()
          Returns the selection model
 boolean hasActionListeners()
          Determines if the menu has any ActionListeners registered.
 void processInput(java.lang.String name, java.lang.Object value)
           
 void removeActionListener(nextapp.echo.app.event.ActionListener l)
          Removes an ActionListener from being notified when a menu item is selected.
 void setAnimationTime(int newValue)
          Sets the animation time (in milliseconds).
 void setModel(MenuModel newValue)
          Sets the model.
 void setStateModel(MenuStateModel newValue)
          Sets the state model.
 
Methods inherited from class nextapp.echo.app.Component
add, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, get, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndex, getLayoutData, getLayoutDirection, getLocale, getLocalStyle, getParent, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, set, setBackground, setComponents, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndex, setLayoutData, setLayoutDirection, setLocale, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT_ACTION

public static final java.lang.String INPUT_ACTION
See Also:
Constant Field Values

MODEL_CHANGED_PROPERTY

public static final java.lang.String MODEL_CHANGED_PROPERTY
See Also:
Constant Field Values

STATE_MODEL_CHANGED_PROPERTY

public static final java.lang.String STATE_MODEL_CHANGED_PROPERTY
See Also:
Constant Field Values

ACTION_LISTENERS_CHANGED_PROPERTY

public static final java.lang.String ACTION_LISTENERS_CHANGED_PROPERTY
See Also:
Constant Field Values

PROPERTY_ANIMATION_TIME

public static final java.lang.String PROPERTY_ANIMATION_TIME
See Also:
Constant Field Values

DEFAULT_ANIMATION_TIME

public static final int DEFAULT_ANIMATION_TIME
See Also:
Constant Field Values
Constructor Detail

AbstractMenuComponent

public AbstractMenuComponent(MenuModel model,
                             MenuStateModel stateModel)
Creates a new AbstractMenuComponent displaying the specified MenuModel and using the specified MenuStateModel to provide state information.

Parameters:
model - the model
stateModel - the selection model
Method Detail

addActionListener

public void addActionListener(nextapp.echo.app.event.ActionListener l)
Adds an ActionListener to be notified when a menu item is selected.

Parameters:
l - the listener to add

getAnimationTime

public int getAnimationTime()
Returns the animation time (in milliseconds). A value of zero indicates animation is disabled.

Returns:
the animation time

hasActionListeners

public boolean hasActionListeners()
Determines if the menu has any ActionListeners registered.

Returns:
true if any action listeners are registered

doAction

public void doAction(OptionModel optionModel)
Programmatically performs a menu action.

Parameters:
optionModel - the OptionModel whose action is to be invoked

fireActionPerformed

protected void fireActionPerformed(OptionModel optionModel)
Notifies ActionListeners that an option was chosen.

Parameters:
optionModel - the selected OptionModel

getModel

public MenuModel getModel()
Returns the model

Returns:
the model

getStateModel

public MenuStateModel getStateModel()
Returns the selection model

Returns:
the selection model

processInput

public void processInput(java.lang.String name,
                         java.lang.Object value)
Overrides:
processInput in class nextapp.echo.app.Component
See Also:
Component.processInput(java.lang.String, java.lang.Object)

removeActionListener

public void removeActionListener(nextapp.echo.app.event.ActionListener l)
Removes an ActionListener from being notified when a menu item is selected.

Parameters:
l - the listener to remove

setAnimationTime

public void setAnimationTime(int newValue)
Sets the animation time (in milliseconds). A value of zero indicates animation is disabled.

Parameters:
newValue - the new animation time

setModel

public void setModel(MenuModel newValue)
Sets the model.

Parameters:
newValue - the new model

setStateModel

public void setStateModel(MenuStateModel newValue)
Sets the state model.

Parameters:
newValue - the new state model

NextApp Echo3 Extras
v3.0.b4