public class TList extends javax.swing.JList implements TView
TList
is used to display elements of data box
in list structure.javax.swing.JList.AccessibleJList, javax.swing.JList.DropLocation
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
CHECK_SELECTION
Define checkbox selection mode.
|
static int |
DEFAULT_SELECTION
Default selection mode.
|
protected boolean |
locked |
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
TList()
Creates a
TList instance with a default
data box created inside the initialization. |
TList(TDataBox box)
Creates a
TList instance with a given data box. |
Modifier and Type | Method and Description |
---|---|
void |
addElementClickedActionListener(java.awt.event.ActionListener l)
Add an element clicked action listener.
|
void |
addElementDoubleClickedActionListener(java.awt.event.ActionListener l)
Add an element double click action listener to the list.
|
void |
addSelectionInterval(int anchor,
int lead)
Sets the selection to be the union of the specified interval with current
selection.
|
void |
addVisibleFilter(VisibleFilter visibleFilter)
Add the given visible filter onto this list.
|
void |
cleanDirtyState()
Calls this method to force this list to publish data.
|
void |
ensureVisible(Element element)
Scroll list view port to make given element list item visible.
|
void |
fireElementClicked(MouseActionEvent event)
Fire element clicked event.
|
void |
fireElementDoubleClicked(MouseActionEvent event)
Fire element double clicked event.
|
CheckableFilter |
getCheckableFilter()
Get the list item checkable filter.
|
TDataBox |
getDataBox()
Gets the connected data box.
|
Element |
getElementByPoint(java.awt.Point point)
Gets the element at the specified mouse point.
|
Element |
getElementByRowIndex(int rowIndex)
Gets the element at the specified row index.
|
java.util.List |
getElementClickedActionListeners()
Gets all element clicked action listeners.
|
java.util.List |
getElementDoubleClickedActionListeners()
Gets all element double clicked action listeners.
|
Generator |
getElementIconGenerator()
Gets the element icon generator for this list.
|
Generator |
getElementLabelGenerator()
Gets the element label generator for this list.
|
Generator |
getElementToolTipTextGenerator()
Gets the element tooltip text generator for this list.
|
PopupMenuGenerator |
getPopupMenuGenerator()
Get popup menu generator for list.
|
TListCellRenderer |
getRenderer()
Gets the cell renderer of this list.
|
int |
getRowIndexByElement(Element element)
Gets the row index of the specified element.
|
java.util.Comparator |
getSortComparator()
Get comparator for list items sorting.
|
int |
getTListSelectionMode()
Get selection mode for TWaver list component.
|
int |
getUncheckableStyle()
Gets the uncheckable style for this list.
|
int |
getUncheckableStyle(Element element) |
java.util.List |
getVisibleFilters()
Gets all visible filters of this list.
|
boolean |
isAutoSyncSelectionFromDataBoxToView()
Determines whether synchronize selection from data box to this list automatically.
|
boolean |
isAutoSyncSelectionFromViewToDataBox()
Determines whether synchronize selection from this list to data box automatically.
|
boolean |
isCenterAlignment()
Checks whether the cell renderer is center alignment.
|
boolean |
isCheckable(Element element)
Return whether the given element is checkable on list.
|
boolean |
isClearSelectionOnMarginClicked()
Returns true if clearing selection when margin (blank area) is clicked.
|
boolean |
isEnableRightClickEvent() |
boolean |
isEnsureVisibleOnSelected()
Check whether element will be
ensure visible when element is selected.
|
boolean |
isIconVisible()
Check whether list item icon is visible.
|
boolean |
isLazyPublishMode()
Determines whether this list uses lazy publish mode.
|
boolean |
isLocked()
Checks whether the list is locked.
|
boolean |
isPaintSelectedStateWhenChecked()
Determines whether to paint selected state when element is checked.
|
boolean |
isSelectableOnRightClick()
Returns true if element is selectable on right click,
false otherwise.
|
boolean |
isVisible(Element element)
Check whether given element is visible on list.
|
int |
locationToIndex(java.awt.Point location) |
void |
lock()
Locks this list from publishing data.
|
void |
paint(java.awt.Graphics g) |
void |
publishData()
publish elements in connected data box.
|
void |
removeElementClickedActionListener(java.awt.event.ActionListener l)
Remove element clicked action listener from list.
|
void |
removeElementDoubleClickedActionListener(java.awt.event.ActionListener l)
Remove the element double click action listener from list.
|
void |
removeVisibleFilter(VisibleFilter visibleFilter)
Remove the given visible filter from this list.
|
void |
setAutoSyncSelectionFromDataBoxToView(boolean autoSyncSelectionFromDataBoxToList)
Sets whether synchronize selection from data box to this list automatically.
|
void |
setAutoSyncSelectionFromViewToDataBox(boolean autoSyncSelectionFromListToDataBox)
Sets whether synchronize selection from this list to data box automatically.
|
void |
setCellRenderer(javax.swing.ListCellRenderer cellRenderer)
Sets a new cell renderer for this list.
|
void |
setCenterAlignment(boolean isCenterAlignment)
Sets whether the cell renderer is center alignment.
|
void |
setCheckableFilter(CheckableFilter checkableFilter)
Set the list item checkable filter.
|
void |
setClearSelectionOnMarginClicked(boolean isClearSelectionOnMarginClicked)
Use this method to determines whether clear selection
when blank area is clicked.
|
void |
setDataBox(TDataBox box)
Sets a new data box for this list.
|
void |
setElementIconGenerator(Generator elementIconGenerator)
Sets the element icon generator for this list.
|
void |
setElementLabelGenerator(Generator elementLabelGenerator)
Sets the element label generator for this list.
|
void |
setElementToolTipTextGenerator(Generator elementToolTipTextGenerator)
Sets the element tooltip text generator for this list.
|
void |
setEnableRightClickEvent(boolean isEnableRightClickEvent) |
void |
setEnsureVisibleOnSelected(boolean isEnsureVisibleOnSelected)
Set value used to determine whether element will be
ensure visible when element is selected.
|
void |
setIconVisible(boolean isIconVisible)
Determine whether list item icon is visible.
|
void |
setLazyPublishMode(boolean lazyPublishMode)
Sets whether the list should use the lazy publish mode.
|
void |
setPaintSelectedStateWhenChecked(boolean paintSelectedStateWhenChecked)
Sets whether to paint selected state when element is checked.
|
void |
setPopupMenuGenerator(PopupMenuGenerator popupMenuGenerator)
Set popup menu generator for list.
|
void |
setSelectableOnRightClick(boolean isSelectableOnRightClick)
Set whether element is selectable on right click.
|
void |
setSortComparator(java.util.Comparator sortComparator)
Set comparator for list items sorting.
|
void |
setTListSelectionMode(int selectionMode)
Set selection mode for TWaver list component.
|
void |
setUncheckableStyle(int uncheckableStyle)
Sets the uncheckable style for this list.
|
void |
unlock()
Unlocks the list for republish data.
|
void |
updateTViewUI()
Calls this method to publish data.
|
void |
updateUI() |
addListSelectionListener, 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, paramString, removeListSelectionListener, removeSelectionInterval, setDragEnabled, setDropMode, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionBackground, setSelectionForeground, setSelectionInterval, setSelectionMode, setSelectionModel, setUI, setValueIsAdjusting, setVisibleRowCount
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, 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 static final int DEFAULT_SELECTION
public static final int CHECK_SELECTION
protected boolean locked
public TList()
TList
instance with a default
data box created inside the initialization.public TList(TDataBox box)
TList
instance with a given data box.box
- the connected data box.public void lock()
unlock()
public boolean isLocked()
public void unlock()
lock()
public java.util.List getElementDoubleClickedActionListeners()
public java.util.List getElementClickedActionListeners()
public void setCellRenderer(javax.swing.ListCellRenderer cellRenderer)
Notice that the cellRenderer for TList
should be
an instance of TListCellRenderer
.
setCellRenderer
in class javax.swing.JList
public TListCellRenderer getRenderer()
public boolean isCenterAlignment()
public void setCenterAlignment(boolean isCenterAlignment)
isCenterAlignment
- True if the cell renderer is center alignment, false otherwise.public Element getElementByPoint(java.awt.Point point)
point
- the specified mouse point.public int locationToIndex(java.awt.Point location)
locationToIndex
in class javax.swing.JList
public TDataBox getDataBox()
getDataBox
in interface TView
TView.setDataBox(twaver.TDataBox)
public void setDataBox(TDataBox box)
setDataBox
in interface TView
box
- TDataBox the databox of this viewTView.getDataBox()
public void addSelectionInterval(int anchor, int lead)
selectionModel
. The
DefaultListSelectionModel
implementation
will do nothing if either anchor
or
lead
are -1.
If anchor
or lead
are less than -1,
IndexOutOfBoundsException
is thrown.addSelectionInterval
in class javax.swing.JList
anchor
- the first index to add to the selectionlead
- the last index to add to the selectionjava.lang.IndexOutOfBoundsException
- if either anchor
or lead
are less than -1ListSelectionModel.addSelectionInterval(int, int)
,
JList.setSelectionInterval(int, int)
,
JList.removeSelectionInterval(int, int)
,
JList.addListSelectionListener(javax.swing.event.ListSelectionListener)
public void setEnsureVisibleOnSelected(boolean isEnsureVisibleOnSelected)
isEnsureVisibleOnSelected
- boolean true if element
should ensure visible on selected, false otherwise.isEnsureVisibleOnSelected
public boolean isEnsureVisibleOnSelected()
setEnsureVisibleOnSelected(boolean)
public void ensureVisible(Element element)
element
- Element the element to be ensured visible#ensureVisibleAtCurrentPage
public void updateTViewUI()
updateTViewUI
in interface TView
public boolean isVisible(Element element)
element
- Element an element to be checkedaddVisibleFilter(twaver.VisibleFilter)
public java.util.List getVisibleFilters()
public void addVisibleFilter(VisibleFilter visibleFilter)
visibleFilter
- VisibleFilter the visible filter
to be added.removeVisibleFilter(twaver.VisibleFilter)
public void removeVisibleFilter(VisibleFilter visibleFilter)
visibleFilter
- VisibleFilter the visible filter
to be removed.addVisibleFilter(twaver.VisibleFilter)
public int getRowIndexByElement(Element element)
element
- the element to be queried.public Element getElementByRowIndex(int rowIndex)
rowIndex
- the row index to be queried.public int getTListSelectionMode()
setTListSelectionMode(int)
public void setTListSelectionMode(int selectionMode)
selectionMode
- int list selection modegetTListSelectionMode()
public CheckableFilter getCheckableFilter()
setCheckableFilter(twaver.CheckableFilter)
public void setCheckableFilter(CheckableFilter checkableFilter)
checkableFilter
- CheckableFilter the list item
checkable filter to be usedgetCheckableFilter()
public boolean isCheckable(Element element)
element
- Element an element to be checked.public java.util.Comparator getSortComparator()
setSortComparator(java.util.Comparator)
public void setSortComparator(java.util.Comparator sortComparator)
sortComparator
- Comparator comparator for sortgetSortComparator()
public boolean isIconVisible()
setIconVisible(boolean)
public void setIconVisible(boolean isIconVisible)
isIconVisible
- boolean true if show list item icon,
false otherwise.isIconVisible
public PopupMenuGenerator getPopupMenuGenerator()
PopupMenuGenerator
for more information.public void setPopupMenuGenerator(PopupMenuGenerator popupMenuGenerator)
PopupMenuGenerator
for more information.popupMenuGenerator
- PopupMenuGenerator the popup menu generator
to be used for this listpublic void addElementDoubleClickedActionListener(java.awt.event.ActionListener l)
l
- ActionListener action listener to be addedremoveElementDoubleClickedActionListener(java.awt.event.ActionListener)
public void removeElementDoubleClickedActionListener(java.awt.event.ActionListener l)
l
- ActionListener action listener to be removedaddElementDoubleClickedActionListener(java.awt.event.ActionListener)
public void fireElementDoubleClicked(MouseActionEvent event)
event
- MouseActionEvent the event to be fired.public void addElementClickedActionListener(java.awt.event.ActionListener l)
l
- ActionListener action listener to be added.removeElementClickedActionListener(java.awt.event.ActionListener)
public void removeElementClickedActionListener(java.awt.event.ActionListener l)
l
- ActionListener the listener to be removedaddElementClickedActionListener(java.awt.event.ActionListener)
public void fireElementClicked(MouseActionEvent event)
event
- MouseActionEvent event to be firedpublic void cleanDirtyState()
setLazyPublishMode(boolean)
public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
public void updateUI()
updateUI
in class javax.swing.JList
public void publishData()
public boolean isPaintSelectedStateWhenChecked()
public void setPaintSelectedStateWhenChecked(boolean paintSelectedStateWhenChecked)
paintSelectedStateWhenChecked
- True to paint selected state, false otherwise.public Generator getElementIconGenerator()
public void setElementIconGenerator(Generator elementIconGenerator)
elementIconGenerator
- the element icon generator for this list.public Generator getElementLabelGenerator()
public void setElementLabelGenerator(Generator elementLabelGenerator)
elementLabelGenerator
- the element label generator for this list.public Generator getElementToolTipTextGenerator()
public void setElementToolTipTextGenerator(Generator elementToolTipTextGenerator)
elementToolTipTextGenerator
- the element tooltip text generator for this list.public int getUncheckableStyle(Element element)
public int getUncheckableStyle()
setUncheckableStyle(int)
public void setUncheckableStyle(int uncheckableStyle)
uncheckableStyle
- public boolean isAutoSyncSelectionFromDataBoxToView()
public void setAutoSyncSelectionFromDataBoxToView(boolean autoSyncSelectionFromDataBoxToList)
autoSyncSelectionFromDataBoxToList
- True to synchronize selection from
data box to this list automatically. false otherwise.public boolean isAutoSyncSelectionFromViewToDataBox()
public void setAutoSyncSelectionFromViewToDataBox(boolean autoSyncSelectionFromListToDataBox)
autoSyncSelectionFromListToDataBox
- True to synchronize selection from
this list to data box automatically. false otherwise.public boolean isLazyPublishMode()
setLazyPublishMode(boolean)
public void setLazyPublishMode(boolean lazyPublishMode)
lazyPublishMode
- If true the list should use the lazy publish mode, false otherwise.isLazyPublishMode()
public boolean isSelectableOnRightClick()
setSelectableOnRightClick(boolean)
public void setSelectableOnRightClick(boolean isSelectableOnRightClick)
isSelectableOnRightClick
- boolean true if
element is selectable on right click, false otherwise.isSelectableOnRightClick
public boolean isClearSelectionOnMarginClicked()
setClearSelectionOnMarginClicked(boolean)
public void setClearSelectionOnMarginClicked(boolean isClearSelectionOnMarginClicked)
isClearSelectionOnMarginClicked
- boolean true
if clearing selection when margin (blank area) is clicked,
false otherwise.isClearSelectionOnMarginClicked
public boolean isEnableRightClickEvent()
public void setEnableRightClickEvent(boolean isEnableRightClickEvent)
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.