Diamond Control Suite 3.0

diamondedge.swing
Class DsComboBox

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JComboBox
                  extended by diamondedge.swing.DsComboBox
All Implemented Interfaces:
DsConstants, ActionListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, ListDataListener, SwingConstants

public class DsComboBox
extends JComboBox
implements DsConstants

DsComboBox is a multi-column ComboBox which displays a collection of objects. Each object is represented by a DsListItem object which holds all of the information for the object being displayed including a list of DsListCell objects for each column. The items can be created in a number of different ways. One way is to call the addItem method. Another way is to use the addItems to add an array or List of objects. If the object added implements the DsListObject interface then it is used to fill in the other properties of the DsListItem such as the icons.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComboBox
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManager
 
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  IconList iconlist
           
 
Fields inherited from class javax.swing.JComboBox
actionCommand, dataModel, editor, 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 diamondedge.swing.DsConstants
ACCOUNTING, ALL, ASCENDING, ASCENDING_CASE, BORDER_BOTTOM, BORDER_LEFT, BORDER_NONE, BORDER_OUTLINE, BORDER_RIGHT, BORDER_TOP, CROSS_LINES, DASH, DASH_DOT, DASH_DOT_DOT, DEFAULT, DESCENDING, DESCENDING_CASE, DIAGONAL_CROSS_LINES, DOT, DOUBLE, DOUBLE_LINE, DOWNWARD_DIAGONAL_LINES, ETCHED, ETCHED_RAISED, FALSE, FIND_ALL, FIND_EQUALS, FIND_GT, FIND_GTE, FIND_LT, FIND_LTE, FIND_NE, FIND_PREFIX, FIND_REGEX, FIND_STRING, FIRST, FLAT, GRID_DASH, GRID_DASH_DOT, GRID_DASH_DOT_DOT, GRID_DOT, GRID_LINE, HIGHLIGHT_SELECTION_ALWAYS, HIGHLIGHT_SELECTION_NEVER, HIGHLIGHT_SELECTION_WITH_FOCUS, HORIZONTAL_LINES, LOWERED, LOWERED_LIGHT, NONE, RAISED, RAISED_LIGHT, SELECT_CELL, SELECT_NONE, SELECT_ROW, SINGLE, SINGLE_LINE, SOLID, STRETCH, TILE, TRANSPARENT, TRUE, UPWARD_DIAGONAL_LINES, VERTICAL_LINES
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DsComboBox()
           
 
Method Summary
 TableColumn addColumn()
           
 TableColumn addColumn(String columnName, String id)
           
 DsListItem addItem()
          Appends a DsListItem object to the list.
 DsListItem addItem(int index, String key, Object text, Object smallIcon)
          Adds a DsListItem object to the list.
 void addItem(List values)
          Adds an item and loads the data for multiple cells into that item.
 void addItem(Object obj)
          Loads the data from an object into the List.
 DsListItem addItem(Object[] values)
          Adds an item and loads the data for multiple cells into that item.
 void addItems(List objects)
          Loads the data from multiple objects into the List.
 void addItems(Object[] objects)
          Loads the data from multiple objects into the List.
 int calculateTotalListWidth()
          Returns the total width of the columns.
 void clear()
          Removes all items in the list.
 void configureEditor(ComboBoxEditor editor, Object item)
           
protected  DsListItem createListItem()
          Creates a new DsListItem.
 void doLayout()
           
 int findItem(String str, int col, int startRow, boolean partial)
          Finds the row index of an item in the list using a case insensitive string comparison.
 boolean getAutoExpand()
          Returns a value to specify whether the text box portion of a combo box automatically fills as you type with a value from the combo box list that matches the characters you enter.
 int getBoundColumn()
          Determines the column used as the value for the selection.
 TableColumn getColumn(int index)
           
 TableColumn getColumn(String columnId)
           
 int getColumnCount()
          Determines the total number of columns.
 DsCellProperties getColumnProperties(int col)
          Returns the default cell containing the default properties for the column.
 int getColumnWidth(int index)
          Determines the width of the specified column in pixels.
 IconList getIconList()
          Returns the IconList object to be used for the icons displayed in the DsComboBox.
 DsListItem getItem(int index)
          Returns a specific item in the list by position.
 DsListItem getItem(Object indexOrKey)
          Returns a specific item in the list by position (Number) or by key (String).
 DsListItem getItem(String key)
          Returns a specific item in the list by key.
 boolean getLimitToList()
          Returns whether a combo box's values are limited to the listed items.
 int getListWidth()
          Determines the width of the drop-down list.
 String getRowValueList()
          Returns the text used to initialize each cell in the list.
 Dimension getSize()
           
 String getText()
          Returns the string displayed in the text area (editor).
 String getTextAt(int row, int col)
          Returns the text (contents formatted as a string) for the cell at the given row and column.
 int getTextColumn()
          Determines the column used as the value for the Text.
 Object getValue()
          Returns the value for the BoundColumn of the item selected in the drop-down list or the text in the editor if no item was selected.
 Object getValueAt(int row, int column)
          Returns the cell value at row and column.
 void refresh()
          Reloads data from the original DsListObjects.
 void removeItem(int index)
          Removes a item from the list
 void setAutoExpand(boolean val)
          Sets a value to specify whether the text box portion of a combo box automatically fills as you type with a value from the combo box list that matches the characters you enter.
 void setBackground(Color c)
           
 void setBoundColumn(int val)
          Determines the column used as the value for the selection.
 void setColumnCount(int val)
          Determines the total number of columns.
 void setColumnHorizontalAlignment(int column, int align)
          Sets the horizontal alignment of the text in the column header.
 void setColumnWidth(int index, int val)
           
 void setColumnWidth(String columnId, int val)
           
 int setColumnWidthsToFit(int columnMargin)
          Returns the width of all columns and sets each column width to the size needed to fit the data in cells in that column.
 void setForeground(Color c)
           
 void setIconList(IconList i)
          Sets the IconList object to be used for the icons displayed in the DsComboBox.
 void setLimitToList(boolean val)
          Sets a value to specify whether a combo box's values are limited to the listed items.
 void setListWidth(int val)
          Determines the width of the drop-down list.
 void setRowValueList(String newValues)
          Sets the text in each cell in the list with each string being separated by a ;.
 void setShowGrid(boolean showVerticalLine, boolean showHorizontalLine)
          Sets whether the grid lines should be drawn between cells.
 void setText(String text)
          Sets the string displayed in the text area (editor).
 void setTextColumn(int val)
          Determines the column used as the value for the Text property which is diplayed in the text area of the ComboBox.
 void setValue(Object value)
          Selects the item whose value for the BoundColumn is equal to the specified value argument.
 void setValueAt(Object value, int row, int col)
          Sets the value for the cell in the model at row and column.
 void setValues(Object[] values)
          Loads the cell values from an array of values.
 void setValues(Object[][] values)
          Loads the cell values from an array of values.
 void setValues(TableModel table)
          Loads the cell values from an array of values.
 void updateUI()
           
 
Methods inherited from class javax.swing.JComboBox
actionPerformed, actionPropertyChanged, addActionListener, addItemListener, addPopupMenuListener, 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
 
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, getPreferredSize, 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, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, 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, 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, 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,