|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.visuals.UpDownListBox
public class UpDownListBox
UpDownListBox
presents a
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:
ListBox
Placement.TOP
Placement.BOTTOM
Placement.LEFTSIDE_TOP
Placement.LEFTSIDE_BOTTOM
Placement.RIGHTSIDE_TOP
Placement.RIGHTSIDE_BOTTOM
Placement.TOP_LEFT
Placement.TOP_RIGHT
Placement.BOTTOM_LEFT
Placement.BOTTOM_RIGHT
Placement.LEFTSIDE_CENTER
Placement.RIGHTSIDE_CENTER
setButtonPlacement(Placement buttonPlacement)
method. The default placement
is Placement.RIGHTSIDE_BOTTOM
.
multipleMode
property to
true
will allow more than one item to be selected. The multipleMode
property is initially set to false.
UpDownListBox
UpDownListBox upDownListBox1 = new UpDownListBox(); upDownListBox1.initialize();
UpDownListBox
with
the specified value of the multipleMode property and a specific button placement:
UpDownListBox upDownListBox1 = new UpDownListBox( true, Placement.TOP_LEFT); upDownListBox1.initialize();
ListBox
ListBox
ListBox
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 interface com.sas.awt.ContainerInterface |
---|
getComponents, getLayout, invalidate, setLayout, validate |
Field Detail |
---|
public static final java.lang.String RB_KEY
Constructor Detail |
---|
public UpDownListBox()
public UpDownListBox(int rows, boolean multipleMode, Placement buttonPlacement)
rows
- the number of rows to displaymultipleMode
- if true, the listbox allows multiple selectionbuttonPlacement
- where the up/down buttons should be placed.public UpDownListBox(boolean multipleMode, Placement buttonPlacement)
multipleMode
- if true, the updownlistbox allows multiple selectionbuttonPlacement
- where the up/down buttons should be placed.Method Detail |
---|
public static int getDefaultWidth()
setDefaultWidth(int)
public static void setDefaultWidth(int newDefaultWidth)
newDefaultWidth
- the new default width in pixelsgetDefaultWidth()
public static int getDefaultHeight()
setDefaultHeight(int)
public static void setDefaultHeight(int newDefaultHeight)
newDefaultHeight
- the new default height in pixelsgetDefaultHeight()
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
public void addItemListener(java.awt.event.ItemListener listener)
addItemListener
in interface java.awt.ItemSelectable
listener
- item Listenerpublic void addItems(java.util.Enumeration items)
items
- items to be addedpublic void add(java.lang.Object item)
items
- items to be addedpublic void add(java.lang.Object item, int pos)
items
- items to be addedpublic void add(java.lang.Object[] items)
items
- items to be addedpublic void add(java.lang.String item)
item
- item to be addedpublic void add(java.lang.String item, int pos)
item
- item to be addedpos
- location for adding the itempublic void deselect(int index)
index
- postion of the item to deselectpublic void deselectAll()
public int findItemByPrefix(java.lang.String prefix, int index)
prefix
- specified prefixindex
- specified starting location
public com.sas.util.transforms.TransformInterface getDisplayTransform()
setDisplayTransform(com.sas.util.transforms.TransformInterface)
public java.lang.String[] getInitialItems()
setInitialItems(java.lang.String[])
public com.sas.util.transforms.TransformInterface getInputTransform()
setInputTransform(com.sas.util.transforms.TransformInterface)
public int getItemCount()
public java.lang.String[] getItems()
public com.sas.util.transforms.TransformInterface getOutputTransform()
setOutputTransform(com.sas.util.transforms.TransformInterface)
public java.awt.Dimension getPreferredSize()
getPreferredSize
in interface VisualInterface
getPreferredSize
in class PanelVisualComponent
VisualInterface.getPreferredSize()
public java.util.Vector getRequiredInterfaces()
getRequiredInterfaces
in interface com.sas.ViewInterface
getRequiredInterfaces
in class PanelVisualComponent
ViewInterface.getRequiredInterfaces()
public int getSelectedIndex()
setSelectedIndex(int)
public int[] getSelectedIndexes()
setSelectedIndexes(int[])
public java.lang.String getSelectedItem()
setSelectedItem(java.lang.Object)
public java.lang.String[] getSelectedItems()
setSelectedItems(java.lang.Object[])
public java.lang.Object[] getSelectedObjects()
getSelectedObjects
in interface java.awt.ItemSelectable
public java.lang.String getSelectionPrefix()
findItemByPrefix(java.lang.String, int)
,
setSelectionPrefix(java.lang.String)
public int getVisibleIndex()
public int getVisibleRows()
public boolean isKeyboardSelectable()
setKeyboardSelectable(boolean)
public boolean isMultipleMode()
setMultipleMode(boolean)
public void makeVisible(int index)
index
- the index of the line to make visible.public void remove(java.lang.String item)
item
- item to be removedpublic void remove(java.lang.Object item)
item
- item to be removedpublic void remove(int position)
remove
in class Panel
position
- index of the item to be removedpublic void removeAll()
removeAll
in class Panel
public void removeItemListener(java.awt.event.ItemListener listener)
removeItemListener
in interface java.awt.ItemSelectable
listener
- keyListenerpublic void replaceItem(java.lang.String newValue, int index)
newValue
- replacement textindex
- index of the item to be replacedpublic void replaceItem(java.lang.Object newValue, int index)
newValue
- replacement textindex
- index of the item to be replacedpublic void select(int index)
index
- the selected item positionpublic void selectAll()
public void setBackgroundColor(java.awt.Color color)
setBackgroundColor
in interface VisualInterface
setBackgroundColor
in class PanelVisualComponent
color
- colorVisualInterface.setBackgroundColor(java.awt.Color)
public void setBackground(java.awt.Color color)
setBackground
in class java.awt.Component
color
- colorpublic void setDisplayTransform(com.sas.util.transforms.TransformInterface transform)
transform
- the new value for the displayTransform propertygetDisplayTransform()
public void setForeground(java.awt.Color color)
setForeground
in class java.awt.Component
color
- colorpublic void setInputTransform(com.sas.util.transforms.TransformInterface transform)
the
- new value for the inputTransform propertygetInputTransform()
public void setInitialItems(java.lang.String[] initialItems)
items
- items to add to the defaultModelgetInitialItems()
public void setItems(java.lang.String[] items)
items
- an array of elements to set the UpDownListBox withpublic void setKeyboardSelectable(boolean state)
state
- boolean valuepublic void setMultipleMode(boolean state)
state
- if true then multiple selections are allowed;
otherwise, only one item can be selected at a time.isMultipleMode()
public void setMultipleSelectionStyle(int style)
style
- multipleSelectionStyle (STANDARD_AWT (0) or EXTENDED_SELECT (1)).
java.lang.IllegalArgumentException
public void setOutputTransform(com.sas.util.transforms.TransformInterface transform)
transform
- the new value for the outputTransform propertygetOutputTransform()
public void setSelectedIndex(int index)
index
- position of the selected itemgetSelectedIndex()
public void setSelectedIndexes(int[] indexes)
indexes
- the indicies of the selected itemsgetSelectedIndexes()
public void setSelectedItem(java.lang.Object text)
text
- the string to selectpublic void setSelectedItem(java.lang.String text)
text
- the string to selectgetSelectedItem()
public void setSelectedItems(java.lang.Object[] items)
items
- an array of Objects to selectpublic void setSelectedItems(java.lang.String[] items)
items
- an array of Strings to selectgetSelectedItems()
public void setSelectionPrefix(java.lang.String prefix)
prefix
- selection prefixfindItemByPrefix(java.lang.String, int)
,
getSelectionPrefix()
public void setSize(java.awt.Dimension d)
setSize
in class java.awt.Component
size
- new sizepublic void setSpinButtonVisible(boolean bool)
bool
- boolean that indicates whether to show the spinButton or notpublic boolean isSpinButtonVisible()
public void setVisibleRows(int rows)
rows
- number of visible rowspublic Placement getButtonPlacement()
public void itemStateChanged(java.awt.event.ItemEvent e)
itemStateChanged
in interface java.awt.event.ItemListener
e
- ItemEventpublic boolean isDefaultModelAttached()
isDefaultModelAttached
in interface com.sas.ViewDefaultModelInterface
protected void processItemEvent(java.awt.event.ItemEvent e)
e
- the item eventComponent.enableEvents(long)
public void preview()
public void refresh()
public void refresh(com.sas.ModelInterface model)
refresh
in interface com.sas.ViewInterface
refresh
in class PanelVisualComponent
model
- attached modelViewInterface.refresh(com.sas.ModelInterface)
public void setButtonPlacement(Placement buttonPlacement)
buttonPlacement
- spin button locationpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- the action event.public void attachModel(com.sas.ModelInterface model)
attachModel
in interface com.sas.ViewInterface
attachModel
in class PanelVisualComponent
model
- model to attachViewInterface.attachModel(com.sas.ModelInterface)
public void contentsChanged(com.sas.collection.ContentsChangedEvent event)
contentsChanged
in interface com.sas.collection.ContentsChangedListener
event
- ContentsChangedEvent from the Modelpublic void detachModel(com.sas.ModelInterface model)
detachModel
in interface com.sas.ViewInterface
detachModel
in class PanelVisualComponent
model
- Model to detachViewInterface.detachModel(com.sas.ModelInterface)
public int dragOver(java.awt.Point point, int representation, int keyState, java.util.Vector data)
dragOver
in interface ContainerInterface
dragOver
in interface com.sas.DesignTimeDropTargetInterface
dragOver
in class PanelContainerComponent
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.
DesignTimeDropTargetInterface.dragOver(java.awt.Point, int, int, java.util.Vector)
public com.sas.ModelInterface getModelInterface()
getModelInterface
in interface com.sas.ViewInterface
getModelInterface
in class PanelVisualComponent
ViewInterface.getModelInterface()
public void initialize()
initialize
in interface com.sas.ComponentInterface
initialize
in class PanelVisualComponent
ComponentInterface.initialize()
public void moveSelection(int offset)
offset
- how much to move the selections.
negative values move towards the top of the list box;
positive values towards the bottom.public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange
in interface java.beans.PropertyChangeListener
propertyChange
in class PanelVisualComponent
e
- The event from the model indicating what property changedPropertyChangeListener.propertyChange(java.beans.PropertyChangeEvent)
public void setDefaultValues()
setDefaultValues
in interface ContainerInterface
setDefaultValues
in interface VisualInterface
setDefaultValues
in interface com.sas.ComponentInterface
setDefaultValues
in class CompositePanel
ContainerInterface.setDefaultValues()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |