VALUE
- is the generic type of the #getSelectedValue() selected value}.public class UiWidgetAdapterTestSelectedValue<VALUE> extends UiWidgetAdapterTest implements AttributeWriteSelectedValue<VALUE>
UiWidgetAdapterTest
and implements AttributeWriteSelectedValue
for
testing without a native toolkit.Modifier and Type | Field and Description |
---|---|
private Collection<VALUE> |
selectedValues |
ACCESS_KEY_NONE, HTML_ATTRIBUTE_ACCESS_KEY
HTML_ATTRIBUTE_ID, ID_SEPARATOR, PROPERTY_ID
PROPERTY_STYLES, STYLE_PATTERN_MULTIPLE, STYLE_PATTERN_SINGLE
PROPERTY_TITLE
PROPERTY_SUMMARY
ATTRIBUTE_COLSPAN
Constructor and Description |
---|
UiWidgetAdapterTestSelectedValue()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
VALUE |
getSelectedValue()
This method gets the currently selected value (item).
|
Collection<VALUE> |
getSelectedValues()
This method gets the currently selected values.
|
int |
getSelectionCount()
Logically the same as
AttributeReadSelectedValue.getSelectedValues() .size() but more efficient. |
boolean |
hasSelectedValue() |
boolean |
setSelectedValue(VALUE selectedValue)
This method sets the value currently selected.
|
boolean |
setSelectedValues(Collection<VALUE> selection)
This method sets the
values currently selected . |
clearValidationFailureSetCount, createAbsoluteImageUrl, createToplevelWidget, dispose, getHeightInPixel, getLength, getSummary, getValidationFailure, getValidationFailureSetCount, getWidthInPixel, isCollapsed, isTitleVisible, removeFromParent, setAccessKey, setAltText, setAttribute, setCollapsed, setEnabled, setEventSender, setFocused, setId, setImage, setLabel, setLength, setMaximumTextLength, setSelectionMode, setStyles, setSummary, setTitle, setTitleVisible, setTooltip, setUrl, setValidationFailure, setVisible, verifyNotDisposed
addStyle, createLabel, getAccessKey, getActiveWidget, getAltText, getAttribute, getBundle, getColumnSpan, getContext, getHeightInRows, getId, getImage, getLabel, getMaximumTextLength, getPrimaryStyle, getSelectionMode, getStyles, getTitle, getTooltip, getToplevelWidget, getUiWidget, getUiWidgetTyped, getUrl, hasStyle, isDisposed, isEnabled, isFocused, isResizable, isStyleDeltaSupported, removeStyle, setMode, setParent, setPrimaryStyle, setUiWidget
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMaximumTextLength
getAltText
getUrl
isFocused
getAccessKey
createLabel, getToplevelWidget, isStyleDeltaSupported, setMode, setParent
getId
getTooltip
isEnabled
addStyle, removeStyle
hasStyle
getStyles
setPrimaryStyle
getPrimaryStyle
isDisposed
getAttribute
getImage
getSelectionMode
getTitle
private Collection<VALUE> selectedValues
getSelectedValues()
public UiWidgetAdapterTestSelectedValue()
public boolean hasSelectedValue()
hasSelectedValue
in interface AttributeReadSelectedValue<VALUE>
true
if at least one value is selected
,
false
otherwise.public int getSelectionCount()
AttributeReadSelectedValue.getSelectedValues()
.size() but more efficient.getSelectionCount
in interface AttributeReadSelectedValue<VALUE>
selected values
.public VALUE getSelectedValue()
getSelectedValue
in interface AttributeReadSelectedValue<VALUE>
null
if no value is selected.public Collection<VALUE> getSelectedValues()
Collection
is
unspecified.getSelectedValues
in interface AttributeReadSelectedValue<VALUE>
Collection
with all selected values. Will be empty
if
nothing is selected.AttributeReadSelectedValue.getSelectedValue()
public boolean setSelectedValue(VALUE selectedValue)
currently selected values
and select the given value.setSelectedValue
in interface AttributeWriteSelectedValue<VALUE>
selectedValue
- is the value to select
.true
if the operation was successful, false
otherwise (the given
selectedValue
is not contained in this object and cannot be selected).public boolean setSelectedValues(Collection<VALUE> selection)
values currently selected
. All values that are NOT
available, will be ignored. SelectionMode.SINGLE_SELECTION
you shall not provide a
Collection
with more than one element. So you should then use AttributeWriteSelectedValue.setSelectedValue(Object)
instead. AttributeReadSelectedValue.getSelectedValues()
after this method the items may be in a different
order. Additionally the result of AttributeReadSelectedValue.getSelectedValue()
will contain elements that are actually
items available in this object. So e.g. if you have a list of items and call this method to select two
items but only one of them is actually available in the list, then only that one is selected and
therefore returned by AttributeReadSelectedValue.getSelectedValues()
.setSelectedValues
in interface AttributeWriteSelectedValue<VALUE>
selection
- is the Collection
with the values to select
.true
if the operation was successful and all selectedValues
have been
selected, false
otherwise (at least one item out of selectedValues
is
not contained in this object and cannot be selected).Copyright © 2001–2016 mmm-Team. All rights reserved.