EchoPoint
1.0

echopoint
Class DropDownBox

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Container
          extended byechopoint.EchoPointComponent
              extended byechopoint.positionable.AbstractScrollableComponent
                  extended byechopoint.ScrollableBox
                      extended byechopoint.DropDownBox
All Implemented Interfaces:
Borderable, Clippable, LayoutManageable, MouseCursorable, Positionable, ReflectionSetter, Scrollable, ScrollableContainer, java.io.Serializable, ToolTipPopUpSupport, nextapp.echo.ToolTipSupport

public class DropDownBox
extends ScrollableBox
implements nextapp.echo.ToolTipSupport

The DropDownBox class is a ScrollableBox component that can be used as a container for other components, with a "toggle" child component.

The "toggle" child component is displayed with a toggle handle next to it. This allows a drop down list to be presented consisting of all the other contained components in the DropDownBox.

This drop down list contents are rendered just like any other ScrollableBox

You can set a group name into the drop down box. All drop down boxes with the same group name are "drop down mutually exclusive", that is to say only one drop down box in a set of drop down boxes, with the same group name, can be open at the one time.

Author:
Brad Baker
See Also:
Serialized Form

Nested Class Summary
static class DropDownBox.NestedStyleInfo
          Nested public static StyleInfo class.
 
Field Summary
static java.lang.String AUTO_COLLAPSE_CHANGED_PROPERTY
          Auto Collapse Property
static java.lang.String BOX_HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY
           
static java.lang.String DROP_DOWN_BUTTON_BACKGROUND_CHANGED_PROPERTY
           
static java.lang.String DROP_DOWN_BUTTON_VERTICAL_ALIGNMENT_CHANGED_PROPERTY
           
static java.lang.String EXPANSION_MODEL_CHANGED_PROPERTY
           
static java.lang.String GROUP_NAME_CHANGED_PROPERTY
           
static java.lang.String STYLE_BOX_HORIZONTAL_ALIGNMENT
           
static java.lang.String STYLE_DROP_DOWN_BUTTON_BACKGROUND
           
static java.lang.String STYLE_DROP_DOWN_BUTTON_VERTICAL_ALIGNMENT
           
static java.lang.String STYLE_GROUP_NAME
           
static java.lang.String TOGGLE_COMPONENT_CHANGED_PROPERTY
          Nominated Component Property
 
Fields inherited from class echopoint.ScrollableBox
DEFAULT_INSETS, DEFAULT_POSITONABLE_POLICY, DEFAULT_SCROLLBAR_POLICY
 
Fields inherited from class echopoint.EchoPointComponent
STYLE_TOOL_TIP_TEXT, TOOL_TIP_TEXT_CHANGED_PROPERTY, toolTipPopUp
 
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, MODEL_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
 
Fields inherited from interface echopoint.positionable.ScrollableContainer
HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY, INSETS_CHANGED_PROPERTY, STYLE_HORIZONTAL_ALIGNMENT, STYLE_INSETS, STYLE_VERTICAL_ALIGNMENT, VERTICAL_ALIGNMENT_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.Scrollable
HEIGHT_CHANGED_PROPERTY, SCROLL_BAR_X_CHANGED_PROPERTY, SCROLL_BAR_Y_CHANGED_PROPERTY, SCROLLBAR_POLICY_CHANGED_PROPERTY, SCROLLBARS_ALWAYS, SCROLLBARS_AUTO, SCROLLBARS_CLIPHIDE, SCROLLBARS_NEVER, STYLE_HEIGHT, STYLE_SCROLL_BAR_POLICY, STYLE_WIDTH, UNDEFINED, undefinedSymbolic, WIDTH_CHANGED_PROPERTY
 
Fields inherited from interface echopoint.positionable.Positionable
POSITION_CHANGED_PROPERTY, POSITIONING_ABSOLUTE, POSITIONING_FLOW, POSITIONING_RELATIVE, positioningSymbolics, STYLE_BOTTOM, STYLE_LEFT, STYLE_POSITIONING, STYLE_RIGHT, STYLE_TOP, STYLE_ZINDEX, UNDEFINED, undefinedSymbolic
 
Fields inherited from interface echopoint.positionable.Clippable
CLIP_RECT_CHANGED_PROPERTY, STYLE_CLIP_RECT
 
Fields inherited from interface echopoint.positionable.Borderable
BORDER_DASHED, BORDER_DOTTED, BORDER_DOUBLE, BORDER_GROOVE, BORDER_INSET, BORDER_NONE, BORDER_OUTSET, BORDER_RIDGE, BORDER_SOLID, borderStyleSymbolics, STYLE_BORDER_COLOR, STYLE_BORDER_SIZE, STYLE_BORDER_STYLE, STYLE_BOTTOM_BORDER_COLOR, STYLE_BOTTOM_BORDER_SIZE, STYLE_BOTTOM_BORDER_STYLE, STYLE_LEFT_BORDER_COLOR, STYLE_LEFT_BORDER_SIZE, STYLE_LEFT_BORDER_STYLE, STYLE_RIGHT_BORDER_COLOR, STYLE_RIGHT_BORDER_SIZE, STYLE_RIGHT_BORDER_STYLE, STYLE_TOP_BORDER_COLOR, STYLE_TOP_BORDER_SIZE, STYLE_TOP_BORDER_STYLE
 
Fields inherited from interface echopoint.layout.LayoutManageable
LAYOUT_MANAGED_CHANGED_PROPERTY
 
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
DropDownBox()
          Creates a DropDownBox
DropDownBox(int left, int top)
          Constructs a DropDownBox * @param left * @param top
DropDownBox(int left, int top, int right, int bottom)
          Constructs a DropDownBox * @param left * @param top * @param right * @param bottom
DropDownBox(int left, int top, int right, int bottom, int zIndex)
          Constructs a DropDownBox * @param left * @param top * @param right * @param bottom * @param zIndex
DropDownBox(int left, int top, int right, int bottom, int zIndex, int positioning)
          Constructs a DropDownBox * @param left * @param top * @param right * @param bottom * @param zIndex * @param positioning
DropDownBox(int left, int top, int right, int bottom, int zIndex, int positioning, int scrollBarPolicy)
          Constructs a DropDownBox * @param left * @param top * @param right * @param bottom * @param zIndex * @param positioning * @param scrollBarPolicy
DropDownBox(int left, int top, int right, int bottom, int zIndex, int positioning, int scrollBarPolicy, int[] clipRect)
          Constructs a DropDownBox * @param left * @param top * @param right * @param bottom * @param zIndex * @param positioning * @param scrollBarPolicy * @param clipRect
DropDownBox(LayoutManager layoutManager)
          Constructs a DropDownBox with a LayoutManager
 
Method Summary
 void applyStyle(nextapp.echo.Style style)
          Applies the provided style to the component.
 int getBoxHorizontalAlignment()
          Returns the horizontal alignment of the expanded box itself relative to the button.
 nextapp.echo.Color getDropDownButtonBackground()
          Returns the background Color of the drop down button
 int getDropDownButtonVerticalAlignment()
          Returns the vertical alignment of the drop down button.
 ExpandableModel getExpansionModel()
           
 java.lang.String getGroupName()
          Returns the Group Name for this DropDownBox.
 nextapp.echo.Component getToggleComponent()
          Returns the toggle Component that will be drawn with a drop down toggle button beside it.
 boolean isAutoCollapse()
          Returns TRUE if the DropDownBox will revert to a collapsed state when any server interaction occurs.
 boolean isDisplayToggle()
          Returns true if a toggle component should be displayed.
 boolean isExpanded()
           
 void remove(nextapp.echo.Component c)
          Removes a component from the container Component and informs the LayoutManager of this removal.
 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 setAutoCollapse(boolean newAutoCollapse)
          Sets whether the DropDownBox will revert to a collapsed state when any server interaction occurs.
 void setBoxHorizontalAlignment(int newValue)
          Sets the horizontal alignment of the expanded box itself relative to the toggle component.
 void setDisplayToggle(boolean displayToggle)
          Sets the flag to indicate whether or not a toggle button should be displayed.
 void setDropDownButtonBackground(nextapp.echo.Color newValue)
          Sets the background Color of the drop down button
 void setDropDownButtonVerticalAlignment(int newValue)
          Sets the vertical alignment of the drop down button.
 void setExpanded(boolean isExpanded)
          Sets whether the DropDownBox is expanded or not and hence whether its contained DatePicker is showing.
 void setExpansionModel(ExpandableModel newExpansionModel)
          Sets the ExpandableModel model used by the DropDownBox.
 void setGroupName(java.lang.String groupName)
          Sets the name of a "logical box group" for this DropDownBox.
 void setToggleComponent(nextapp.echo.Component newValue)
          Sets the toggle Component that will be drawn with a drop down button beside it.
 void validate()
           
 
Methods inherited from class echopoint.ScrollableBox
getHorizontalAlignment, getInsets, getVerticalAlignment, setHorizontalAlignment, setInsets, setVerticalAlignment
 
Methods inherited from class echopoint.positionable.AbstractScrollableComponent
add, add, add, add, addImpl, clearPositioning, getBorderColor, getBorderSize, getBorderStyle, getBottom, getBottomBorderColor, getBottomBorderSize, getBottomBorderStyle, getClipRect, getHeight, getLayoutManager, getLeft, getLeftBorderColor, getLeftBorderSize, getLeftBorderStyle, getPositioning, getRight, getRightBorderColor, getRightBorderSize, getRightBorderStyle, getScreenHeight, getScreenHeight, getScreenWidth, getScreenWidth, getScrollBarPolicy, getScrollBarX, getScrollBarY, getTop, getTopBorderColor, getTopBorderSize, getTopBorderStyle, getWidth, getzIndex, isPositioned, remove, setBorderColor, setBorderSize, setBorderStyle, setBottom, setBottomBorderColor, setBottomBorderSize, setBottomBorderStyle, setClipRect, setClipRect, setClipRect, setHeight, setLayoutManager, setLeft, setLeftBorderColor, setLeftBorderSize, setLeftBorderStyle, setPositioning, setRight, setRightBorderColor, setRightBorderSize, setRightBorderStyle, setScrollBarPolicy, setScrollBarX, setScrollBarY, setTop, setTopBorderColor, setTopBorderSize, setTopBorderStyle, setWidth, setzIndex
 
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 nextapp.echo.Component
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, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setEnabled, setFont, setForeground, setIdentifier, setLocale, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nextapp.echo.ToolTipSupport
getToolTipText, setToolTipText
 
Methods inherited from interface echopoint.positionable.Scrollable
getHeight, getScrollBarPolicy, getScrollBarX, getScrollBarY, getWidth, setHeight, setScrollBarPolicy, setScrollBarX, setScrollBarY, setWidth
 
Methods inherited from interface echopoint.positionable.Positionable
clearPositioning, getBottom, getLeft, getPositioning, getRight, getTop, getzIndex, isPositioned, setBottom, setLeft, setPositioning, setRight, setTop, setzIndex
 
Methods inherited from interface echopoint.positionable.Clippable
getClipRect, setClipRect, setClipRect, setClipRect
 
Methods inherited from interface echopoint.positionable.Borderable
getBorderColor, getBorderSize, getBorderStyle, getBottomBorderColor, getBottomBorderSize, getBottomBorderStyle, getLeftBorderColor, getLeftBorderSize, getLeftBorderStyle, getRightBorderColor, getRightBorderSize, getRightBorderStyle, getTopBorderColor, getTopBorderSize, getTopBorderStyle, setBorderColor, setBorderSize, setBorderStyle, setBottomBorderColor, setBottomBorderSize, setBottomBorderStyle, setLeftBorderColor, setLeftBorderSize, setLeftBorderStyle, setRightBorderColor, setRightBorderSize, setRightBorderStyle, setTopBorderColor, setTopBorderSize, setTopBorderStyle
 
Methods inherited from interface echopoint.layout.LayoutManageable
add, add, add, add, getLayoutManager, remove, setLayoutManager
 

Field Detail

AUTO_COLLAPSE_CHANGED_PROPERTY

public static final java.lang.String AUTO_COLLAPSE_CHANGED_PROPERTY
Auto Collapse Property

See Also:
Constant Field Values

DROP_DOWN_BUTTON_BACKGROUND_CHANGED_PROPERTY

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

DROP_DOWN_BUTTON_VERTICAL_ALIGNMENT_CHANGED_PROPERTY

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

BOX_HORIZONTAL_ALIGNMENT_CHANGED_PROPERTY

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

GROUP_NAME_CHANGED_PROPERTY

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

EXPANSION_MODEL_CHANGED_PROPERTY

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

STYLE_DROP_DOWN_BUTTON_BACKGROUND

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

STYLE_DROP_DOWN_BUTTON_VERTICAL_ALIGNMENT

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

STYLE_BOX_HORIZONTAL_ALIGNMENT

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

STYLE_GROUP_NAME

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

TOGGLE_COMPONENT_CHANGED_PROPERTY

public static final java.lang.String TOGGLE_COMPONENT_CHANGED_PROPERTY
Nominated Component Property

See Also:
Constant Field Values
Constructor Detail

DropDownBox

public DropDownBox()
Creates a DropDownBox


DropDownBox

public DropDownBox(LayoutManager layoutManager)
Constructs a DropDownBox with a LayoutManager


DropDownBox

public DropDownBox(int left,
                   int top)
Constructs a DropDownBox * @param left * @param top


DropDownBox

public DropDownBox(int left,
                   int top,
                   int right,
                   int bottom)
Constructs a DropDownBox * @param left * @param top * @param right * @param bottom


DropDownBox

public DropDownBox(int left,
                   int top,
                   int right,
                   int bottom,
                   int zIndex)
Constructs a DropDownBox * @param left * @param top * @param right * @param bottom * @param zIndex


DropDownBox

public DropDownBox(int left,
                   int top,
                   int right,
                   int bottom,
                   int zIndex,
                   int positioning)
Constructs a DropDownBox * @param left * @param top * @param right * @param bottom * @param zIndex * @param positioning


DropDownBox

public DropDownBox(int left,
                   int top,
                   int right,
                   int bottom,
                   int zIndex,
                   int positioning,
                   int scrollBarPolicy)
Constructs a DropDownBox * @param left * @param top * @param right * @param bottom * @param zIndex * @param positioning * @param scrollBarPolicy


DropDownBox

public DropDownBox(int left,
                   int top,
                   int right,
                   int bottom,
                   int zIndex,
                   int positioning,
                   int scrollBarPolicy,
                   int[] clipRect)
Constructs a DropDownBox * @param left * @param top * @param right * @param bottom * @param zIndex * @param positioning * @param scrollBarPolicy * @param clipRect

Method Detail

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.

Specified by:
applyStyle in interface Scrollable
Overrides:
applyStyle in class ScrollableBox
See Also:
Component.applyStyle(nextapp.echo.Style)

getDropDownButtonBackground

public nextapp.echo.Color getDropDownButtonBackground()
Returns the background Color of the drop down button

Returns:
the background Color of the drop down button

getDropDownButtonVerticalAlignment

public int getDropDownButtonVerticalAlignment()
Returns the vertical alignment of the drop down button.

Returns:
The vertical alignment of the drop down button, one of the following values:
  • EchoConstants.TOP (the default)
  • EchoConstants.CENTER
  • EchoConstants.BOTTOM

getExpansionModel

public ExpandableModel getExpansionModel()
Returns:
the ExpandableModel model of the DropDownBox.

getToggleComponent

public nextapp.echo.Component getToggleComponent()
Returns the toggle Component that will be drawn with a drop down toggle button beside it.

Returns:
- the toggle component or null

isAutoCollapse

public boolean isAutoCollapse()
Returns TRUE if the DropDownBox will revert to a collapsed state when any server interaction occurs.

Returns:
boolean

isExpanded

public boolean isExpanded()
Returns:
whether DropDownBox is expanded or not, and hence whether it is showing its underlying drop down component.

remove

public void remove(nextapp.echo.Component c)
Description copied from interface: LayoutManageable
Removes a component from the container Component and informs the LayoutManager of this removal.

Specified by:
remove in interface LayoutManageable
Overrides:
remove in class AbstractScrollableComponent
See Also:
Component.remove(nextapp.echo.Component)

setAutoCollapse

public void setAutoCollapse(boolean newAutoCollapse)
Sets whether the DropDownBox will revert to a collapsed state when any server interaction occurs.

Parameters:
newAutoCollapse - boolean

setDropDownButtonBackground

public void setDropDownButtonBackground(nextapp.echo.Color newValue)
Sets the background Color of the drop down button

Parameters:
newValue - - the new background color

setDropDownButtonVerticalAlignment

public void setDropDownButtonVerticalAlignment(int newValue)
Sets the vertical alignment of the drop down button.

Parameters:
newValue - The the vertical alignment of the drop down button, one of the following values.
  • EchoConstants.TOP (the default)
  • EchoConstants.CENTER
  • EchoConstants.BOTTOM

setExpanded

public void setExpanded(boolean isExpanded)
Sets whether the DropDownBox is expanded or not and hence whether its contained DatePicker is showing.


setExpansionModel

public void setExpansionModel(ExpandableModel newExpansionModel)
Sets the ExpandableModel model used by the DropDownBox.


setToggleComponent

public void setToggleComponent(nextapp.echo.Component newValue)
Sets the toggle Component that will be drawn with a drop down button beside it.

If this Component is not already an ancestor of this DropDownBox then it will be added as the latest child of the DropDownBox

Parameters:
newValue - - the component in question
Throws:
java.lang.IllegalArgumentException - - if the nominated component is null

validate

public void validate()
Overrides:
validate in class EchoPointComponent
See Also:
Component.validate()

setBoxHorizontalAlignment

public void setBoxHorizontalAlignment(int newValue)
Sets the horizontal alignment of the expanded box itself relative to the toggle component. Valid values are:
  • EchoConstands.LEFT
  • EchoConstands.RIGHT

Parameters:
newValue - The new horizontal alignment

getBoxHorizontalAlignment

public int getBoxHorizontalAlignment()
Returns the horizontal alignment of the expanded box itself relative to the button.

Returns:
Returns the horizontal alignment of the expanded box itself relative to the button.

getGroupName

public java.lang.String getGroupName()
Returns the Group Name for this DropDownBox.

Returns:
Returns the Group Name for this DropDownBox.
See Also:
setGroupName(String)

setGroupName

public void setGroupName(java.lang.String groupName)
Sets the name of a "logical box group" for this DropDownBox. A "logical box group" is a programmer chosen name given to several DropDownBoxes to allow only one to be open at a given time. When one DropDownBox is toggledopen, all other boxes with the same GroupName are closed.

Parameters:
groupName - The group name to use.

isDisplayToggle

public boolean isDisplayToggle()
Returns true if a toggle component should be displayed.

Returns:
Returns true if a toggle component should be displayed.

setDisplayToggle

public void setDisplayToggle(boolean displayToggle)
Sets the flag to indicate whether or not a toggle button should be displayed. If this is set to false, then the application is responsible for hiding and showing the DropDownBox. The default is true.

Parameters:
displayToggle - The new display toggle flag.

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 ScrollableBox
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0