Save This Page
Home » openjdk-7 » net.sourceforge » jbird » awt » [javadoc | source]
net.sourceforge.jbird.awt
public class: ListChooser [javadoc | source]
java.lang.Object
   java.awt.Component
      java.awt.Container
         java.awt.Panel
            net.sourceforge.jbird.awt.ListChooser

All Implemented Interfaces:
    TextFocus, Accessible, MenuContainer, Serializable, ImageObserver

Direct Known Subclasses:
    CommonChooser, TripChooser, FamilyChooser, EditableTripChooser, GenusChooser, ObserverChooser, RegionChooser, SpeciesChooser, IndexedListChooser, EditableRegionChooser, LoggingILC, EditableObserverChooser

A component that provides two ways to select among choices: a TextField and a List. If an item is selected in the List its name appears in the TextField, or if the name of an item is typed into the TextField, the corresponding item is selected in the List. Titles are available for the TextField and List as well as for the entire component. An indicator appears for the whole component. If no item is selected it is yellow and indicates that nothing has been selected. Whan an item has been selected its name appears in green.

ListChooser beeps when name completion is enabled and the user types in text that matches no entry in the list. Developers can override with whatever action they choose by using the setBeeper method to provide an object that implmenets NullListener to do the job.
Nested Class Summary:
class  ListChooser.TextWrangler   
class  ListChooser.ListAction   
class  ListChooser.ClickOnList   
class  ListChooser.CompletionListener   
Field Summary
public  int[] selecteditems     
public  String[] selectednames     
public  boolean canchoose     
public  String[] names     
public  String lasttextentry     
public  Collator collator     
 NumberFormat nformatter     
protected  Label title     
public  Label selectedname     
protected  Color unselectedcolor     
protected  Color selectedcolor     
public  Label typetitle     
public  Label picktitle     
public  TextField typefield     
public  List picklist     
public  Insets inset     
public  ListChooser.ListAction listlistener     
public  ListChooser.ClickOnList itemlistener     
protected  boolean skiptext     
protected  boolean skiplist     
protected  String newtextvalue     
protected  NullListener beeper    When not null, the receiveNull method of this interface will be called when the ListChooser wishes to scold the user. Otherwise, it beeps. Implemented in method beep. Configured using method setBeeper. @since J-Bird 0.1.2 
protected  KeyAdapter return_listener    A KeyAdapter that listens for return character in typefield. Not instantiated until setNextFocus is called. @since J-Bird 0.1.2 
protected  TextFocus next_text_focus     
Fields inherited from java.awt.Container:
ncomponents,  component,  layoutMgr,  containerListener,  listeningChildren,  listeningBoundsChildren,  descendantsCount,  INCLUDE_SELF,  SEARCH_HEAVYWEIGHTS,  modalComp,  modalAppContext
Fields inherited from java.awt.Component:
TOP_ALIGNMENT,  CENTER_ALIGNMENT,  BOTTOM_ALIGNMENT,  RIGHT_ALIGNMENT,  LEFT_ALIGNMENT,  treeLock,  x,  y,  width,  height,  foreground,  background,  font,  peerFont,  cursor,  locale,  ignoreRepaint,  visible,  enabled,  valid,  dropTarget,  popups,  name,  nameExplicitlySet,  focusable,  isFocusTraversableOverridden,  focusTraversalKeys,  focusTraversalKeysEnabled,  minSize,  prefSize,  newEventsOnly,  eventMask,  changeSupport,  isPacked,  componentSerializedDataVersion,  accessibleContext,  componentListener,  focusListener,  keyListener,  mouseListener,  mouseMotionListener,  mouseWheelListener,  inputMethodListener,  hierarchyListener,  hierarchyBoundsListener,  parent,  peer,  orientation,  graphicsConfig,  bufferStrategy
Constructor:
 public ListChooser() 
 public ListChooser(int rows) 
 public ListChooser(int rows,
    boolean multmode) 
 public ListChooser(int rows,
    boolean multmode,
    GridBagConstraints[] gbc) 
    A constructor that provides control over the position of the components using GrigBagConstraints.

    The array of GridBagConstraints should be length 6 and describe the postions of (in order):

    1. chooser title
    2. selected value
    3. header for keyboard input area
    4. keyboard input field
    5. header for pick list
    6. pick list
    Titles for the chooser, keyboard input field and the picker can be omitted by setting those elements of the array to null values.
Method from net.sourceforge.jbird.awt.ListChooser Summary:
addArrayActionListener,   beep,   buildList,   buildList,   buildList,   common,   deselectItem,   getHorizontalConstraints,   getNameCompletion,   getSelectedColor,   getSelectedNames,   getUnselectedColor,   getVerticalConstraints,   isEnabledChoices,   isMultipleMode,   localize,   localize,   narrowPossibilities,   narrowPossibilities,   removeArrayActionListener,   requestTextFocus,   selectItem,   setBeeper,   setEnabledChoices,   setMultipleMode,   setNameCompletion,   setNextFocus,   setSelectedColor,   setTitle,   setTypefieldText,   setTypefieldTextNoNotice,   setUnselectedColor,   updateSelectedItemInfo
Methods from java.awt.Panel:
addNotify,   constructComponentName,   getAccessibleContext
Methods from java.awt.Container:
add,   add,   add,   add,   add,   addContainerListener,   addImpl,   addNotify,   addPropertyChangeListener,   addPropertyChangeListener,   adjustDecendantsOnParent,   adjustDescendants,   adjustListeningChildren,   applyComponentOrientation,   areFocusTraversalKeysSet,   canContainFocusOwner,   checkGD,   clearCurrentFocusCycleRootOnHide,   clearMostRecentFocusOwnerOnHide,   containsFocus,   countComponents,   countHierarchyMembers,   createChildHierarchyEvents,   createHierarchyEvents,   decreaseComponentCount,   deliverEvent,   dispatchEventImpl,   dispatchEventToSelf,   doLayout,   eventEnabled,   findComponentAt,   findComponentAt,   findComponentAt,   findComponentAtImpl,   getAccessibleAt,   getAccessibleChild,   getAccessibleChildrenCount,   getAlignmentX,   getAlignmentY,   getComponent,   getComponentAt,   getComponentAt,   getComponentCount,   getComponentZOrder,   getComponents,   getComponents_NoClientCode,   getContainerListeners,   getDropTargetEventTarget,   getFocusTraversalKeys,   getFocusTraversalPolicy,   getHeavyweightContainer,   getInsets,   getLayout,   getListeners,   getMaximumSize,   getMinimumSize,   getMouseEventTarget,   getMousePosition,   getPreferredSize,   getTraversalRoot,   increaseComponentCount,   initializeFocusTraversalKeys,   insets,   invalidate,   invalidateTree,   isAncestorOf,   isFocusCycleRoot,   isFocusCycleRoot,   isFocusTraversalPolicyProvider,   isFocusTraversalPolicySet,   isSameOrAncestorOf,   layout,   lightweightPaint,   lightweightPrint,   list,   list,   locate,   minimumSize,   mixOnHiding,   mixOnReshaping,   mixOnShowing,   mixOnZOrderChanging,   numListening,   paint,   paintComponents,   paintHeavyweightComponents,   paramString,   postProcessKeyEvent,   postsOldMouseEvents,   preProcessKeyEvent,   preferredSize,   print,   printComponents,   printHeavyweightComponents,   processContainerEvent,   processEvent,   proxyEnableEvents,   recursiveApplyCurrentShape,   recursiveApplyCurrentShape,   recursiveApplyCurrentShape,   recursiveSubtractAndApplyShape,   recursiveSubtractAndApplyShape,   recursiveSubtractAndApplyShape,   remove,   remove,   removeAll,   removeContainerListener,   removeNotify,   setComponentZOrder,   setFocusCycleRoot,   setFocusTraversalKeys,   setFocusTraversalPolicy,   setFocusTraversalPolicyProvider,   setFont,   setLayout,   transferFocusDownCycle,   update,   validate,   validateTree
Methods from java.awt.Component:
action,   add,   addComponentListener,   addFocusListener,   addHierarchyBoundsListener,   addHierarchyListener,   addInputMethodListener,   addKeyListener,   addMouseListener,   addMouseMotionListener,   addMouseWheelListener,   addNotify,   addPropertyChangeListener,   addPropertyChangeListener,   applyComponentOrientation,   areFocusTraversalKeysSet,   bounds,   checkImage,   checkImage,   coalesceEvents,   contains,   contains,   createImage,   createImage,   createVolatileImage,   createVolatileImage,   deliverEvent,   disable,   disableEvents,   dispatchEvent,   dispatchEventImpl,   doLayout,   enable,   enable,   enableEvents,   enableInputMethods,   eventTypeEnabled,   findNextFocusComponent,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   generateName,   getAccessibleContext,   getAlignmentX,   getAlignmentY,   getBackground,   getBounds,   getBounds,   getColorModel,   getComponentAt,   getComponentAt,   getComponentListeners,   getComponentOrientation,   getCursor,   getDropTarget,   getFocusCycleRootAncestor,   getFocusListeners,   getFocusTraversalKeys,   getFocusTraversalKeysEnabled,   getFont,   getFontMetrics,   getForeground,   getGraphics,   getGraphicsConfiguration,   getGraphicsConfigurationImpl,   getHeight,   getHierarchyBoundsListeners,   getHierarchyListeners,   getIgnoreRepaint,   getInputContext,   getInputMethodListeners,   getInputMethodRequests,   getKeyListeners,   getListeners,   getLocale,   getLocation,   getLocation,   getLocationOnScreen,   getMaximumSize,   getMinimumSize,   getMouseListeners,   getMouseMotionListeners,   getMouseWheelListeners,   getName,   getParent,   getPeer,   getPreferredSize,   getPropertyChangeListeners,   getPropertyChangeListeners,   getSize,   getSize,   getToolkit,   getTreeLock,   getWidth,   getX,   getY,   gotFocus,   handleEvent,   hasFocus,   hide,   imageUpdate,   inside,   invalidate,   isBackgroundSet,   isCursorSet,   isDisplayable,   isDoubleBuffered,   isEnabled,   isFocusCycleRoot,   isFocusOwner,   isFocusTraversable,   isFocusable,   isFontSet,   isForegroundSet,   isLightweight,   isOpaque,   isShowing,   isValid,   isVisible,   keyDown,   keyUp,   layout,   list,   list,   list,   list,   list,   locate,   location,   lostFocus,   minimumSize,   mouseDown,   mouseDrag,   mouseEnter,   mouseExit,   mouseMove,   mouseUp,   move,   nextFocus,   paint,   paintAll,   paramString,   postEvent,   preferredSize,   prepareImage,   prepareImage,   print,   printAll,   processComponentEvent,   processEvent,   processFocusEvent,   processHierarchyBoundsEvent,   processHierarchyEvent,   processInputMethodEvent,   processKeyEvent,   processMouseEvent,   processMouseMotionEvent,   processMouseWheelEvent,   remove,   removeComponentListener,   removeFocusListener,   removeHierarchyBoundsListener,   removeHierarchyListener,   removeInputMethodListener,   removeKeyListener,   removeMouseListener,   removeMouseMotionListener,   removeMouseWheelListener,   removeNotify,   removePropertyChangeListener,   removePropertyChangeListener,   repaint,   repaint,   repaint,   repaint,   requestFocus,   requestFocus,   requestFocusInWindow,   requestFocusInWindow,   reshape,   resize,   resize,   setBackground,   setBounds,   setBounds,   setComponentOrientation,   setCursor,   setDropTarget,   setEnabled,   setFocusTraversalKeys,   setFocusTraversalKeysEnabled,   setFocusable,   setFont,   setForeground,   setIgnoreRepaint,   setLocale,   setLocation,   setLocation,   setName,   setPeer,   setSize,   setSize,   setVisible,   show,   show,   size,   toString,   transferFocus,   transferFocusBackward,   transferFocusUpCycle,   translateEvent,   update,   validate
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from net.sourceforge.jbird.awt.ListChooser Detail:
 public  void addArrayActionListener(IntarrayListener item) 
 protected final  void beep() 
    Use this method to scold users. Calls the receiveNull method of beeper if beeper is not null. Otherwise, it just beeps. Use setBeeper to control behavior.
 public final  void buildList(String[] itemnames) 
 public final  void buildList(String[] itemnames,
    CollationKeyArray cka) 
    Use this method when itemnames is already sorted and you've already built a sorted CollationKeyArray
 public final  void buildList(String[] itemnames,
    Collator coll,
    boolean presorted) 
 protected  void common() 
    Tasks that are common to all constructors.
 public  void deselectItem(int item) 
    Unselect item based on row number in List.
 public static GridBagConstraints[] getHorizontalConstraints() 
    Return an array of GridBagConstraints that lays out a ListChooser with keyboard input on the left and picker on the right.

    The picker should always be much taller than the keyboard input field. Empty space in the lower left quadrant is useful placing buttons and other components that might be used in subclasses of ListChooser.

 public int getNameCompletion(int value) 
 public final Color getSelectedColor() 
    Return color of selected value.
 public String[] getSelectedNames() 
    Return a string array of the selected items This method returns information exactly as does the getSelectedItems method of objects of type List
 public final Color getUnselectedColor() 
    Return color of non-selected message.
 public static GridBagConstraints[] getVerticalConstraints() 
    Return an array of GridBagConstraints that will layout members of a ListChooser vertically, with keyboard chooser over picker.
 public boolean isEnabledChoices() 
    Return boolean indication of whether ListChoice is enabled.
 public boolean isMultipleMode() 
    Returns boolean indicator of whether multiple selections are allowed.
 public  void localize(ResourceBundle bund) 
 public  void localize(String kbdtxt,
    String picktxt) 
 public  void narrowPossibilities(String value) 
 public  void narrowPossibilities(String value,
    int completion) 
 public  void removeArrayActionListener(IntarrayListener item) 
 public final  void requestTextFocus() 
    Calls requestFocus method of the text field.

    Implements TextFocus.

 public  void selectItem(int index) 
    Select item by row number in List.
 public final  void setBeeper(NullListener beeper) 
    Provide a NullListener that will perform suitable acts when the ListChooser wishes to beep. By default the ListChooser beeps. Provide a null value to restore default behavior.
 public  void setEnabledChoices(boolean b) 
    Enable or disble ListChoice for use by users.
 public  void setMultipleMode(boolean multmode) 
    Set multiple selection mode according to multmode.
 public  void setNameCompletion(int value) 
 public  void setNextFocus(TextFocus component) 
    Set the component that will receive focus when the user presses return in the typefield of this component.

    Implements TextFocus.

 public final  void setSelectedColor(Color color) 
    Set color of selected value.
 public final  void setTitle(String text) 
 public  void setTypefieldText(String value) 
 public  void setTypefieldTextNoNotice(String value) 
 public final  void setUnselectedColor(Color color) 
    Set color of non-selected message.
 public  void updateSelectedItemInfo() 
    Reset the label and notify listeners based on state of ListChooser.