EchoPoint
1.0

echopoint
Class PickList

java.lang.Object
  extended bynextapp.echo.Component
      extended bynextapp.echo.Container
          extended byechopoint.EchoPointComponent
              extended byechopoint.PickList
All Implemented Interfaces:
MouseCursorable, ReflectionSetter, java.io.Serializable, ToolTipPopUpSupport, nextapp.echo.ToolTipSupport

public class PickList
extends EchoPointComponent

The PickList class provides a Component that presents tow list of objects and allows the user to move them from one list to the other.

The class uses two ListBox components to contain the PickList contents.

The listbox models must be derived from nextapp.echo.DefaultListModel. The reason for this is that the PickList adds and removes elements from each listbox model. nextapp.echo.DefaultListModel has method to allows this to happen, as opposed to the generic nextapp.echo.ListModel, which does not.

Author:
Brad Baker
See Also:
Serialized Form

Nested Class Summary
static class PickList.NestedStyleInfo
          Nested public static StyleInfo class.
 
Field Summary
static java.lang.String BORDER_COLOR_CHANGED_PROPERTY
           
static java.lang.String BORDER_SIZE_CHANGED_PROPERTY
           
protected  nextapp.echo.Color borderColor
          the default border is Color.BLACK
protected  int borderSize
          the default border size is 0
static nextapp.echo.Insets DEFAULT_INSETS
          the default insets are Insets(0)
static int defaultOrientation
          The default orientation for a progress bar is HORIZONTAL.
protected  nextapp.echo.Insets insets
          the default insets Insets(0)
static java.lang.String INSETS_CHANGED_PROPERTY
           
static java.lang.String LEFT_LISTBOX_CHANGED_PROPERTY
           
static java.lang.String LEFT_SWAP_TEXT_CHANGED_PROPERTY
           
static java.lang.String LEFT_TITLE_CHANGED_PROPERTY
           
protected  nextapp.echo.ListBox leftListBox
          the left ListBox
protected  java.lang.String leftSwapText
          the left swap text
protected  java.lang.String leftTitle
          the left title text
protected  int orientation
          The default is HORIZONTAL.
static java.lang.String ORIENTATION_CHANGED_PROPERTY
           
static int ORIENTATION_HORIZONTAL
          The orientation values for the the progress bar.
static int ORIENTATION_VERTICAL
           
static java.lang.String RIGHT_LISTBOX_CHANGED_PROPERTY
           
static java.lang.String RIGHT_SWAP_TEXT_CHANGED_PROPERTY
           
static java.lang.String RIGHT_TITLE_CHANGED_PROPERTY
           
protected  nextapp.echo.ListBox rightListBox
          the right ListBox
protected  java.lang.String rightSwapText
          the right swap text
protected  java.lang.String rightTitle
          the right title text
static java.lang.String STYLE_BORDER_COLOR
          A style constant for the Border Color property.
static java.lang.String STYLE_BORDER_SIZE
          A style constant for the Border Size property.
static java.lang.String STYLE_INSETS
          A style constant for the Insets property.
static java.lang.String STYLE_ORIENTATION
          A style constant for the Orientation property.
 
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 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
PickList()
          Constructs a PickList with nothing in it
PickList(int ordering)
          Constructs a PickList Orientation can be one of the following values.
PickList(int orientation, java.lang.Object[] leftList, java.lang.Object[] rightList)
          Constructs a PickList with the objects supplied in the provided array.
PickList(java.lang.Object[] leftList, java.lang.Object[] rightList)
          Constructs a PickList with the objects supplied in the provided array.
 
Method Summary
 void applyStyle(nextapp.echo.Style style)
          Applies the provided style to the component.
 nextapp.echo.Color getBorderColor()
           
 int getBorderSize()
           
 nextapp.echo.Insets getInsets()
           
 nextapp.echo.ListBox getLeftListBox()
          Returns the PickList's left list box.
 java.lang.String getLeftSwapText()
          Returns the PickList's left swap text .
 java.lang.String getLeftTitle()
          Returns the PickList's left list box title.
 int getOrientation()
          Returns PickList.ORIENTATION_VERTICAL or PickList.ORIENTATION_HORIZONTAL, depending on the orientation of the progress bar.
 nextapp.echo.ListBox getRightListBox()
          Returns the PickList's right list box.
 java.lang.String getRightSwapText()
          Returns the PickList's right swap text.
 java.lang.String getRightTitle()
          Returns the PickList's right list box title.
 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 setBorderColor(nextapp.echo.Color newBorderColor)
          Sets the border Color of the PickList.
 void setBorderSize(int newBorderSize)
          Sets the border size of the PickList.
 void setEnabled(boolean newValue)
           
 void setInsets(nextapp.echo.Insets newValue)
          Sets the Insets used by the PickList
This methods fires a PropertyChangeEvent with a getPropertyName() value of PickList.INSETS_CHANGED_PROPERTY
 void setLeftListBox(nextapp.echo.ListBox newLeftListBox)
          Sets the PickList's left list box.
 void setLeftSwapText(java.lang.String newLeftSwapText)
          Sets the PickList's left swap text.
 void setLeftTitle(java.lang.String newLeftTitle)
          Sets the PickList's left list box title.
 void setOrientation(int newOrientation)
          Sets the PickList's orientation to newOrientation, which must be PickList.ORIENTATION_VERTICAL or PickList.ORIENTATION_HORIZONTAL.
 void setRightListBox(nextapp.echo.ListBox newRightListBox)
          Sets the PickList's right list box.
 void setRightSwapText(java.lang.String newRightSwapText)
          Sets the PickList's right swap text.
 void setRightTitle(java.lang.String newRightTitle)
          Sets the PickList's right list box title.
 
Methods inherited from class echopoint.EchoPointComponent
getMouseCursor, getMouseCursorURI, getToolTipPopUp, getToolTipText, set, set, set, set, set, set, set, set, set, setEnabledAllChildren, setMouseCursor, setMouseCursorURI, setToolTipText, validate
 
Methods inherited from class nextapp.echo.Component
add, 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, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setBackground, setFont, setForeground, setIdentifier, setLocale, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORIENTATION_HORIZONTAL

public static final int ORIENTATION_HORIZONTAL
The orientation values for the the progress bar.

See Also:
Constant Field Values

ORIENTATION_VERTICAL

public static final int ORIENTATION_VERTICAL
See Also:
Constant Field Values

STYLE_BORDER_COLOR

public static final java.lang.String STYLE_BORDER_COLOR
A style constant for the Border Color property. Values of this key must be of type nextapp.echo.Color.

See Also:
Constant Field Values

STYLE_BORDER_SIZE

public static final java.lang.String STYLE_BORDER_SIZE
A style constant for the Border Size property. Values of this key must be of type Integer.

See Also:
Constant Field Values

STYLE_INSETS

public static final java.lang.String STYLE_INSETS
A style constant for the Insets property. Values of this key must be of type nextapp.echo.Insets.

See Also:
Constant Field Values

STYLE_ORIENTATION

public static final java.lang.String STYLE_ORIENTATION
A style constant for the Orientation property. Values of this key must be of type int

See Also:
Constant Field Values

BORDER_COLOR_CHANGED_PROPERTY

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

BORDER_SIZE_CHANGED_PROPERTY

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

INSETS_CHANGED_PROPERTY

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

LEFT_LISTBOX_CHANGED_PROPERTY

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

RIGHT_LISTBOX_CHANGED_PROPERTY

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

LEFT_TITLE_CHANGED_PROPERTY

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

RIGHT_TITLE_CHANGED_PROPERTY

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

LEFT_SWAP_TEXT_CHANGED_PROPERTY

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

RIGHT_SWAP_TEXT_CHANGED_PROPERTY

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

ORIENTATION_CHANGED_PROPERTY

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

DEFAULT_INSETS

public static final nextapp.echo.Insets DEFAULT_INSETS
the default insets are Insets(0)


borderColor

protected nextapp.echo.Color borderColor
the default border is Color.BLACK


borderSize

protected int borderSize
the default border size is 0


insets

protected nextapp.echo.Insets insets
the default insets Insets(0)


leftListBox

protected nextapp.echo.ListBox leftListBox
the left ListBox


rightListBox

protected nextapp.echo.ListBox rightListBox
the right ListBox


leftTitle

protected java.lang.String leftTitle
the left title text


rightTitle

protected java.lang.String rightTitle
the right title text


leftSwapText

protected java.lang.String leftSwapText
the left swap text


rightSwapText

protected java.lang.String rightSwapText
the right swap text


defaultOrientation

public static final int defaultOrientation
The default orientation for a progress bar is HORIZONTAL.

See Also:
Constant Field Values

orientation

protected int orientation
The default is HORIZONTAL.

Constructor Detail

PickList

public PickList()
Constructs a PickList with nothing in it


PickList

public PickList(java.lang.Object[] leftList,
                java.lang.Object[] rightList)
Constructs a PickList with the objects supplied in the provided array.


PickList

public PickList(int ordering)
Constructs a PickList Orientation can be one of the following values.


PickList

public PickList(int orientation,
                java.lang.Object[] leftList,
                java.lang.Object[] rightList)
Constructs a PickList with the objects supplied in the provided array. Orientation can be one of the following values.

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 MouseCursorable
Overrides:
applyStyle in class EchoPointComponent
See Also:
Component.applyStyle(nextapp.echo.Style)

getBorderColor

public nextapp.echo.Color getBorderColor()
Returns:
The Color of the PickList's border.

getBorderSize

public int getBorderSize()
Returns:
The size of the PickList's border.

getInsets

public nextapp.echo.Insets getInsets()
Returns:
the Insets (margins) of the PickList.

getLeftListBox

public nextapp.echo.ListBox getLeftListBox()
Returns the PickList's left list box.

Returns:
nextapp.echo.ListBox

getLeftSwapText

public java.lang.String getLeftSwapText()
Returns the PickList's left swap text .

Returns:
java.lang.String

getLeftTitle

public java.lang.String getLeftTitle()
Returns the PickList's left list box title.

Returns:
java.lang.String

getOrientation

public int getOrientation()
Returns PickList.ORIENTATION_VERTICAL or PickList.ORIENTATION_HORIZONTAL, depending on the orientation of the progress bar. The default orientation is ORIENTATION_HORIZONTAL.


getRightListBox

public nextapp.echo.ListBox getRightListBox()
Returns the PickList's right list box.

Returns:
nextapp.echo.ListBox

getRightSwapText

public java.lang.String getRightSwapText()
Returns the PickList's right swap text.

Returns:
java.lang.String

getRightTitle

public java.lang.String getRightTitle()
Returns the PickList's right list box title.

Returns:
java.lang.String

setBorderColor

public void setBorderColor(nextapp.echo.Color newBorderColor)
Sets the border Color of the PickList.
This methods fires a PropertyChangeEvent with a getPropertyName() value of PickList.BORDER_COLOR_CHANGED_PROPERTY


setBorderSize

public void setBorderSize(int newBorderSize)
Sets the border size of the PickList.
This methods fires a PropertyChangeEvent with a getPropertyName() value of PickList.BORDER_SIZE_CHANGED_PROPERTY


setInsets

public void setInsets(nextapp.echo.Insets newValue)
Sets the Insets used by the PickList
This methods fires a PropertyChangeEvent with a getPropertyName() value of PickList.INSETS_CHANGED_PROPERTY


setLeftListBox

public void setLeftListBox(nextapp.echo.ListBox newLeftListBox)
Sets the PickList's left list box.

Parameters:
newLeftListBox - nextapp.echo.ListBox

setLeftSwapText

public void setLeftSwapText(java.lang.String newLeftSwapText)
Sets the PickList's left swap text.

Parameters:
newLeftSwapText - java.lang.String

setLeftTitle

public void setLeftTitle(java.lang.String newLeftTitle)
Sets the PickList's left list box title.

Parameters:
newLeftTitle - java.lang.String

setOrientation

public void setOrientation(int newOrientation)
Sets the PickList's orientation to newOrientation, which must be PickList.ORIENTATION_VERTICAL or PickList.ORIENTATION_HORIZONTAL. The default orientation is ORIENTATION_HORIZONTAL.


setRightListBox

public void setRightListBox(nextapp.echo.ListBox newRightListBox)
Sets the PickList's right list box.

Parameters:
newRightListBox - nextapp.echo.ListBox

setRightSwapText

public void setRightSwapText(java.lang.String newRightSwapText)
Sets the PickList's right swap text.

Parameters:
newRightSwapText - java.lang.String

setRightTitle

public void setRightTitle(java.lang.String newRightTitle)
Sets the PickList's right list box title.

Parameters:
newRightTitle - java.lang.String

setEnabled

public void setEnabled(boolean newValue)
See Also:
Component.setEnabled(boolean)

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;
 }
 

Parameters:
field - - the field to be set
newValue - - the new value to be set
Returns:
the oldValue of the field
Throws:
java.lang.Exception
See Also:
ReflectionSetter.set(Field, Object)

EchoPoint
1.0