net.sf.jzeno.echo.components
Class MenuBar

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by net.sf.jzeno.echo.components.CustomComponent
          extended by net.sf.jzeno.echo.components.MenuBar
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, MenuComponent, BindingTarget, PropertyComponent, RebindableComponent, EventSink, EventSource, Precreation, Component, ActionListener, FastComponent, FastComponentContainer

public class MenuBar
extends CustomComponent
implements ActionListener, Precreation, MenuComponent

Generic menubar that initializes itself based on a property file.

This property file is called menu.properties (typically in the root of your WEB-INF/classes folder) and must comply with the following format :


  
   menuName1=Title of menu 
   menuName1.menuName2=Title of second menu
   menuName1.menuName2.menuItemName=Title_of_the_menu_ITEM,package.ScreenClassName
   
 

You may also specify generic menu options that map to a function in the current screen like this :

  
   menuName1.menuName2.menuItemName=Title_of_the_menu_ITEM,name_of_the_public_function_to_call
   
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
MenuBar()
           
MenuBar(boolean horizontal)
           
 
Method Summary
 void actionPerformed(ActionEvent actionEvent)
          Invoked when an action occurs.
 void applyContext()
           
 void applyStyle(Style style)
          Sets stylistic properties of this component based on a Style object.
 Color getBackground()
          Returns the background color of the component.
 Font getFont()
          Returns the font.
 Color getForeground()
          Returns the foreground of the component.
 int getHorizontalAlignment()
           
 int getHorizontalTextPosition()
           
 int getLeft()
           
 int getLeftOffset()
           
 int getMargin()
           
 Color getMenuBorderColor()
           
 int getMenuBorderSize()
           
 int getMenuWidth()
           
 MenuBarModel getModel()
           
 int getPadding()
           
 Color getRolloverBackground()
           
 Color getRolloverBorderColor()
           
 Font getRolloverFont()
           
 Color getRolloverForeground()
           
 ImageReference getRolloverIcon()
           
 ImageReference getRolloverSelectedIcon()
           
 ImageReference getSelectedIcon()
           
 ImageReference getSubmenuImage()
           
 java.lang.String getSubMenuImage()
           
 int getSubmenuImageAlignment()
           
 java.lang.String getToolTipText()
           
 int getTop()
           
 Color getTopMenuBackground()
           
 int getTopOffset()
           
 int getVerticalAlignment()
           
 int getVerticalTextPosition()
           
 int getWidth()
           
 boolean isClickToOpen()
           
 boolean isEnabled()
          Returns true if the component is enabled.
 boolean isFixedPosition()
           
 boolean isFocused()
          Returns true if the component is focused.
 boolean isHorizontal()
           
 boolean isKeepAlive()
           
 boolean isMenuVisible(java.lang.String menuName)
           
 boolean isRolloverEnabled()
           
 boolean isScrollWithPage()
           
 boolean isSelected()
           
 boolean isSuckerfishRendering()
           
 void rebuild()
           
 void setBackground(Color background)
          Sets the background color of the component.
 void setClickToOpen(boolean clickToOpen)
           
 void setEnabled(boolean enabled)
          Sets whether the component is enabled.
 void setFixedPosition(boolean fixedPosition)
           
 void setFocused(boolean focused)
          Sets whether the component is focused.
 void setFont(Font font)
          Sets the font of the component.
 void setForeground(Color foreground)
          Sets the foreground color of the component.
 void setHorizontal(boolean horizontal)
           
 void setHorizontalAlignment(int ha)
           
 void setHorizontalTextPosition(int htp)
           
 void setKeepAlive(boolean b)
           
 void setLeft(int newValue)
           
 void setLeftOffset(int newLeftOffset)
           
 void setMargin(int newValue)
           
 void setMenuBorderColor(Color newBorderColor)
           
 void setMenuBorderSize(int newBorderSize)
           
 void setMenusVisible(java.lang.String[] menuNames, boolean visible)
           
 void setMenuVisible(java.lang.String menuName, boolean visible)
           
 void setMenuWidth(int width)
           
 void setPadding(int newValue)
           
 void setRolloverBackground(Color newValue)
           
 void setRolloverBorderColor(Color newBorderColor)
           
 void setRolloverEnabled(boolean newValue)
           
 void setRolloverFont(Font newValue)
           
 void setRolloverForeground(Color newValue)
           
 void setRolloverIcon(ImageReference newValue)
           
 void setRolloverSelectedIcon(ImageReference newValue)
           
 void setScrollWithPage(boolean newValue)
           
 void setSelected(boolean newValue)
           
 void setSelectedIcon(ImageReference newValue)
           
 void setSubmenuImage(ImageReference newImageRef)
           
 void setSubMenuImage(java.lang.String subMenuImage)
           
 void setSubmenuImageAlignment(int newAlignment)
           
 void setSuckerfishRendering(boolean suckerfishRendering)
           
 void setToolTipText(java.lang.String newValue)
           
 void setTop(int newValue)
           
 void setTopMenuBackground(Color background)
           
 void setTopOffset(int newTopOffset)
           
 void setVerticalAlignment(int newValue)
           
 void setVerticalTextPosition(int newValue)
           
 void setWidth(int newValue)
           
 
Methods inherited from class net.sf.jzeno.echo.components.CustomComponent
addValidator, fireActionEvent, fireActionEvent, fireActionEvent, getActionCommand, getBean, getBeanClass, getDecorator, getNullObject, getProperty, getValidationErrors, getValidators, getValue, isBound, isMarkedInvalid, isReadOnly, isRequired, isValid, markInvalid, markValid, preRender, rebind, removeValidator, setActionCommand, setBean, setBeanClass, setDecorator, setNullObject, setProperty, setReadOnly, setRequired, setValue, traceValue, validate
 
Methods inherited from class nextapp.echo.AbstractComponent
add, add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getClientId, getComponent, getComponentCount, getComponents, getEchoInstance, getIdentifier, getListenerList, getLocale, getParent, indexOf, init, isAncestorOf, isDifferent, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setClientId, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuBar

public MenuBar(boolean horizontal)

MenuBar

public MenuBar()
Method Detail

getModel

public MenuBarModel getModel()

rebuild

public void rebuild()
Specified by:
rebuild in interface MenuComponent

actionPerformed

public void actionPerformed(ActionEvent actionEvent)
Description copied from interface: ActionListener
Invoked when an action occurs.

Specified by:
actionPerformed in interface ActionListener
Parameters:
actionEvent - The event describing the action.

setMenuWidth

public void setMenuWidth(int width)

getMenuWidth

public int getMenuWidth()

setTopMenuBackground

public void setTopMenuBackground(Color background)

getTopMenuBackground

public Color getTopMenuBackground()

getSubMenuImage

public java.lang.String getSubMenuImage()

setSubMenuImage

public void setSubMenuImage(java.lang.String subMenuImage)

applyStyle

public void applyStyle(Style style)
Description copied from interface: Component
Sets stylistic properties of this component based on a Style object. The version of this method in Component will set foreground and background colors and the font from the style if they are present. Components should override this method if they allow more properties to be set from a style object, and should call super.applyStyle() if necessary.

Specified by:
applyStyle in interface Component
Overrides:
applyStyle in class AbstractComponent
Parameters:
style - The style object from which to retrieve properties for this Component.

setKeepAlive

public void setKeepAlive(boolean b)

isKeepAlive

public boolean isKeepAlive()

setMenuVisible

public void setMenuVisible(java.lang.String menuName,
                           boolean visible)

setMenusVisible

public void setMenusVisible(java.lang.String[] menuNames,
                            boolean visible)

isMenuVisible

public boolean isMenuVisible(java.lang.String menuName)

setBackground

public void setBackground(Color background)
Description copied from interface: Component
Sets the background color of the component.

Specified by:
setBackground in interface Component
Overrides:
setBackground in class AbstractComponent
Parameters:
background - The new background color of the component.

getBackground

public Color getBackground()
Description copied from interface: Component
Returns the background color of the component.

Specified by:
getBackground in interface Component
Overrides:
getBackground in class AbstractComponent
Returns:
The background color of the component.

setClickToOpen

public void setClickToOpen(boolean clickToOpen)

isClickToOpen

public boolean isClickToOpen()

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: Component
Sets whether the component is enabled.

Specified by:
setEnabled in interface Component
Overrides:
setEnabled in class AbstractComponent
Parameters:
enabled - True if the component is enabled.

isEnabled

public boolean isEnabled()
Description copied from interface: Component
Returns true if the component is enabled.

Specified by:
isEnabled in interface Component
Overrides:
isEnabled in class AbstractComponent
Returns:
True if the component is enabled.

setFixedPosition

public void setFixedPosition(boolean fixedPosition)

isFixedPosition

public boolean isFixedPosition()

setFocused

public void setFocused(boolean focused)
Description copied from interface: Component
Sets whether the component is focused.

Specified by:
setFocused in interface Component
Overrides:
setFocused in class AbstractComponent
Parameters:
focused - True if the component is to be focused.

isFocused

public boolean isFocused()
Description copied from interface: Component
Returns true if the component is focused.

Specified by:
isFocused in interface Component
Overrides:
isFocused in class AbstractComponent
Returns:
True if the component is focused.

setFont

public void setFont(Font font)
Description copied from interface: Component
Sets the font of the component.

Specified by:
setFont in interface Component
Overrides:
setFont in class AbstractComponent
Parameters:
font - The new font of the component.

getFont

public Font getFont()
Description copied from interface: Component
Returns the font.

Specified by:
getFont in interface Component
Overrides:
getFont in class AbstractComponent
Returns:
The font of the component.

setForeground

public void setForeground(Color foreground)
Description copied from interface: Component
Sets the foreground color of the component.

Specified by:
setForeground in interface Component
Overrides:
setForeground in class AbstractComponent
Parameters:
foreground - The new foreground color of the component.

getForeground

public Color getForeground()
Description copied from interface: Component
Returns the foreground of the component.

Specified by:
getForeground in interface Component
Overrides:
getForeground in class AbstractComponent
Returns:
The foreground of the component.

setHorizontal

public void setHorizontal(boolean horizontal)

isHorizontal

public boolean isHorizontal()

setHorizontalAlignment

public void setHorizontalAlignment(int ha)

getHorizontalAlignment

public int getHorizontalAlignment()

setHorizontalTextPosition

public void setHorizontalTextPosition(int htp)

getHorizontalTextPosition

public int getHorizontalTextPosition()

getLeft

public int getLeft()

getTop

public int getTop()

isScrollWithPage

public boolean isScrollWithPage()

setLeft

public void setLeft(int newValue)

setScrollWithPage

public void setScrollWithPage(boolean newValue)

setTop

public void setTop(int newValue)

getLeftOffset

public int getLeftOffset()

getMargin

public int getMargin()

getMenuBorderColor

public Color getMenuBorderColor()

getMenuBorderSize

public int getMenuBorderSize()

getPadding

public int getPadding()

getSubmenuImage

public ImageReference getSubmenuImage()

getSubmenuImageAlignment

public int getSubmenuImageAlignment()

getTopOffset

public int getTopOffset()

getWidth

public int getWidth()

setLeftOffset

public void setLeftOffset(int newLeftOffset)

setMargin

public void setMargin(int newValue)

setMenuBorderColor

public void setMenuBorderColor(Color newBorderColor)

setMenuBorderSize

public void setMenuBorderSize(int newBorderSize)

setPadding

public void setPadding(int newValue)

setSubmenuImage

public void setSubmenuImage(ImageReference newImageRef)

setSubmenuImageAlignment

public void setSubmenuImageAlignment(int newAlignment)

setTopOffset

public void setTopOffset(int newTopOffset)

setWidth

public void setWidth(int newValue)

getRolloverBorderColor

public Color getRolloverBorderColor()

setRolloverBorderColor

public void setRolloverBorderColor(Color newBorderColor)

getRolloverBackground

public Color getRolloverBackground()

getRolloverFont

public Font getRolloverFont()

getRolloverForeground

public Color getRolloverForeground()

getRolloverIcon

public ImageReference getRolloverIcon()

getRolloverSelectedIcon

public ImageReference getRolloverSelectedIcon()

getSelectedIcon

public ImageReference getSelectedIcon()

getToolTipText

public java.lang.String getToolTipText()

getVerticalAlignment

public int getVerticalAlignment()

getVerticalTextPosition

public int getVerticalTextPosition()

isRolloverEnabled

public boolean isRolloverEnabled()

isSelected

public boolean isSelected()

setRolloverBackground

public void setRolloverBackground(Color newValue)

setRolloverEnabled

public void setRolloverEnabled(boolean newValue)

setRolloverFont

public void setRolloverFont(Font newValue)

setRolloverForeground

public void setRolloverForeground(Color newValue)

setRolloverIcon

public void setRolloverIcon(ImageReference newValue)

setRolloverSelectedIcon

public void setRolloverSelectedIcon(ImageReference newValue)

setSelected

public void setSelected(boolean newValue)

setSelectedIcon

public void setSelectedIcon(ImageReference newValue)

setToolTipText

public void setToolTipText(java.lang.String newValue)

setVerticalAlignment

public void setVerticalAlignment(int newValue)

setVerticalTextPosition

public void setVerticalTextPosition(int newValue)

applyContext

public void applyContext()
Specified by:
applyContext in interface Precreation

isSuckerfishRendering

public boolean isSuckerfishRendering()

setSuckerfishRendering

public void setSuckerfishRendering(boolean suckerfishRendering)