Extension SDK

oracle.ide.controls
Class AbstractPicker

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JComboBox
                  extended byoracle.ide.controls.AbstractPicker
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, javax.swing.event.ListDataListener, java.awt.MenuContainer, java.io.Serializable

public abstract class AbstractPicker
extends javax.swing.JComboBox
implements java.awt.event.ActionListener

See Also:
Serialized Form

Nested Class Summary
static interface AbstractPicker.PickerResultValidator
          The interface defining Validators for AbstractPicker browse actions.
static interface AbstractPicker.PickerValueEncoder
          The interface defining Encoders for AbstractPicker values.
 
Nested classes inherited from class javax.swing.JComboBox
javax.swing.JComboBox.AccessibleJComboBox, javax.swing.JComboBox.KeySelectionManager
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.ComboBoxEditor editor
           
protected  AbstractPicker.PickerValueEncoder encoder
           
protected  AbstractPicker.PickerResultValidator validator
           
 
Fields inherited from class javax.swing.JComboBox
actionCommand, dataModel, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder
 
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.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
AbstractPicker()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
           
protected  void addValue(java.lang.Object value)
          Adds the value to the model.
protected abstract  void doBrowse()
           
 java.lang.Object getCurrentValue()
           
 AbstractPicker.PickerValueEncoder getEncoder()
          Retrieve the Encoder used by this AbstractPicker.
protected  java.lang.String getInvalidValueErrorHelpID()
          Retrieves the HelpID string to use in the error dialog shown when the entered value is invalid.
protected  java.lang.String getInvalidValueErrorTitle()
          Retrieves the title string to use in the error dialog when the entered value is invalid.
 AbstractPicker.PickerResultValidator getValidator()
          Retrieve the PickerResultValidator used by this AbstractPicker to validate the results of Browse actions.
 void requestFocus()
           
 void setBrowseResult(java.lang.Object result)
          Set the value resulting from a Browse.
 void setCurrentValue(java.lang.Object newCurrentValue)
           
 void setEncoder(AbstractPicker.PickerValueEncoder newEncoder)
          Set the Encoder used by this AbstractPicker.
 void setValidator(AbstractPicker.PickerResultValidator newValidator)
          Set the Validator used by this AbstractPicker.
 
Methods inherited from class javax.swing.JComboBox
addActionListener, addItem, addItemListener, addPopupMenuListener, configureEditor, configurePropertiesFromAction, contentsChanged, createActionPropertyChangeListener, createDefaultKeySelectionManager, fireActionEvent, fireItemStateChanged, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemAt, getItemCount, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedIndex, getSelectedItem, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, installAncestorListener, intervalAdded, intervalRemoved, isEditable, isLightWeightPopupEnabled, isPopupVisible, paramString, processKeyEvent, removeActionListener, removeAllItems, removeItem, removeItemAt, removeItemListener, removePopupMenuListener, selectedItemChanged, selectWithKeyChar, setAction, setActionCommand, setEditable, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, setSelectedIndex, setSelectedItem, setUI, showPopup, 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, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, 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

validator

protected AbstractPicker.PickerResultValidator validator

encoder

protected AbstractPicker.PickerValueEncoder encoder

editor

protected javax.swing.ComboBoxEditor editor
Constructor Detail

AbstractPicker

public AbstractPicker()
Method Detail

getValidator

public AbstractPicker.PickerResultValidator getValidator()
Retrieve the PickerResultValidator used by this AbstractPicker to validate the results of Browse actions.

Returns:
the PickerResultValidator which the AbstractPicker will use to validate results.

setValidator

public void setValidator(AbstractPicker.PickerResultValidator newValidator)
Set the Validator used by this AbstractPicker.

Parameters:
newValidator - the PickerResultValidator which this AbstractPicker should use to validate results.

getEncoder

public AbstractPicker.PickerValueEncoder getEncoder()
Retrieve the Encoder used by this AbstractPicker.

Returns:
the PickerValueEncoder which this AbstractPicker will use to encode values.

setEncoder

public void setEncoder(AbstractPicker.PickerValueEncoder newEncoder)
Set the Encoder used by this AbstractPicker.

Parameters:
newEncoder - the PickerValueEncoder which this AbstractPicker should use to encode results.

getCurrentValue

public java.lang.Object getCurrentValue()

setCurrentValue

public void setCurrentValue(java.lang.Object newCurrentValue)

getInvalidValueErrorTitle

protected java.lang.String getInvalidValueErrorTitle()
Retrieves the title string to use in the error dialog when the entered value is invalid. By default, it is 'Invalid Value'.


getInvalidValueErrorHelpID

protected java.lang.String getInvalidValueErrorHelpID()
Retrieves the HelpID string to use in the error dialog shown when the entered value is invalid. A value of null means that no Help button should be displayed.


setBrowseResult

public final void setBrowseResult(java.lang.Object result)
Set the value resulting from a Browse. If the Validator for this AbstractPicker is assigned, it will be used to validate the value. If the value is not valid, the Validator's getInvalidValueMsg method will be called to provide an error message. If the value is valid, the Encoder (if assigned) will be used to encode the value. This encoded value is then added to the model and selected.

Parameters:
result - the result of the Browse operation. If result is null, nothing is done. A non-null result is passed to the optional PickerResultValidator, the optional PickerValueEncoder, and then added to the model.

addValue

protected void addValue(java.lang.Object value)
Adds the value to the model. The default behavior is to check the model to see if the value already exists, and only add it if it does not. Subclasses can override addValue to change this behavior. Clients should interact directly with the model.

Parameters:
value - the new value (optionally encoded) to be added.

requestFocus

public void requestFocus()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

doBrowse

protected abstract void doBrowse()

Extension SDK

 

Copyright ©1997, 2003, Oracle. All rights reserved.