|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnextapp.echo.AbstractComponent
nextapp.echo.Container
echopoint.EchoPointComponent
echopoint.ExpandableMenu
public class ExpandableMenu
The ExpandableMenu
class provides a Component
that shows a hierarchial menu of Component objects. These can
then be expanded and collapsed, according to the parent-child hierarchy
of the components.
The component works in "client side mode" only. It does not raise events on the server when Component are expanded or collapse.
However if you use Components such as Menu's,MenuItem's or Buttons you can add the usual ActionListeners in the usual manner, and hence be notified when they raise events.
Nested Class Summary | |
---|---|
static class |
ExpandableMenu.NestedStyleInfo
Nested public static StyleInfo class. |
Field Summary | |
---|---|
static ImageReference |
defaultBlankLeafImage
a blank image for an leaf menu |
static ImageReference |
defaultBulletLeafImage
a bullet image for an leaf menu |
static ImageReference |
defaultCollapsedImage
the default image for an collapsed menu |
static ImageReference |
defaultExpandedImage
the default image for an expanded menu |
static java.lang.String |
IMAGES_CHANGED_PROPERTY
image support component |
static java.lang.String |
ROW_HEIGHT_CHANGED_PROPERTY
Tree Row Height |
static java.lang.String |
STYLE_ROW_HEIGHT
A style constant for the Row Height property. |
Fields inherited from class echopoint.EchoPointComponent |
---|
STYLE_TOOL_TIP_TEXT, TOOL_TIP_TEXT_CHANGED_PROPERTY, toolTipPopUp |
Fields inherited from interface echopoint.positionable.MouseCursorable |
---|
borderStyleSymbolics, 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, STYLE_MOUSE_CURSOR, STYLE_MOUSE_CURSOR_URI |
Constructor Summary | |
---|---|
ExpandableMenu()
ExpandableMenu constructor. |
Method Summary | |
---|---|
void |
add(Component c)
Adds a Component derived object to the ExpandableMenu . |
void |
add(Component c,
int index)
Adds a Component derived object to the ExpandableMenu . |
void |
applyStyle(Style style)
Applies the provided style to the component. |
void |
collapseAll()
Collapses all nodes in the ExpandableMenu |
void |
expandAll()
Expand all nodes in the ExpandableMenu |
TreeCellRenderer |
getCellRender()
Returns the cell renderer of the underlying tree component. |
ImageReference |
getCollapsedImage()
Returns the icon to use for collapsed Menus (with children) |
ImageReference |
getExpandedImage()
Returns the icon to use for expanded Menus (with children) |
ImageReference |
getLeafImage()
Returns the icon to use for leaf Menus (ie they have no children) |
int |
getRowHeight()
Returns the row height to be used for each row within the ExpandableMenu. |
void |
hierarchyChanged(HierarchyEvent e)
Notifies the listener of a heirarchy change. |
void |
remove(Component c)
Removes a Component from
the ExpandableMenu . |
void |
remove(int index)
Removes a Menu from the ExpandableMenu at
the specified index. |
void |
removeAll()
Removes all Menu under management. |
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 |
setCellRenderer(TreeCellRenderer cellRenderer)
Sets the cell renderer of the underlying tree |
void |
setCollapsedImage(ImageReference newCollapsedImage)
Sets the icon to use for collapsed Menus (with children) |
void |
setEnabled(boolean newValue)
Sets whether the component is enabled. |
void |
setExpandedImage(ImageReference newExpandedImage)
Sets the icon to use for expanded Menus (with children) |
void |
setLeafImage(ImageReference newLeafImage)
Sets the icon to use for leaf Menus (ie they have no children) |
void |
setRowHeight(int newRowHeight)
Sets the row height to be used for each row within the ExpandableMenu. |
void |
validate()
Called just before the ExpandableMenu is to be rendered, to give it a chance to updates its internal state. |
Methods inherited from class echopoint.EchoPointComponent |
---|
getMouseCursor, getMouseCursorURI, getToolTipPopUp, getToolTipText, set, set, set, set, set, set, set, set, set, setEnabledAllChildren, setMouseCursor, setMouseCursorURI, setToolTipText |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ROW_HEIGHT_CHANGED_PROPERTY
public static final java.lang.String STYLE_ROW_HEIGHT
int
public static ImageReference defaultExpandedImage
public static ImageReference defaultCollapsedImage
public static ImageReference defaultBlankLeafImage
public static ImageReference defaultBulletLeafImage
public static final java.lang.String IMAGES_CHANGED_PROPERTY
Constructor Detail |
---|
public ExpandableMenu()
Method Detail |
---|
public void add(Component c)
Component
derived object to the ExpandableMenu
.
This may or may not have child Component
objects
Remember to add ActionListeners to the child components to ensure they can raise events.
add
in interface Component
add
in class AbstractComponent
c
- The child component to add.public void add(Component c, int index)
Component
derived object to the ExpandableMenu
.
at the specified index.
This may or may not have child Component
objects.
Remember to add ActionListeners to the child components to ensure they can raise events.
add
in interface Component
add
in class AbstractComponent
c
- The child component to add.index
- The index at which to add the child component, or -1 to add
the component at the end.public void applyStyle(Style style)
nextapp.echo.Component
style names can be used as well.
applyStyle
in interface MouseCursorable
applyStyle
in interface Component
applyStyle
in class EchoPointComponent
style
- The style object from which to retrieve properties for this
Component
.Component.applyStyle(nextapp.echo.Style)
public ImageReference getCollapsedImage()
public ImageReference getExpandedImage()
public ImageReference getLeafImage()
public int getRowHeight()
public void hierarchyChanged(HierarchyEvent e)
hierarchyChanged
in interface HierarchyListener
e
- An HierarchyEvent
describing the change.public void remove(int index)
Menu
from the ExpandableMenu
at
the specified index.
remove
in interface Component
remove
in class AbstractComponent
index
- The index of the child component to remove.public void remove(Component c)
Component
from
the ExpandableMenu
.
remove
in interface Component
remove
in class AbstractComponent
c
- The child component to remove.public void removeAll()
removeAll
in interface Component
removeAll
in class AbstractComponent
public void setCellRenderer(TreeCellRenderer cellRenderer)
cellRenderer
- - the new cell rendererpublic TreeCellRenderer getCellRender()
public void setCollapsedImage(ImageReference newCollapsedImage)
newCollapsedImage
- nextapp.echo.ImageReferencepublic void setExpandedImage(ImageReference newExpandedImage)
newExpandedImage
- nextapp.echo.ImageReferencepublic void setLeafImage(ImageReference newLeafImage)
newLeafImage
- nextapp.echo.ImageReferencepublic void setRowHeight(int newRowHeight)
newRowHeight
- intpublic void setEnabled(boolean newValue)
Component
setEnabled
in interface Component
setEnabled
in class AbstractComponent
newValue
- True if the component is enabled.Component.setEnabled(boolean)
public void expandAll()
ExpandableMenu
public void collapseAll()
ExpandableMenu
public void validate()
validate
in interface Component
validate
in class EchoPointComponent
Component.validate()
public java.lang.Object set(java.lang.reflect.Field field, java.lang.Object newValue) throws java.lang.Exception
ReflectionSetter
public Object set(Field f, Object newValue) throws Exception { Object oldValue = f.get(this); f.set(this,newValue); return oldValue; }
set
in interface ReflectionSetter
field
- - the field to be setnewValue
- - the new value to be set
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.NullPointerException
java.lang.Exception
ReflectionSetter.set(Field, Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |