|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JList
|
+--arlut.csd.JDataComponent.JstringListBox
A sorted listbox that handles listHandle's.
JstringListBox supports pop-up menus and uses the
Invid,
listHandle,
StringSelector,
JsetValueCallback,
Serialized Form| Field Summary | |
(package private) arlut.csd.JDataComponent.JsetValueCallback |
callback
The callback we'l use to report user activities. |
(package private) arlut.csd.Util.Compare |
comparator
The comparator to use for putting items in sort order if the JstringListBox was most recently with sorting request. |
(package private) static boolean |
debug
|
private boolean |
doSort
If true, the JstringListBox will sort items. |
private int |
dragNode
|
private boolean |
dragOk
If true, this JstringListBox will allow nodes to be dragged up and down in the list. |
(package private) java.lang.String |
maxWidthString
The default maximum width string |
(package private) javax.swing.DefaultListModel |
model
|
(package private) javax.swing.JPopupMenu |
popup
The popup menu to be displayed on right-click. |
(package private) int |
popUpIndex
|
private int |
startDragIndex
|
(package private) int |
width
|
| Fields inherited from class javax.swing.JList |
HORIZONTAL_WRAP, VERTICAL, VERTICAL_WRAP |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
JstringListBox()
Default Constructor |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
For the pop up menu callback. |
void |
addItem(java.lang.Object o)
Add an item to the list box. |
int |
compare(java.lang.Object a,
java.lang.Object b)
Default comparator, does a string comparison on the toString() output of the objects for ordering. |
boolean |
containsItem(java.lang.Object o)
Returns true if the item is in the list |
boolean |
containsLabel(java.lang.String string)
Returns true if the list contains an object with the specified label. |
boolean |
containsString(java.lang.String string)
Returns true if the list contains an object with the specified label. |
java.util.Vector |
getHandles()
Returns all handles |
arlut.csd.JDataComponent.listHandle |
getSelectedHandle()
This returns the whole listHandle. |
java.util.Vector |
getSelectedHandles()
Returns all the selected handles. |
java.lang.Object |
getSelectedItem()
This returns the object, without the label. |
java.lang.String |
getSelectedLabel()
This returns just the label. |
int |
getSizeOfList()
|
void |
insertHandleAt(arlut.csd.JDataComponent.listHandle handle,
int row)
Use this one to skip the sorting. |
void |
load(java.util.Vector items,
int width,
boolean sort,
arlut.csd.Util.Compare comparator)
This method loads a Vector of items into this list box. |
void |
mouseClicked(java.awt.event.MouseEvent e)
For the MouseListener interface |
void |
mouseDragged(java.awt.event.MouseEvent e)
For the MouseMotionListener interface |
void |
mouseEntered(java.awt.event.MouseEvent e)
For the MouseListener interface |
void |
mouseExited(java.awt.event.MouseEvent e)
For the MouseListener interface |
void |
mouseMoved(java.awt.event.MouseEvent e)
For the MouseMotionListener interface |
void |
mousePressed(java.awt.event.MouseEvent e)
For the mouseListener interface |
void |
mouseReleased(java.awt.event.MouseEvent e)
For the MouseListener interface |
void |
moveItem(int sourceRow,
int targetRow)
This method moves an item around in the list. |
void |
registerPopupMenu(javax.swing.JPopupMenu popup)
This method associates a node-linked popup menu to this listbox. |
void |
removeItem(java.lang.Object o)
Remove an item from list. |
void |
removeLabel(java.lang.String s)
Remove an object by label |
void |
setCallback(arlut.csd.JDataComponent.JsetValueCallback callback)
Connects this JstringListBox to an implementaton of the JsetValueCallback interface
in order to provide live notification of changes performed by the user. |
void |
setCellWidth(int width)
This method sets the default cell width for this list. |
void |
setCellWidth(java.lang.String template)
This method sets the default cell width for this list. |
void |
setDragEnabled(boolean dragOk)
This method enables and disables item dragging in this list. |
void |
setSelected(java.lang.Object o)
Sets the selected item. |
void |
setSelectedLabel(java.lang.String s)
This selects the item with the given label. |
void |
setSelectedLabel(java.lang.String s,
boolean ensureVisible)
This selects the item with the given label. |
void |
setSize(int size)
Convenience method to set the size on the model. |
void |
valueChanged(javax.swing.event.ListSelectionEvent e)
For the ListSelectionListener |
| Methods inherited from class javax.swing.JList |
addListSelectionListener, addSelectionInterval, clearSelection, createSelectionModel, ensureIndexIsVisible, fireSelectionValueChanged, getAccessibleContext, getAnchorSelectionIndex, getCellBounds, getCellRenderer, getDragEnabled, getFirstVisibleIndex, getFixedCellHeight, getFixedCellWidth, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getModel, getNextMatch, getPreferredScrollableViewportSize, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndex, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionMode, setSelectionModel, setUI, setValueIsAdjusting, setVisibleRowCount, updateUI |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
static final boolean debug
int width
int popUpIndex
javax.swing.DefaultListModel model
private boolean dragOk
If true, this JstringListBox will allow nodes to be dragged up and down in the list.
private boolean doSort
If true, the JstringListBox will sort items. This variable is set
by the value of the sort parameter in the most recent
load()
call.
arlut.csd.JDataComponent.JsetValueCallback callback
The callback we'l use to report user activities.
javax.swing.JPopupMenu popup
The popup menu to be displayed on right-click.
private int startDragIndex
private int dragNode
arlut.csd.Util.Compare comparator
The comparator to use for putting items in sort order if the JstringListBox was most recently with sorting request.
java.lang.String maxWidthString
The default maximum width string
| Constructor Detail |
public JstringListBox()
| Method Detail |
public void registerPopupMenu(javax.swing.JPopupMenu popup)
This method associates a node-linked popup menu to this listbox.
public void load(java.util.Vector items,
int width,
boolean sort,
arlut.csd.Util.Compare comparator)
This method loads a Vector of items into this
list box. Elements of the items Vector may
be Strings or listHandle
objects.
If sort is true, the items will be sorted in display order before being loaded into this list box.
Any values previously in the list box will be removed.
items - A Vector of Strings or listHandleswidth - If less than zero, the listbox's cell width will
be left unchanged. If set to zero, the listbox's cell width will
be calculated based on the longest string in the items Vector. If
greater than zero, the cell width will be set to <width> columns
wide.sort - If true, the items Vector will be sorted in place before
being set into the listbox.comparator - Typically an instance of an inner class that implements
the arlut.csd.Util.Compare interface, used to guide the sort process. If this
is null, the sort will be performed using a normal string ordering sort.public void setCellWidth(int width)
This method sets the default cell width for this list.
public void setCellWidth(java.lang.String template)
This method sets the default cell width for this list.
public void setDragEnabled(boolean dragOk)
This method enables and disables item dragging in this list.
setDragEnabled in class javax.swing.JListpublic void setSize(int size)
public void setCallback(arlut.csd.JDataComponent.JsetValueCallback callback)
Connects this JstringListBox to an implementaton of the
JsetValueCallback interface
in order to provide live notification of changes performed by the user. The
JsetValueCallback implementation is given the opportunity to approve any change
made by the user before the GUI is updated to show the change. The JsetValueCallback
interface is also used to pass pop-up menu commands to the client.
JstringListBox uses the following value type constants from
JValueObject to pass status updates to
the callback.
JsetValueCallback,
JValueObjectpublic void addItem(java.lang.Object o)
o - Can be a String or listHandle.
public void moveItem(int sourceRow,
int targetRow)
This method moves an item around in the list.
public void insertHandleAt(arlut.csd.JDataComponent.listHandle handle,
int row)
public void removeItem(java.lang.Object o)
o - can be listHandle or Stringpublic void removeLabel(java.lang.String s)
s - Label of object to remove.public int getSizeOfList()
public boolean containsLabel(java.lang.String string)
public boolean containsString(java.lang.String string)
public boolean containsItem(java.lang.Object o)
o - Can be a String(label) or listHandlepublic void setSelectedLabel(java.lang.String s)
public void setSelectedLabel(java.lang.String s,
boolean ensureVisible)
public void setSelected(java.lang.Object o)
o - Can be listHandle or Stringpublic java.lang.String getSelectedLabel()
public arlut.csd.JDataComponent.listHandle getSelectedHandle()
public java.util.Vector getSelectedHandles()
public java.util.Vector getHandles()
public java.lang.Object getSelectedItem()
public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged in interface javax.swing.event.ListSelectionListenerpublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListener
public int compare(java.lang.Object a,
java.lang.Object b)
Default comparator, does a string comparison on the toString() output of the objects for ordering.
compare in interface Compare
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||