|
EchoPoint 2.1.0rc4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo2.app.Component
nextapp.echo2.app.button.AbstractButton
nextapp.echo2.app.Button
echopointng.ButtonEx
echopointng.MenuItem
echopointng.Menu
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.
Field Summary | |
static nextapp.echo2.app.Style |
DEFAULT_STYLE
This DEFAULT_STYLE is applied to the Menu to give it a series of borders and background colors |
static nextapp.echo2.app.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 echopointng.ButtonEx |
PROPERTY_INTERPRET_NEWLINES |
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(nextapp.echo2.app.ImageReference icon)
Creates a Menu with an icon. |
|
Menu(MenuItem menuItem)
Creates a Menu with no text or icon and adds
menuItem as its first child. |
|
Menu(java.lang.String text)
Creates a Menu with text. |
|
Menu(java.lang.String text,
nextapp.echo2.app.ImageReference icon)
Creates a Menu with text and an icon. |
Method Summary | |
void |
add(nextapp.echo2.app.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()
|
nextapp.echo2.app.Color |
getMenuBackground()
|
nextapp.echo2.app.FillImage |
getMenuBackgroundImage()
Returns the background image for this Menu's drop down box. |
nextapp.echo2.app.Border |
getMenuBorder()
|
nextapp.echo2.app.Color |
getMenuForeground()
|
nextapp.echo2.app.Insets |
getMenuInsets()
|
MenuItem[] |
getMenuItems()
This returns the MenuItem's that are a direct child of this Menu. |
nextapp.echo2.app.Insets |
getMenuOutsets()
|
int |
getOpenOption()
|
nextapp.echo2.app.ImageReference |
getSubmenuImage()
|
int |
getSubmenuImageAlignment()
|
nextapp.echo2.app.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(nextapp.echo2.app.Component component)
|
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 |
void |
setMenuAlwaysOnTop(boolean newValue)
The menuAlwaysOnTop property can be used control how the popup menu box is drawn. |
void |
setMenuBackground(nextapp.echo2.app.Color menuBackground)
Sets the background color of the Menu's drop down box. |
void |
setMenuBackgroundImage(nextapp.echo2.app.FillImage newValue)
Sets the background image for this Menu's drop down box |
void |
setMenuBorder(nextapp.echo2.app.Border newValue)
Sets the border for this Menu's drop down box |
void |
setMenuForeground(nextapp.echo2.app.Color menuForeground)
Sets the foreground color of the Menu's drop down box. |
void |
setMenuInsets(nextapp.echo2.app.Insets menuInsets)
Sets the Insets used inside the Menu's drop down box. |
void |
setMenuOutsets(nextapp.echo2.app.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(nextapp.echo2.app.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(nextapp.echo2.app.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 |
void |
styleAllMenuItems()
This methods will call styleMenuItem() for every child MenuItem in the Menu. |
void |
styleAllMenuItems(nextapp.echo2.app.Style menuStyle,
nextapp.echo2.app.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, getText, isInterpretNewlines, processInput, setAccessKey, setAttribute, setInsets, setInterpretNewlines, setModel, setMouseCursor, setMouseCursorUri, setOutsets, setText |
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, getTextAlignment, getTextPosition, getToolTipText, getWidth, hasActionListeners, isLineWrap, isPressedEnabled, isRolloverEnabled, removeActionListener, setActionCommand, setAlignment, setBackgroundImage, setBorder, setDisabledBackground, setDisabledBackgroundImage, setDisabledBorder, setDisabledFont, setDisabledForeground, setDisabledIcon, setHeight, setIcon, setIconTextMargin, setLineWrap, 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, setRenderId, 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.Widthable |
getWidth, setWidth |
Methods inherited from interface echopointng.able.Heightable |
getHeight, setHeight |
Methods inherited from interface echopointng.able.ToolTipable |
getToolTipText, setToolTipText |
Field Detail |
public static final nextapp.echo2.app.ImageReference DEFAULT_SUBMENU_IMAGE
public static final int OPEN_ON_MOUSEOVER
public static final int OPEN_ON_CLICK
public static final int OPEN_ON_SUBMENU_CLICK
public static final java.lang.String PROPERTY_BACKGROUND_IMAGE
public static final java.lang.String PROPERTY_DRAW_OUTER_BORDERS
public static final java.lang.String PROPERTY_HORIZONTAL
public static final java.lang.String PROPERTY_KEEP_ALIVE
public static final java.lang.String PROPERTY_LEFT_OFFSET
public static final java.lang.String PROPERTY_MENU_ALWAYS_ON_TOP
public static final java.lang.String PROPERTY_MENU_BACKGROUND
public static final java.lang.String PROPERTY_MENU_BACKGROUND_IMAGE
public static final java.lang.String PROPERTY_MENU_BORDER
public static final java.lang.String PROPERTY_MENU_FOREGROUND
public static final java.lang.String PROPERTY_MENU_INSETS
public static final java.lang.String PROPERTY_MENU_OUTSETS
public static final java.lang.String PROPERTY_OPEN_OPTION
public static final java.lang.String PROPERTY_PROPERTY_CHILDREN
public static final java.lang.String PROPERTY_STYLE_CHILDREN
public static final java.lang.String PROPERTY_SUBMENU_IMAGE
public static final java.lang.String PROPERTY_SUBMENU_IMAGE_ALIGNMENT
public static final java.lang.String PROPERTY_SUBMENU_IMAGE_BORDERED
public static final java.lang.String PROPERTY_SUBMENU_ROLLOVER_IMAGE
public static final java.lang.String PROPERTY_TOP_OFFSET
public static final nextapp.echo2.app.Style DEFAULT_STYLE
Constructor Detail |
public Menu()
Menu
with no text or icon.
public Menu(MenuItem menuItem)
Menu
with no text or icon and adds
menuItem as its first child.
menuItem
- - the first child to add to this Menu
public Menu(nextapp.echo2.app.ImageReference icon)
Menu
with an icon.
icon
- An icon to display in the Menu
.public Menu(java.lang.String text)
Menu
with text.
text
- A text label to display in the Menu
.public Menu(java.lang.String text, nextapp.echo2.app.ImageReference icon)
Menu
with text and an icon.
text
- A text label to display in the Menu
.icon
- An icon to display in the Menu
.Method Detail |
public void add(nextapp.echo2.app.Component c)
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.
public void add(MenuItem menuItem)
MenuItem
to the end of the Menu
and
styles it the same if styleChildren is set to true.
menuItem
- -
the new child MenuItempublic MenuItem add(java.lang.String text)
MenuItem
to the end of the
Menu
with the specified text.
public int getLeftOffset()
Menu
public boolean getMenuAlwaysOnTop()
setMenuAlwaysOnTop(boolean)
public nextapp.echo2.app.Color getMenuBackground()
public nextapp.echo2.app.FillImage getMenuBackgroundImage()
public nextapp.echo2.app.Border getMenuBorder()
public nextapp.echo2.app.Color getMenuForeground()
public nextapp.echo2.app.Insets getMenuInsets()
public MenuItem[] getMenuItems()
public nextapp.echo2.app.Insets getMenuOutsets()
public int getOpenOption()
public nextapp.echo2.app.ImageReference getSubmenuImage()
Image Reference
of the
Menu
.public int getSubmenuImageAlignment()
Menu
.public nextapp.echo2.app.ImageReference getSubmenuRolloverImage()
public int getTopOffset()
Menu
- Returns:
- int
public boolean isClickToOpen()
This will return true if the open options are set to OPEN_ON_CLICK or OPEN_ON_SUBMENU_CLICK.
public boolean isDrawOuterBorders()
public boolean isHorizontal()
public boolean isKeepAlive()
public boolean isStyleChildren()
public boolean isSubmenuImageBordered()
public void setClickToOpen(boolean clickToOpen)
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);
clickToOpen
- true ot falsepublic void setDrawOuterBorders(boolean newValue)
newValue
- -
The newValue to set.public void setHorizontal(boolean newValue)
Menu
is orientated horizontal or
vertical on the screen.
public void setKeepAlive(boolean newValue)
public void setLeftOffset(int newLeftOffset)
Menu
relative to its parent.
- Parameters:
newLeftOffset
- the left offset of this Menu
public void setMenuAlwaysOnTop(boolean newValue)
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.
newValue
- - the new menuAlwaysOnTop valuepublic void setMenuBackground(nextapp.echo2.app.Color menuBackground)
menuBackground
- the new backgroundpublic void setMenuBackgroundImage(nextapp.echo2.app.FillImage newValue)
newValue
- The new background image.public void setMenuBorder(nextapp.echo2.app.Border newValue)
newValue
- The new borderpublic void setMenuForeground(nextapp.echo2.app.Color menuForeground)
menuForeground
- -
the new colorpublic void setMenuInsets(nextapp.echo2.app.Insets menuInsets)
menuInsets
- the Insets used inside the Menu's drop down box.public void setMenuOutsets(nextapp.echo2.app.Insets menuOutsets)
menuOutsets
- the Insets used outside the Menu's drop down box.public void setOpenOption(int newValue)
newValue
- -
The newValue to set.public void setStyleChildren(boolean newValue)
newValue
- -
whether to style children when addedpublic void setSubmenuImage(nextapp.echo2.app.ImageReference newImageRef)
ImageReference
of the Menu
.
This submenu image will only be shown if the Menu does in fact have
children
public void setSubmenuImageAlignment(int newAlignment)
Menu
.
public void setSubmenuImageBordered(boolean newValue)
newValue
- -
true of falsepublic void setSubmenuRolloverImage(nextapp.echo2.app.ImageReference newValue)
newValue
- -
the new imagepublic void setTopOffset(int newTopOffset)
Menu
relative to its parent.
- Parameters:
newTopOffset
- the top offset of this Menu
public void styleAllMenuItems()
styleMenuItem(MenuItem)
public void styleMenuItem(MenuItem menuItem)
Note only screen presentation parameters are set, other functional parameters such as isHorizontal() are not set.
Also the getStyle() value is copied into the MenuItem as well.
menuItem
- -
the MenuItem to style the same as this Menupublic void styleAllMenuItemsByName(java.lang.String menuStyleName, java.lang.String menuItemStyleName)
menuStyleName
- -
the style name to use for instances of MenumenuItemStyleName
- -
the style name to use for instances of MenuItempublic void styleAllMenuItems(nextapp.echo2.app.Style menuStyle, nextapp.echo2.app.Style menuItemStyle)
menuStyle
- -
the style to use for instances of MenumenuItemStyle
- -
the style to use for instances of MenuItempublic boolean isValidChild(nextapp.echo2.app.Component component)
AbstractButton.isValidChild(nextapp.echo2.app.Component)
public java.lang.String toString()
toString
in class MenuItem
Object.toString()
|
EchoPoint 2.1.0rc4 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |