JIDE 3.5.15

com.jidesoft.combobox
Class AbstractComboBox.DefaultRendererComponent

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.jidesoft.combobox.AbstractComboBox.EditorComponent
                      extended by com.jidesoft.combobox.AbstractComboBox.DefaultRendererComponent
All Implemented Interfaces:
AlignmentSupport, ImageObserver, MenuContainer, Serializable, Accessible, ComboBoxEditor
Direct Known Subclasses:
ColorComboBox.ColorRendererComponent, DateComboBox.DateRendererComponent, ListComboBox.ListRendererComponent
Enclosing class:
AbstractComboBox

public class AbstractComboBox.DefaultRendererComponent
extends AbstractComboBox.EditorComponent

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  CellRendererPane _rendererPane
           
 
Fields inherited from class com.jidesoft.combobox.AbstractComboBox.EditorComponent
_class, _value
 
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
AbstractComboBox.DefaultRendererComponent(Class<?> clazz)
          Creates a DefaultRendererComponent.
 
Method Summary
 void addActionListener(ActionListener l)
           
 Component getEditorComponent()
           
 int getHorizontalAlignment()
          Returns the horizontal alignment of the content.
 Dimension getPreferredSize()
          Gets the default preferred size {100, 18}.
 String getText()
          Gets the text.
 int getVerticalAlignment()
          Returns the vertical alignment of the content.
 boolean isEditable()
          Gets the editable attribute.
protected  void paintComponent(Graphics g)
           
protected  void paintRendererPane(Graphics g, Component c)
          Paint renderer pane to an appropriate place.
 void removeActionListener(ActionListener l)
           
 void selectAll()
           
 void setEditable(boolean editable)
          Sets the editable attribute.
 void setHorizontalAlignment(int horizontalAlignment)
          Sets the horizontal alignment of the content.
 void setText(String text)
          Sets the text.
 void setVerticalAlignment(int verticalAlignment)
          Sets the vertical alignment of the content.
 
Methods inherited from class com.jidesoft.combobox.AbstractComboBox.EditorComponent
convertElementToString, convertStringToElement, getItem, registerKeys, setItem, textChanged
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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

_rendererPane

protected CellRendererPane _rendererPane
Constructor Detail

AbstractComboBox.DefaultRendererComponent

public AbstractComboBox.DefaultRendererComponent(Class<?> clazz)
Creates a DefaultRendererComponent.

Parameters:
clazz - class type which this editor can handle.
Method Detail

getPreferredSize

public Dimension getPreferredSize()
Description copied from class: AbstractComboBox.EditorComponent
Gets the default preferred size {100, 18}.

Overrides:
getPreferredSize in class AbstractComboBox.EditorComponent
Returns:
preferred size

paintComponent

protected void paintComponent(Graphics g)
Overrides:
paintComponent in class JComponent

paintRendererPane

protected void paintRendererPane(Graphics g,
                                 Component c)
Paint renderer pane to an appropriate place.

Parameters:
g - the Graphics instance
c - the component

getEditorComponent

public Component getEditorComponent()

selectAll

public void selectAll()

addActionListener

public void addActionListener(ActionListener l)

removeActionListener

public void removeActionListener(ActionListener l)

getText

public String getText()
Description copied from class: AbstractComboBox.EditorComponent
Gets the text. Since subclass can use different components to edit text, this method will provide a common interface to retrieve text from those different components.

Specified by:
getText in class AbstractComboBox.EditorComponent
Returns:
the text.

setText

public void setText(String text)
Description copied from class: AbstractComboBox.EditorComponent
Sets the text. Since subclass can use different components to edit text, this method will provide a common interface to set text to those different components.

Specified by:
setText in class AbstractComboBox.EditorComponent
Parameters:
text - the text

setEditable

public void setEditable(boolean editable)
Description copied from class: AbstractComboBox.EditorComponent
Sets the editable attribute. Since subclass can use different components to edit text, this method will provide a common interface to change editable attribute to those different components.

Specified by:
setEditable in class AbstractComboBox.EditorComponent
Parameters:
editable - true or false.

isEditable

public boolean isEditable()
Description copied from class: AbstractComboBox.EditorComponent
Gets the editable attribute. Since subclass can use different components to edit text, this method will provide a common interface to check editable attribute for those different components.

Specified by:
isEditable in class AbstractComboBox.EditorComponent
Returns:
true if the editor component is editable

getHorizontalAlignment

public int getHorizontalAlignment()
Description copied from interface: AlignmentSupport
Returns the horizontal alignment of the content. AbstractButton's default is SwingConstants.CENTER, but subclasses such as JCheckBox may use a different default.

Specified by:
getHorizontalAlignment in interface AlignmentSupport
Overrides:
getHorizontalAlignment in class AbstractComboBox.EditorComponent
Returns:
the horizontalAlignment property, one of the following values:
  • SwingConstants.RIGHT
  • SwingConstants.LEFT
  • SwingConstants.CENTER
  • SwingConstants.LEADING
  • SwingConstants.TRAILING

setHorizontalAlignment

public void setHorizontalAlignment(int horizontalAlignment)
Description copied from interface: AlignmentSupport
Sets the horizontal alignment of the content. AbstractButton's default is SwingConstants.CENTER, but subclasses such as JCheckBox may use a different default.

Specified by:
setHorizontalAlignment in interface AlignmentSupport
Overrides:
setHorizontalAlignment in class AbstractComboBox.EditorComponent
Parameters:
horizontalAlignment - the alignment value, one of the following values:
  • SwingConstants.RIGHT
  • SwingConstants.LEFT
  • SwingConstants.CENTER
  • SwingConstants.LEADING
  • SwingConstants.TRAILING

getVerticalAlignment

public int getVerticalAlignment()
Description copied from interface: AlignmentSupport
Returns the vertical alignment of the content.

Specified by:
getVerticalAlignment in interface AlignmentSupport
Overrides:
getVerticalAlignment in class AbstractComboBox.EditorComponent
Returns:
the verticalAlignment property, one of the following values:
  • SwingConstants.CENTER (the default)
  • SwingConstants.TOP
  • SwingConstants.BOTTOM

setVerticalAlignment

public void setVerticalAlignment(int verticalAlignment)
Description copied from interface: AlignmentSupport
Sets the vertical alignment of the content.

Specified by:
setVerticalAlignment in interface AlignmentSupport
Overrides:
setVerticalAlignment in class AbstractComboBox.EditorComponent
Parameters:
verticalAlignment - one of the following values:
  • SwingConstants.CENTER (the default)
  • SwingConstants.TOP
  • SwingConstants.BOTTOM

JIDE 3.5.15