|
||||||||||
| 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.JPanel
|
+--arlut.csd.JDataComponent.StringSelector
A two-paneled GUI component for adding or removing strings and/or labeled objects from a list, with an optional list of available strings and/or objects to choose from.
StringSelector consists of one or (optionally) two JstringListBox panels and
allows the user to move values back and forth between the two
panels. Pop-up menus can be attached to each panel, allowing the
user to command the client to view or edit objects referenced in
either panel. Objects in both panels are sorted alphabetically by
label.
The setCallback() method takes an object implementing 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,
JsetValueCallback,
Serialized Form| Field Summary | |
(package private) javax.swing.JButton |
add
|
(package private) javax.swing.JButton |
addCustom
|
private boolean |
canChoose
|
(package private) arlut.csd.JDataComponent.JstringField |
custom
|
(package private) static boolean |
debug
|
private boolean |
editable
|
(package private) arlut.csd.JDataComponent.JstringListBox |
in
|
(package private) javax.swing.JPanel |
inPanel
|
(package private) javax.swing.JButton |
inTitle
|
private boolean |
mustChoose
|
(package private) arlut.csd.JDataComponent.JsetValueCallback |
my_callback
|
(package private) java.lang.String |
org_in
|
(package private) java.lang.String |
org_out
|
(package private) arlut.csd.JDataComponent.JstringListBox |
out
|
(package private) javax.swing.JPanel |
outPanel
|
(package private) javax.swing.JButton |
outTitle
|
(package private) java.awt.Container |
parent
|
(package private) javax.swing.JButton |
remove
|
| Fields inherited from class javax.swing.JPanel |
|
| 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 | |
StringSelector(java.awt.Container parent,
boolean editable,
boolean canChoose,
boolean mustChoose)
Fully specified Constructor for StringSelector |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
This method handles events from the Add and Remove buttons, and from hitting enter/loss of focus in the custom JstringField. |
(package private) void |
addItem()
Internal method to move item from out to in |
void |
addNewItem(java.lang.Object item,
boolean ShouldBeIn)
Add a new item to the StringSelector. |
java.util.Vector |
getChosenHandles()
Returns a Vector of listHandle
objects corresponding to the currently selected members. |
java.util.Vector |
getChosenStrings()
Returns a Vector of Strings corresponding to the currently selected members. |
boolean |
isEditable()
Returns true if this StringSelector is editable. |
static void |
main(java.lang.String[] args)
|
(package private) void |
putItemIn(arlut.csd.JDataComponent.listHandle item)
this actually does the inserting |
(package private) void |
removeItem()
internal method to move item from in to out |
void |
setButtonText(java.lang.String text)
Change the text on the add button. |
void |
setCallback(arlut.csd.JDataComponent.JsetValueCallback parent)
Connects this StringSelector to an implementaton of the JsetValueCallback interface
in order to provide live notification of changes performed by the user. |
void |
setCellWidth(int rowWidth)
This method sets the width of the in and out rows. |
void |
setCellWidth(java.lang.String template)
This method sets the width of the in and out rows. |
void |
setPopups(javax.swing.JPopupMenu inPopup,
javax.swing.JPopupMenu outPopup)
This method attaches popup menus to the in box and out box. |
void |
setTitles(java.lang.String inString,
java.lang.String outString)
This method sets the titles for the in and out boxes. |
boolean |
setValuePerformed(arlut.csd.JDataComponent.JValueObject o)
Accept a status update from a GUI component in the arlut.csd.JDataComponent package. |
void |
setVisibleRowCount(int numRows)
Deprecated. This doesn't work anymore. |
(package private) void |
takeItemOut(arlut.csd.JDataComponent.listHandle item)
this actually moves it from from in to out |
void |
update(java.util.Vector available,
boolean sortAvailable,
arlut.csd.Util.Compare availComparator,
java.util.Vector chosen,
boolean sortChosen,
arlut.csd.Util.Compare chosenComparator)
Update the StringSelector. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, 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
arlut.csd.JDataComponent.JsetValueCallback my_callback
javax.swing.JButton add
javax.swing.JButton remove
arlut.csd.JDataComponent.JstringListBox in
arlut.csd.JDataComponent.JstringListBox out
javax.swing.JPanel inPanel
javax.swing.JPanel outPanel
javax.swing.JButton inTitle
javax.swing.JButton outTitle
java.lang.String org_in
java.lang.String org_out
javax.swing.JButton addCustom
arlut.csd.JDataComponent.JstringField custom
java.awt.Container parent
private boolean editable
private boolean canChoose
private boolean mustChoose
| Constructor Detail |
public StringSelector(java.awt.Container parent,
boolean editable,
boolean canChoose,
boolean mustChoose)
parent - AWT container that the StringSelector will be contained in.editable - If false, this string selector is for display onlycanChoose - Choice must be made from vector of choicesmustChoose - Vector of choices is available| Method Detail |
public void setCellWidth(int rowWidth)
This method sets the width of the in and out rows.
public void setCellWidth(java.lang.String template)
This method sets the width of the in and out rows.
template - A string to use as the required size of the cells
in the in and out boxes.
public void setTitles(java.lang.String inString,
java.lang.String outString)
This method sets the titles for the in and out boxes. The StringSelector will show these titles, followed by a colon and the current count of elements in the in and/or out boxes.
public void setPopups(javax.swing.JPopupMenu inPopup,
javax.swing.JPopupMenu outPopup)
This method attaches popup menus to the in box and out box.
public boolean isEditable()
Returns true if this StringSelector is editable.
Non-editable StringSelector's only have the chosen list. Editable StringSelector's have both the chosen and available lists.
public void update(java.util.Vector available,
boolean sortAvailable,
arlut.csd.Util.Compare availComparator,
java.util.Vector chosen,
boolean sortChosen,
arlut.csd.Util.Compare chosenComparator)
public void setButtonText(java.lang.String text)
public void setVisibleRowCount(int numRows)
public void addNewItem(java.lang.Object item,
boolean ShouldBeIn)
Add a new item to the StringSelector.
This is for adding an item that is not in either list, not selecting an item from the out list.
item - Item to be added. Can be listHandle or StringShouldBeIn - If true, object will be placed in in list. Otherwise, it goes in out list.public void setCallback(arlut.csd.JDataComponent.JsetValueCallback parent)
Connects this StringSelector 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.
StringSelector uses the following value type constants from
JValueObject to pass status updates to
the callback.
JsetValueCallback,
JValueObjectpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenervoid addItem()
void removeItem()
void putItemIn(arlut.csd.JDataComponent.listHandle item)
void takeItemOut(arlut.csd.JDataComponent.listHandle item)
public boolean setValuePerformed(arlut.csd.JDataComponent.JValueObject o)
JsetValueCallback
setValuePerformed in interface JsetValueCallbackpublic java.util.Vector getChosenHandles()
Returns a Vector of listHandle
objects corresponding to the currently selected members.
public java.util.Vector getChosenStrings()
Returns a Vector of Strings corresponding to the currently selected members.
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||