org.formaria.swing
Class CheckCombo

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 org.formaria.swing.ComboBox
                      extended by org.formaria.swing.CheckCombo
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ListDataListener, ErrorDisplay, ListHolder

public class CheckCombo
extends ComboBox
implements java.awt.event.KeyListener, java.awt.event.MouseListener

A Combo box that contains a Combo of check boxes

Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.

$Revision: 1.5 $

See Also:
Serialized Form

Nested Class Summary
protected  class CheckCombo.CheckComboCellRenderer
           
 
Nested classes/interfaces inherited from class org.formaria.swing.ComboBox
ComboBox.SystemSelectionManager
 
Nested classes/interfaces inherited from class javax.swing.JComboBox
javax.swing.JComboBox.AccessibleJComboBox, javax.swing.JComboBox.KeySelectionManager
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected static javax.swing.border.Border noFocusBorder
           
 
Fields inherited from class org.formaria.swing.ComboBox
autoComplete, errorStatus, isCaseSensitive
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
CheckCombo()
          Create a new checked Combo
CheckCombo(java.lang.Object[] items)
          Create a new checked Combo
 
Method Summary
 void addItem(java.lang.String s)
          Add an item to the listmodel
 void clearSelection()
          Clear the list selections
 void configureEditor(javax.swing.ComboBoxEditor anEditor, java.lang.Object anItem)
          Initializes the editor with the specified item.
 java.awt.event.MouseListener getMouseListener()
          Return the mouse listener interface that this component implements
 int getSelecteditemIndex()
          Returns the first item in the list that matches the given item.
 java.lang.String[] getSelectedItems()
          Get a Combo of the checked items in the Combo
 void keyPressed(java.awt.event.KeyEvent e)
          Listen for keyboard press events on the component
 void keyReleased(java.awt.event.KeyEvent e)
          Template method, unused at present
 void keyTyped(java.awt.event.KeyEvent e)
          Template method, unused at present
 void mouseClicked(java.awt.event.MouseEvent e)
          Template method, unused at present
 void mouseEntered(java.awt.event.MouseEvent e)
          Template method, unused at present
 void mouseExited(java.awt.event.MouseEvent e)
          Template method, unused at present
 void mousePressed(java.awt.event.MouseEvent e)
          Template method, unused at present
 void mouseReleased(java.awt.event.MouseEvent e)
          Listen for mouse released events and update the selected items
 void selectItem(int idx, boolean selected)
          Force the selection of an item in the Combo
 void setSelectedItem(java.lang.Object selObj)
           
 void setSeparator(java.lang.String s)
          Set the separator text
 
Methods inherited from class org.formaria.swing.ComboBox
add, getCaseSensitive, getErrorStatus, getSelectedObject, getSelectedObjects, getSelectionMode, isAutoComplete, isSearchable, paintComponent, removeAll, select, select, setAlphaNum, setAutoComplete, setBackground, setCaseSensitive, setDefaultSelection, setErrorMessage, setErrorStatus, setForeground, setPause, setRenderer, setSearch, setSearchable, setSelectedObject, setSelectedObjects
 
Methods inherited from class javax.swing.JComboBox
actionPerformed, actionPropertyChanged, addActionListener, addItem, 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, 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, setSelectedIndex, setUI, showPopup, 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, 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, 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, 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, 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
 
Methods inherited from interface org.formaria.aria.ListHolder
addItem, getItemCount, getSelectedIndex
 

Field Detail

noFocusBorder

protected static javax.swing.border.Border noFocusBorder
Constructor Detail

CheckCombo

public CheckCombo()
Create a new checked Combo


CheckCombo

public CheckCombo(java.lang.Object[] items)
Create a new checked Combo

Parameters:
items - an array of items to add to the Combo
Method Detail

addItem

public void addItem(java.lang.String s)
Add an item to the listmodel

Overrides:
addItem in class ComboBox
Parameters:
s - the item to be added

configureEditor

public void configureEditor(javax.swing.ComboBoxEditor anEditor,
                            java.lang.Object anItem)
Initializes the editor with the specified item.

Overrides:
configureEditor in class javax.swing.JComboBox
Parameters:
anEditor - the ComboBoxEditor that displays the list item in the combo box field and allows it to be edited
anItem - the object to display and edit in the field

getSelecteditemIndex

public int getSelecteditemIndex()
Returns the first item in the list that matches the given item. The result is not always defined if the JComboBox allows selected items that are not in the list. Returns -1 if there is no selected item or if the user specified an item which is not in the list.

Returns:
an integer specifying the currently selected list item, where 0 specifies the first item in the list; or -1 if no item is selected or if the currently selected item is not in the list

setSelectedItem

public void setSelectedItem(java.lang.Object selObj)
Overrides:
setSelectedItem in class javax.swing.JComboBox

clearSelection

public void clearSelection()
Clear the list selections


getSelectedItems

public java.lang.String[] getSelectedItems()
Get a Combo of the checked items in the Combo

Returns:
the checked items

selectItem

public void selectItem(int idx,
                       boolean selected)
Force the selection of an item in the Combo

Parameters:
idx - the itemIndex of the item
selected - true to force selection of the item

setSeparator

public void setSeparator(java.lang.String s)
Set the separator text

Parameters:
s - the separator text

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Listen for keyboard press events on the component

Specified by:
keyPressed in interface java.awt.event.KeyListener
Parameters:
e - the fired KeyEvent

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Listen for mouse released events and update the selected items

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - the fired MouseEvent

getMouseListener

public java.awt.event.MouseListener getMouseListener()
Return the mouse listener interface that this component implements

Returns:
the MouseListener interface.

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Template method, unused at present

Specified by:
keyTyped in interface java.awt.event.KeyListener
Parameters:
e - the window event

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Template method, unused at present

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
e - the window event

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Template method, unused at present

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - the window event

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Template method, unused at present

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - the window event

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Template method, unused at present

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
e - the window event

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Template method, unused at present

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e - the window event