EchoPoint
1.0

echopoint
Class MenuBar

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.AbstractButton
          extended byechopoint.MenuItem
              extended byechopoint.Menu
                  extended byechopoint.MenuBar
All Implemented Interfaces:
ReflectionSetter, java.io.Serializable, nextapp.echo.ToolTipSupport

public class MenuBar
extends Menu

The MenuBar class provides a Component that contains other Menu objects and MenuItem objects.

Author:
Brad Baker
See Also:
Serialized Form

Nested Class Summary
static class MenuBar.NestedStyleInfo
          Nested public static StyleInfo class.
 
Field Summary
static java.lang.String CLICK_TO_OPEN_CHANGED_PROPERTY
           
protected  boolean clickToOpen
           
static nextapp.echo.Color DEFAULT_BACKGROUND
          the default colors for our menus
static nextapp.echo.Color DEFAULT_FOREGROUND
           
static nextapp.echo.Color DEFAULT_ROLLOVER_BACKGROUND
           
static nextapp.echo.Color DEFAULT_ROLLOVER_FOREGROUND
           
protected  boolean fixedPosition
           
protected  boolean horizontal
           
static java.lang.String KEEP_ALIVE_CHANGED_PROPERTY
           
protected  boolean keepAlive
           
protected  int left
           
static java.lang.String LEFT_CHANGED_PROPERTY
           
static java.lang.String POSITIONING_CHANGED_PROPERTY
           
protected  boolean scrollWithPage
           
static java.lang.String STYLE_IS_CLICK_TO_OPEN
          A style constant for the Click To Open property.
static java.lang.String STYLE_IS_FIXED_POSITION
          A style constant for the FixedPosition property.
static java.lang.String STYLE_IS_HORIZONTAL
          A style constant for the Horizontal property.
static java.lang.String STYLE_IS_KEEP_ALIVE
          A style constant for the Keep Alive property.
static java.lang.String STYLE_IS_SCROLL_WITH_PAGE
          A style constant for the Scroll With Page property.
static java.lang.String STYLE_LEFT
          A style constant for the Left property.
static java.lang.String STYLE_TOP
          A style constant for the Top property.
protected  nextapp.echo.ImageReference submenuImage
           
protected  int submenuImageAlignment
           
static java.lang.String TEXT_ALIGNMENT_CHANGED_PROPERTY
          Property Change Names
protected  int top
           
static java.lang.String TOP_CHANGED_PROPERTY
           
 
Fields inherited from class echopoint.Menu
LEFT_OFFSET_CHANGED_PROPERTY, leftOffset, margin, MARGIN_CHANGED_PROPERTY, MENU_BORDER_COLOR_CHANGED_PROPERTY, MENU_BORDER_SIZE_CHANGED_PROPERTY, menuBorderColor, menuBorderSize, padding, PADDING_CHANGED_PROPERTY, STYLE_LEFT_OFFSET, STYLE_MARGIN, STYLE_MENU_BORDER_COLOR, STYLE_MENU_BORDER_SIZE, STYLE_PADDING, STYLE_ROLLOVER_SUBMENU_IMAGE, STYLE_ROLLOVER_SUBMENU_IMAGE_ALIGNMENT, STYLE_TOP_OFFSET, STYLE_WIDTH, SUBMENU_IMAGE_ALIGNMENT_CHANGED_PROPERTY, SUBMENU_IMAGE_CHANGED_PROPERTY, TOP_OFFSET_CHANGED_PROPERTY, topOffset, width, WIDTH_CHANGED_PROPERTY
 
Fields inherited from class echopoint.MenuItem
BORDER_COLOR_CHANGED_PROPERTY, borderColor, rolloverColor, STYLE_BORDER_COLOR, STYLE_ROLLOVER_BORDER_COLOR
 
Fields inherited from class nextapp.echo.AbstractButton
ACTION_COMMAND_CHANGED_PROPERTY, HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, HORIZONTAL_TEXT_POSITION_CHANGED_PROPERTY, ICON_CHANGED_PROPERTY, ICON_TEXT_MARGIN_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, ROLLOVER_BACKGROUND_CHANGED_PROPERTY, ROLLOVER_ENABLED_CHANGED_PROPERTY, ROLLOVER_FONT_CHANGED_PROPERTY, ROLLOVER_FOREGROUND_CHANGED_PROPERTY, ROLLOVER_ICON_CHANGED_PROPERTY, ROLLOVER_SELECTED_ICON_CHANGED_PROPERTY, SELECTED_CHANGED_PROPERTY, SELECTED_ICON_CHANGED_PROPERTY, STYLE_HORIZONTAL_ALIGNMENT, STYLE_HORIZONTAL_TEXT_POSITION, STYLE_ICON_TEXT_MARGIN, STYLE_ROLLOVER_BACKGROUND, STYLE_ROLLOVER_ENABLED, STYLE_ROLLOVER_FONT, STYLE_ROLLOVER_FOREGROUND, STYLE_VERTICAL_ALIGNMENT, STYLE_VERTICAL_TEXT_POSITION, TEXT_CHANGED_PROPERTY, VERTICAL_ALIGNMENT_CHANGED_PROPERTY, VERTICAL_TEXT_POSITION_CHANGED_PROPERTY
 
Fields inherited from class nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, listenerList, LOCALE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Fields inherited from interface nextapp.echo.ToolTipSupport
TOOL_TIP_TEXT_CHANGED_PROPERTY
 
Constructor Summary
MenuBar()
          Constructs a MenuBar.
 
Method Summary
 Menu add(Menu menu)
          Adds a Menu to the MenuBar.
 Menu addMenu(java.lang.String text)
          Adds a Menu to the end of the MenuBar with the specified text.
 void applyStyle(nextapp.echo.Style style)
          Applies the provided style to the component.
 int getLeft()
           
 int getTop()
           
 boolean isClickToOpen()
           
 boolean isFixedPosition()
           
 boolean isHorizontal()
           
 boolean isKeepAlive()
           
 boolean isScrollWithPage()
           
 java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue)
          Called to save the old value of a field, set in a new value and return the old value of a field.
 void setClickToOpen(boolean newValue)
          Sets the whether the user must click on the MenuBar in order to open the sub menus.
 void setFixedPosition(boolean newFixedPosition)
          Sets the whether the MenuBar is fixed on the screen within the position it was defined, or whether it floats free on the screen according to its Positioning property.
 void setHorizontal(boolean newValue)
          Sets the whether the MenuBar is horizontal or vertical on the screen.
 void setKeepAlive(boolean newValue)
          Sets the whether the MenuBar kept alive when the user moves or clicks off the menu items.
 void setLeft(int newValue)
          Sets the left of the MenuBar on the screen.
 void setScrollWithPage(boolean newValue)
          Sets the whether the MenuBar scrolls down the page when the scroll bars change.
 void setTop(int newValue)
          Sets the top of the MenuBar on the screen.
 java.lang.String toString()
           
 
Methods inherited from class echopoint.Menu
add, add, add, addToHierarchy, getLeftOffset, getMargin, getMenuBorderColor, getMenuBorderSize, getPadding, getSubmenuImage, getSubmenuImageAlignment, getTopOffset, getWidth, remove, setLeftOffset, setMargin, setMenuBorderColor, setMenuBorderSize, setPadding, setSubmenuImage, setSubmenuImageAlignment, setTopOffset, setWidth
 
Methods inherited from class echopoint.MenuItem
getBorderColor, getId, getRolloverBorderColor, setBorderColor, setRolloverBorderColor
 
Methods inherited from class nextapp.echo.AbstractButton
addActionListener, addChangeListener, addItemListener, doAction, fireActionPerformed, fireItemStateChanged, fireStateChanged, getActionCommand, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextMargin, getModel, getRolloverBackground, getRolloverFont, getRolloverForeground, getRolloverIcon, getRolloverSelectedIcon, getSelectedIcon, getText, getToolTipText, getVerticalAlignment, getVerticalTextPosition, hasActionListeners, isRolloverEnabled, isSelected, removeActionListener, removeChangeListener, removeItemListener, setActionCommand, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextMargin, setModel, setRolloverBackground, setRolloverEnabled, setRolloverFont, setRolloverForeground, setRolloverIcon, setRolloverSelectedIcon, setSelected, setSelectedIcon, setText, setToolTipText, setVerticalAlignment, setVerticalTextPosition
 
Methods inherited from class nextapp.echo.Component
add, addHierarchyListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getComponent, getComponentCount, getComponents, getEchoInstance, getFont, getForeground, getIdentifier, getLocale, getParent, indexOf, init, isAncestorOf, isEnabled, isRegistered, isShowing, isVisible, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STYLE_TOP

public static final java.lang.String STYLE_TOP
A style constant for the Top property. Values of this key must be of type int

See Also:
Constant Field Values

STYLE_LEFT

public static final java.lang.String STYLE_LEFT
A style constant for the Left property. Values of this key must be of type int

See Also:
Constant Field Values

STYLE_IS_CLICK_TO_OPEN

public static final java.lang.String STYLE_IS_CLICK_TO_OPEN
A style constant for the Click To Open property. Values of this key must be of type boolean

See Also:
Constant Field Values

STYLE_IS_FIXED_POSITION

public static final java.lang.String STYLE_IS_FIXED_POSITION
A style constant for the FixedPosition property. Values of this key must be of type boolean

See Also:
Constant Field Values

STYLE_IS_HORIZONTAL

public static final java.lang.String STYLE_IS_HORIZONTAL
A style constant for the Horizontal property. Values of this key must be of type boolean

See Also:
Constant Field Values

STYLE_IS_KEEP_ALIVE

public static final java.lang.String STYLE_IS_KEEP_ALIVE
A style constant for the Keep Alive property. Values of this key must be of type boolean

See Also:
Constant Field Values

STYLE_IS_SCROLL_WITH_PAGE

public static final java.lang.String STYLE_IS_SCROLL_WITH_PAGE
A style constant for the Scroll With Page property. Values of this key must be of type boolean

See Also:
Constant Field Values

DEFAULT_BACKGROUND

public static final nextapp.echo.Color DEFAULT_BACKGROUND
the default colors for our menus


DEFAULT_FOREGROUND

public static final nextapp.echo.Color DEFAULT_FOREGROUND

DEFAULT_ROLLOVER_BACKGROUND

public static final nextapp.echo.Color DEFAULT_ROLLOVER_BACKGROUND

DEFAULT_ROLLOVER_FOREGROUND

public static final nextapp.echo.Color DEFAULT_ROLLOVER_FOREGROUND

TEXT_ALIGNMENT_CHANGED_PROPERTY

public static final java.lang.String TEXT_ALIGNMENT_CHANGED_PROPERTY
Property Change Names

See Also:
Constant Field Values

POSITIONING_CHANGED_PROPERTY

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

TOP_CHANGED_PROPERTY

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

LEFT_CHANGED_PROPERTY

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

CLICK_TO_OPEN_CHANGED_PROPERTY

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

KEEP_ALIVE_CHANGED_PROPERTY

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

fixedPosition

protected boolean fixedPosition

top

protected int top

left

protected int left

submenuImage

protected nextapp.echo.ImageReference submenuImage

submenuImageAlignment

protected int submenuImageAlignment

clickToOpen

protected boolean clickToOpen

horizontal

protected boolean horizontal

keepAlive

protected boolean keepAlive

scrollWithPage

protected boolean scrollWithPage
Constructor Detail

MenuBar

public MenuBar()
Constructs a MenuBar.

Method Detail

add

public Menu add(Menu menu)
Adds a Menu to the MenuBar.


addMenu

public Menu addMenu(java.lang.String text)
Adds a Menu to the end of the MenuBar with the specified text.


applyStyle

public void applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. The base nextapp.echo.Component style names can be used as well.

Overrides:
applyStyle in class Menu

getLeft

public int getLeft()

getTop

public int getTop()

isClickToOpen

public boolean isClickToOpen()

isFixedPosition

public boolean isFixedPosition()

isHorizontal

public boolean isHorizontal()

isKeepAlive

public boolean isKeepAlive()

isScrollWithPage

public boolean isScrollWithPage()

setClickToOpen

public void setClickToOpen(boolean newValue)
Sets the whether the user must click on the MenuBar in order to open the sub menus.
This methods fires a PropertyChangeEvent with a getPropertyName() value of MenuBar.CLICK_TO_OPEN_CHANGED_PROPERTY


setFixedPosition

public void setFixedPosition(boolean newFixedPosition)
Sets the whether the MenuBar is fixed on the screen within the position it was defined, or whether it floats free on the screen according to its Positioning property.
This methods fires a PropertyChangeEvent with a getPropertyName() value of MenuBar.POSITIONING_CHANGED_PROPERTY


setHorizontal

public void setHorizontal(boolean newValue)
Sets the whether the MenuBar is horizontal or vertical on the screen.
This methods fires a PropertyChangeEvent with a getPropertyName() value of MenuBar.POSITIONING_CHANGED_PROPERTY


setKeepAlive

public void setKeepAlive(boolean newValue)
Sets the whether the MenuBar kept alive when the user moves or clicks off the menu items.
This methods fires a PropertyChangeEvent with a getPropertyName() value of MenuBar.KEEP_ALIVE_CHANGED_PROPERTY


setLeft

public void setLeft(int newValue)
Sets the left of the MenuBar on the screen.
This only affects menus that are not in a fixed position.
This methods fires a PropertyChangeEvent with a getPropertyName() value of MenuBar.LEFT_CHANGED_PROPERTY


setScrollWithPage

public void setScrollWithPage(boolean newValue)
Sets the whether the MenuBar scrolls down the page when the scroll bars change. If true, then the MenuBar will always be visible to the user.
This methods fires a PropertyChangeEvent with a getPropertyName() value of MenuBar.POSITIONING_CHANGED_PROPERTY


setTop

public void setTop(int newValue)
Sets the top of the MenuBar on the screen.
This only affects menus that are not in a fixed position.
This methods fires a PropertyChangeEvent with a getPropertyName() value of MenuBar.TOP_CHANGED_PROPERTY


toString

public java.lang.String toString()
Overrides:
toString in class Menu
See Also:
Object.toString()

set

public java.lang.Object set(java.lang.reflect.Field field,
                            java.lang.Object newValue)
                     throws java.lang.Exception
Description copied from interface: ReflectionSetter
Called to save the old value of a field, set in a new value and return the old value of a field. This interface allows a field set operation to be "delegated" back into the class that has permission to perform the field set.

 public Object set(Field f, Object newValue) throws Exception {
      Object oldValue = f.get(this);
      f.set(this,newValue);
      return oldValue;
 }
 

Specified by:
set in interface ReflectionSetter
Overrides:
set in class Menu
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0