|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JList
org.formaria.swing.List
org.formaria.swing.CheckList
public class CheckList
A list box that contains a list of check boxes
Copyright (c) Formaria Ltd., 2001-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.8 $
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JList |
|---|
javax.swing.JList.AccessibleJList, javax.swing.JList.DropLocation |
| 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 |
|---|
| Fields inherited from class org.formaria.swing.List |
|---|
errorMessage, errorStatus, invoker, listModel |
| Fields inherited from class javax.swing.JList |
|---|
HORIZONTAL_WRAP, VERTICAL, VERTICAL_WRAP |
| 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 | |
|---|---|
CheckList()
Create a new checked list |
|
CheckList(java.lang.Object[] items)
Create a new checked list |
|
| Method Summary | |
|---|---|
void |
addItem(java.lang.Object obj)
Add an item to the listmodel |
void |
addItemListener(java.awt.event.ItemListener l)
Adds an ItemListener to the checkbox. |
void |
enableItem(int idx,
boolean selected)
Enable the selection of an item in the list |
protected void |
fireItemStateChanged(java.awt.event.ItemEvent event)
Notifies all listeners that have registered interest for notification on this event type. |
java.lang.String[] |
getSelectedItems()
Get a list of the checked items in the list |
java.lang.Object[] |
getSelectedObjects()
Get the selected objects |
int |
getSelectionMode()
Get the list selection mode. |
boolean |
isItemChecked(int idx)
Get the checked state of the indexed item |
void |
removeItemListener(java.awt.event.ItemListener l)
Removes an ItemListener from the button. |
void |
selectItem(int idx,
boolean selected)
Force the selection of an item in the list |
void |
setAltUnselectedColors(java.awt.Color frgd,
java.awt.Color bkgd)
Set the colors for alternate ( odd ) row colors |
void |
setBorderStyle(java.lang.String style)
Set the border style |
void |
setCellRenderer(javax.swing.ListCellRenderer cellRenderer)
Sets the delegate that is used to paint each cell in the list. |
void |
setDefaultSelection()
Set the list to its default selection state |
void |
toggleAll(boolean select)
Select/unselect all the items in the list |
| Methods inherited from class org.formaria.swing.List |
|---|
addHandler, getItemCount, getSelectedObject, paint, removeAll, select, select, setDragEnabled, setErrorMessage, setErrorStatus, setRenderer, setRendererClass, setSelectedObject, setSelectedObjects, valueChanged |
| Methods inherited from class javax.swing.JList |
|---|
addListSelectionListener, addSelectionInterval, clearSelection, createSelectionModel, ensureIndexIsVisible, fireSelectionValueChanged, getAccessibleContext, 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, getSelectionBackground, getSelectionForeground, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setDropMode, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionMode, setSelectionModel, setUI, setValueIsAdjusting, setVisibleRowCount, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, 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, 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 |
|---|
getSelectedIndex |
| Constructor Detail |
|---|
public CheckList()
public CheckList(java.lang.Object[] items)
items - an array of items to add to the list| Method Detail |
|---|
public void setDefaultSelection()
setDefaultSelection in interface ListHoldersetDefaultSelection in class Listpublic void addItem(java.lang.Object obj)
addItem in interface ListHolderaddItem in class Listobj - the item to be added
public void setAltUnselectedColors(java.awt.Color frgd,
java.awt.Color bkgd)
frgd - the foreground colorbkgd - the background colorpublic void setCellRenderer(javax.swing.ListCellRenderer cellRenderer)
If the prototypeCellValue property is non-null,
setting the cell renderer also causes the fixedCellWidth and
fixedCellHeight properties to be re-calculated. Only one
PropertyChangeEvent is generated however -
for the cellRenderer property.
The default value of this property is provided by the ListUI
delegate, i.e. by the look and feel implementation.
This is a JavaBeans bound property.
setCellRenderer in class javax.swing.JListcellRenderer - the ListCellRenderer
that paints list cellsJList.getCellRenderer()public java.lang.Object[] getSelectedObjects()
ListHolder
getSelectedObjects in interface java.awt.ItemSelectablegetSelectedObjects in interface ListHoldergetSelectedObjects in class Listpublic java.lang.String[] getSelectedItems()
public void enableItem(int idx,
boolean selected)
idx - the index of the itemselected - true to force selection of the item
public void selectItem(int idx,
boolean selected)
idx - the index of the itemselected - true to force selection of the itempublic boolean isItemChecked(int idx)
idx - the index of the item
public void toggleAll(boolean select)
select - true to select the items, false to unselectpublic int getSelectionMode()
getSelectionMode in interface ListHoldergetSelectionMode in class javax.swing.JListpublic void setBorderStyle(java.lang.String style)
style - 0 to turn off the borderpublic void addItemListener(java.awt.event.ItemListener l)
ItemListener to the checkbox.
addItemListener in interface java.awt.ItemSelectablel - the ItemListener to be addedpublic void removeItemListener(java.awt.event.ItemListener l)
ItemListener from the button.
removeItemListener in interface java.awt.ItemSelectablel - the ItemListener to be removedprotected void fireItemStateChanged(java.awt.event.ItemEvent event)
event parameter.
event - the ItemEvent objectEventListenerList
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||