public class CheckBoxList<T> extends JBList<javax.swing.JCheckBox>
JBList.AccessibleJBList, JBList.StripedListCellRenderer
javax.swing.JList.AccessibleJList, javax.swing.JList.DropLocation
javax.swing.JComponent.AccessibleJComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
CheckBoxList() |
CheckBoxList(CheckBoxListListener checkBoxListListener) |
CheckBoxList(javax.swing.DefaultListModel dataModel) |
CheckBoxList(javax.swing.DefaultListModel<javax.swing.JCheckBox> dataModel,
CheckBoxListListener checkBoxListListener) |
Modifier and Type | Method and Description |
---|---|
void |
addItem(T item,
java.lang.String text,
boolean selected) |
protected javax.swing.JComponent |
adjustRendering(javax.swing.JComponent rootComponent,
javax.swing.JCheckBox checkBox,
int index,
boolean selected,
boolean hasFocus) |
void |
clear() |
protected java.awt.Point |
findPointRelativeToCheckBox(int x,
int y,
javax.swing.JCheckBox checkBox,
int index)
Find point relative to the checkbox.
|
protected java.awt.Point |
findPointRelativeToCheckBoxWithAdjustedRendering(int x,
int y,
javax.swing.JCheckBox checkBox,
int index)
Find point relative to the checkbox.
|
protected java.awt.Color |
getBackground(boolean isSelected) |
protected java.awt.Color |
getForeground(boolean isSelected) |
T |
getItemAt(int index) |
protected java.lang.String |
getSecondaryText(int index) |
protected boolean |
isEnabled(int index) |
boolean |
isItemSelected(int index) |
boolean |
isItemSelected(T item) |
void |
setCheckBoxListListener(CheckBoxListListener checkBoxListListener) |
void |
setItems(java.util.List<? extends T> items,
Function<? super T,java.lang.String> converter) |
void |
setItemSelected(T item,
boolean selected) |
void |
setStringItems(java.util.Map<java.lang.String,java.lang.Boolean> items) |
void |
updateItem(T oldItem,
T newItem,
java.lang.String newText) |
createDefaultListModel, createDefaultListModel, createExpandableItemsHandler, disableEmptyText, doCopyToClipboardAction, doLayout, getAccessibleContext, getComponentGraphics, getEmptyText, getExpandableItemsHandler, getItemsCount, getPreferredSize, installCellRenderer, isEmpty, paint, paintComponent, removeNotify, repaint, setCellRenderer, setDataProvider, setEmptyText, setExpandableItemsEnabled, setPaintBusy, setUI
addListSelectionListener, addSelectionInterval, clearSelection, createSelectionModel, ensureIndexIsVisible, fireSelectionValueChanged, getAnchorSelectionIndex, getCellBounds, getCellRenderer, getDragEnabled, getDropLocation, getDropMode, getFirstVisibleIndex, getFixedCellHeight, getFixedCellWidth, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getModel, getNextMatch, getPreferredScrollableViewportSize, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndex, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectedValuesList, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setDragEnabled, setDropMode, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionMode, setSelectionModel, setValueIsAdjusting, setVisibleRowCount, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public CheckBoxList(CheckBoxListListener checkBoxListListener)
public CheckBoxList(javax.swing.DefaultListModel<javax.swing.JCheckBox> dataModel, CheckBoxListListener checkBoxListListener)
public CheckBoxList()
public CheckBoxList(javax.swing.DefaultListModel dataModel)
protected java.awt.Point findPointRelativeToCheckBox(int x, int y, javax.swing.JCheckBox checkBox, int index)
x
- x-coordinate relative to the rendered componenty
- y-coordinate relative to the rendered componentcheckBox
- JCheckBox instanceindex
- The list cell indexprotected java.awt.Point findPointRelativeToCheckBoxWithAdjustedRendering(int x, int y, javax.swing.JCheckBox checkBox, int index)
x
- x-coordinate relative to the rendered componenty
- y-coordinate relative to the rendered componentcheckBox
- JCheckBox instanceindex
- The list cell indexpublic void setStringItems(java.util.Map<java.lang.String,java.lang.Boolean> items)
public void setItems(java.util.List<? extends T> items, Function<? super T,java.lang.String> converter)
public void addItem(T item, java.lang.String text, boolean selected)
public T getItemAt(int index)
public void clear()
public boolean isItemSelected(int index)
public boolean isItemSelected(T item)
public void setItemSelected(T item, boolean selected)
public void setCheckBoxListListener(CheckBoxListListener checkBoxListListener)
protected javax.swing.JComponent adjustRendering(javax.swing.JComponent rootComponent, javax.swing.JCheckBox checkBox, int index, boolean selected, boolean hasFocus)
protected java.lang.String getSecondaryText(int index)
protected boolean isEnabled(int index)
protected java.awt.Color getBackground(boolean isSelected)
protected java.awt.Color getForeground(boolean isSelected)