Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## echopointng
Class Menu

    java.lang.Object
      nextapp.echo2.app.Component
          nextapp.echo2.app.button.AbstractButton
              nextapp.echo2.app.Button
                  echopointng.ButtonEx
                      echopointng.MenuItem
                          echopointng.Menu

All Implemented Interfaces:
  AccessKeyable, Attributeable, Borderable, Delegateable, Heightable, Insetable, MouseCursorable, Sizeable, ToolTipable, Widthable, java.io.Serializable, RenderIdSupport

Direct Known Subclasses:
  MenuBar, MenuButton

    public class Menu

extends MenuItem

The `Menu` class provides a `MenuItem` that can be added to a parent `Menu` or `MenuBar`.

If it is not contained within a parent `Menu`, then it is rendered just like a `ButtonEx` but with a drop down box for any of its child components.

The styleChildren property can be used to help ensure consistent visual properties between parent and child Menu's. When this is true, the visual properties of the parent Menu will be transfered to the child `Menu` or `MenuItem.`

See Also:
  Serialized Form

Field Summary
`static Style` | `DEFAULT_STYLE` This DEFAULT_STYLE is applied to the Menu to give it a series of borders and background colors
`static ImageReference` | `DEFAULT_SUBMENU_IMAGE` The default sub menu image
`static int` | `OPEN_ON_CLICK` Open Option that opens the Menu's drop down box when the mouse is clicked anywhere on the Menu's button, including the SubMenu image.
`static int` | `OPEN_ON_MOUSEOVER` Open Option that opens the Menu's drop down box when the mouse is placed over the Menu's button.
`static int` | `OPEN_ON_SUBMENU_CLICK` Open Option that opens the Menu's drop down box when the mouse is clicked only on the Menu's SubMenu image.
`static java.lang.String` | `PROPERTY_BACKGROUND_IMAGE`
`static java.lang.String` | `PROPERTY_DRAW_OUTER_BORDERS`
`static java.lang.String` | `PROPERTY_HORIZONTAL`
`static java.lang.String` | `PROPERTY_KEEP_ALIVE`
`static java.lang.String` | `PROPERTY_LEFT_OFFSET`
`static java.lang.String` | `PROPERTY_MENU_ALWAYS_ON_TOP`
`static java.lang.String` | `PROPERTY_MENU_BACKGROUND`
`static java.lang.String` | `PROPERTY_MENU_BACKGROUND_IMAGE`
`static java.lang.String` | `PROPERTY_MENU_BORDER`
`static java.lang.String` | `PROPERTY_MENU_FOREGROUND`
`static java.lang.String` | `PROPERTY_MENU_INSETS`
`static java.lang.String` | `PROPERTY_MENU_OUTSETS`
`static java.lang.String` | `PROPERTY_OPEN_OPTION`
`static java.lang.String` | `PROPERTY_PROPERTY_CHILDREN`
`static java.lang.String` | `PROPERTY_STYLE_CHILDREN`
`static java.lang.String` | `PROPERTY_SUBMENU_IMAGE`
`static java.lang.String` | `PROPERTY_SUBMENU_IMAGE_ALIGNMENT`
`static java.lang.String` | `PROPERTY_SUBMENU_IMAGE_BORDERED`
`static java.lang.String` | `PROPERTY_SUBMENU_ROLLOVER_IMAGE`
`static java.lang.String` | `PROPERTY_TOP_OFFSET`

Fields inherited from class nextapp.echo2.app.button.AbstractButton
`ACTION_LISTENERS_CHANGED_PROPERTY, INPUT_CLICK, PROPERTY_ALIGNMENT, PROPERTY_BORDER, PROPERTY_DISABLED_BACKGROUND, PROPERTY_DISABLED_BACKGROUND_IMAGE, PROPERTY_DISABLED_BORDER, PROPERTY_DISABLED_FONT, PROPERTY_DISABLED_FOREGROUND, PROPERTY_DISABLED_ICON, PROPERTY_HEIGHT, PROPERTY_ICON, PROPERTY_ICON_TEXT_MARGIN, PROPERTY_INSETS, PROPERTY_LINE_WRAP, PROPERTY_MODEL, PROPERTY_PRESSED_BACKGROUND, PROPERTY_PRESSED_BACKGROUND_IMAGE, PROPERTY_PRESSED_BORDER, PROPERTY_PRESSED_ENABLED, PROPERTY_PRESSED_FONT, PROPERTY_PRESSED_FOREGROUND, PROPERTY_PRESSED_ICON, PROPERTY_ROLLOVER_BACKGROUND, PROPERTY_ROLLOVER_BACKGROUND_IMAGE, PROPERTY_ROLLOVER_BORDER, PROPERTY_ROLLOVER_ENABLED, PROPERTY_ROLLOVER_FONT, PROPERTY_ROLLOVER_FOREGROUND, PROPERTY_ROLLOVER_ICON, PROPERTY_TEXT, PROPERTY_TEXT_ALIGNMENT, PROPERTY_TEXT_POSITION, PROPERTY_TOOL_TIP_TEXT, PROPERTY_WIDTH`

Fields inherited from class nextapp.echo2.app.Component
`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`

Fields inherited from interface echopointng.able.Borderable
`PROPERTY_BORDER`

Fields inherited from interface echopointng.able.MouseCursorable
`CURSOR_AUTO, CURSOR_CROSSHAIR, CURSOR_CUSTOM_URI, CURSOR_DEFAULT, CURSOR_E_RESIZE, CURSOR_HELP, CURSOR_MOVE, CURSOR_N_RESIZE, CURSOR_NE_RESIZE, CURSOR_NW_RESIZE, CURSOR_POINTER, CURSOR_S_RESIZE, CURSOR_SE_RESIZE, CURSOR_SW_RESIZE, CURSOR_TEXT, CURSOR_W_RESIZE, CURSOR_WAIT, PROPERTY_MOUSE_CURSOR, PROPERTY_MOUSE_CURSOR_URI`

Fields inherited from interface echopointng.able.AccessKeyable
`PROPERTY_ACCESS_KEY`

Fields inherited from interface echopointng.able.Insetable
`DEFAULT_INSETS, DEFAULT_OUTSETS, PROPERTY_INSETS, PROPERTY_OUTSETS`

Fields inherited from interface echopointng.able.Widthable
`PROPERTY_WIDTH`

Fields inherited from interface echopointng.able.Heightable
`PROPERTY_HEIGHT`

Fields inherited from interface echopointng.able.ToolTipable
`PROPERTY_TOOL_TIP_TEXT`

Constructor Summary
`Menu()` Creates a `Menu` with no text or icon.
`Menu(ImageReference icon)` Creates a `Menu` with an icon.
`Menu(java.lang.String text)` Creates a `Menu` with text.
`Menu(java.lang.String text, ImageReference icon)` Creates a `Menu` with text and an icon.

Method Summary
`void` | `add(Component c)` Adds a `Component` to the end of the `Menu`.
`void` | `add(MenuItem menuItem)` Adds a `MenuItem` to the end of the `Menu` and styles it the same if styleChildren is set to true.
`MenuItem` | `add(java.lang.String text)` Creates and adds a `MenuItem` to the end of the `Menu` with the specified text.
`int` | `getLeftOffset()`
`boolean` | `getMenuAlwaysOnTop()`
`Color` | `getMenuBackground()`
`FillImage` | `getMenuBackgroundImage()` Returns the background image for this Menu's drop down box.
`Border` | `getMenuBorder()`
`Color` | `getMenuForeground()`
`Insets` | `getMenuInsets()`
`MenuItem[]` | `getMenuItems()` This returns the MenuItem's that are a direct child of this Menu.
`Insets` | `getMenuOutsets()`
`int` | `getOpenOption()`
`ImageReference` | `getSubmenuImage()`
`int` | `getSubmenuImageAlignment()`
`ImageReference` | `getSubmenuRolloverImage()`
`int` | `getTopOffset()` Returns the top offset of this `Menu```
`boolean` | `isClickToOpen()`
`boolean` | `isDrawOuterBorders()` Returns true if the Menu's outer borders and insets/outsets will be drawn.
`boolean` | `isHorizontal()`
`boolean` | `isKeepAlive()`
`boolean` | `isStyleChildren()`
`boolean` | `isSubmenuImageBordered()`
`boolean` | `isValidChild(Component component)` This component does not support children.
`void` | `setClickToOpen(boolean clickToOpen)` Set to true if the Menu must be clicked on to open is drop down box.
`void` | `setDrawOuterBorders(boolean newValue)` Sets the false to prevent the menu outer borders and insets from being used.
`void` | `setHorizontal(boolean newValue)` Sets the whether the `Menu` is orientated horizontal or vertical on the screen.
`void` | `setKeepAlive(boolean newValue)` Set to true if drop down menu boxes will stay alive (ie visible) when the mouse moves out of them
`void` | `setLeftOffset(int newLeftOffset)` Sets the left offset of the drop down box associated with this `Menu`relative to its parent.``
`void` | `setMenuAlwaysOnTop(boolean newValue)` The menuAlwaysOnTop property can be used control how the popup menu box is drawn.
`void` | `setMenuBackground(Color menuBackground)` Sets the background color of the Menu's drop down box.
`void` | `setMenuBackgroundImage(FillImage newValue)` Sets the background image for this Menu's drop down box
`void` | `setMenuBorder(Border newValue)` Sets the border for this Menu's drop down box
`void` | `setMenuForeground(Color menuForeground)` Sets the foreground color of the Menu's drop down box.
`void` | `setMenuInsets(Insets menuInsets)` Sets the Insets used inside the Menu's drop down box.
`void` | `setMenuOutsets(Insets menuOutsets)` Sets the Insets used outside the Menu's drop down box.
`void` | `setOpenOption(int newValue)` Sets the Menu's drop down box opening options.
`void` | `setStyleChildren(boolean newValue)` Set to true if child Menu's and MenuItems will be styled with the same presentation parameters as this Menu when they are added.
`void` | `setSubmenuImage(ImageReference newImageRef)` Sets the submenu `ImageReference` of the `Menu`.
`void` | `setSubmenuImageAlignment(int newAlignment)` Sets the alignment of the submenu image of the `Menu`.
`void` | `setSubmenuImageBordered(boolean newValue)` Set to true if the submenu image is bordered with the Menu's border color / style and size.
`void` | `setSubmenuRolloverImage(ImageReference newValue)` Sets the submenu image used when the mouse if rolled over the Menu
`void` | `setTopOffset(int newTopOffset)` Sets the top offset of the drop down box associated with this `Menu`relative to its parent.``
`void` | `styleAllMenuItems()` This methods will call styleMenuItem() for every child MenuItem in the Menu.
`void` | `styleAllMenuItems(Style menuStyle, Style menuItemStyle)` This static method will set the style via setStyle() of the each of the child menus and menu items using topMenu as the top most level Menu.
`void` | `styleAllMenuItemsByName(java.lang.String menuStyleName, java.lang.String menuItemStyleName)` This method will set the style name via setStyleName() of the each of the child menus and menu items using topMenu as the top most level Menu.
`void` | `styleMenuItem(MenuItem menuItem)` This will style the MenuItem with the same presentation parameters as this Menu.
`java.lang.String` | `toString()`

Methods inherited from class echopointng.MenuItem
`getRootMenu`

Methods inherited from class echopointng.ButtonEx
`getAccessKey, getAttribute, getAttributeNames, getInsets, getMouseCursor, getMouseCursorURI, getOutsets, setAccessKey, setAttribute, setInsets, setMouseCursor, setMouseCursorURI, setOutsets`

Methods inherited from class nextapp.echo2.app.button.AbstractButton
`addActionListener, doAction, fireActionPerformed, getActionCommand, getAlignment, getBackgroundImage, getBorder, getDisabledBackground, getDisabledBackgroundImage, getDisabledBorder, getDisabledFont, getDisabledForeground, getDisabledIcon, getHeight, getIcon, getIconTextMargin, getModel, getPressedBackground, getPressedBackgroundImage, getPressedBorder, getPressedFont, getPressedForeground, getPressedIcon, getRolloverBackground, getRolloverBackgroundImage, getRolloverBorder, getRolloverFont, getRolloverForeground, getRolloverIcon, getText, getTextAlignment, getTextPosition, getToolTipText, getWidth, hasActionListeners, isLineWrap, isPressedEnabled, isRolloverEnabled, processInput, removeActionListener, setActionCommand, setAlignment, setBackgroundImage, setBorder, setDisabledBackground, setDisabledBackgroundImage, setDisabledBorder, setDisabledFont, setDisabledForeground, setDisabledIcon, setHeight, setIcon, setIconTextMargin, setLineWrap, setModel, setPressedBackground, setPressedBackgroundImage, setPressedBorder, setPressedEnabled, setPressedFont, setPressedForeground, setPressedIcon, setRolloverBackground, setRolloverBackgroundImage, setRolloverBorder, setRolloverEnabled, setRolloverFont, setRolloverForeground, setRolloverIcon, setText, setTextAlignment, setTextPosition, setToolTipText, setWidth`

Methods inherited from class nextapp.echo2.app.Component
`add, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface echopointng.able.Borderable
`getBorder, setBorder`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Methods inherited from interface echopointng.able.Widthable
`getWidth, setWidth`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Methods inherited from interface echopointng.able.Heightable
`getHeight, setHeight`

Methods inherited from interface echopointng.able.Delegateable
`getRenderProperty, getRenderProperty`

Methods inherited from interface echopointng.able.ToolTipable
`getToolTipText, setToolTipText`

Field Detail

### DEFAULT_SUBMENU_IMAGE

    public static final ImageReference DEFAULT_SUBMENU_IMAGE

  The default sub menu image

### OPEN_ON_MOUSEOVER

    public static final int OPEN_ON_MOUSEOVER

  Open Option that opens the Menu's drop down box when the mouse is placed over the Menu's button.

  See Also:
    Constant Field Values

### OPEN_ON_CLICK

    public static final int OPEN_ON_CLICK

  Open Option that opens the Menu's drop down box when the mouse is clicked anywhere on the Menu's button, including the SubMenu image.

  See Also:
    Constant Field Values

### OPEN_ON_SUBMENU_CLICK

    public static final int OPEN_ON_SUBMENU_CLICK

  Open Option that opens the Menu's drop down box when the mouse is clicked only on the Menu's SubMenu image. If the user clicks on the ButtonEx part, then the button action is fired.

  See Also:
    Constant Field Values

### PROPERTY_BACKGROUND_IMAGE

    public static final java.lang.String PROPERTY_BACKGROUND_IMAGE

See Also:
  Constant Field Values

### PROPERTY_DRAW_OUTER_BORDERS

    public static final java.lang.String PROPERTY_DRAW_OUTER_BORDERS

See Also:
  Constant Field Values

### PROPERTY_HORIZONTAL

    public static final java.lang.String PROPERTY_HORIZONTAL

See Also:
  Constant Field Values

### PROPERTY_KEEP_ALIVE

    public static final java.lang.String PROPERTY_KEEP_ALIVE

See Also:
  Constant Field Values

### PROPERTY_LEFT_OFFSET

    public static final java.lang.String PROPERTY_LEFT_OFFSET

See Also:
  Constant Field Values

### PROPERTY_MENU_ALWAYS_ON_TOP

    public static final java.lang.String PROPERTY_MENU_ALWAYS_ON_TOP

See Also:
  Constant Field Values

### PROPERTY_MENU_BACKGROUND

    public static final java.lang.String PROPERTY_MENU_BACKGROUND

See Also:
  Constant Field Values

### PROPERTY_MENU_BACKGROUND_IMAGE

    public static final java.lang.String PROPERTY_MENU_BACKGROUND_IMAGE

See Also:
  Constant Field Values

### PROPERTY_MENU_BORDER

    public static final java.lang.String PROPERTY_MENU_BORDER

See Also:
  Constant Field Values

### PROPERTY_MENU_FOREGROUND

    public static final java.lang.String PROPERTY_MENU_FOREGROUND

See Also:
  Constant Field Values

### PROPERTY_MENU_INSETS

    public static final java.lang.String PROPERTY_MENU_INSETS

See Also:
  Constant Field Values

### PROPERTY_MENU_OUTSETS

    public static final java.lang.String PROPERTY_MENU_OUTSETS

See Also:
  Constant Field Values

### PROPERTY_OPEN_OPTION

    public static final java.lang.String PROPERTY_OPEN_OPTION

See Also:
  Constant Field Values

### PROPERTY_PROPERTY_CHILDREN

    public static final java.lang.String PROPERTY_PROPERTY_CHILDREN

See Also:
  Constant Field Values

### PROPERTY_STYLE_CHILDREN

    public static final java.lang.String PROPERTY_STYLE_CHILDREN

See Also:
  Constant Field Values

### PROPERTY_SUBMENU_IMAGE

    public static final java.lang.String PROPERTY_SUBMENU_IMAGE

See Also:
  Constant Field Values

### PROPERTY_SUBMENU_IMAGE_ALIGNMENT

    public static final java.lang.String PROPERTY_SUBMENU_IMAGE_ALIGNMENT

See Also:
  Constant Field Values

### PROPERTY_SUBMENU_IMAGE_BORDERED

    public static final java.lang.String PROPERTY_SUBMENU_IMAGE_BORDERED

See Also:
  Constant Field Values

### PROPERTY_SUBMENU_ROLLOVER_IMAGE

    public static final java.lang.String PROPERTY_SUBMENU_ROLLOVER_IMAGE

See Also:
  Constant Field Values

### PROPERTY_TOP_OFFSET

    public static final java.lang.String PROPERTY_TOP_OFFSET

See Also:
  Constant Field Values

### DEFAULT_STYLE

    public static final Style DEFAULT_STYLE

  This DEFAULT_STYLE is applied to the Menu to give it a series of borders and background colors

Constructor Detail

### Menu

    public Menu()

  Creates a `Menu` with no text or icon.

### Menu

    public Menu(ImageReference icon)

  Creates a `Menu` with an icon.

  Parameters:
    `icon` - An icon to display in the `Menu`.

### Menu

    public Menu(java.lang.String text)

  Creates a `Menu` with text.

  Parameters:
    `text` - A text label to display in the `Menu`.

### Menu

    public Menu(java.lang.String text,
                ImageReference icon)

  Creates a `Menu` with text and an icon.

  Parameters:
    `text` - A text label to display in the `Menu`.
    `icon` - An icon to display in the `Menu`.

Method Detail

### add

    public void add(Component c)

  Adds a `Component` to the end of the `Menu`. This could typically be a `Separator`. If the Component is a MenuItem then it is styled if styleChildren is set to true.

  Overrides:
    `add` in class `Component`
  Parameters:
    `c` - the child `Component` to add

### add

    public void add(MenuItem menuItem)

  Adds a `MenuItem` to the end of the `Menu` and styles it the same if styleChildren is set to true.

  Parameters:
    `menuItem` - - the new child MenuItem

### add

    public MenuItem add(java.lang.String text)

  Creates and adds a `MenuItem` to the end of the `Menu` with the specified text.

### getLeftOffset

    public int getLeftOffset()

  Returns:
    the left offset of this `Menu```

### getMenuAlwaysOnTop

    public boolean getMenuAlwaysOnTop()

  See Also:
    `setMenuAlwaysOnTop(boolean)`

### getMenuBackground

    public Color getMenuBackground()

  Returns:
    Returns the background color of the Menu's drop down box.

### getMenuBackgroundImage

    public FillImage getMenuBackgroundImage()

  Returns the background image for this Menu's drop down box.

  Returns:
    The background image for this Menu's drop down box.

### getMenuBorder

    public Border getMenuBorder()

  Returns:
    the border around the Menu drop down box

### getMenuForeground

    public Color getMenuForeground()

  Returns:
    Returns the foreground color of the Menu's drop down box.

### getMenuInsets

    public Insets getMenuInsets()

  Returns:
    the Insets used inside the Menu's drop down box.

### getMenuItems

    public MenuItem[] getMenuItems()

  This returns the MenuItem's that are a direct child of this Menu.

  Returns:
    a non null array of MenuItem's

### getMenuOutsets

    public Insets getMenuOutsets()

  Returns:
    the Insets used outside the Menu's drop down box.

### getOpenOption

    public int getOpenOption()

  Returns:
    Returns the Menu's Drop Down Box opening option.

### getSubmenuImage

    public ImageReference getSubmenuImage()

  Returns:
    The submenu `Image Reference` of the `Menu`.

### getSubmenuImageAlignment

    public int getSubmenuImageAlignment()

  Returns:
    The submenu image alignmentof the `Menu`.

### getSubmenuRolloverImage

    public ImageReference getSubmenuRolloverImage()

  Returns:
    the submenu image used when the mouse if rolled over the Menu

### getTopOffset

    public int getTopOffset()

  Returns the top offset of this `Menu`

  ``
  Returns:
    int

### isClickToOpen

    public boolean isClickToOpen()

  Returns:
    Returns true if the Menu must be clicked on to open is drop down box.

    This will return true if the open options are set to OPEN_ON_CLICK or OPEN_ON_SUBMENU_CLICK.

### isDrawOuterBorders

    public boolean isDrawOuterBorders()

  Returns true if the Menu's outer borders and insets/outsets will be drawn.

  Returns:
    true if the Menu's outer borders and insets/outsets will be drawn.

### isHorizontal

    public boolean isHorizontal()

  Returns:
    true if the Menu is oriented in a horizontal manner

### isKeepAlive

    public boolean isKeepAlive()

  Returns:
    true if drop down menu boxes will stay alive (ie visible) when the mouse moves out of them

### isStyleChildren

    public boolean isStyleChildren()

  Returns:
    true if child Menu's and MenuItems will be styled with the same presentation parameters as this Menu when they are added.

### isSubmenuImageBordered

    public boolean isSubmenuImageBordered()

  Returns:
    true if the submenu image is bordered with the Menu's border color / style and size.

### setClickToOpen

    public void setClickToOpen(boolean clickToOpen)

  Set to true if the Menu must be clicked on to open is drop down box.

  This is the equivalent of calling setOpenOption(OPEN_ON_CLICK);

  If clickToOpen is false, then this is the equivalent of calling setOpenOption(OPEN_ON_MOUSEOVER);

  Parameters:
    `clickToOpen` - true ot false

### setDrawOuterBorders

    public void setDrawOuterBorders(boolean newValue)

  Sets the false to prevent the menu outer borders and insets from being used.

  Parameters:
    `newValue` - - The newValue to set.

### setHorizontal

    public void setHorizontal(boolean newValue)

  Sets the whether the `Menu` is orientated horizontal or vertical on the screen.

### setKeepAlive

    public void setKeepAlive(boolean newValue)

  Set to true if drop down menu boxes will stay alive (ie visible) when the mouse moves out of them

### setLeftOffset

    public void setLeftOffset(int newLeftOffset)

  Sets the left offset of the drop down box associated with this `Menu`relative to its parent.

  ``
  Parameters:
    `newLeftOffset` - the left offset of this `Menu```

### setMenuAlwaysOnTop

    public void setMenuAlwaysOnTop(boolean newValue)

  The menuAlwaysOnTop property can be used control how the popup menu box is drawn.

  If this is true, then the Menu box with always take the highest position on the screen and will disregard parent clipping and scrolling constraints.

  If this is false, then the normal client clipping and scrollling constraints will apply. This can cause the popup menu box to be shown under other components according to the current hierarchy.

  Parameters:
    `newValue` - - the new menuAlwaysOnTop value

### setMenuBackground

    public void setMenuBackground(Color menuBackground)

  Sets the background color of the Menu's drop down box.

  Parameters:
    `menuBackground` - the new background

### setMenuBackgroundImage

    public void setMenuBackgroundImage(FillImage newValue)

  Sets the background image for this Menu's drop down box

  Parameters:
    `newValue` - The new background image.

### setMenuBorder

    public void setMenuBorder(Border newValue)

  Sets the border for this Menu's drop down box

  Parameters:
    `newValue` - The new border

### setMenuForeground

    public void setMenuForeground(Color menuForeground)

  Sets the foreground color of the Menu's drop down box.

  Parameters:
    `menuForeground` - - the new color

### setMenuInsets

    public void setMenuInsets(Insets menuInsets)

  Sets the Insets used inside the Menu's drop down box. Note that this differs from the Insets that are used for the Menu's text within its parent Menu drop down box.

  Parameters:
    `menuInsets` - the Insets used inside the Menu's drop down box.

### setMenuOutsets

    public void setMenuOutsets(Insets menuOutsets)

  Sets the Insets used outside the Menu's drop down box. Note that this differs from the outsets that are used for the Menu's text within its parent Menu drop down box.

  Parameters:
    `menuOutsets` - the Insets used outside the Menu's drop down box.

### setOpenOption

    public void setOpenOption(int newValue)

  Sets the Menu's drop down box opening options. This can be one of the following values :
  - OPEN_ON_MOUSEOVER - opens the Menu's drop down box when the mouse moves over the Menu's button part.
  - OPEN_ON_CLICK - opens the Menu's drop down box when the mouse is clicked anywhere on the Menu's button part.
  - OPEN_ON_SUBMENU_CLICK - opens the Menu's drop down box when the mouse is clicked only on the Menu's sub menu image part.

  Parameters:
    `newValue` - - The newValue to set.

### setStyleChildren

    public void setStyleChildren(boolean newValue)

  Set to true if child Menu's and MenuItems will be styled with the same presentation parameters as this Menu when they are added.

  Parameters:
    `newValue` - - whether to style children when added

### setSubmenuImage

    public void setSubmenuImage(ImageReference newImageRef)

  Sets the submenu `ImageReference` of the `Menu`. This submenu image will only be shown if the Menu does in fact have children

### setSubmenuImageAlignment

    public void setSubmenuImageAlignment(int newAlignment)

  Sets the alignment of the submenu image of the `Menu`.
  This can be one of the following values :
  - Alignment.LEFT
  - Alignment.RIGHT (the default)

### setSubmenuImageBordered

    public void setSubmenuImageBordered(boolean newValue)

  Set to true if the submenu image is bordered with the Menu's border color / style and size.

  Parameters:
    `newValue` - - true of false

### setSubmenuRolloverImage

    public void setSubmenuRolloverImage(ImageReference newValue)

  Sets the submenu image used when the mouse if rolled over the Menu

  Parameters:
    `newValue` - - the new image

### setTopOffset

    public void setTopOffset(int newTopOffset)

  Sets the top offset of the drop down box associated with this `Menu`relative to its parent.

  ``
  Parameters:
    `newTopOffset` - the top offset of this `Menu```

### styleAllMenuItems

    public void styleAllMenuItems()

  This methods will call styleMenuItem() for every child MenuItem in the Menu. It will recurse down the parent-child relationship tree for any contained Menu's.

  See Also:
    `styleMenuItem(MenuItem)`

### styleMenuItem

    public void styleMenuItem(MenuItem menuItem)

  This will style the MenuItem with the same presentation parameters as this Menu. The following groups of properties are set :
  - foreground, background, font, background image
  - borders
  - rollover foreground, background, font, background image
  - rollover borders
  - insets, outsets
  - If the MenuItem is in fact a Menu
  - menu foreground, background, font
  - menu borders
  - menu insets, outsets
  - menu submenu image, submenu alignment
  - menu submenu rollover image, submenu bordered
  - menu background image properties

  Note only screen presentation parameters are set, other functional parameters such as isHorizontal() are not set.

  Parameters:
    `menuItem` - - the MenuItem to style the same as this Menu

### styleAllMenuItemsByName

    public void styleAllMenuItemsByName(java.lang.String menuStyleName,
                                        java.lang.String menuItemStyleName)

  This method will set the style name via setStyleName() of the each of the child menus and menu items using topMenu as the top most level Menu. It calls setStyleName() of the starting Menu as well.

  Parameters:
    `menuStyleName` - - the style name to use for instances of Menu
    `menuItemStyleName` - - the style name to use for instances of MenuItem

### styleAllMenuItems

    public void styleAllMenuItems(Style menuStyle,
                                  Style menuItemStyle)

  This static method will set the style via setStyle() of the each of the child menus and menu items using topMenu as the top most level Menu. It calls setStyle() of the starting Menu as well.

  Parameters:
    `menuStyle` - - the style to use for instances of Menu
    `menuItemStyle` - - the style to use for instances of MenuItem

### isValidChild

    public boolean isValidChild(Component component)

  Description copied from class: `AbstractButton`
  This component does not support children.

  Overrides:
    `isValidChild` in class `AbstractButton`
  Parameters:
    `component` - the `Component` to evaluate as a child
  Returns:
    true if the `Component` is a valid child
  See Also:
    `AbstractButton.isValidChild(nextapp.echo2.app.Component)`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `MenuItem`
  See Also:
    `Object.toString()`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD