com.sas.visuals
Class UpDownListBox

com.sas.visuals.UpDownListBox
All Implemented Interfaces:
CompositeInterface, ContainerInterface, com.sas.awt.print.PrintableInterface, VisualInterface, com.sas.beans.PropertyChangeSource, com.sas.beans.VetoableChangeSource, com.sas.collection.ContentsChangedListener, com.sas.ComponentInterface, com.sas.DesignTimeDropTargetInterface, com.sas.LinkPropertiesInterface, com.sas.ModelInterface, ValidatorInterface, com.sas.ViewDefaultModelInterface, com.sas.ViewInterface, MultipleValueEventSourceInterface, java.awt.event.ActionListener, java.awt.event.ItemListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.ObjectInputValidation, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class UpDownListBox
implements java.awt.event.ActionListener, java.awt.ItemSelectable, java.awt.event.ItemListener, com.sas.collection.ContentsChangedListener, com.sas.ViewDefaultModelInterface

UpDownListBox presents a ListBox class with buttons for moving the items within the list box. The selected items may be moved up or down one position at a time using up/down buttons. The buttons appear as small spin buttons with graphic arrows. The buttons can be oriented either horizontally or vertically (default is vertically). The button arrows can be set to point either up/down or left/right (default = up/down). The buttons can be positioned at any of twelve positions:

  1. Placement.TOP
  2. Placement.BOTTOM
  3. Placement.LEFTSIDE_TOP
  4. Placement.LEFTSIDE_BOTTOM
  5. Placement.RIGHTSIDE_TOP
  6. Placement.RIGHTSIDE_BOTTOM
  7. Placement.TOP_LEFT
  8. Placement.TOP_RIGHT
  9. Placement.BOTTOM_LEFT
  10. Placement.BOTTOM_RIGHT
  11. Placement.LEFTSIDE_CENTER
  12. Placement.RIGHTSIDE_CENTER


The button placement can be specified during construction or set through the setButtonPlacement(Placement buttonPlacement) method. The default placement is Placement.RIGHTSIDE_BOTTOM.

Setting the multipleMode property to true will allow more than one item to be selected. The multipleMode property is initially set to false.

Creation:
  1. Create an UpDownListBox
         UpDownListBox upDownListBox1 = new UpDownListBox();
         upDownListBox1.initialize();
     

  2. Create an UpDownListBox with the specified value of the multipleMode property and a specific button placement:
          UpDownListBox upDownListBox1 = new UpDownListBox( true, Placement.TOP_LEFT);
          upDownListBox1.initialize();
     


Default Size:
Required Interfaces:
Please refer to ListBox

Events:
Please refer to ListBox

Notes:
Please refer to ListBox

See Also:
Serialized Form

Field Summary
static java.lang.String RB_KEY
           
 
Constructor Summary
UpDownListBox()
          Default Constructor
UpDownListBox(boolean multipleMode, Placement buttonPlacement)
          Create a new UpDownListBox with the specified properties
UpDownListBox(int rows, boolean multipleMode, Placement buttonPlacement)
          Deprecated. UpDownListBox no longer supports the rows option Use UpDownListBox(boolean multipleMode, Placement buttonPlacement)
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Called whenever one of the pushbuttons has been clicked and performs an action based on whichever pushbutton was clicked.
 void add(java.lang.Object item)
          Adds an item to the end of the list if the attached model supports addition of items.
 void add(java.lang.Object[] items)
          Adds items to the end of the list if the attached model supports addition of items.
 void add(java.lang.Object item, int pos)
          Adds an item to the end of the list if the attached model supports addition of items.
 void add(java.lang.String item)
          Adds an item to the end of the list if the attached model supports addition of items.
 void add(java.lang.String item, int pos)
          Adds an item at the specified location if the attached model supports addition of items.
 void addItemListener(java.awt.event.ItemListener listener)
          Adds a selection item listener
 void addItems(java.util.Enumeration items)
          Adds items to the end of the list if the attached model supports addition of items.
 void attachModel(com.sas.ModelInterface model)
          Attaches a model to the component.
 void contentsChanged(com.sas.collection.ContentsChangedEvent event)
          Called when the contents of the Model have changed.
 void deselect(int index)
          Deselects the item at the specified index
 void deselectAll()
          Deselects all items currently selected in the UpDownListBox
 void detachModel(com.sas.ModelInterface model)
          Detaches the current model and attaches the default model if the model is set to null
 int dragOver(java.awt.Point point, int representation, int keyState, java.util.Vector data)
          Override the dragOver method of com.sas.awt.Panel.
 int findItemByPrefix(java.lang.String prefix, int index)
          Finds an item in the upDownListBox starting with the specified prefix and starting at the specified location
 Placement getButtonPlacement()
          Returns the spin button location
static int getDefaultHeight()
          Returns the default height for instances of this class
static int getDefaultWidth()
          Returns the default width for instances of this class
 com.sas.util.transforms.TransformInterface getDisplayTransform()
          Returns the display transform.
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns the ExtendedBeanInfo for this class.
 java.lang.String[] getInitialItems()
          Returns the initial items (an empty string array is returned is there are no initial items)
 com.sas.util.transforms.TransformInterface getInputTransform()
          Returns the input transform.
 int getItemCount()
          Returns the number of items in the list
 java.lang.String[] getItems()
          Returns an array containing the items in the upDownListBox (an empty string array is returned is there are no items)
 com.sas.ModelInterface getModelInterface()
          Returns the specified Model attached to this client.
 com.sas.util.transforms.TransformInterface getOutputTransform()
          Returns the output transform.
 java.awt.Dimension getPreferredSize()
          Returns the preferred size of the UpDownListBox
 java.util.Vector getRequiredInterfaces()
          Returns the required interfaces Vector for this component.
 int getSelectedIndex()
          Returns the value of the selectedIndex property
 int[] getSelectedIndexes()
          Returns the value of the selectedIndexes property
 java.lang.String getSelectedItem()
          Returns the value of the selectedItem property
 java.lang.String[] getSelectedItems()
          Returns the value of the selectedItems property
 java.lang.Object[] getSelectedObjects()
          Returns the value of the selectedObjects property
 java.lang.String getSelectionPrefix()
          Returns the selectionPrefix value.
 int getVisibleIndex()
          Returns the index of the item that was last made visible by the method makeVisible.
 int getVisibleRows()
          Deprecated. UpDownListBox no longer supports this property
 void initialize()
          Initializes the component.
 boolean isDefaultModelAttached()
          Returns whether the default model is attached.
 boolean isKeyboardSelectable()
          Returns the value of the keyboardSelectable property.
 boolean isMultipleMode()
          Indicates if the list allows multiple selections.
 boolean isSpinButtonVisible()
           
 void itemStateChanged(java.awt.event.ItemEvent e)
          Invoke processItemEvent to process item events
 void makeVisible(int index)
          Makes the specified line in the UpDownListBox visible
 void moveSelection(int offset)
          Moves the selected item(s) up or down.
 void preview()
          Adds descriptive items to the UpDownListBox at design time.
protected  void processItemEvent(java.awt.event.ItemEvent e)
          Processes item events occurring on this component.Subclasses should always call super so that events are delivered to any ItemListeners.
 void propertyChange(java.beans.PropertyChangeEvent event)
          Processes a PropertyChangeEvent sent by the model.
 void refresh()
          Refreshes the component.
 void refresh(com.sas.ModelInterface model)
          Refreshes the component after an attachModel call
 void remove(int position)
          Removes an item at the specified position if the attached model supports removal of items.
 void remove(java.lang.Object item)
          Removes the first occurrence of item if the attached model supports removal of items.
 void remove(java.lang.String item)
          Removes the first occurrence of item if the attached model supports removal of items.
 void removeAll()
          Removes all items from the UpDownListBox.
 void removeItemListener(java.awt.event.ItemListener listener)
          Removes a key listener
 void replaceItem(java.lang.Object newValue, int index)
          Replaces an item if the attached model supports replacement of items.
 void replaceItem(java.lang.String newValue, int index)
          Replaces an item if the attached model supports replacement of items.
 void select(int index)
          Selects the item corresponding to the specified index
 void selectAll()
          Selects all items in the UpDownListBox
 void setBackground(java.awt.Color color)
          Sets the background color
 void setBackgroundColor(java.awt.Color color)
          Sets the background color
 void setButtonPlacement(Placement buttonPlacement)
          Set the spin button location
static void setDefaultHeight(int newDefaultHeight)
          Sets the default height of the component.
 void setDefaultValues()
          Sets the initial values to the default values.
static void setDefaultWidth(int newDefaultWidth)
          Sets the default width of the component.
 void setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
          Sets the display transform.
 void setForeground(java.awt.Color color)
          Sets the background color
 void setInitialItems(java.lang.String[] initialItems)
          Sets the initialItems on the UpDownListBox.
 void setInputTransform(com.sas.util.transforms.TransformInterface transform)
          Sets the input Transform.
 void setItems(java.lang.String[] items)
          Sets the items in the UpDownListBox.
 void setKeyboardSelectable(boolean state)
          Sets the value of the keyboardSelectable property.
 void setMultipleMode(boolean state)
          Sets whether this list allows multiple selections.
 void setMultipleSelectionStyle(int style)
          Sets the multipleSelectionStyle(STANDARD_AWT or EXTENDED_SELECT).
 void setOutputTransform(com.sas.util.transforms.TransformInterface transform)
          Sets the output Transform.
 void setSelectedIndex(int index)
          Selects the item corresponding to the specified index
 void setSelectedIndexes(int[] indexes)
          Selects items by specifying a set of item indices
 void setSelectedItem(java.lang.Object text)
          Sets the selected item to the specified object.
 void setSelectedItem(java.lang.String text)
          Sets the selected item to the specified string.
 void setSelectedItems(java.lang.Object[] items)
          Sets the selected items to the specified objects.
 void setSelectedItems(java.lang.String[] items)
          Sets the selected items to the specified strings.
 void setSelectionPrefix(java.lang.String prefix)
          Sets the selection prefix.
 void setSize(java.awt.Dimension d)
          Sets the component size
 void setSpinButtonVisible(boolean bool)
          Sets the value of the the spinButtonVisible property.
 void setVisibleRows(int rows)
          Deprecated. UpDownListBox no longer supports this property
 
Methods inherited from class com.sas.awt.Panel
remove
 
Methods inherited from class com.sas.awt.PanelContainerComponent
addNotify, clone, dragEnter, dragLeave, drop, getContainerInterfaceSupportInfo, getErrorHandler, getInsets, getValidator, isIDEDnDDropBarrier, isIDEDnDDropTarget, isValid, removeNotify, setContainerInterfaceSupportInfo, setErrorHandler, setIDEDnDDropBarrier, setIDEDnDDropTarget, setInsets, setInsets, setValidator, superAddNotify, superGetInsets, superRemoveNotify, superSetDefaultValues
 
Methods inherited from class com.sas.awt.PanelVisualComponent
addLink, addPropertyChangeListener, addVetoableChangeListener, anyPropertyChangeListeners, attachView, computePreferredSize, detachView, dumpComponent, firePropertyChange, firePropertyChange, fireVetoableChange, getBackgroundColor, getBorder, getComponentDescription, getComponentSupportInfo, getEventMethod, getEventValues, getFont, getForegroundColor, getHeight, getHorizontalPosition, getLinkInfo, getMinimumSize, getPageBounds, getPrePainter, getPrintOptionsPanel, getVerticalPosition, getViewInterfaceSupportInfo, getVisualInterfaceSupportInfo, getWidth, initializeComponent, isDesignTime, isEnabled, isFocus, isLinked, isTransparent, isVisible, pageExists, paint, print, printFinalize, printInitialize, queryLinks, queryLinks, removeAllLinks, removeInterfaceTraps, removeLink, removePropertyChangeListener, removeVetoableChangeListener, setBorder, setBounds, setComponentDescription, setComponentSupportInfo, setEnabled, setFocus, setFont, setForegroundColor, setHeight, setHorizontalPosition, setLinkInfo, setModelInterface, setPreferredSize, setPrePainter, setRequiredInterfaces, setTransparent, setVerticalPosition, setViewInterfaceSupportInfo, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate, supportsListenerInterface, supportsRequiredInterfaces, trapInterfaceEvents, update, validateObject
 
Methods inherited from interface com.sas.awt.ContainerInterface
getComponents, getLayout, invalidate, setLayout, validate
 
Methods inherited from interface com.sas.awt.VisualInterface
computePreferredSize, getBackgroundColor, getBorder, getFont, getForegroundColor, getHeight, getHorizontalPosition, getMinimumSize, getPrePainter, getVerticalPosition, getVisualInterfaceSupportInfo, getWidth, isEnabled, isFocus, isTransparent, isVisible, setBorder, setBounds, setEnabled, setFocus, setFont, setForegroundColor, setHeight, setHorizontalPosition, setPreferredSize, setPrePainter, setTransparent, setVerticalPosition, setVisible, setVisualInterfaceSupportInfo, setWidth, superGetFont, superGetMinimumSize, superGetPreferredSize, superIsEnabled, superIsVisible, superPaint, superSetBounds, superSetEnabled, superSetFont, superSetVisible, superUpdate
 

Field Detail

RB_KEY

public static final java.lang.String RB_KEY
See Also:
Constant Field Values
Constructor Detail

UpDownListBox

public UpDownListBox()
Default Constructor


UpDownListBox

public UpDownListBox(int rows,
                     boolean multipleMode,
                     Placement buttonPlacement)
Deprecated. UpDownListBox no longer supports the rows option Use UpDownListBox(boolean multipleMode, Placement buttonPlacement)

Create a new UpDownListBox with the specified properties

Parameters:
rows - the number of rows to display
multipleMode - if true, the listbox allows multiple selection
buttonPlacement - where the up/down buttons should be placed.

UpDownListBox

public UpDownListBox(boolean multipleMode,
                     Placement buttonPlacement)
Create a new UpDownListBox with the specified properties

Parameters:
multipleMode - if true, the updownlistbox allows multiple selection
buttonPlacement - where the up/down buttons should be placed.
Method Detail

getDefaultWidth

public static int getDefaultWidth()
Returns the default width for instances of this class

Returns:
the default width in pixels
See Also:
setDefaultWidth(int)

setDefaultWidth

public static void setDefaultWidth(int newDefaultWidth)
Sets the default width of the component. The default width will be used by webAF when creating this component.

Parameters:
newDefaultWidth - the new default width in pixels
See Also:
getDefaultWidth()

getDefaultHeight

public static int getDefaultHeight()
Returns the default height for instances of this class

Returns:
the default height in pixels
See Also:
setDefaultHeight(int)

setDefaultHeight

public static void setDefaultHeight(int newDefaultHeight)
Sets the default height of the component. The default height will be used by webAF when creating this component.

Parameters:
newDefaultHeight - the new default height in pixels
See Also:
getDefaultHeight()

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
Returns the ExtendedBeanInfo for this class.

Returns:
ExtendedBeanInfo for this class

addItemListener

public void addItemListener(java.awt.event.ItemListener listener)
Adds a selection item listener

Specified by:
addItemListener in interface java.awt.ItemSelectable
Parameters:
listener - item Listener

addItems

public void addItems(java.util.Enumeration items)
Adds items to the end of the list if the attached model supports addition of items.

Parameters:
items - items to be added

add

public void add(java.lang.Object item)
Adds an item to the end of the list if the attached model supports addition of items.

Parameters:
items - items to be added

add

public void add(java.lang.Object item,
                int pos)
Adds an item to the end of the list if the attached model supports addition of items.

Parameters:
items - items to be added

add

public void add(java.lang.Object[] items)
Adds items to the end of the list if the attached model supports addition of items.

Parameters:
items - items to be added

add

public void add(java.lang.String item)
Adds an item to the end of the list if the attached model supports addition of items.

Parameters:
item - item to be added

add

public void add(java.lang.String item,
                int pos)
Adds an item at the specified location if the attached model supports addition of items.

Parameters:
item - item to be added
pos - location for adding the item

deselect

public void deselect(int index)
Deselects the item at the specified index

Parameters:
index - postion of the item to deselect

deselectAll

public void deselectAll()
Deselects all items currently selected in the UpDownListBox


findItemByPrefix

public int findItemByPrefix(java.lang.String prefix,
                            int index)
Finds an item in the upDownListBox starting with the specified prefix and starting at the specified location

Parameters:
prefix - specified prefix
index - specified starting location
Returns:
location of the specified prefix (-1 if prefix is not found)

getDisplayTransform

public com.sas.util.transforms.TransformInterface getDisplayTransform()
Returns the display transform.

Returns:
the display transform
See Also:
setDisplayTransform(com.sas.util.transforms.TransformInterface)

getInitialItems

public java.lang.String[] getInitialItems()
Returns the initial items (an empty string array is returned is there are no initial items)

Returns:
initial items
See Also:
setInitialItems(java.lang.String[])

getInputTransform

public com.sas.util.transforms.TransformInterface getInputTransform()
Returns the input transform.

Returns:
the input transform
See Also:
setInputTransform(com.sas.util.transforms.TransformInterface)

getItemCount

public int getItemCount()
Returns the number of items in the list

Returns:
the number of items in the list.

getItems

public java.lang.String[] getItems()
Returns an array containing the items in the upDownListBox (an empty string array is returned is there are no items)

Returns:
items in the upDownListBox

getOutputTransform

public com.sas.util.transforms.TransformInterface getOutputTransform()
Returns the output transform.

Returns:
the output transform
See Also:
setOutputTransform(com.sas.util.transforms.TransformInterface)

getPreferredSize

public java.awt.Dimension getPreferredSize()
Returns the preferred size of the UpDownListBox

Specified by:
getPreferredSize in interface VisualInterface
Overrides:
getPreferredSize in class PanelVisualComponent
Returns:
the Dimensions of the preferred size. If setSize has been called, return a copy of those dimensions.
See Also:
VisualInterface.getPreferredSize()

getRequiredInterfaces

public java.util.Vector getRequiredInterfaces()
Returns the required interfaces Vector for this component.

Specified by:
getRequiredInterfaces in interface com.sas.ViewInterface
Overrides:
getRequiredInterfaces in class PanelVisualComponent
Returns:
the required interfaces Vector for this component.
See Also:
ViewInterface.getRequiredInterfaces()

getSelectedIndex

public int getSelectedIndex()
Returns the value of the selectedIndex property

Returns:
the index of the selected item
See Also:
setSelectedIndex(int)

getSelectedIndexes

public int[] getSelectedIndexes()
Returns the value of the selectedIndexes property

Returns:
the indicies of the selected items
See Also:
setSelectedIndexes(int[])

getSelectedItem

public java.lang.String getSelectedItem()
Returns the value of the selectedItem property

Returns:
the selected item
See Also:
setSelectedItem(java.lang.Object)

getSelectedItems

public java.lang.String[] getSelectedItems()
Returns the value of the selectedItems property

Returns:
the selected items
See Also:
setSelectedItems(java.lang.Object[])

getSelectedObjects

public java.lang.Object[] getSelectedObjects()
Returns the value of the selectedObjects property

Specified by:
getSelectedObjects in interface java.awt.ItemSelectable
Returns:
the selected objects

getSelectionPrefix

public java.lang.String getSelectionPrefix()
Returns the selectionPrefix value. The selection prefix is a "search string" which is used by the findItemByPrefix method.

Returns:
selectionPrefix
See Also:
findItemByPrefix(java.lang.String, int), setSelectionPrefix(java.lang.String)

getVisibleIndex

public int getVisibleIndex()
Returns the index of the item that was last made visible by the method makeVisible.

Returns:
the index of the item that was last made visible.

getVisibleRows

public int getVisibleRows()
Deprecated. UpDownListBox no longer supports this property

Returns the number of visible rows

Returns:
number of visible rows

isKeyboardSelectable

public boolean isKeyboardSelectable()
Returns the value of the keyboardSelectable property. The keyboardSelectable property indicates whether an event is sent whenever a character is typed in the UpDownListBox.

Returns:
value of the keyboardSelectable property
See Also:
setKeyboardSelectable(boolean)

isMultipleMode

public boolean isMultipleMode()
Indicates if the list allows multiple selections.

Returns:
true if multiple selections are allowed
See Also:
setMultipleMode(boolean)

makeVisible

public void makeVisible(int index)
Makes the specified line in the UpDownListBox visible

Parameters:
index - the index of the line to make visible.

remove

public void remove(java.lang.String item)
Removes the first occurrence of item if the attached model supports removal of items.

Parameters:
item - item to be removed

remove

public void remove(java.lang.Object item)
Removes the first occurrence of item if the attached model supports removal of items.

Parameters:
item - item to be removed

remove

public void remove(int position)
Removes an item at the specified position if the attached model supports removal of items.

Overrides:
remove in class Panel
Parameters:
position - index of the item to be removed

removeAll

public void removeAll()
Removes all items from the UpDownListBox. (Note that removeAll is also a Container/Panel method, but it does not apply to UpDownListBox)

Overrides:
removeAll in class Panel

removeItemListener

public void removeItemListener(java.awt.event.ItemListener listener)
Removes a key listener

Specified by:
removeItemListener in interface java.awt.ItemSelectable
Parameters:
listener - keyListener

replaceItem

public void replaceItem(java.lang.String newValue,
                        int index)
Replaces an item if the attached model supports replacement of items.

Parameters:
newValue - replacement text
index - index of the item to be replaced

replaceItem

public void replaceItem(java.lang.Object newValue,
                        int index)
Replaces an item if the attached model supports replacement of items.

Parameters:
newValue - replacement text
index - index of the item to be replaced

select

public void select(int index)
Selects the item corresponding to the specified index

Parameters:
index - the selected item position

selectAll

public void selectAll()
Selects all items in the UpDownListBox


setBackgroundColor

public void setBackgroundColor(java.awt.Color color)
Sets the background color

Specified by:
setBackgroundColor in interface VisualInterface
Overrides:
setBackgroundColor in class PanelVisualComponent
Parameters:
color - color
See Also:
VisualInterface.setBackgroundColor(java.awt.Color)

setBackground

public void setBackground(java.awt.Color color)
Sets the background color

Overrides:
setBackground in class java.awt.Component
Parameters:
color - color

setDisplayTransform

public void setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
Sets the display transform. The display transform is used to transform the data prior to it being displayed.

Parameters:
transform - the new value for the displayTransform property
See Also:
getDisplayTransform()

setForeground

public void setForeground(java.awt.Color color)
Sets the background color

Overrides:
setForeground in class java.awt.Component
Parameters:
color - color

setInputTransform

public void setInputTransform(com.sas.util.transforms.TransformInterface transform)
Sets the input Transform. The inputTransform is used to transform the input to methods of the UpDownListBox to the objects that are in the model.

Parameters:
the - new value for the inputTransform property
See Also:
getInputTransform()

setInitialItems

public void setInitialItems(java.lang.String[] initialItems)
Sets the initialItems on the UpDownListBox. This sets the items on the defaultModel and will attach the defaultModel if it is not already attached. The items will all be transformed using the inputTransform before being added to the model.

Parameters:
items - items to add to the defaultModel
See Also:
getInitialItems()

setItems

public void setItems(java.lang.String[] items)
Sets the items in the UpDownListBox.

Parameters:
items - an array of elements to set the UpDownListBox with

setKeyboardSelectable

public void setKeyboardSelectable(boolean state)
Sets the value of the keyboardSelectable property. The keyboardSelectable property indicates whether an event is sent whenever a character is typed in the UpDownListBox. In order to be set to true, the multipleMode property must be false. If any of the items in the UpDownListbox begin with the character typed in the UpDownListBox, the item will be selected.

Parameters:
state - boolean value

setMultipleMode

public void setMultipleMode(boolean state)
Sets whether this list allows multiple selections.

Parameters:
state - if true then multiple selections are allowed; otherwise, only one item can be selected at a time.
See Also:
isMultipleMode()

setMultipleSelectionStyle

public void setMultipleSelectionStyle(int style)
Sets the multipleSelectionStyle(STANDARD_AWT or EXTENDED_SELECT). Specifying any other value will result in a java.lang.IllegalArgumentException to be thrown. The multipleMode property must be set to true in order for the multipleSelectionStyle to be honored.

Parameters:
style - multipleSelectionStyle (STANDARD_AWT (0) or EXTENDED_SELECT (1)).
Throws:
java.lang.IllegalArgumentException

setOutputTransform

public void setOutputTransform(com.sas.util.transforms.TransformInterface transform)
Sets the output Transform. The outputTransform is used to transform the output from methods of the ListBox from the objects that are in the model.

Parameters:
transform - the new value for the outputTransform property
See Also:
getOutputTransform()

setSelectedIndex

public void setSelectedIndex(int index)
Selects the item corresponding to the specified index

Parameters:
index - position of the selected item
See Also:
getSelectedIndex()

setSelectedIndexes

public void setSelectedIndexes(int[] indexes)
Selects items by specifying a set of item indices

Parameters:
indexes - the indicies of the selected items
See Also:
getSelectedIndexes()

setSelectedItem

public void setSelectedItem(java.lang.Object text)
Sets the selected item to the specified object. If more than one item matches the specified object, the one with the smallest index is selected.

Parameters:
text - the string to select

setSelectedItem

public void setSelectedItem(java.lang.String text)
Sets the selected item to the specified string. If more than one item matches the specified string, the one with the smallest index is selected.

Parameters:
text - the string to select
See Also:
getSelectedItem()

setSelectedItems

public void setSelectedItems(java.lang.Object[] items)
Sets the selected items to the specified objects.

Parameters:
items - an array of Objects to select

setSelectedItems

public void setSelectedItems(java.lang.String[] items)
Sets the selected items to the specified strings.

Parameters:
items - an array of Strings to select
See Also:
getSelectedItems()

setSelectionPrefix

public void setSelectionPrefix(java.lang.String prefix)
Sets the selection prefix. The selection prefix is a "search string" which is used by the findItemByPrefix method.

Parameters:
prefix - selection prefix
See Also:
findItemByPrefix(java.lang.String, int), getSelectionPrefix()

setSize

public void setSize(java.awt.Dimension d)
Sets the component size

Overrides:
setSize in class java.awt.Component
Parameters:
size - new size

setSpinButtonVisible

public void setSpinButtonVisible(boolean bool)
Sets the value of the the spinButtonVisible property. The spinButtonVisible property indicates whether the spinButton should be displayed or hidden.

Parameters:
bool - boolean that indicates whether to show the spinButton or not

isSpinButtonVisible

public boolean isSpinButtonVisible()

setVisibleRows

public void setVisibleRows(int rows)
Deprecated. UpDownListBox no longer supports this property

Sets the number of visible rows Setting the number of visible rows to a value less than 0 will be ignored.

Parameters:
rows - number of visible rows

getButtonPlacement

public Placement getButtonPlacement()
Returns the spin button location

Returns:
spin button location

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Invoke processItemEvent to process item events

Specified by:
itemStateChanged in interface java.awt.event.ItemListener
Parameters:
e - ItemEvent

isDefaultModelAttached

public boolean isDefaultModelAttached()
Returns whether the default model is attached.

Specified by:
isDefaultModelAttached in interface com.sas.ViewDefaultModelInterface
Returns:
whether the default model is attached.

processItemEvent

protected void processItemEvent(java.awt.event.ItemEvent e)
Processes item events occurring on this component.Subclasses should always call super so that events are delivered to any ItemListeners. NOTE: This method will not be called unless item events are enabled for this component; this happens when one of the following occurs: a) An ItemListener object is registered via addItemListener() b) Item events are enabled via enableEvents()

Parameters:
e - the item event
See Also:
Component.enableEvents(long)

preview

public void preview()
Adds descriptive items to the UpDownListBox at design time. This is not called at runtime.


refresh

public void refresh()
Refreshes the component.


refresh

public void refresh(com.sas.ModelInterface model)
Refreshes the component after an attachModel call

Specified by:
refresh in interface com.sas.ViewInterface
Overrides:
refresh in class PanelVisualComponent
Parameters:
model - attached model
See Also:
ViewInterface.refresh(com.sas.ModelInterface)

setButtonPlacement

public void setButtonPlacement(Placement buttonPlacement)
Set the spin button location

Parameters:
buttonPlacement - spin button location

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Called whenever one of the pushbuttons has been clicked and performs an action based on whichever pushbutton was clicked.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the action event.

attachModel

public void attachModel(com.sas.ModelInterface model)
Attaches a model to the component.

Specified by:
attachModel in interface com.sas.ViewInterface
Overrides:
attachModel in class PanelVisualComponent
Parameters:
model - model to attach
See Also:
ViewInterface.attachModel(com.sas.ModelInterface)

contentsChanged

public void contentsChanged(com.sas.collection.ContentsChangedEvent event)
Called when the contents of the Model have changed.

Specified by:
contentsChanged in interface com.sas.collection.ContentsChangedListener
Parameters:
event - ContentsChangedEvent from the Model

detachModel

public void detachModel(com.sas.ModelInterface model)
Detaches the current model and attaches the default model if the model is set to null

Specified by:
detachModel in interface com.sas.ViewInterface
Overrides:
detachModel in class PanelVisualComponent
Parameters:
model - Model to detach
See Also:
ViewInterface.detachModel(com.sas.ModelInterface)

dragOver

public int dragOver(java.awt.Point point,
                    int representation,
                    int keyState,
                    java.util.Vector data)
Override the dragOver method of com.sas.awt.Panel. Do not allow Viewers and Components to be dropped on the UpDownListBox. If anything else is dragged onto the UpDownListBox, let the container handle it.

Specified by:
dragOver in interface ContainerInterface
Specified by:
dragOver in interface com.sas.DesignTimeDropTargetInterface
Overrides:
dragOver in class PanelContainerComponent
Parameters:
point - The x/y coordinates of the mouse cursor inside the component.
representation - One of com.sas.DesignTimeDropResult.{representationComponent,representationModel,representationAttribute,representationViewer}
keyState - Unused.
data - A Vector containing information about the drag.
Returns:
One of com.sas.DesignTimeDropResult.{dragIndeterminate,dragMove,dragCopy,dragLink,dragNone}
See Also:
DesignTimeDropTargetInterface.dragOver(java.awt.Point, int, int, java.util.Vector)

getModelInterface

public com.sas.ModelInterface getModelInterface()
Returns the specified Model attached to this client.

Specified by:
getModelInterface in interface com.sas.ViewInterface
Overrides:
getModelInterface in class PanelVisualComponent
Returns:
model attached to this client
See Also:
ViewInterface.getModelInterface()

initialize

public void initialize()
Initializes the component.

Specified by:
initialize in interface com.sas.ComponentInterface
Overrides:
initialize in class PanelVisualComponent
See Also:
ComponentInterface.initialize()

moveSelection

public void moveSelection(int offset)
Moves the selected item(s) up or down. This works whether there are one or many selected items.

Parameters:
offset - how much to move the selections. negative values move towards the top of the list box; positive values towards the bottom.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent event)
Processes a PropertyChangeEvent sent by the model.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Overrides:
propertyChange in class PanelVisualComponent
Parameters:
e - The event from the model indicating what property changed
See Also:
PropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)

setDefaultValues

public void setDefaultValues()
Sets the initial values to the default values. This method is called by the Component constructors. The setDefaultValues method of each class is responsible for setting its own initial values.

Specified by:
setDefaultValues in interface ContainerInterface
Specified by:
setDefaultValues in interface VisualInterface
Specified by:
setDefaultValues in interface com.sas.ComponentInterface
Overrides:
setDefaultValues in class CompositePanel
See Also:
ContainerInterface.setDefaultValues()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.