public class ItemListView extends javax.swing.JList<DraggedItem>
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 |
---|
ItemListView()
Initializes a new instance of the ItemListView class.
|
Modifier and Type | Method and Description |
---|---|
void |
addItem(Item item)
Adds a new item to the end of the list view.
|
void |
addItem(Item item,
java.lang.String label)
Adds a new item to the end of the list view.
|
void |
addItem(Item item,
java.lang.String label,
javax.swing.Icon icon)
Adds a new item to the end of the list view.
|
void |
addItemListViewListener(ItemListViewListener listener)
Registers
listener to receive events when
users select or delete items from the list. |
void |
addItems(Item[] itemList)
Adds the specified items to the end of the list box.
|
void |
addItems(Item[] itemList,
java.lang.String[] textList)
Adds the specified items to the end of the list box.
|
void |
addItems(Item[] itemList,
java.lang.String[] textList,
javax.swing.Icon[] iconList)
Adds the specified items to the end of the list box.
|
void |
addItems(SchedulingItemList itemList)
Adds the specified items to the end of the list box.
|
void |
addItems(SchedulingItemList itemList,
java.util.List<java.lang.String> textList)
Adds the specified items to the end of the list box.
|
void |
addItems(SchedulingItemList itemList,
java.util.List<java.lang.String> textList,
java.util.List<javax.swing.Icon> iconList)
Adds the specified items to the end of the list box.
|
void |
clearItems()
Removes all items from the list view.
|
java.awt.Dimension |
getIconMargin()
Gets the horizontal and vertical margins around the items.
|
Item |
getItemAt(int index)
Gets the item at the specified position.
|
int |
getItemsCount()
Gets the number of items in the list view.
|
java.awt.Dimension |
getItemSize()
Gets the size of the icons displayed in the list.
|
boolean |
getShowIcons()
Gets a value indicating whether to show icons for each list item.
|
boolean |
getShowLabels()
Gets a value indicating whether to show text labels along with icons for each list item.
|
void |
insertItem(int index,
Item item)
Inserts the item at the specified position.
|
void |
insertItem(int index,
Item item,
java.lang.String text)
Inserts the item at the specified position.
|
void |
insertItem(int index,
Item item,
java.lang.String text,
javax.swing.Icon icon)
Inserts the item at the specified position.
|
protected void |
onItemSelected(ItemListEvent e) |
protected void |
onMousePressed(java.awt.event.MouseEvent e) |
protected void |
onSelected(javax.swing.event.ListSelectionEvent e) |
void |
removeItemAt(int index)
Removes the item at the specified position.
|
void |
removeItemListViewListener(ItemListViewListener listener)
Unregisters
listener not to receive ItemListView events. |
void |
setIconMargin(java.awt.Dimension iconMargin)
Sets the horizontal and vertical margins around the items.
|
void |
setItemSize(java.awt.Dimension itemSize)
Sets the size of the icons displayed in the list.
|
void |
setShowIcons(boolean showIcons)
Sets a value specifying whether to show icons for each list item.
|
void |
setShowLabels(boolean showLabels)
Sets a value specifying whether to show text labels along with icons for each list item.
|
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, getSelectedValuesList, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setDragEnabled, setDropMode, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionMode, setSelectionModel, setUI, 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, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, 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
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, 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, 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, transferFocusUpCycle
public ItemListView()
protected void onSelected(javax.swing.event.ListSelectionEvent e)
protected void onMousePressed(java.awt.event.MouseEvent e)
public java.awt.Dimension getItemSize()
Dimension
instance specifying the icon size.public void setItemSize(java.awt.Dimension itemSize)
itemSize
- A Dimension
instance specifying the icon size.public java.awt.Dimension getIconMargin()
Dimension
instance specifying the icon margins.public void setIconMargin(java.awt.Dimension iconMargin)
iconMargin
- A Dimension
instance specifying the icon margins.public void addItem(Item item)
item
- The item to add.public void addItem(Item item, java.lang.String label)
item
- The item to add.label
- The text to be displayed for the item.public void addItem(Item item, java.lang.String label, javax.swing.Icon icon)
item
- The item to add.label
- The text to be displayed for the item.icon
- the icon to be displayed for the itempublic void addItems(SchedulingItemList itemList)
itemList
- The collection of items to add.public void addItems(SchedulingItemList itemList, java.util.List<java.lang.String> textList)
itemList
- The collection of items to add.textList
- The List of texts to be displayed for the items.public void addItems(SchedulingItemList itemList, java.util.List<java.lang.String> textList, java.util.List<javax.swing.Icon> iconList)
itemList
- The collection of items to add.textList
- The List of texts to be displayed for the items.iconList
- The List of Icon
to be displayed for the items.public void addItems(Item[] itemList)
itemList
- The collection of items to add.public void addItems(Item[] itemList, java.lang.String[] textList)
itemList
- The collection of items to add.textList
- The List of texts to be displayed for the items.public void addItems(Item[] itemList, java.lang.String[] textList, javax.swing.Icon[] iconList)
itemList
- The collection of items to add.textList
- The List of texts to be displayed for the items.iconList
- The List of Icon
to be displayed for the items.public void insertItem(int index, Item item)
index
- The zero-based index at which the item should be inserted.item
- The Item
to insert.public void insertItem(int index, Item item, java.lang.String text)
index
- The zero-based index at which the item should be inserted.item
- The Item
to insert.text
- to insertpublic void insertItem(int index, Item item, java.lang.String text, javax.swing.Icon icon)
index
- The zero-based index at which the item should be inserted.item
- The Item
to insert.text
- to inserticon
- The Icon
to insertpublic void removeItemAt(int index)
index
- The zero-based index of the item to remove.public void clearItems()
public Item getItemAt(int index)
index
- An integer value specifying the item's index in the list.Item
at the specified position.public int getItemsCount()
protected void onItemSelected(ItemListEvent e)
public void addItemListViewListener(ItemListViewListener listener)
listener
to receive events when
users select or delete items from the list.listener
- An object implementing the ItemListViewListener
interface.public void removeItemListViewListener(ItemListViewListener listener)
listener
not to receive ItemListView events.listener
- An object implementing the ItemListViewListener
interface.public boolean getShowLabels()
true
if labels are shown.public void setShowLabels(boolean showLabels)
showLabels
- true
if text labels must be shown, otherwise false
.public boolean getShowIcons()
true
if icons are shown.public void setShowIcons(boolean showIcons)
showIcons
- true
if icons must be shown, otherwise false
.