|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.swing.visuals.dualselector.JListDualSelectorAdapter
public class JListDualSelectorAdapter
JListDualSelectorAdapter is a class that supports using a JList in a dual selector.
| Field Summary | |
|---|---|
protected javax.swing.JList |
component
The JList component that's being adapted |
protected javax.swing.JScrollPane |
containerComponent
a scrollpane for the JList component |
java.awt.dnd.DragSource |
dragSource
enables this component to be a Drag Source |
java.awt.dnd.DropTarget |
dropTarget
enables this component to be a dropTarget |
protected javax.swing.JComponent |
parentSelector
the parent component |
| Constructor Summary | |
|---|---|
JListDualSelectorAdapter(javax.swing.JComponent parent)
Default constructor. |
|
JListDualSelectorAdapter(javax.swing.JList list,
javax.swing.JComponent parent)
Constructor method that takes a JList instance for use in the component. |
|
| Method Summary | |
|---|---|
void |
addItems(java.util.List newItems)
Adds the items to the component. |
boolean |
canMove(int[] indices,
int offset)
Determines whether a particular move is allowed. |
void |
clearSelections()
Clears the selections made on the component. |
void |
dragDropEnd(java.awt.dnd.DragSourceDropEvent event)
this message goes to DragSourceListener, informing it that the dragging has ended |
void |
dragEnter(java.awt.dnd.DragSourceDragEvent event)
this message goes to DragSourceListener, informing it that the dragging has entered the DropSite |
void |
dragEnter(java.awt.dnd.DropTargetDragEvent event)
is invoked when you are dragging over the DropSite |
void |
dragExit(java.awt.dnd.DragSourceEvent event)
this message goes to DragSourceListener, informing it that the dragging has exited the DropSite |
void |
dragExit(java.awt.dnd.DropTargetEvent event)
is invoked when you are exit the DropSite without dropping |
void |
dragGestureRecognized(java.awt.dnd.DragGestureEvent event)
a drag gesture has been initiated |
void |
dragOver(java.awt.dnd.DragSourceDragEvent event)
this message goes to DragSourceListener, informing it that the dragging is currently ocurring over the DropSite |
void |
dragOver(java.awt.dnd.DropTargetDragEvent event)
is invoked when a drag operation is going on |
void |
drop(java.awt.dnd.DropTargetDropEvent event)
a drop has occurred |
void |
dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
is invoked when the user changes the dropAction |
void |
dropActionChanged(java.awt.dnd.DropTargetDragEvent event)
is invoked if the use modifies the current drop gesture |
java.util.List |
getAllItems()
Returns all items in the component. |
java.util.List |
getAllMoveableItems()
Returns all of the items that are moveable based on the status of the movement control options. |
javax.swing.JComponent |
getComponent()
Returns the actual component. |
javax.swing.JComponent |
getContainerComponent()
Returns the container component. |
int |
getCount()
Returns the number of items in the component. |
int |
getLastSelectedIndex()
Returns the index of the last item selected. |
int |
getSelectedCount()
Returns the number of selected items in the component. |
int[] |
getSelectedIndices()
Returns the indices of the selected items. |
java.util.List |
getSelectedItems()
Returns the user selected items. |
boolean |
isInAdapter(java.lang.Object item)
Returns true if the item is a member of the adapter model. |
boolean |
isSelectedIndex(int index)
Returns whether the supplied index is selected. |
void |
moveItems(int[] selectedIndices,
int offset)
Performs the actual movement of the items within the list. |
void |
removeItems(java.util.List removeItems)
Removes the items from the component. |
void |
setSelectedIndex(int index)
Selects the item at the specified index. |
| Field Detail |
|---|
protected javax.swing.JList component
protected javax.swing.JScrollPane containerComponent
protected javax.swing.JComponent parentSelector
public java.awt.dnd.DropTarget dropTarget
public java.awt.dnd.DragSource dragSource
| Constructor Detail |
|---|
public JListDualSelectorAdapter(javax.swing.JComponent parent)
parent - this class' parent component
public JListDualSelectorAdapter(javax.swing.JList list,
javax.swing.JComponent parent)
list - a JList instanceparent - this class' parent component| Method Detail |
|---|
public void clearSelections()
clearSelections in interface DualSelectorInterfacepublic int getCount()
getCount in interface DualSelectorInterfacepublic int getSelectedCount()
getSelectedCount in interface DualSelectorInterfacepublic int getLastSelectedIndex()
getLastSelectedIndex in interface DualSelectorInterfacepublic void setSelectedIndex(int index)
setSelectedIndex in interface DualSelectorInterfaceindex - the index of the item to be selectedpublic javax.swing.JComponent getComponent()
getComponent in interface DualSelectorInterfacepublic javax.swing.JComponent getContainerComponent()
getContainerComponent in interface DualSelectorInterfacepublic java.util.List getSelectedItems()
getSelectedItems in interface DualSelectorInterfacepublic java.util.List getAllItems()
getAllItems in interface DualSelectorInterfacepublic java.util.List getAllMoveableItems()
getAllMoveableItems in interface DualSelectorInterfacepublic void addItems(java.util.List newItems)
addItems in interface DualSelectorInterfacenewItems - the items to be added.public void removeItems(java.util.List removeItems)
removeItems in interface DualSelectorInterfaceremoveItems - items to be removed from the componentpublic boolean isInAdapter(java.lang.Object item)
isInAdapter in interface DualSelectorInterfaceitem - the object to be checked
public int[] getSelectedIndices()
getSelectedIndices in interface DualSelectorUpDownInterface
public void moveItems(int[] selectedIndices,
int offset)
moveItems in interface DualSelectorUpDownInterfaceselectedIndices - the indices of the selected itemsoffset - the direction to move items. 1 is up and -1 is down.public boolean isSelectedIndex(int index)
isSelectedIndex in interface DualSelectorUpDownInterfaceindex - the item index to check
public boolean canMove(int[] indices,
int offset)
canMove in interface DualSelectorUpDownInterfaceindices - the indices of the items to be movedoffset - the number of places to move the items
public void dragEnter(java.awt.dnd.DropTargetDragEvent event)
dragEnter in interface java.awt.dnd.DropTargetListenerevent - the drag eventpublic void dragExit(java.awt.dnd.DropTargetEvent event)
dragExit in interface java.awt.dnd.DropTargetListenerevent - the drop eventpublic void dragOver(java.awt.dnd.DropTargetDragEvent event)
dragOver in interface java.awt.dnd.DropTargetListenerevent - the drag eventpublic void drop(java.awt.dnd.DropTargetDropEvent event)
drop in interface java.awt.dnd.DropTargetListenerevent - the drop eventpublic void dropActionChanged(java.awt.dnd.DropTargetDragEvent event)
dropActionChanged in interface java.awt.dnd.DropTargetListenerpublic void dragGestureRecognized(java.awt.dnd.DragGestureEvent event)
dragGestureRecognized in interface java.awt.dnd.DragGestureListenerpublic void dragDropEnd(java.awt.dnd.DragSourceDropEvent event)
dragDropEnd in interface java.awt.dnd.DragSourceListenerpublic void dragEnter(java.awt.dnd.DragSourceDragEvent event)
dragEnter in interface java.awt.dnd.DragSourceListenerpublic void dragExit(java.awt.dnd.DragSourceEvent event)
dragExit in interface java.awt.dnd.DragSourceListenerpublic void dragOver(java.awt.dnd.DragSourceDragEvent event)
dragOver in interface java.awt.dnd.DragSourceListenerpublic void dropActionChanged(java.awt.dnd.DragSourceDragEvent event)
dropActionChanged in interface java.awt.dnd.DragSourceListener
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||