|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractField<java.lang.Object>
com.vaadin.ui.AbstractSelect
public abstract class AbstractSelect
A class representing a selection of items the user has selected in a UI. The
set of choices is presented as a set of Item
s in a
Container
.
A Select
component may be in single- or multiselect mode.
Multiselect mode means that more than one item can be selected
simultaneously.
Nested Class Summary | |
---|---|
class |
AbstractSelect.AbstractSelectTargetDetails
TargetDetails implementation for subclasses of AbstractSelect
that implement DropTarget . |
static class |
AbstractSelect.AcceptItem
This criterion accepts a only a Transferable that contains given
Item (practically its identifier) from a specific AbstractSelect. |
protected class |
AbstractSelect.CaptionChangeListener
This is a listener helper for Item and Property changes that should cause a repaint. |
class |
AbstractSelect.DefaultNewItemHandler
TODO refine doc This is a default class that handles adding new items that are typed by user to selects container. |
static interface |
AbstractSelect.Filtering
Interface for option filtering, used to filter options based on user entered value. |
static class |
AbstractSelect.ItemCaptionMode
|
static interface |
AbstractSelect.ItemDescriptionGenerator
Implement this interface and pass it to Tree.setItemDescriptionGenerator or Table.setItemDescriptionGenerator to generate mouse over descriptions ("tooltips") for the rows and cells in Table or for the items in Tree. |
static interface |
AbstractSelect.NewItemHandler
|
static class |
AbstractSelect.TargetItemIs
Criterion which accepts a drop only if the drop target is (one of) the given Item identifier(s). |
static class |
AbstractSelect.VerticalLocationIs
An accept criterion to accept drops only on a specific vertical location of an item. |
Nested classes/interfaces inherited from class com.vaadin.ui.AbstractField |
---|
AbstractField.FocusShortcut, AbstractField.ReadOnlyStatusChangeEvent |
Nested classes/interfaces inherited from interface com.vaadin.data.Container |
---|
Container.Editor, Container.Filter, Container.Filterable, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Container.Viewer |
Nested classes/interfaces inherited from interface com.vaadin.ui.Component |
---|
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener |
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector |
---|
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener |
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable |
---|
Sizeable.Unit |
Nested classes/interfaces inherited from interface com.vaadin.ui.Field |
---|
Field.ValueChangeEvent |
Nested classes/interfaces inherited from interface com.vaadin.data.Buffered |
---|
Buffered.SourceException |
Nested classes/interfaces inherited from interface com.vaadin.data.Property |
---|
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer |
Fields inherited from class com.vaadin.ui.AbstractComponent |
---|
DESIGN_ATTR_PLAIN_TEXT |
Fields inherited from interface com.vaadin.server.Sizeable |
---|
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS |
Constructor Summary | |
---|---|
AbstractSelect()
Creates an empty Select. |
|
AbstractSelect(java.lang.String caption)
Creates an empty Select with caption. |
|
AbstractSelect(java.lang.String caption,
java.util.Collection<?> options)
Creates a new select that is filled from a collection of option values. |
|
AbstractSelect(java.lang.String caption,
Container dataSource)
Creates a new select that is connected to a data-source. |
Method Summary | |
---|---|
boolean |
addContainerProperty(java.lang.Object propertyId,
java.lang.Class<?> type,
java.lang.Object defaultValue)
Adds the new property to all items. |
java.lang.Object |
addItem()
Creates a new item into container with container managed id. |
Item |
addItem(java.lang.Object itemId)
Create a new item into container. |
void |
addItems(java.util.Collection<?> itemIds)
Adds given items with given item ids to container. |
void |
addItems(java.lang.Object... itemId)
Adds given items with given item ids to container. |
void |
addItemSetChangeListener(Container.ItemSetChangeListener listener)
Adds an Item set change listener for the object. |
void |
addListener(Container.ItemSetChangeListener listener)
Deprecated. As of 7.0, replaced by addItemSetChangeListener(com.vaadin.data.Container.ItemSetChangeListener) |
void |
addListener(Container.PropertySetChangeListener listener)
Deprecated. As of 7.0, replaced by addPropertySetChangeListener(com.vaadin.data.Container.PropertySetChangeListener) |
void |
addPropertySetChangeListener(Container.PropertySetChangeListener listener)
Adds a new Property set change listener for this Container. |
void |
attach()
Notifies the component that it is connected to an application. |
void |
changeVariables(java.lang.Object source,
java.util.Map<java.lang.String,java.lang.Object> variables)
Invoked when the value of a variable has changed. |
void |
containerItemSetChange(Container.ItemSetChangeEvent event)
Lets the listener know a Containers Item set has changed. |
void |
containerPropertySetChange(Container.PropertySetChangeEvent event)
Notifies this listener that the Containers contents has changed. |
boolean |
containsId(java.lang.Object itemId)
Tests, if the collection contains an item with given id. |
void |
detach()
Detaches the component from application. |
protected void |
fireItemSetChange()
Fires the item set change event. |
protected void |
firePropertySetChange()
Fires the property set change event. |
protected AbstractSelect.CaptionChangeListener |
getCaptionChangeListener()
|
Container |
getContainerDataSource()
Gets the viewing data-source container. |
Property |
getContainerProperty(java.lang.Object itemId,
java.lang.Object propertyId)
Gets the Property identified by the given itemId and propertyId from the Container |
java.util.Collection<?> |
getContainerPropertyIds()
Gets the property Id collection from the container. |
Item |
getItem(java.lang.Object itemId)
Gets the item from the container with given id. |
java.lang.String |
getItemCaption(java.lang.Object itemId)
Gets the caption of an item. |
AbstractSelect.ItemCaptionMode |
getItemCaptionMode()
Gets the item caption mode. |
java.lang.Object |
getItemCaptionPropertyId()
Gets the item caption property. |
Resource |
getItemIcon(java.lang.Object itemId)
Gets the item icon. |
java.lang.Object |
getItemIconPropertyId()
Gets the item icon property. |
java.util.Collection<?> |
getItemIds()
Gets the item Id collection from the container. |
java.util.Collection<?> |
getListeners(java.lang.Class<?> eventType)
Returns all listeners that are registered for the given event type or one of its subclasses. |
AbstractSelect.NewItemHandler |
getNewItemHandler()
TODO refine doc |
java.lang.Object |
getNullSelectionItemId()
Returns the item id that represents null value of this select in single select mode. |
java.lang.Class<?> |
getType()
Returns the type of the property. |
java.lang.Class<?> |
getType(java.lang.Object propertyId)
Gets the property type. |
java.lang.Object |
getValue()
Gets the selected item id or in multiselect mode a set of selected ids. |
java.util.Collection<?> |
getVisibleItemIds()
Gets the visible item ids. |
boolean |
isEmpty()
For multi-selectable fields, also an empty collection of values is considered to be an empty field. |
boolean |
isMultiSelect()
Is the select in multiselect mode? In multiselect mode |
boolean |
isNewItemsAllowed()
Does the select allow adding new options by the user. |
boolean |
isNullSelectionAllowed()
Checks if null empty selection is allowed by the user. |
boolean |
isSelected(java.lang.Object itemId)
Tests if an item is selected. |
void |
paintContent(PaintTarget target)
Paints the content of this component. |
protected void |
paintItem(PaintTarget target,
java.lang.Object itemId)
|
void |
readDesign(org.jsoup.nodes.Element design,
DesignContext context)
Reads the component state from the given design. |
protected java.lang.Object |
readItem(org.jsoup.nodes.Element child,
java.util.Set<java.lang.String> selected,
DesignContext context)
Reads an Item from a design and inserts it into the data source. |
protected void |
readItems(org.jsoup.nodes.Element design,
DesignContext context)
|
boolean |
removeAllItems()
Removes all items from the container. |
boolean |
removeContainerProperty(java.lang.Object propertyId)
Removes the property from all items. |
boolean |
removeItem(java.lang.Object itemId)
Removes the Item identified by ItemId from the Container. |
void |
removeItemSetChangeListener(Container.ItemSetChangeListener listener)
Removes the Item set change listener from the object. |
void |
removeListener(Container.ItemSetChangeListener listener)
Deprecated. As of 7.0, replaced by removeItemSetChangeListener(com.vaadin.data.Container.ItemSetChangeListener) |
void |
removeListener(Container.PropertySetChangeListener listener)
Deprecated. As of 7.0, replaced by removePropertySetChangeListener(com.vaadin.data.Container.PropertySetChangeListener) |
void |
removePropertySetChangeListener(Container.PropertySetChangeListener listener)
Removes a previously registered Property set change listener. |
void |
sanitizeSelection()
Checks that the current selection is valid, i.e. |
void |
select(java.lang.Object itemId)
Selects an item. |
void |
setContainerDataSource(Container newDataSource)
Sets the Container that serves as the data source of the viewer. |
void |
setItemCaption(java.lang.Object itemId,
java.lang.String caption)
Override the caption of an item. |
void |
setItemCaptionMode(AbstractSelect.ItemCaptionMode mode)
Sets the item caption mode. |
void |
setItemCaptionPropertyId(java.lang.Object propertyId)
Sets the item caption property. |
void |
setItemIcon(java.lang.Object itemId,
Resource icon)
Sets the icon for an item. |
void |
setItemIconPropertyId(java.lang.Object propertyId)
Sets the item icon property. |
void |
setMultiSelect(boolean multiSelect)
Sets the multiselect mode. |
void |
setNewItemHandler(AbstractSelect.NewItemHandler newItemHandler)
TODO refine doc Setter for new item handler that is called when user adds new item in newItemAllowed mode. |
void |
setNewItemsAllowed(boolean allowNewOptions)
Enables or disables possibility to add new options by the user. |
void |
setNullSelectionAllowed(boolean nullSelectionAllowed)
Allow or disallow empty selection by the user. |
void |
setNullSelectionItemId(java.lang.Object nullSelectionItemId)
Sets the item id that represents null value of this select. |
void |
setValue(java.lang.Object newValue)
Sets the visible value of the property. |
protected void |
setValue(java.lang.Object newValue,
boolean repaintIsNotNeeded)
Sets the visible value of the property. |
int |
size()
Gets the number of visible Items in the Container. |
void |
unselect(java.lang.Object itemId)
Unselects an item. |
void |
writeDesign(org.jsoup.nodes.Element design,
DesignContext context)
Writes the component state to the given design. |
protected org.jsoup.nodes.Element |
writeItem(org.jsoup.nodes.Element design,
java.lang.Object itemId,
DesignContext context)
Writes a data source Item to a design. |
protected void |
writeItems(org.jsoup.nodes.Element design,
DesignContext context)
Writes the data source items to a design. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.vaadin.ui.LegacyComponent |
---|
markAsDirty |
Methods inherited from interface com.vaadin.server.VariableOwner |
---|
isEnabled, isImmediate |
Methods inherited from interface com.vaadin.ui.Component |
---|
addListener, addStyleName, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible |
Methods inherited from interface com.vaadin.server.ClientConnector |
---|
addAttachListener, addDetachListener, beforeClientResponse, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler |
Methods inherited from interface com.vaadin.shared.Connector |
---|
getConnectorId |
Methods inherited from interface com.vaadin.server.Sizeable |
---|
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthUndefined |
Methods inherited from interface com.vaadin.event.Action.ShortcutNotifier |
---|
addShortcutListener, removeShortcutListener |
Field Detail |
---|
@Deprecated public static final AbstractSelect.ItemCaptionMode ITEM_CAPTION_MODE_ID
AbstractSelect.ItemCaptionMode.ID
instead@Deprecated public static final AbstractSelect.ItemCaptionMode ITEM_CAPTION_MODE_ITEM
AbstractSelect.ItemCaptionMode.ITEM
instead@Deprecated public static final AbstractSelect.ItemCaptionMode ITEM_CAPTION_MODE_INDEX
AbstractSelect.ItemCaptionMode.INDEX
instead@Deprecated public static final AbstractSelect.ItemCaptionMode ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID
AbstractSelect.ItemCaptionMode.EXPLICIT_DEFAULTS_ID
instead@Deprecated public static final AbstractSelect.ItemCaptionMode ITEM_CAPTION_MODE_EXPLICIT
AbstractSelect.ItemCaptionMode.EXPLICIT
instead@Deprecated public static final AbstractSelect.ItemCaptionMode ITEM_CAPTION_MODE_ICON_ONLY
AbstractSelect.ItemCaptionMode.ICON_ONLY
instead@Deprecated public static final AbstractSelect.ItemCaptionMode ITEM_CAPTION_MODE_PROPERTY
AbstractSelect.ItemCaptionMode.PROPERTY
insteadprotected Container items
protected KeyMapper<java.lang.Object> itemIdMapper
Constructor Detail |
---|
public AbstractSelect()
public AbstractSelect(java.lang.String caption)
public AbstractSelect(java.lang.String caption, Container dataSource)
caption
- the Caption of the component.dataSource
- the Container datasource to be selected from by this select.public AbstractSelect(java.lang.String caption, java.util.Collection<?> options)
caption
- the Caption of this field.options
- the Collection containing the options.Method Detail |
---|
public void paintContent(PaintTarget target) throws PaintException
paintContent
in interface LegacyComponent
target
- the Paint Event.
PaintException
- if the paint operation failed.protected void paintItem(PaintTarget target, java.lang.Object itemId) throws PaintException
PaintException
public void changeVariables(java.lang.Object source, java.util.Map<java.lang.String,java.lang.Object> variables)
changeVariables
in interface VariableOwner
source
- the Source of the variable change. This is the origin of the
event. For example in Web Adapter this is the request.variables
- the Mapping from variable names to new variable values.com.vaadin.ui.AbstractComponent#changeVariables(java.lang.Object,
java.util.Map)
public void setNewItemHandler(AbstractSelect.NewItemHandler newItemHandler)
newItemHandler
- public AbstractSelect.NewItemHandler getNewItemHandler()
public java.util.Collection<?> getVisibleItemIds()
public java.lang.Class<?> getType()
getValue
and
setValue
methods must be compatible with this type: one can
safely cast getValue
to given type and pass any variable
assignable to this type as a parameter to setValue
.
getType
in interface Property<java.lang.Object>
getType
in class AbstractField<java.lang.Object>
public java.lang.Object getValue()
getValue
in interface Property<java.lang.Object>
getValue
in class AbstractField<java.lang.Object>
AbstractField.getValue()
public void setValue(java.lang.Object newValue) throws Property.ReadOnlyException
The value of the select is the selected item id. If the select is in multiselect-mode, the value is a set of selected item keys. In multiselect mode all collections of id:s can be assigned.
setValue
in interface Property<java.lang.Object>
setValue
in class AbstractField<java.lang.Object>
newValue
- the New selected item or collection of selected items.
Property.ReadOnlyException
- if the object is in read-only modeAbstractField.setValue(java.lang.Object)
protected void setValue(java.lang.Object newValue, boolean repaintIsNotNeeded) throws Property.ReadOnlyException
The value of the select is the selected item id. If the select is in multiselect-mode, the value is a set of selected item keys. In multiselect mode all collections of id:s can be assigned.
setValue
in class AbstractField<java.lang.Object>
newValue
- the New selected item or collection of selected items.repaintIsNotNeeded
- True if caller is sure that repaint is not needed.
Property.ReadOnlyException
com.vaadin.ui.AbstractField#setValue(java.lang.Object,
java.lang.Boolean)
public Item getItem(java.lang.Object itemId)
getItem
in interface Container
itemId
- the item id.
public java.util.Collection<?> getItemIds()
getItemIds
in interface Container
public java.util.Collection<?> getContainerPropertyIds()
getContainerPropertyIds
in interface Container
public java.lang.Class<?> getType(java.lang.Object propertyId)
getType
in interface Container
propertyId
- the Id identifying the property.
Container.getType(java.lang.Object)
public int size()
Container
Filtering can hide items so that they will not be visible through the container API.
size
in interface Container
public boolean containsId(java.lang.Object itemId)
containsId
in interface Container
itemId
- the Id the of item to be tested.
public Property getContainerProperty(java.lang.Object itemId, java.lang.Object propertyId)
getContainerProperty
in interface Container
itemId
- ID of the visible Item which contains the PropertypropertyId
- ID of the Property to retrieve
null
Container.getContainerProperty(Object, Object)
public boolean addContainerProperty(java.lang.Object propertyId, java.lang.Class<?> type, java.lang.Object defaultValue) throws java.lang.UnsupportedOperationException
addContainerProperty
in interface Container
propertyId
- ID of the Propertytype
- Data type of the new PropertydefaultValue
- The value all created Properties are initialized to
java.lang.UnsupportedOperationException
- if the container does not support explicitly adding container
propertiesContainer.addContainerProperty(java.lang.Object,
java.lang.Class, java.lang.Object)
public boolean removeAllItems() throws java.lang.UnsupportedOperationException
removeAllItems
in interface Container
java.lang.UnsupportedOperationException
- if the container does not support removing all itemsContainer.removeAllItems()
public java.lang.Object addItem() throws java.lang.UnsupportedOperationException
addItem
in interface Container
java.lang.UnsupportedOperationException
- if adding an item without an explicit item ID is not
supported by the containerContainer.addItem()
public Item addItem(java.lang.Object itemId) throws java.lang.UnsupportedOperationException
addItem
in interface Container
itemId
- the Identification of the item to be created.
java.lang.UnsupportedOperationException
- if adding an item with an explicit item ID is not supported
by the containerContainer.addItem(java.lang.Object)
public void addItems(java.lang.Object... itemId) throws java.lang.UnsupportedOperationException
itemId
- item identifiers to be added to underlying container
java.lang.UnsupportedOperationException
- if the underlying container don't support adding items with
identifierspublic void addItems(java.util.Collection<?> itemIds) throws java.lang.UnsupportedOperationException
itemIds
- item identifiers to be added to underlying container
java.lang.UnsupportedOperationException
- if the underlying container don't support adding items with
identifierspublic boolean removeItem(java.lang.Object itemId) throws java.lang.UnsupportedOperationException
Container
ItemId
from the Container.
Containers that support filtering should also allow removing an item that is currently filtered out.
This functionality is optional.
removeItem
in interface Container
itemId
- ID of the Item to remove
true
if the operation succeeded, false
if not
java.lang.UnsupportedOperationException
- if the container does not support removing individual itemspublic void sanitizeSelection()
public boolean removeContainerProperty(java.lang.Object propertyId) throws java.lang.UnsupportedOperationException
removeContainerProperty
in interface Container
propertyId
- ID of the Property to remove
java.lang.UnsupportedOperationException
- if the container does not support removing container
propertiesContainer.removeContainerProperty(java.lang.Object)
public void setContainerDataSource(Container newDataSource)
setContainerDataSource
in interface Container.Viewer
newDataSource
- the new data source.Container.Viewer.setContainerDataSource(Container)
public Container getContainerDataSource()
getContainerDataSource
in interface Container.Viewer
Container.Viewer.getContainerDataSource()
public boolean isMultiSelect()
public void setMultiSelect(boolean multiSelect)
UnsupportedOperationException
.
multiSelect
- the New value of property multiSelect.public boolean isNewItemsAllowed()
public void setNewItemsAllowed(boolean allowNewOptions)
allowNewOptions
- the New value of property allowNewOptions.public void setItemCaption(java.lang.Object itemId, java.lang.String caption)
itemId
- the id of the item to be recaptioned.caption
- the New caption.public java.lang.String getItemCaption(java.lang.Object itemId)
setItemCaptionMode()
for more
details.
itemId
- the id of the item to be queried.
public void setItemIcon(java.lang.Object itemId, Resource icon)
itemId
- the id of the item to be assigned an icon.icon
- the icon to use or null.public Resource getItemIcon(java.lang.Object itemId)
itemId
- the id of the item to be assigned an icon.
public void setItemCaptionMode(AbstractSelect.ItemCaptionMode mode)
The mode can be one of the following ones:
ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID
: Items
Id-objects toString
is used as item caption. If caption is
explicitly specified, it overrides the id-caption.
ITEM_CAPTION_MODE_ID
: Items Id-objects
toString
is used as item caption.ITEM_CAPTION_MODE_ITEM
: Item-objects
toString
is used as item caption.ITEM_CAPTION_MODE_INDEX
: The index of the item is used
as item caption. The index mode can only be used with the containers
implementing Container.Indexed
interface.ITEM_CAPTION_MODE_EXPLICIT
: The item captions must be
explicitly specified.ITEM_CAPTION_MODE_PROPERTY
: The item captions are read
from property, that must be specified with
setItemCaptionPropertyId
.ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID
is the default
mode.
mode
- the One of the modes listed above.public AbstractSelect.ItemCaptionMode getItemCaptionMode()
The mode can be one of the following ones:
ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID
: Items
Id-objects toString
is used as item caption. If caption is
explicitly specified, it overrides the id-caption.
ITEM_CAPTION_MODE_ID
: Items Id-objects
toString
is used as item caption.ITEM_CAPTION_MODE_ITEM
: Item-objects
toString
is used as item caption.ITEM_CAPTION_MODE_INDEX
: The index of the item is used
as item caption. The index mode can only be used with the containers
implementing Container.Indexed
interface.ITEM_CAPTION_MODE_EXPLICIT
: The item captions must be
explicitly specified.ITEM_CAPTION_MODE_PROPERTY
: The item captions are read
from property, that must be specified with
setItemCaptionPropertyId
.ITEM_CAPTION_MODE_EXPLICIT_DEFAULTS_ID
is the default
mode.
public void setItemCaptionPropertyId(java.lang.Object propertyId)
Setting the id to a existing property implicitly sets the item caption
mode to ITEM_CAPTION_MODE_PROPERTY
. If the object is in
ITEM_CAPTION_MODE_PROPERTY
mode, setting caption property id
null resets the item caption mode to
ITEM_CAPTION_EXPLICIT_DEFAULTS_ID
.
Note that the type of the property used for caption must be String
Setting the property id to null disables this feature. The id is null by default
.
propertyId
- the id of the property.public java.lang.Object getItemCaptionPropertyId()
public void setItemIconPropertyId(java.lang.Object propertyId) throws java.lang.IllegalArgumentException
If the property id is set to a valid value, each item is given an icon got from the given property of the items. The type of the property must be assignable to Resource.
Note : The icons set with setItemIcon
function override the
icons from the property.
Setting the property id to null disables this feature. The id is null by default
.
propertyId
- the id of the property that specifies icons for items or null
java.lang.IllegalArgumentException
- If the propertyId is not in the container or is not of a
valid typepublic java.lang.Object getItemIconPropertyId()
If the property id is set to a valid value, each item is given an icon got from the given property of the items. The type of the property must be assignable to Icon.
Note : The icons set with setItemIcon
function override the
icons from the property.
Setting the property id to null disables this feature. The id is null by default
.
public boolean isSelected(java.lang.Object itemId)
In single select mode testing selection status of the item identified by
getNullSelectionItemId()
returns true if the value of the
property is null.
itemId
- the Id the of the item to be tested.getNullSelectionItemId()
,
setNullSelectionItemId(Object)
public void select(java.lang.Object itemId)
In single select mode selecting item identified by
getNullSelectionItemId()
sets the value of the property to null.
itemId
- the identifier of Item to be selected.getNullSelectionItemId()
,
setNullSelectionItemId(Object)
public void unselect(java.lang.Object itemId)
itemId
- the identifier of the Item to be unselected.getNullSelectionItemId()
,
setNullSelectionItemId(Object)
public void containerPropertySetChange(Container.PropertySetChangeEvent event)
containerPropertySetChange
in interface Container.PropertySetChangeListener
event
- Change event.Container.PropertySetChangeListener.containerPropertySetChange(com.vaadin.data.Container.PropertySetChangeEvent)
public void addPropertySetChangeListener(Container.PropertySetChangeListener listener)
addPropertySetChangeListener
in interface Container.PropertySetChangeNotifier
listener
- The new Listener to be registeredContainer.PropertySetChangeNotifier.addListener(com.vaadin.data.Container.PropertySetChangeListener)
@Deprecated public void addListener(Container.PropertySetChangeListener listener)
addPropertySetChangeListener(com.vaadin.data.Container.PropertySetChangeListener)
addListener
in interface Container.PropertySetChangeNotifier
public void removePropertySetChangeListener(Container.PropertySetChangeListener listener)
removePropertySetChangeListener
in interface Container.PropertySetChangeNotifier
listener
- Listener to be removedContainer.PropertySetChangeNotifier.removeListener(com.vaadin.data.Container.PropertySetChangeListener)
@Deprecated public void removeListener(Container.PropertySetChangeListener listener)
removePropertySetChangeListener(com.vaadin.data.Container.PropertySetChangeListener)
removeListener
in interface Container.PropertySetChangeNotifier
public void addItemSetChangeListener(Container.ItemSetChangeListener listener)
addItemSetChangeListener
in interface Container.ItemSetChangeNotifier
listener
- listener to be addedContainer.ItemSetChangeNotifier.addListener(com.vaadin.data.Container.ItemSetChangeListener)
@Deprecated public void addListener(Container.ItemSetChangeListener listener)
addItemSetChangeListener(com.vaadin.data.Container.ItemSetChangeListener)
addListener
in interface Container.ItemSetChangeNotifier
public void removeItemSetChangeListener(Container.ItemSetChangeListener listener)
removeItemSetChangeListener
in interface Container.ItemSetChangeNotifier
listener
- listener to be removedContainer.ItemSetChangeNotifier.removeListener(com.vaadin.data.Container.ItemSetChangeListener)
@Deprecated public void removeListener(Container.ItemSetChangeListener listener)
removeItemSetChangeListener(com.vaadin.data.Container.ItemSetChangeListener)
removeListener
in interface Container.ItemSetChangeNotifier
public java.util.Collection<?> getListeners(java.lang.Class<?> eventType)
AbstractClientConnector
getListeners
in class AbstractClientConnector
eventType
- The type of event to return listeners for.
public void containerItemSetChange(Container.ItemSetChangeEvent event)
containerItemSetChange
in interface Container.ItemSetChangeListener
event
- change event textContainer.ItemSetChangeListener.containerItemSetChange(com.vaadin.data.Container.ItemSetChangeEvent)
protected void firePropertySetChange()
protected void fireItemSetChange()
public boolean isEmpty()
isEmpty
in interface Field<java.lang.Object>
isEmpty
in class AbstractField<java.lang.Object>
AbstractField.isEmpty().
public void setNullSelectionAllowed(boolean nullSelectionAllowed)
setNullSelectionItemId()
. This way you can for
instance set an icon and caption for the null selection item.
nullSelectionAllowed
- whether or not to allow empty selectionsetNullSelectionItemId(Object)
,
isNullSelectionAllowed()
public boolean isNullSelectionAllowed()
setNullSelectionAllowed(boolean)
public java.lang.Object getNullSelectionItemId()
Data interface does not support nulls as item ids. Selecting the item identified by this id is the same as selecting no items at all. This setting only affects the single select mode.
setNullSelectionItemId(Object)
,
isSelected(Object)
,
select(Object)
public void setNullSelectionItemId(java.lang.Object nullSelectionItemId)
Data interface does not support nulls as item ids. Selecting the item identified by this id is the same as selecting no items at all. This setting only affects the single select mode.
nullSelectionItemId
- the nullSelectionItemId to set.getNullSelectionItemId()
,
isSelected(Object)
,
select(Object)
public void attach()
attach
in interface ClientConnector
attach
in interface Component
attach
in class AbstractField<java.lang.Object>
AbstractField.attach()
public void detach()
detach
in interface ClientConnector
detach
in class AbstractField<java.lang.Object>
AbstractComponent.detach()
protected AbstractSelect.CaptionChangeListener getCaptionChangeListener()
public void readDesign(org.jsoup.nodes.Element design, DesignContext context)
Component
The component is responsible not only for updating its own state but also for ensuring that its children update their state based on the design.
It is assumed that the component is in its default state when this method is called. Reading should only take into consideration attributes specified in the design and not reset any unspecified attributes to their defaults.
This method must not modify the design.
readDesign
in interface Component
readDesign
in class AbstractField<java.lang.Object>
design
- The element to obtain the state fromcontext
- The DesignContext instance used for parsing the designprotected void readItems(org.jsoup.nodes.Element design, DesignContext context)
protected java.lang.Object readItem(org.jsoup.nodes.Element child, java.util.Set<java.lang.String> selected, DesignContext context)
child
- a child element representing the itemselected
- A set accumulating selected items. If the item that is read is
marked as selected, its item id should be added to this set.context
- the DesignContext instance used in parsing
DesignException
- if the tag name of the child
element is not
option
.public void writeDesign(org.jsoup.nodes.Element design, DesignContext context)
Component
The component is responsible not only for writing its own state but also for ensuring that its children write their state to the design.
This method must not modify the component state.
writeDesign
in interface Component
writeDesign
in class AbstractField<java.lang.Object>
design
- The element to write the component state to. Any previous
attributes or child nodes are not cleared.context
- The DesignContext instance used for writing the designprotected void writeItems(org.jsoup.nodes.Element design, DesignContext context)
design
- the element into which to insert the itemscontext
- the DesignContext instance used in writingprotected org.jsoup.nodes.Element writeItem(org.jsoup.nodes.Element design, java.lang.Object itemId, DesignContext context)
design
- the element into which to insert the itemitemId
- the id of the item to writecontext
- the DesignContext instance used in writing
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |