public class ZList<E> extends javax.swing.JList<E> implements Clearable, Steppable
Steppable
so that you can
attach a Stepper Gui.javax.swing.JList.AccessibleJList, javax.swing.JList.DropLocation
javax.swing.JComponent.AccessibleJComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
ZList() |
ZList(ZListModel<E> model) |
Modifier and Type | Method and Description |
---|---|
void |
addAllItems(java.util.Collection items) |
void |
addAllItems(E[] items) |
void |
addIndexChangeListener(IndexChangeEvent.Listener l) |
int |
addItem(E item) |
int |
addItem(int index,
E item) |
void |
addListDataListener(javax.swing.event.ListDataListener l) |
void |
adjustSelection(int rowIndex)
Adjusts the selection such that the given index is selected.
|
void |
clear()
Clears the content
|
boolean |
contains(java.lang.Object obj) |
protected javax.swing.ListSelectionModel |
createSelectionModel() |
protected void |
doOnDoubleClick(java.util.List<E> selectedItems)
This method is called when a mouse double-click was detected on the list component.
|
void |
first() |
ZAction |
getActionClear() |
ZAction |
getActionDelete() |
ZAction |
getActionMoveDown() |
ZAction |
getActionMoveUp() |
java.util.List<E> |
getAllItems() |
java.util.Comparator |
getComparator() |
int |
getCurrentIndex() |
E |
getFirstItem() |
java.lang.Object |
getItem(int index) |
int |
getItemCount() |
E |
getLastItem() |
ZListModel<E> |
getModel() |
ModifyFlag |
getModifyFlag() |
int |
getRecordCount() |
E |
getSelectedItem() |
java.util.List<E> |
getSelectedItems()
Returns the selected Objects as an array.
|
IndexSelectionModel |
getSelectionModel() |
boolean |
hasMultipleSelection() |
boolean |
hasSingleSelection() |
int |
indexOf(java.lang.Object item)
Returns the index of the first occurrence of the given object.
|
boolean |
isChangeConfirmed() |
boolean |
isEmpty() |
boolean |
isLocked() |
boolean |
isModified() |
boolean |
isNumb()
Tells whether the ListModel is in numb state
|
boolean |
isSortAscending() |
void |
last() |
void |
load() |
void |
loadFrom(java.util.Collection<E> objects) |
void |
loadFrom(E[] objects) |
protected boolean |
matchesTypedString(java.lang.Object obj,
java.lang.String typedStr) |
boolean |
next() |
boolean |
previous() |
void |
removeIndexChangeListener(IndexChangeEvent.Listener l) |
int |
removeItem(E item)
Deletes the given object reference from the list.
|
int |
removeItem(E item,
boolean isAdjustSelection)
Same as
removeItem(Object) but adjusts the selection
to the next available object. |
void |
removeItem(int index)
Deletes the object at the given index from the list.
|
void |
removeItem(int index,
boolean isAdjustSelection)
Same as
removeItem(int) but adjusts the selection
to the next available object. |
void |
removeListDataListener(javax.swing.event.ListDataListener l) |
void |
removeSelectedItem(boolean isAdjustSelection) |
int |
replaceItem(E item)
Replaces the item in the list.
|
int |
replaceOrAddItem(E item)
Replaces the item in the list or adds it if it could not be found.
|
void |
scrollToRow(int rowIndex)
Scrolls to the given row index to make it visible.
|
void |
selectAllItems() |
void |
selectItem(E item) |
void |
selectItem(int index) |
void |
selectItems(E[] items) |
void |
selectItems(java.util.List<E> items) |
void |
setComparator(java.util.Comparator cmp) |
boolean |
setCurrentIndex(int i) |
void |
setDoubleClickAction(java.awt.event.ActionListener doubleClickListener)
Adds a listener to react on double clicks.
|
void |
setItem(int index,
E item)
Sets the item at the given index
|
void |
setLocked(boolean isLocked) |
void |
setModified(boolean state) |
void |
setModifyFlag(ModifyFlag flag) |
void |
setNumb(boolean isNumb)
Sets the underlying ListModel in a numb state where it does not fire any events.
|
void |
setSelectedIndex(int index)
Allows for programmatically selecting an item at the specified index.
|
void |
setSelectionMode(ListSelectionMode mode) |
void |
setSortAscending(boolean isAscending) |
addListSelectionListener, addSelectionInterval, clearSelection, ensureIndexIsVisible, fireSelectionValueChanged, getAccessibleContext, getAnchorSelectionIndex, getCellBounds, getCellRenderer, getDragEnabled, getDropLocation, getDropMode, getFirstVisibleIndex, getFixedCellHeight, getFixedCellWidth, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getNextMatch, getPreferredScrollableViewportSize, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndex, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectedValuesList, getSelectionBackground, getSelectionForeground, getSelectionMode, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setDragEnabled, setDropMode, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, 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 ZList()
public ZList(ZListModel<E> model)
public final boolean hasSingleSelection()
public final boolean hasMultipleSelection()
public final void setSelectionMode(ListSelectionMode mode)
public final boolean isSortAscending()
public final void setSortAscending(boolean isAscending)
public final void setComparator(java.util.Comparator cmp)
public final java.util.Comparator getComparator()
public final ZAction getActionDelete()
public final ZAction getActionClear()
public final ZAction getActionMoveUp()
public final ZAction getActionMoveDown()
protected final javax.swing.ListSelectionModel createSelectionModel()
createSelectionModel
in class javax.swing.JList<E>
public final IndexSelectionModel getSelectionModel()
getSelectionModel
in class javax.swing.JList<E>
public final void addIndexChangeListener(IndexChangeEvent.Listener l)
addIndexChangeListener
in interface Steppable
public final void removeIndexChangeListener(IndexChangeEvent.Listener l)
public ZListModel<E> getModel()
getModel
in class javax.swing.JList<E>
public final ModifyFlag getModifyFlag()
public final java.lang.Object getItem(int index)
public final E getFirstItem()
public final E getLastItem()
public final java.util.List<E> getAllItems()
public final void setModifyFlag(ModifyFlag flag)
public final void setModified(boolean state)
public final boolean isModified()
public void load() throws java.lang.Exception
java.lang.Exception
public void loadFrom(java.util.Collection<E> objects)
public void loadFrom(E[] objects)
public final int getItemCount()
public final boolean contains(java.lang.Object obj)
public void clear()
Clearable
public final void addAllItems(java.util.Collection items)
public void addAllItems(E[] items)
public int addItem(E item)
public int addItem(int index, E item)
public final int replaceItem(E item)
public final int replaceOrAddItem(E item)
public final void setItem(int index, E item)
public int removeItem(E item)
public int removeItem(E item, boolean isAdjustSelection)
removeItem(Object)
but adjusts the selection
to the next available object.public void removeItem(int index)
public void removeItem(int index, boolean isAdjustSelection)
removeItem(int)
but adjusts the selection
to the next available object.public final void removeSelectedItem(boolean isAdjustSelection)
public final int indexOf(java.lang.Object item)
public final void adjustSelection(int rowIndex)
public final void setSelectedIndex(int index)
setSelectedIndex
in class javax.swing.JList<E>
public final E getSelectedItem()
public final java.util.List<E> getSelectedItems()
public final void selectItem(int index)
public final void selectItem(E item)
public final void selectItems(java.util.List<E> items)
public final void selectItems(E[] items)
public final void selectAllItems()
public final void setLocked(boolean isLocked)
public final boolean isLocked()
public final void setNumb(boolean isNumb)
public final boolean isNumb()
public final void setDoubleClickAction(java.awt.event.ActionListener doubleClickListener)
public final void addListDataListener(javax.swing.event.ListDataListener l)
public final void removeListDataListener(javax.swing.event.ListDataListener l)
protected boolean matchesTypedString(java.lang.Object obj, java.lang.String typedStr)
public int getRecordCount()
getRecordCount
in interface Steppable
public boolean isChangeConfirmed()
isChangeConfirmed
in interface Steppable
public boolean setCurrentIndex(int i)
setCurrentIndex
in interface Steppable
public int getCurrentIndex()
getCurrentIndex
in interface Steppable
public final void scrollToRow(int rowIndex)
protected void doOnDoubleClick(java.util.List<E> selectedItems)
selectedItems
- the values currently selected in the list.Copyright © 2014 EsprIT-Systems. All Rights Reserved.