public class CheckList
extends javax.swing.JComponent
CheckList is widget that shows a list of entries and a check box to enable/disable
each of them.
It has been written to replace com.cosylab.gui.components.r2.JCheckList that is not
maintained anymore.
The user is presented with a list of items each of which has a associated check box: each item in the list can be selectively enabled/disabled by using the checkbox.
CheckList is a table of 2 columns: the first one is a boolean whose state
says if the item is selected or not. The second one is a not editable string.
The model of this widget accepts any not null java Object's.
The text shown in the second column is generated by invoking Object.toString().
| Modifier and Type | Class and Description |
|---|---|
class |
CheckList.CheckListTableEntry
Each entry in the list is composed of a
Boolean and a Object |
javax.swing.JComponent.AccessibleJComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW| Constructor and Description |
|---|
CheckList()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
activateAll(boolean active)
Activate ar deactivate all the itemes of the widget
|
CheckList.CheckListTableEntry |
addElement(boolean active,
java.lang.Object obj)
Add a element to the list with its initial activation state.
|
void |
clear()
Remove all the entries from the widget
|
boolean[] |
getActivationStates() |
int |
getActiveItemsNumber() |
java.util.List<CheckList.CheckListTableEntry> |
getCheckedEntries() |
java.util.List<CheckList.CheckListTableEntry> |
getEntries() |
int |
getItemsSize() |
CheckList.CheckListTableEntry |
getSelectedEntry() |
int |
getSelectedIndex() |
java.util.List<CheckList.CheckListTableEntry> |
getUnCheckedEntries() |
CheckList.CheckListTableEntry |
removeEntry(int index)
Remove the entry in the passed position from the widget.
|
CheckList.CheckListTableEntry |
removeSelectedEntry()
Remove the selected entry from the widget
|
void |
updateSelectedEntry()
Update the selected entry.
|
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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, updateUIadd, 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, transferFocusDownCycle, validate, validateTreeaction, 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, getAccessibleContext, 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, 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, transferFocusBackward, transferFocusUpCyclepublic boolean[] getActivationStates()
public java.util.List<CheckList.CheckListTableEntry> getEntries()
CheckList.CheckListTableModel.getEntries()public java.util.List<CheckList.CheckListTableEntry> getCheckedEntries()
CheckList.CheckListTableModel.getCheckedEntries()public java.util.List<CheckList.CheckListTableEntry> getUnCheckedEntries()
CheckList.CheckListTableModel.getUnCheckedEntries()public void clear()
public CheckList.CheckListTableEntry addElement(boolean active, java.lang.Object obj)
active - The activation state of the itemobj - The not null item to addCheckList.CheckListTableModel.addElement(boolean, java.lang.Object)public int getItemsSize()
public int getActiveItemsNumber()
CheckList.CheckListTableModel.getActiveItemsNumber()public CheckList.CheckListTableEntry getSelectedEntry()
public int getSelectedIndex()
public void activateAll(boolean active)
active - if true activate the itemsCheckList.CheckListTableModel.activateAll(boolean)public CheckList.CheckListTableEntry removeEntry(int index)
index - The index of the item to removeCheckList.CheckListTableModel.removeEntry(int)public CheckList.CheckListTableEntry removeSelectedEntry()
null if the entry was not foundpublic void updateSelectedEntry()
This method is meant to be called when the selected entry in the model has been changed to trigger a refresh of the list.