@BeanSettings(useXdevCustomizer=true) public class XdevListBox extends JList implements ExtendedList<XdevListBox>, XdevFocusCycleComponent, PopupRowSelectionHandler, Pageable
JList
.JList
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
XdevListBox.ItemListModelWrapper |
protected class |
XdevListBox.XdevCheckBoxListCellRenderer |
protected class |
XdevListBox.XdevListCellRenderer |
protected class |
XdevListBox.XdevListSelectionModel |
JList.AccessibleJList, JList.DropLocation
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
MasterDetailComponent.DetailHandler
FormularComponent.ValueChangeListener
Modifier and Type | Field and Description |
---|---|
static String |
CHECKBOX_LIST_PROPERTY |
static String |
EVEN_BACKGROUND_PROPERTY |
static String |
ODD_BACKGROUND_PROPERTY |
HORIZONTAL_WRAP, VERTICAL, VERTICAL_WRAP
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
DATA_FIELD_SEPARATOR
TAB_INDEX_PROPERTY
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
XdevListBox()
Constructs a
XdevListBox that is initialized with a default
ListCellRenderer . |
XdevListBox(boolean checkable)
Constructs a
XdevListBox that is initialized with a default
ListCellRenderer . |
XdevListBox(ItemList il)
|
XdevListBox(ItemList il,
boolean checkable)
|
XdevListBox(ListModel model)
|
XdevListBox(ListModel model,
boolean checkable)
|
Modifier and Type | Method and Description |
---|---|
void |
addValidator(Validator validator)
Adds a validator to this component
|
void |
addValueChangeListener(FormularComponent.ValueChangeListener l)
Registers a
FormularComponent.ValueChangeListener . |
void |
clearModel()
Clears the underlying data model, mostly a
VirtualTable , and the
view. |
protected ListCellRenderer |
createCheckBoxListCellRenderer() |
protected ListCellRenderer |
createDefaultListCellRenderer() |
protected ListSelectionModel |
createListSelectionModel() |
Rectangle |
getCellBounds(int index0,
int index1) |
String |
getDataField()
Returns the name of the bound data field of this formular component.
|
Color |
getEvenBackground()
Returns the background
Color of even rows. |
Operator |
getFilterOperator()
Returns the operator used in
Formular.createCondition(String) |
String |
getFormularName()
Returns the name of the component in the formular context.
|
Object |
getFormularValue()
Returns the value of the component.
|
ItemList |
getItemList()
|
Color |
getOddBackground()
Returns the background
Color of odd rows. |
ListBoxPageControl |
getPageControl() |
Dimension |
getPreferredScrollableViewportSize() |
Dimension |
getPreferredSize() |
int |
getRowAtPoint(int x,
int y)
This method is a alias for
getRowAtPoint(Point) . |
int |
getRowAtPoint(Point location)
Returns the row index closest to the given location in the list's
coordinate system.
|
Object |
getSelectedData()
Returns the data for the selected value from
ItemList . |
XdevList<Object> |
getSelectedDataAsList()
Returns all data of the selected list entries as a list.
|
XdevList<Integer> |
getSelectedIndicesAsList()
Returns a
XdevList of all of the selected indices, in increasing
order. |
Object |
getSelectedItem()
Returns the item for the selected value from
ItemList . |
XdevList<Object> |
getSelectedItemsAsList()
Returns all items of the selected list entries as a list.
|
int |
getSelectedModelIndex()
Returns the modelindex of the selected item.
|
int[] |
getSelectedModelIndices()
Returns the modelindices of the selected items.
|
VirtualTable.VirtualTableRow |
getSelectedVirtualTableRow()
Returns the selected
VirtualTable.VirtualTableRow of this component, or
null if nothing is selected. |
VirtualTable.VirtualTableRow[] |
getSelectedVirtualTableRows()
Returns the selected
VirtualTable.VirtualTableRow s of this component, or an
empty array if nothing is selected. |
int |
getTabIndex()
Returns the tabindex assigned to this component.
|
Validator[] |
getValidators()
Returns all validators of this component.
|
VirtualTable |
getVirtualTable()
Returns the associated
VirtualTable of this object. |
void |
handlePopupRowSelection(int x,
int y)
Handles the row selection of and
PopupRowSelectionHandler . |
boolean |
hasStateChanged()
Checks if the component's state since the last call of
FormularComponent.saveState() has changed. |
boolean |
isCheckBoxList()
|
protected boolean |
isElementSelectable(Object item) |
boolean |
isMultiSelect()
Returns whether the component supports multi selection or not.
|
boolean |
isPagingEnabled() |
boolean |
isReadOnly()
Determines whether this component is only used to display values.
|
boolean |
isSomethingSelected()
Verify if a item is selected.
|
ItemList |
modelToItemList(ListModel model)
Create a new
ItemList based on the provided model . |
void |
refresh()
Reloads the data from the underlying data source with the last executed
resp.
|
void |
removeValidator(Validator validator)
Removes a validator from this component
|
void |
restoreState()
Restores the internally saved state of the component.
|
void |
saveState()
Saves the state of the component internally.
|
void |
selectAll()
Select all items in the
XdevListBox . |
void |
setCheckBoxList(boolean checkBoxList)
Sets if this list should use checkboxes to render the list entries.
|
void |
setDataField(String dataField)
Sets the name of the bound data field of this formular component.
|
void |
setDetailHandler(MasterDetailComponent.DetailHandler detailHandler)
Sets the handler which controls the corporation of two
MasterDetailComponent s. |
void |
setEvenBackground(Color evenBackground)
Sets the background
Color of even rows. |
void |
setFilterOperator(Operator filterOperator)
Sets the filter operator used in
Formular.createCondition(String) |
void |
setFormularValue(VirtualTable vtRow,
int col,
Object value)
Deprecated.
|
void |
setFormularValue(VirtualTable vt,
Map<String,Object> record)
Sets the value of the component, taking the value(s) of the record
according to
FormularComponent.getDataField() . |
void |
setItemList(ItemList itemList)
Sets the
ItemList that represents the contents or "value" of the
ExtendedList and then clears the list's selection. |
void |
setMasterValue(VirtualTable vt,
Map<String,Object> record)
Sets the value of this component (master), taking the value(s) of the
record.
|
void |
setModel(VirtualTable vt,
String itemCol,
String dataCol)
Updates the underlying model with data from the
VirtualTable vt. |
void |
setModel(VirtualTable vt,
String itemCol,
String dataCol,
boolean queryData)
Updates the underlying model with data from the
VirtualTable vt. |
void |
setModel(VirtualTable vt,
String itemCol,
String dataCol,
boolean queryData,
boolean selectiveQuery)
Updates the underlying model with data from the
VirtualTable vt. |
void |
setOddBackground(Color oddBackground)
Sets the background
Color of odd rows. |
void |
setPagingEnabled(boolean pagingEnabled)
Turns the paging behavior on or off.
|
void |
setReadOnly(boolean readOnly)
Sets if this form component is only used to display values.
|
void |
setSelectedData(Collection<?> dataList)
Selects all entries with a data in the list
dataList . |
void |
setSelectedData(Object o)
Selects the specified data from the
XdevList . |
void |
setSelectedIndices(Collection<Integer> indices)
Changes the selection to be the set of indices specified by the given
XdevList . |
void |
setSelectedItem(Object o)
Selects the specified item.
|
void |
setSelectedItems(Collection<?> items)
Selects all entries with an item in the list
items . |
void |
setSelectedModelIndex(int index)
Selects the item at modelindex
anIndex . |
void |
setSelectedModelIndices(int[] indices)
Selects the items at their modelindices position
indices . |
void |
setSelectedVirtualTableRow(VirtualTable.VirtualTableRow row)
Selects the row in the list if present.
|
void |
setSelectedVirtualTableRows(VirtualTable.VirtualTableRow[] rows)
Selects the rows in the list if present.
|
void |
setTabIndex(int tabIndex)
Sets the tabindex of this component.
|
void |
setVirtualTable(VirtualTable vt)
Sets the
VirtualTable containing the valid values for this
component. |
void |
setVisibleRowCount(int visibleRowCount) |
String |
toString() |
void |
updateModel(Condition condition,
Object... params)
Reloads the data form the underlying data source.
|
void |
validateState()
Calls
Validator.validate(Object) of all registered
Validator s. |
void |
validateState(Validation validation)
Calls
Validator.validate(Object) of all registered
Validator s. |
boolean |
verify()
Returns whether the component's value adheres all set constraints.
|
addListSelectionListener, addSelectionInterval, clearSelection, createSelectionModel, ensureIndexIsVisible, fireSelectionValueChanged, getAccessibleContext, getAnchorSelectionIndex, getCellRenderer, getDragEnabled, getDropLocation, getDropMode, getFirstVisibleIndex, getFixedCellHeight, getFixedCellWidth, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getModel, getNextMatch, 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, 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getClientProperty, isEnabled, isVisible, putClientProperty
public static final String CHECKBOX_LIST_PROPERTY
public static final String EVEN_BACKGROUND_PROPERTY
public static final String ODD_BACKGROUND_PROPERTY
public XdevListBox()
XdevListBox
that is initialized with a default
ListCellRenderer
.setCheckBoxList(boolean)
,
setItemList(ItemList)
public XdevListBox(boolean checkable)
XdevListBox
that is initialized with a default
ListCellRenderer
.checkable
- if true
the XdevListBox
items are
initialized with a checkbox stylesetItemList(ItemList)
,
setCheckBoxList(boolean)
public XdevListBox(ItemList il)
il
- represents the contents or "value" of this XdevListBox
setItemList(ItemList)
,
setCheckBoxList(boolean)
public XdevListBox(ListModel model)
model
- the ListModel
for this XdevListBox
JList.setModel(ListModel)
,
setCheckBoxList(boolean)
public XdevListBox(ItemList il, boolean checkable)
il
- represents the contents or "value" of this XdevListBox
checkable
- if true
the XdevListBox
items are
initialized with a checkbox stylesetCheckBoxList(boolean)
,
setItemList(ItemList)
public XdevListBox(ListModel model, boolean checkable)
model
- the ListModel
for this XdevListBox
checkable
- if true
the XdevListBox
items are
initialized with a checkbox stylesetCheckBoxList(boolean)
,
JList.setModel(ListModel)
protected boolean isElementSelectable(Object item)
public void setCheckBoxList(boolean checkBoxList)
checkBoxList
- true
if this list should use checkboxesprotected ListSelectionModel createListSelectionModel()
protected ListCellRenderer createDefaultListCellRenderer()
protected ListCellRenderer createCheckBoxListCellRenderer()
public boolean isCheckBoxList()
true
if the items
of this
XdevListBox
were drawn with a checkbox style, otherwise
false
.public ItemList getItemList()
getItemList
in interface ExtendedList<XdevListBox>
ItemList
of this ExtendedList
public void setItemList(ItemList itemList)
ItemList
that represents the contents or "value" of the
ExtendedList
and then clears the list's selection.setItemList
in interface ExtendedList<XdevListBox>
itemList
- ItemList
include the item
and
data
public void setModel(VirtualTable vt, String itemCol, String dataCol)
VirtualTable
vt.
This is a shortcut for setModel(vt,itemCol,dataCol,false)
setModel
in interface ExtendedList<XdevListBox>
vt
- the VirtualTable
containing the data for the modelitemCol
- columnname to fill item
from or string with
variables like "{%SURNAME} {%NAME} - {%AGE}"
dataCol
- column name to fill data
from, or multiple
columns names, comma-separatedItemList.setModel(VirtualTable, String, String)
,
StringUtils.format(String, xdev.util.StringUtils.ParameterProvider)
public void setModel(VirtualTable vt, String itemCol, String dataCol, boolean queryData)
VirtualTable
vt.setModel
in interface ExtendedList<XdevListBox>
vt
- the VirtualTable
containing the data for the modelitemCol
- columnname to fill item
from or string with
variables like "{%SURNAME} {%NAME} - {%AGE}"
dataCol
- column name to fill data
from, or multiple
columns names, comma-separatedqueryData
- if true
, the best fitting select for this vt
is usedItemList.setModel(VirtualTable, String, String, boolean)
,
StringUtils.format(String, xdev.util.StringUtils.ParameterProvider)
public void setModel(VirtualTable vt, String itemCol, String dataCol, boolean queryData, boolean selectiveQuery)
VirtualTable
vt.setModel
in interface ExtendedList<XdevListBox>
vt
- the VirtualTable
containing the data for the modelitemCol
- columnname to fill item
from or string with
variables like "{%SURNAME} {%NAME} - {%AGE}"
dataCol
- column name to fill data
from, or multiple
columns names, comma-separatedqueryData
- if true
, the best fitting select for this vt
is usedselectiveQuery
- if true
, only the used columns
are
queriedItemList.setModel(VirtualTable, String, String, boolean, boolean)
,
StringUtils.format(String, xdev.util.StringUtils.ParameterProvider)
public void setPagingEnabled(boolean pagingEnabled)
setPagingEnabled
in interface Pageable
pagingEnabled
- true
if the paging should be controlled via the
Pageable.getPageControl()
Pageable.isPagingEnabled()
public boolean isPagingEnabled()
isPagingEnabled
in interface Pageable
true
if the paging behavior is on,
false
otherwisePageable.setPagingEnabled(boolean)
public ListBoxPageControl getPageControl()
getPageControl
in interface Pageable
public void refresh()
refresh
in interface MasterDetailComponent<XdevListBox>
public void updateModel(Condition condition, Object... params)
The last executed query is extended with condition
.
updateModel
in interface VirtualTableOwner
condition
- The additional filter for the queryparams
- param objects used in condition
public void clearModel()
VirtualTable
, and the
view.clearModel
in interface MasterDetailComponent<XdevListBox>
public void setEvenBackground(Color evenBackground)
Color
of even rows.evenBackground
- The background of even rows as type Color
.public Color getEvenBackground()
Color
of even rows.Color
.public void setOddBackground(Color oddBackground)
Color
of odd rows.oddBackground
- The background of odd rows as type Color
.public Color getOddBackground()
Color
of odd rows.Color
.public void selectAll()
XdevListBox
.public boolean isSomethingSelected()
true
if a item is selected, otherwise
false
.public void setSelectedIndices(Collection<Integer> indices)
XdevList
. Indices greater than or equal to the model size are
ignored. This is a convenience method that clears the selection and then
uses addSelectionInterval
on the selection model to add the
indices. Refer to the documentation of the selection model class being
used for details on how values less than 0
are handled.indices
- an XdevList
of the indices of the cells to select,
non-null
JList.setSelectedIndices(int[])
public XdevList<Integer> getSelectedIndicesAsList()
XdevList
of all of the selected indices, in increasing
order.XdevList
if nothing is selectedpublic int getSelectedModelIndex()
For example the index of the selected item in it is VirtualTable
.
public int[] getSelectedModelIndices()
For example the indices of the selected items in their model
VirtualTable
.
public void setSelectedModelIndices(int[] indices)
indices
.
For example the given indices of the items in their model
VirtualTable
.
indices
- an integer specifying the list item to select, where 0
specifies the first item in the list and -1 indicates no
selection.public void setSelectedModelIndex(int index)
anIndex
.
For example the given index of an item in it is model VirtualTable
.
index
- an integer specifying the list item to select, where 0
specifies the first item in the list and -1 indicates no
selectionpublic void setSelectedItems(Collection<?> items)
items
.items
- the items to selectpublic Object getSelectedItem()
ItemList
.ItemList
public XdevList<Object> getSelectedItemsAsList()
If nothing is selected an empty list is returned.
public void setSelectedItem(Object o)
XdevListBox
scrolls to the
selected item.o
- the item to selectJList.setSelectedValue(Object, boolean)
public Object getSelectedData()
ItemList
.ItemList
public XdevList<Object> getSelectedDataAsList()
If nothing is selected an empty list is returned.
public void setSelectedData(Object o)
XdevList
. If o
doesn't exist in the ItemList
the selection is cleared.o
- the data to selectJList.setSelectedIndex(int)
public void setSelectedData(Collection<?> dataList)
dataList
.dataList
- the data to selectpublic VirtualTable.VirtualTableRow getSelectedVirtualTableRow()
VirtualTable.VirtualTableRow
of this component, or
null
if nothing is selected.getSelectedVirtualTableRow
in interface MasterDetailComponent<XdevListBox>
VirtualTable.VirtualTableRow
of this componentpublic void setSelectedVirtualTableRow(VirtualTable.VirtualTableRow row)
row
- the row to selectpublic VirtualTable.VirtualTableRow[] getSelectedVirtualTableRows()
VirtualTable.VirtualTableRow
s of this component, or an
empty array if nothing is selected.VirtualTable.VirtualTableRow
s of this componentpublic void setSelectedVirtualTableRows(VirtualTable.VirtualTableRow[] rows)
rows
- the rows to selectpublic String getFormularName()
getFormularName
in interface FormularComponent<XdevListBox>
public void setDataField(String dataField)
setDataField
in interface FormularComponent<XdevListBox>
dataField
- the new bound data fieldpublic String getDataField()
getDataField
in interface FormularComponent<XdevListBox>
@Deprecated public void setFormularValue(VirtualTable vtRow, int col, Object value)
value
. The value is formatted using the column format of the
provided VirtualTable
and columnIndex
.setFormularValue
in interface FormularComponent<XdevListBox>
vtRow
- VirtualTable
to use the format fromcol
- of the column to use the format fromvalue
- value to setpublic void setFormularValue(VirtualTable vt, Map<String,Object> record)
FormularComponent.getDataField()
.setFormularValue
in interface FormularComponent<XdevListBox>
vt
- the underlying virtual tablerecord
- the data <column,value>public void setMasterValue(VirtualTable vt, Map<String,Object> record)
Called by the MasterDetailHandler
if the client's value has
changed.
setMasterValue
in interface MasterDetailComponent<XdevListBox>
vt
- the underlying virtual tablerecord
- the data <column,value>public Object getFormularValue()
getFormularValue
in interface FormularComponent<XdevListBox>
public void saveState()
A saved state can be restored using FormularComponent.restoreState()
.
saveState
in interface FormularComponent<XdevListBox>
public void restoreState()
The state of the component can be saved using FormularComponent.saveState()
.
restoreState
in interface FormularComponent<XdevListBox>
public boolean hasStateChanged()
FormularComponent.saveState()
has changed.hasStateChanged
in interface FormularComponent<XdevListBox>
true
if the component's state has changed,
false
otherwisepublic boolean isMultiSelect()
A component that supports multi selection can have more than one selected item / value.
isMultiSelect
in interface FormularComponent<XdevListBox>
true
if the component supports multi
selection, false
otherwise.public boolean verify()
This is a alternative method for FormularComponent.validateState()
, but this
method returns a boolean depending on the validation's result and doesn't
throw an ValidationException
.
verify
in interface FormularComponent<XdevListBox>
true
if the value of the component adheres all set
constraints; otherwise false
.public void addValidator(Validator validator)
addValidator
in interface FormularComponent<XdevListBox>
validator
- the validator to addFormularComponent.validateState()
public void removeValidator(Validator validator)
removeValidator
in interface FormularComponent<XdevListBox>
validator
- the validator to removeFormularComponent.validateState()
public Validator[] getValidators()
If no validator is present an empty array is returned.
getValidators
in interface FormularComponent<XdevListBox>
public void validateState() throws ValidationException
Validator.validate(Object)
of all registered
Validator
s.validateState
in interface FormularComponent<XdevListBox>
ValidationException
FormularComponent.verify()
public void validateState(Validation validation) throws ValidationException
Validator.validate(Object)
of all registered
Validator
s.
Every ValidationException
is recorded in the
validation
object, and if
Validation.continueValidation(ValidationException)
returns
false
this exception is re-thrown by this method.
validateState
in interface FormularComponent<XdevListBox>
validation
- the validation process objectValidationException
FormularComponent.verify()
public void setFilterOperator(Operator filterOperator)
Formular.createCondition(String)
setFilterOperator
in interface FormularComponent<XdevListBox>
filterOperator
- the new filter operatorpublic Operator getFilterOperator()
Formular.createCondition(String)
getFilterOperator
in interface FormularComponent<XdevListBox>
public void setReadOnly(boolean readOnly)
setReadOnly
in interface FormularComponent<XdevListBox>
readOnly
- true
to only display valuespublic boolean isReadOnly()
isReadOnly
in interface FormularComponent<XdevListBox>
true
if this component is only used to display
values.public void setVirtualTable(VirtualTable vt)
VirtualTable
containing the valid values for this
component.setVirtualTable
in interface VirtualTableOwner
public VirtualTable getVirtualTable()
VirtualTable
of this object.getVirtualTable
in interface VirtualTableOwner
VirtualTable
of this object.public void addValueChangeListener(FormularComponent.ValueChangeListener l)
FormularComponent.ValueChangeListener
.addValueChangeListener
in interface FormularComponent<XdevListBox>
l
- the listener to registerpublic void setDetailHandler(MasterDetailComponent.DetailHandler detailHandler)
MasterDetailComponent
s.setDetailHandler
in interface MasterDetailComponent<XdevListBox>
detailHandler
- the new MasterDetailComponent.DetailHandler
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
getPreferredScrollableViewportSize
in class JList
public int getRowAtPoint(int x, int y)
getRowAtPoint(Point)
.x
- the X coordinate of the rowy
- the Y coordinate of the row-1
JList.locationToIndex(Point)
public int getRowAtPoint(Point location)
getCellBounds
. This method returns -1
if the
model is empty
This is a cover method that delegates to the method of the same name in
the list's ListUI
. It returns -1
if the list has no
ListUI
.
location
- the coordinates of the point-1
JList.locationToIndex(Point)
public void setVisibleRowCount(int visibleRowCount)
setVisibleRowCount
in class JList
public int getTabIndex()
getTabIndex
in interface XdevFocusCycleComponent
public void setTabIndex(int tabIndex)
To exclude this component from the focus cycle set tabindex to -1.
setTabIndex
in interface XdevFocusCycleComponent
tabIndex
- to be setpublic Rectangle getCellBounds(int index0, int index1)
getCellBounds
in class JList
public void handlePopupRowSelection(int x, int y)
PopupRowSelectionHandler
.handlePopupRowSelection
in interface PopupRowSelectionHandler
x
- the x-coordinate where the popup action is invoked.y
- the y-coordinate where the popup action is invoked.Copyright © 2003–2021 XDEV Software. All rights reserved.