|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JList com.alee.laf.list.WebList
public class WebList
This JList extension class provides a direct access to WebListUI methods. There is also a set of additional methods to simplify some operations with list.
This component should never be used with a non-Web UIs as it might cause an unexpected behavior. You could still use that component even if WebLaF is not your application L&F as this component will use Web-UI in any case.
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 | |
---|---|
protected boolean |
editable
Whether this list is editable or not. |
protected int |
editedCell
Currently edited cell index or -1 if none edited at the moment. |
protected java.util.List<ListEditListener> |
editListeners
List edit lsiteners. |
protected ListCellEditor |
listCellEditor
List cell editor. |
protected boolean |
unselectable
Whether list allows an empty selection or not. |
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 | |
---|---|
WebList()
Constructs empty list. |
|
WebList(java.util.List listData)
Constructs list with the specified data. |
|
WebList(javax.swing.ListModel dataModel)
Constructs list with the specified list model. |
|
WebList(java.lang.Object[] listData)
Constructs list with the specified data. |
|
WebList(java.util.Vector listData)
Constructs list with the specified data. |
Method Summary | ||
---|---|---|
void |
addListDataListener(javax.swing.event.ListDataListener listener)
Adds a listener to the list that's notified each time a change to the data model occurs. |
|
void |
addListEditListener(ListEditListener listener)
Adds list edit listener into this list. |
|
WebList |
changeFontSize(int change)
Changes font size of the specified component. |
|
protected ListCellEditor |
createDefaultCellEditor()
Returns default cell editor for this list. |
|
void |
editCell(int index)
Forces the cell under specified index into editing mode. |
|
void |
editSelectedCell()
Forces selected cell into editing mode. |
|
void |
fireEditCancelled(int index)
Informs all listener that editing was cancelled. |
|
void |
fireEditFinished(int index,
java.lang.Object oldValue,
java.lang.Object newValue)
Informs all listener that editing was finished. |
|
void |
fireEditStarted(int index)
Informs all listener that editing was started. |
|
ListCellEditor |
getCellEditor()
Returns cell editor for this list. |
|
int |
getEditedCell()
Returns currently edited cell index or -1 if none edited at the moment. |
|
java.lang.String |
getFontName()
Returns component font name. |
|
int |
getFontSize()
Returns component font size. |
|
int |
getMinimumHeight()
Returns component minimum height. |
|
int |
getMinimumWidth()
Returns component minimum width. |
|
int |
getModelSize()
Returns list model size. |
|
int |
getPreferredHeight()
Returns component preferred height. |
|
java.awt.Dimension |
getPreferredSize()
Returns component preferred size. |
|
int |
getPreferredWidth()
Returns component preferred width. |
|
int |
getSelectionRound()
Returns cells selection rounding. |
|
int |
getSelectionShadeWidth()
Returns cells selection shade width. |
|
|
getValueAt(int index)
Returns model value at the specified cell index. |
|
WebListCellRenderer |
getWebListCellRenderer()
Returns specific web list cell renderer or null if a custom non-web renderer is installed. |
|
WebListModel |
getWebModel()
Returns specific web list model or null if another type of model is used. |
|
WebListUI |
getWebUI()
Returns Web-UI applied to this class. |
|
boolean |
isAutoScrollToSelection()
Returns whether to scroll list down to selection automatically or not. |
|
boolean |
isBoldFont()
Returns whether component font is bold or not. |
|
boolean |
isDecorateSelection()
Returns whether should decorate selected and rollover cells or not. |
|
boolean |
isEditable()
Returns whether this list is editable or not. |
|
boolean |
isEditing()
Returns whether some list cell is being edited at the moment or not. |
|
boolean |
isHighlightRolloverCell()
Returns whether should highlight rollover cell or not. |
|
boolean |
isItalicFont()
Returns whether component font is italic or not. |
|
boolean |
isPlainFont()
Returns whether component font is plain or not. |
|
boolean |
isRolloverSelectionEnabled()
Returns whether rollover selection is enabled for this list or not. |
|
boolean |
isUnselectable()
Returns whether list allows an empty selection or not. |
|
void |
removeCellEditor()
Uninstalls cell editor from this list. |
|
void |
removeListDataListener(javax.swing.event.ListDataListener listener)
Removes a listener from the list that's notified each time a change to the data model occurs. |
|
void |
removeListEditListener(ListEditListener listener)
Removes list edit lsitener from this list. |
|
void |
repaint(int index)
Repaints list cell under the specified index. |
|
void |
repaint(int from,
int to)
Repaints all list cells between the specified indices. |
|
void |
repaint(java.lang.Object value)
Repaints list cell for the specified value. |
|
void |
scrollToCell(int index)
Scrolls list to specified cell. |
|
void |
setAutoScrollToSelection(boolean autoScrollToSelection)
Sets whether to scroll list down to selection automatically or not. |
|
WebList |
setBoldFont()
Sets bold font for the component. |
|
WebList |
setBoldFont(boolean apply)
Sets bold font for the component. |
|
void |
setCellEditor(ListCellEditor listCellEditor)
Installs cell editor for this list. |
|
void |
setDecorateSelection(boolean decorateSelection)
Sets whether should decorate selected and rollover cells or not. |
|
void |
setEditable(boolean editable)
Sets whether this list is editable or not. |
|
WebList |
setFontName(java.lang.String fontName)
Sets component font name. |
|
WebList |
setFontSize(int fontSize)
Sets component font size. |
|
WebList |
setFontSizeAndStyle(int fontSize,
boolean bold,
boolean italic)
Sets font size and style for the specified component. |
|
WebList |
setFontSizeAndStyle(int fontSize,
int style)
Sets font size and style for the specified component. |
|
WebList |
setFontStyle(boolean bold,
boolean italic)
Sets component font style. |
|
WebList |
setFontStyle(int style)
Sets component font style. |
|
void |
setHighlightRolloverCell(boolean highlightRolloverCell)
Sets whether should highlight rollover cell or not. |
|
WebList |
setItalicFont()
Sets italic or plain font for the component. |
|
WebList |
setItalicFont(boolean apply)
Sets italic or plain font for the component. |
|
WebList |
setMinimumHeight(int minimumHeight)
Sets component minimum height. |
|
WebList |
setMinimumWidth(int minimumWidth)
Sets component minimum width. |
|
void |
setMultiplySelectionAllowed(boolean allowed)
Sets whether multiply values selection allowed or not. |
|
WebList |
setPlainFont()
Sets plain font for the component. |
|
WebList |
setPlainFont(boolean apply)
Sets plain font for the component. |
|
WebList |
setPreferredHeight(int preferredHeight)
Sets component preferred height. |
|
WebList |
setPreferredWidth(int preferredWidth)
Sets component preferred width. |
|
void |
setRolloverSelectionEnabled(boolean enabled)
Sets whether rollover selection is enabled for this list or not. |
|
void |
setSelectedValue(java.lang.Object element)
Sets selected value and scrolls view to its cell. |
|
void |
setSelectedValues(java.util.Collection values)
Selects all specified values. |
|
void |
setSelectedValues(java.util.List values)
Selects all specified values. |
|
void |
setSelectedValues(java.lang.Object[] values)
Selects all specified values. |
|
void |
setSelectionRound(int selectionRound)
Sets cells selection rounding. |
|
void |
setSelectionShadeWidth(int selectionShadeWidth)
Sets cells selection shade width. |
|
void |
setUnselectable(boolean unselectable)
Sets whether list allows an empty selection or not. |
|
boolean |
stopCellEditing()
Stops cell editing if possible. |
|
void |
updateUI()
Installs a Web-UI into this component. |
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, 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 |
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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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 |
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, removeAll, 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 |
Field Detail |
---|
protected java.util.List<ListEditListener> editListeners
protected boolean editable
protected ListCellEditor listCellEditor
protected int editedCell
protected boolean unselectable
Constructor Detail |
---|
public WebList()
public WebList(java.util.List listData)
listData
- list datapublic WebList(java.util.Vector listData)
listData
- list datapublic WebList(java.lang.Object[] listData)
listData
- list datapublic WebList(javax.swing.ListModel dataModel)
dataModel
- list modelMethod Detail |
---|
public void setMultiplySelectionAllowed(boolean allowed)
allowed
- whether multiply values selection allowed or notpublic WebListCellRenderer getWebListCellRenderer()
public WebListModel getWebModel()
public void setSelectedValue(java.lang.Object element)
element
- element to selectpublic void setSelectedValues(java.lang.Object[] values)
values
- values to selectpublic void setSelectedValues(java.util.Collection values)
values
- values to selectpublic void setSelectedValues(java.util.List values)
values
- values to selectpublic boolean isEditable()
public void setEditable(boolean editable)
editable
- whether this list is editable or notpublic boolean isRolloverSelectionEnabled()
public void setRolloverSelectionEnabled(boolean enabled)
enabled
- whether rollover selection is enabled for this list or notpublic void setCellEditor(ListCellEditor listCellEditor)
listCellEditor
- new cell editorprotected ListCellEditor createDefaultCellEditor()
public ListCellEditor getCellEditor()
public void removeCellEditor()
public void editSelectedCell()
public void editCell(int index)
index
- index for the cell to editpublic boolean stopCellEditing()
public boolean isEditing()
public boolean isUnselectable()
public void setUnselectable(boolean unselectable)
unselectable
- whether list allows an empty selection or notpublic int getModelSize()
public <T> T getValueAt(int index)
T
- value typeindex
- cell index
public void addListDataListener(javax.swing.event.ListDataListener listener)
listener
- the ListDataListener to be addedpublic void removeListDataListener(javax.swing.event.ListDataListener listener)
listener
- the ListDataListener to be removedpublic void scrollToCell(int index)
index
- cell indexpublic boolean isDecorateSelection()
public void setDecorateSelection(boolean decorateSelection)
decorateSelection
- whether should decorate selected and rollover cells or notpublic boolean isHighlightRolloverCell()
public void setHighlightRolloverCell(boolean highlightRolloverCell)
highlightRolloverCell
- whether should highlight rollover cell or notpublic int getSelectionRound()
public void setSelectionRound(int selectionRound)
selectionRound
- new cells selection roundingpublic int getSelectionShadeWidth()
public void setSelectionShadeWidth(int selectionShadeWidth)
selectionShadeWidth
- new cells selection shade widthpublic boolean isAutoScrollToSelection()
public void setAutoScrollToSelection(boolean autoScrollToSelection)
autoScrollToSelection
- whether to scroll list down to selection automatically or notpublic WebListUI getWebUI()
public void updateUI()
updateUI
in class javax.swing.JList
public void repaint(java.lang.Object value)
value
- cell valuepublic void repaint(int index)
index
- cell indexpublic void repaint(int from, int to)
from
- first cell indexto
- last cell indexpublic int getEditedCell()
public void addListEditListener(ListEditListener listener)
listener
- list edit listener to addpublic void removeListEditListener(ListEditListener listener)
listener
- list edit listener to removepublic void fireEditStarted(int index)
index
- edited cell indexpublic void fireEditFinished(int index, java.lang.Object oldValue, java.lang.Object newValue)
index
- edited cell indexoldValue
- old cell valuenewValue
- new cell valuepublic void fireEditCancelled(int index)
index
- edited cell indexpublic WebList setPlainFont()
setPlainFont
in interface FontMethods<WebList>
public WebList setPlainFont(boolean apply)
setPlainFont
in interface FontMethods<WebList>
apply
- whether to apply font changes or not
public boolean isPlainFont()
isPlainFont
in interface FontMethods<WebList>
public WebList setBoldFont()
setBoldFont
in interface FontMethods<WebList>
public WebList setBoldFont(boolean apply)
setBoldFont
in interface FontMethods<WebList>
apply
- whether to apply font changes or not
public boolean isBoldFont()
isBoldFont
in interface FontMethods<WebList>
public WebList setItalicFont()
setItalicFont
in interface FontMethods<WebList>
public WebList setItalicFont(boolean apply)
setItalicFont
in interface FontMethods<WebList>
apply
- whether to apply font changes or not
public boolean isItalicFont()
isItalicFont
in interface FontMethods<WebList>
public WebList setFontStyle(boolean bold, boolean italic)
setFontStyle
in interface FontMethods<WebList>
bold
- whether should set bold font or notitalic
- whether should set italic font or not
public WebList setFontStyle(int style)
setFontStyle
in interface FontMethods<WebList>
style
- new style
public WebList setFontSize(int fontSize)
setFontSize
in interface FontMethods<WebList>
fontSize
- font size
public WebList changeFontSize(int change)
changeFontSize
in interface FontMethods<WebList>
change
- font size change amount
public int getFontSize()
getFontSize
in interface FontMethods<WebList>
public WebList setFontSizeAndStyle(int fontSize, boolean bold, boolean italic)
setFontSizeAndStyle
in interface FontMethods<WebList>
fontSize
- new font sizebold
- whether should set bold font or notitalic
- whether should set italic font or not
public WebList setFontSizeAndStyle(int fontSize, int style)
setFontSizeAndStyle
in interface FontMethods<WebList>
fontSize
- new font sizestyle
- new style
public WebList setFontName(java.lang.String fontName)
setFontName
in interface FontMethods<WebList>
fontName
- new font name
public java.lang.String getFontName()
getFontName
in interface FontMethods<WebList>
public int getPreferredWidth()
getPreferredWidth
in interface SizeMethods<WebList>
public WebList setPreferredWidth(int preferredWidth)
setPreferredWidth
in interface SizeMethods<WebList>
preferredWidth
- new component preferred width
public int getPreferredHeight()
getPreferredHeight
in interface SizeMethods<WebList>
public WebList setPreferredHeight(int preferredHeight)
setPreferredHeight
in interface SizeMethods<WebList>
preferredHeight
- new component preferred height
public int getMinimumWidth()
getMinimumWidth
in interface SizeMethods<WebList>
public WebList setMinimumWidth(int minimumWidth)
setMinimumWidth
in interface SizeMethods<WebList>
minimumWidth
- new component minimum width
public int getMinimumHeight()
getMinimumHeight
in interface SizeMethods<WebList>
public WebList setMinimumHeight(int minimumHeight)
setMinimumHeight
in interface SizeMethods<WebList>
minimumHeight
- new component minimum height
public java.awt.Dimension getPreferredSize()
getPreferredSize
in interface SizeMethods<WebList>
getPreferredSize
in class javax.swing.JComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |