|
EchoPoint 1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.Component
nextapp.echo.AbstractButton
echopoint.MenuItem
echopoint.Menu
The Menu
class provides a Component
that can be added to a menu bar or other menu items.
Nested Class Summary | |
static class |
Menu.NestedStyleInfo
Nested public static StyleInfo class. |
Field Summary | |
static java.lang.String |
LEFT_OFFSET_CHANGED_PROPERTY
|
protected int |
leftOffset
|
protected int |
margin
|
static java.lang.String |
MARGIN_CHANGED_PROPERTY
|
static java.lang.String |
MENU_BORDER_COLOR_CHANGED_PROPERTY
|
static java.lang.String |
MENU_BORDER_SIZE_CHANGED_PROPERTY
|
protected nextapp.echo.Color |
menuBorderColor
|
protected int |
menuBorderSize
|
protected int |
padding
|
static java.lang.String |
PADDING_CHANGED_PROPERTY
|
static java.lang.String |
STYLE_LEFT_OFFSET
A style constant for the Left Offset property. |
static java.lang.String |
STYLE_MARGIN
A style constant for the Margin property. |
static java.lang.String |
STYLE_MENU_BORDER_COLOR
A style constant for the Menu Border Color property. |
static java.lang.String |
STYLE_MENU_BORDER_SIZE
A style constant for the Menu Border Size property. |
static java.lang.String |
STYLE_PADDING
A style constant for the Padding property. |
static java.lang.String |
STYLE_ROLLOVER_SUBMENU_IMAGE
A style constant for the Submenu Image property. |
static java.lang.String |
STYLE_ROLLOVER_SUBMENU_IMAGE_ALIGNMENT
A style constant for the Submenu Image Alignment property. |
static java.lang.String |
STYLE_TOP_OFFSET
A style constant for the Top Offset property. |
static java.lang.String |
STYLE_WIDTH
A style constant for the Width property. |
static java.lang.String |
SUBMENU_IMAGE_ALIGNMENT_CHANGED_PROPERTY
|
static java.lang.String |
SUBMENU_IMAGE_CHANGED_PROPERTY
Property Changes Names |
protected nextapp.echo.ImageReference |
submenuImage
|
protected int |
submenuImageAlignment
|
static java.lang.String |
TOP_OFFSET_CHANGED_PROPERTY
|
protected int |
topOffset
|
protected int |
width
|
static java.lang.String |
WIDTH_CHANGED_PROPERTY
|
Fields inherited from class echopoint.MenuItem |
BORDER_COLOR_CHANGED_PROPERTY, borderColor, rolloverColor, STYLE_BORDER_COLOR, STYLE_ROLLOVER_BORDER_COLOR, TEXT_ALIGNMENT_CHANGED_PROPERTY |
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 | |
Menu()
Creates a button with no text or icon. |
|
Menu(nextapp.echo.ImageReference icon)
Creates a button with an icon. |
|
Menu(java.lang.String text)
Creates a button with text. |
|
Menu(java.lang.String text,
nextapp.echo.ImageReference icon)
Creates a button with text and an icon. |
Method Summary | |
void |
add(nextapp.echo.Component c)
Adds a Component to the end of the Menu . |
MenuItem |
add(MenuItem menuItem)
Adds a MenuItem to the end of the Menu . |
MenuItem |
add(java.lang.String text)
Adds a MenuItem to the end of the Menu with the specified text. |
protected void |
addToHierarchy(nextapp.echo.Component c)
Adds a Component to the echo hierarchy. |
void |
applyStyle(nextapp.echo.Style style)
Applies the provided style to the component. |
int |
getLeftOffset()
Returns the left offset of this Menu |
int |
getMargin()
Gets the margin of the Menu on the screen.
|
nextapp.echo.Color |
getMenuBorderColor()
|
int |
getMenuBorderSize()
|
int |
getPadding()
Gets the padding of the Menu on the screen.
|
nextapp.echo.ImageReference |
getSubmenuImage()
|
int |
getSubmenuImageAlignment()
|
int |
getTopOffset()
Returns the top offset of this Menu |
int |
getWidth()
Sets the width of the Menu on the screen.
|
void |
remove(nextapp.echo.Component c)
Removes a Component from the Menu . |
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 |
setLeftOffset(int newLeftOffset)
Sets the left offset of this Menu |
void |
setMargin(int newValue)
Sets the margin of the Menu on the screen.
|
void |
setMenuBorderColor(nextapp.echo.Color newBorderColor)
Sets the Color of the Menu's border.
|
void |
setMenuBorderSize(int newBorderSize)
Sets the size of the Menu outer border.
|
void |
setPadding(int newValue)
Sets the padding of the Menu on the screen.
|
void |
setSubmenuImage(nextapp.echo.ImageReference newImageRef)
Sets the submenu ImageReference of the Menu .
|
void |
setSubmenuImageAlignment(int newAlignment)
Sets the submenu alignment of the Menu .
|
void |
setTopOffset(int newTopOffset)
Sets the top offset of this Menu |
void |
setWidth(int newValue)
Sets the width of the Menu on the screen.
|
java.lang.String |
toString()
|
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 |
public static final java.lang.String STYLE_ROLLOVER_SUBMENU_IMAGE
nextapp.echo.ImageReference.
public static final java.lang.String STYLE_ROLLOVER_SUBMENU_IMAGE_ALIGNMENT
int
public static final java.lang.String STYLE_WIDTH
int
public static final java.lang.String STYLE_MARGIN
int
public static final java.lang.String STYLE_PADDING
int
public static final java.lang.String STYLE_MENU_BORDER_COLOR
Color
public static final java.lang.String STYLE_MENU_BORDER_SIZE
Integer.
public static final java.lang.String STYLE_TOP_OFFSET
int
public static final java.lang.String STYLE_LEFT_OFFSET
int
public static final java.lang.String SUBMENU_IMAGE_CHANGED_PROPERTY
public static final java.lang.String SUBMENU_IMAGE_ALIGNMENT_CHANGED_PROPERTY
public static final java.lang.String WIDTH_CHANGED_PROPERTY
public static final java.lang.String MARGIN_CHANGED_PROPERTY
public static final java.lang.String PADDING_CHANGED_PROPERTY
public static final java.lang.String MENU_BORDER_COLOR_CHANGED_PROPERTY
public static final java.lang.String MENU_BORDER_SIZE_CHANGED_PROPERTY
public static final java.lang.String TOP_OFFSET_CHANGED_PROPERTY
public static final java.lang.String LEFT_OFFSET_CHANGED_PROPERTY
protected nextapp.echo.ImageReference submenuImage
protected int submenuImageAlignment
protected int width
protected int margin
protected int padding
protected nextapp.echo.Color menuBorderColor
protected int menuBorderSize
protected int topOffset
protected int leftOffset
Constructor Detail |
public Menu()
public Menu(java.lang.String text)
text
- A text label to display in the button.public Menu(java.lang.String text, nextapp.echo.ImageReference icon)
text
- A text label to display in the button.icon
- An icon to display in the button.public Menu(nextapp.echo.ImageReference icon)
icon
- An icon to display in the button.Method Detail |
public MenuItem add(MenuItem menuItem)
MenuItem
to the end of the Menu
.
public MenuItem add(java.lang.String text)
MenuItem
to the end of the Menu
with the specified text.
public void add(nextapp.echo.Component c)
Component
to the end of the Menu
. This could
typically by a Separator
.
protected void addToHierarchy(nextapp.echo.Component c)
Component
to the echo hierarchy. This can be used
to avoid unintentional super.add() calls.
public void applyStyle(nextapp.echo.Style style)
nextapp.echo.Component
style names can be used as well.
applyStyle
in class MenuItem
public int getLeftOffset()
Menu
Note: Thjis only takes effect when the Menu is a direct child of
the MenuBar, ie a first level child.
- Returns:
- int
getMargin
public int getMargin()
- Gets the margin of the
Menu
on the screen.
If this value is -1, then the Menu
will have no margins
getMenuBorderColor
public nextapp.echo.Color getMenuBorderColor()
- Returns:
- The
Color
of the Menu's
border.
getMenuBorderSize
public int getMenuBorderSize()
- Returns:
- The size of the
Menu's
outer border.
getPadding
public int getPadding()
- Gets the padding of the
Menu
on the screen.
If this value is < 0, then the Menu
will have no padding
getSubmenuImage
public nextapp.echo.ImageReference getSubmenuImage()
- Returns:
- The submenu
Image Reference
of the Menu
.
getSubmenuImageAlignment
public int getSubmenuImageAlignment()
- Returns:
- The submenu image alignmentof the
Menu
.
getTopOffset
public int getTopOffset()
- Returns the top offset of this
Menu
Note: This only takes effect when the Menu is a direct child of
the MenuBar, ie a first level child.
- Returns:
- int
getWidth
public int getWidth()
- Sets the width of the
Menu
on the screen.
This only affects menus that are not in a fixed position.
If this value is -1, then the Menu
will be as wide
as required.
remove
public void remove(nextapp.echo.Component c)
- Removes a
Component
from the Menu
.
setLeftOffset
public void setLeftOffset(int newLeftOffset)
- Sets the left offset of this
Menu
Note: Thjis only takes effect when the Menu is a direct child of
the MenuBar, ie a first level child.
- Parameters:
newLeftOffset
- int
setMargin
public void setMargin(int newValue)
- Sets the margin of the
Menu
on the screen.
If this value is -1, then the Menu
will have no margin
This methods fires a PropertyChangeEvent
with a
getPropertyName()
value of
Menu.MARGIN_CHANGED_PROPERTY
setMenuBorderColor
public void setMenuBorderColor(nextapp.echo.Color newBorderColor)
- Sets the
Color
of the Menu's
border.
This methods fires a PropertyChangeEvent
with a
getPropertyName()
value of
MenuItem.MENU_BORDER_COLOR_CHANGED_PROPERTY
setMenuBorderSize
public void setMenuBorderSize(int newBorderSize)
- Sets the size of the
Menu
outer border.
This methods fires a PropertyChangeEvent
with a
getPropertyName()
value of
Menu.BORDER_SIZE_CHANGED_PROPERTY
setPadding
public void setPadding(int newValue)
- Sets the padding of the
Menu
on the screen.
If this value is -1, then the Menu
will have no padding
This methods fires a PropertyChangeEvent
with a
getPropertyName()
value of
Menu.PADDING_CHANGED_PROPERTY
setSubmenuImage
public void setSubmenuImage(nextapp.echo.ImageReference newImageRef)
- Sets the submenu
ImageReference
of the Menu
.
This methods fires a PropertyChangeEvent
with a
getPropertyName()
value of
Menu.SUBMENU_IMAGE_CHANGED_PROPERTY
setSubmenuImageAlignment
public void setSubmenuImageAlignment(int newAlignment)
- Sets the submenu alignment of the
Menu
.
This can be one of the following values :
- EchoConstants.TOP
- EchoConstants.BOTTOM
- EchoConstants.LEFT
- EchoConstants.RIGHT (the default)
This methods fires a PropertyChangeEvent
with a
getPropertyName()
value of
Menu.SUBMENU_IMAGE_ALIGNMENT_CHANGED_PROPERTY
setTopOffset
public void setTopOffset(int newTopOffset)
- Sets the top offset of this
Menu
Note: Thjis only takes effect when the Menu is a direct child of
the MenuBar, ie a first level child.
- Parameters:
newTopOffset
- int
setWidth
public void setWidth(int newValue)
- Sets the width of the
Menu
on the screen.
This only affects menus that are not in a fixed position.
If this value is -1, then the Menu
will be as wide
as required.
This methods fires a PropertyChangeEvent
with a
getPropertyName()
value of
Menu.WIDTH_CHANGED_PROPERTY
toString
public java.lang.String toString()
- Overrides:
toString
in class MenuItem
- 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 MenuItem
- Throws:
java.lang.Exception
- See Also:
ReflectionSetter.set(Field, Object)
Overview
Package
Class
Tree
Deprecated
Index
Help
EchoPoint
1.0
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD