Interface Select
- All Superinterfaces:
Buffered,BufferedValidatable,Container,Container.ItemSetChangeListener,Container.ItemSetChangeNotifier,Container.PropertySetChangeListener,Container.PropertySetChangeNotifier,Container.Viewer,Field<Object>,Property<Object>,Property.Editor,Property.ReadOnlyStatusChangeListener,Property.ReadOnlyStatusChangeNotifier,Property.ValueChangeListener,Property.ValueChangeNotifier,Property.Viewer,Serializable,Validatable
- All Known Implementing Classes:
FAbstractSelect,FComboBox,FListSelect,FTwinColSelect,Table
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.featurepack.data.Buffered
Buffered.SourceExceptionNested classes/interfaces inherited from interface com.vaadin.featurepack.data.Container
Container.Editor, Container.Filter, Container.Filterable, Container.Hierarchical, Container.Indexed, Container.ItemSetChangeEvent, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.Ordered, Container.PropertySetChangeEvent, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.SimpleFilterable, Container.Sortable, Container.ViewerNested classes/interfaces inherited from interface com.vaadin.featurepack.data.ui.Field
Field.ValueChangeEventNested classes/interfaces inherited from interface com.vaadin.featurepack.data.Property
Property.Editor, Property.ReadOnlyException, Property.ReadOnlyStatusChangeEvent, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.Transactional<T>, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanaddContainerProperty(Object propertyId, Class<?> type, Object defaultValue) Adds a new Property to all Items in the Container.default ObjectaddItem()Creates a new Item into the Container, and assign it an automatic ID.default ItemCreates a new Item with the given ID in the Container.default voidAdds an Item set change listener for the object.default voidRegisters a new Property set change listener for this Container.default voidRegisters a new read-only status change listener for this Property.default voidLets the listener know a Containers visible (filtered and/or sorted, if applicable) Item set has changed.default voidNotifies this listener that the set of property IDs supported by the Container has changed.default booleancontainsId(Object itemId) Tests if the Container contains the specified Item.default ContainerGets the Container serving as the data source of the viewer.default PropertygetContainerProperty(Object itemId, Object propertyId) Gets the Property identified by the given itemId and propertyId from the Container.default Collection<?> Gets the ID's of all Properties stored in the Container.default FAbstractSelectdefault ItemGets theItemwith the given Item ID from the Container.default StringgetItemCaption(Object itemId) default FAbstractSelect.ItemCaptionModedefault Objectdefault ResourcegetItemIcon(Object itemId) default Objectdefault ObjectgetItemIdByItem(Item item) Deprecated.default Collection<?> Gets the ID's of all visible (after filtering and sorting) Items stored in the Container.default Objectdefault Class<?> Gets the data type of all Properties identified by the given Property ID.default ObjectgetValue()Gets the value stored in the Property.default booleandefault booleanDoes the select allow adding new options by the user.default booleandefault voidNotifies this listener that a Property's read-only status has changed.default booleanRemoves all Items from the Container.default booleanremoveContainerProperty(Object propertyId) Removes a Property specified by the given Property ID from the Container.default booleanremoveItem(Object itemId) Removes the Item identified byItemIdfrom the Container.default voidRemoves the Item set change listener from the object.default voidRemoves a previously registered Property set change listener.default voidRemoves a previously registered read-only status change listener.default voiddefault voidsetContainerDataSource(Container newDataSource) Sets the Container that serves as the data source of the viewer.default voiddefault voidsetItemCaptionPropertyId(Object propertyId) default voidsetItemIcon(Object itemId, Resource icon) default voidsetItemIconPropertyId(Object propertyId) default voidsetMultiSelect(boolean multiSelect) default voidsetNewItemsAllowed(boolean allowNewOptions) Enables or disables possibility to add new options by the user.default voidsetNullSelectionAllowed(boolean nullSelectionAllowed) default voidsetNullSelectionItemId(Object nullSelectionItemId) default voidSets the value of the Property.default intsize()Gets the number of visible Items in the Container.default voidvalidate()Checks the validity of the validatable.Methods inherited from interface com.vaadin.featurepack.data.ui.Field
addValidator, addValueChangeListener, commit, discard, getConvertedValue, getConverter, getFAbstractField, getPropertyDataSource, getRequiredError, getType, getValidators, isBuffered, isEmpty, isInvalidAllowed, isInvalidCommitted, isModified, isPropertyReadOnly, isRequired, isValid, removeAllValidators, removeValidator, removeValueChangeListener, setBuffered, setConverter, setInvalidAllowed, setInvalidCommitted, setPropertyDataSource, setPropertyReadOnly, setRequired, setRequiredError, valueChange
-
Method Details
-
getFAbstractSelect
-
validate
Description copied from interface:ValidatableChecks the validity of the validatable. If the validatable is valid this method should do nothing, and if it's not valid, it should throw
Validator.InvalidValueException- Specified by:
validatein interfaceValidatable- Throws:
Validator.InvalidValueException- if the value is not valid
-
getValue
Description copied from interface:PropertyGets the value stored in the Property. The returned object is compatible with the class returned by getType(). -
setValue
Description copied from interface:PropertySets the value of the Property.Implementing this functionality is optional. If the functionality is missing, one should declare the Property to be in read-only mode and throw
Note : Since Vaadin 7.0, setting the value of a non-String property as a String is no longer supported.Property.ReadOnlyExceptionin this function.- Specified by:
setValuein interfaceProperty<Object>- Parameters:
newValue- New value of the Property. This should be assignable to the type returned by getType- Throws:
Property.ReadOnlyException- if the object is in read-only mode
-
readOnlyStatusChange
Description copied from interface:Property.ReadOnlyStatusChangeListenerNotifies this listener that a Property's read-only status has changed.- Specified by:
readOnlyStatusChangein interfaceField<Object>- Specified by:
readOnlyStatusChangein interfaceProperty.ReadOnlyStatusChangeListener- Parameters:
arg0- Read-only status change event object
-
addReadOnlyStatusChangeListener
Description copied from interface:Property.ReadOnlyStatusChangeNotifierRegisters a new read-only status change listener for this Property.- Specified by:
addReadOnlyStatusChangeListenerin interfaceField<Object>- Specified by:
addReadOnlyStatusChangeListenerin interfaceProperty.ReadOnlyStatusChangeNotifier- Parameters:
arg0- the new Listener to be registered
-
removeReadOnlyStatusChangeListener
Description copied from interface:Property.ReadOnlyStatusChangeNotifierRemoves a previously registered read-only status change listener.- Specified by:
removeReadOnlyStatusChangeListenerin interfaceField<Object>- Specified by:
removeReadOnlyStatusChangeListenerin interfaceProperty.ReadOnlyStatusChangeNotifier- Parameters:
arg0- listener to be removed
-
getItem
Description copied from interface:ContainerGets theItemwith the given Item ID from the Container. If the Container does not contain the requested Item,nullis returned.Containers should not return Items that are filtered out.
-
getContainerPropertyIds
Description copied from interface:ContainerGets the ID's of all Properties stored in the Container. The ID's cannot be modified through the returned collection.- Specified by:
getContainerPropertyIdsin interfaceContainer- Returns:
- unmodifiable collection of Property IDs
-
getItemIds
Description copied from interface:ContainerGets the ID's of all visible (after filtering and sorting) Items stored in the Container. The ID's cannot be modified through the returned collection.If the container is
Container.Ordered, the collection returned by this method should follow that order. If the container isContainer.Sortable, the items should be in the sorted order.Calling this method for large lazy containers can be an expensive operation and should be avoided when practical.
- Specified by:
getItemIdsin interfaceContainer- Returns:
- unmodifiable collection of Item IDs
-
getItemIdByItem
Deprecated.Returns the itemId for a given item ID.- Parameters:
item-- Returns:
-
isMultiSelect
default boolean isMultiSelect() -
setMultiSelect
default void setMultiSelect(boolean multiSelect) -
getContainerProperty
Description copied from interface:ContainerGets the Property identified by the given itemId and propertyId from the Container. If the Container does not contain the item or it is filtered out, or the Container does not have the Property,nullis returned.- Specified by:
getContainerPropertyin interfaceContainer- Parameters:
itemId- ID of the visible Item which contains the PropertypropertyId- ID of the Property to retrieve- Returns:
- Property with the given ID or
null
-
getType
Description copied from interface:ContainerGets the data type of all Properties identified by the given Property ID. -
size
default int size()Description copied from interface:ContainerGets the number of visible Items in the Container.Filtering can hide items so that they will not be visible through the container API.
-
containsId
Description copied from interface:ContainerTests if the Container contains the specified Item.Filtering can hide items so that they will not be visible through the container API, and this method should respect visibility of items (i.e. only indicate visible items as being in the container) if feasible for the container.
- Specified by:
containsIdin interfaceContainer- Parameters:
itemId- ID the of Item to be tested- Returns:
- boolean indicating if the Container holds the specified Item
-
addItem
Description copied from interface:ContainerCreates a new Item with the given ID in the Container.The new Item is returned, and it is ready to have its Properties modified. Returns
nullif the operation fails or the Container already contains a Item with the given ID.This functionality is optional.
- Specified by:
addItemin interfaceContainer- Parameters:
itemId- ID of the Item to be created- Returns:
- Created new Item, or
nullin case of a failure - Throws:
UnsupportedOperationException- if adding an item with an explicit item ID is not supported by the container
-
addItem
Description copied from interface:ContainerCreates a new Item into the Container, and assign it an automatic ID.The new ID is returned, or
nullif the operation fails. After a successful call you can use themethod to fetch the Item.getItemThis functionality is optional.
- Specified by:
addItemin interfaceContainer- Returns:
- ID of the newly created Item, or
nullin case of a failure - Throws:
UnsupportedOperationException- if adding an item without an explicit item ID is not supported by the container
-
select
-
removeItem
Description copied from interface:ContainerRemoves the Item identified byItemIdfrom the Container.Containers that support filtering should also allow removing an item that is currently filtered out.
This functionality is optional.
- Specified by:
removeItemin interfaceContainer- Parameters:
itemId- ID of the Item to remove- Returns:
trueif the operation succeeded,falseif not- Throws:
UnsupportedOperationException- if the container does not support removing individual items
-
addContainerProperty
default boolean addContainerProperty(Object propertyId, Class<?> type, Object defaultValue) throws UnsupportedOperationException Description copied from interface:ContainerAdds a new Property to all Items in the Container. The Property ID, data type and default value of the new Property are given as parameters.This functionality is optional.
- Specified by:
addContainerPropertyin interfaceContainer- Parameters:
propertyId- ID of the Propertytype- Data type of the new PropertydefaultValue- The value all created Properties are initialized to- Returns:
trueif the operation succeeded,falseif not- Throws:
UnsupportedOperationException- if the container does not support explicitly adding container properties
-
removeContainerProperty
Description copied from interface:ContainerRemoves a Property specified by the given Property ID from the Container. Note that the Property will be removed from all Items in the Container.This functionality is optional.
- Specified by:
removeContainerPropertyin interfaceContainer- Parameters:
propertyId- ID of the Property to remove- Returns:
trueif the operation succeeded,falseif not
-
removeAllItems
Description copied from interface:ContainerRemoves all Items from the Container.Note that Property ID and type information is preserved. This functionality is optional.
- Specified by:
removeAllItemsin interfaceContainer- Returns:
trueif the operation succeeded,falseif not- Throws:
UnsupportedOperationException- if the container does not support removing all items
-
setContainerDataSource
Description copied from interface:Container.ViewerSets the Container that serves as the data source of the viewer.- Specified by:
setContainerDataSourcein interfaceContainer.Viewer- Parameters:
newDataSource- The new data source Item
-
getContainerDataSource
Description copied from interface:Container.ViewerGets the Container serving as the data source of the viewer.- Specified by:
getContainerDataSourcein interfaceContainer.Viewer- Returns:
- data source Container
-
containerPropertySetChange
Description copied from interface:Container.PropertySetChangeListenerNotifies this listener that the set of property IDs supported by the Container has changed.- Specified by:
containerPropertySetChangein interfaceContainer.PropertySetChangeListener- Parameters:
arg0- Change event.
-
addPropertySetChangeListener
Description copied from interface:Container.PropertySetChangeNotifierRegisters a new Property set change listener for this Container.- Specified by:
addPropertySetChangeListenerin interfaceContainer.PropertySetChangeNotifier- Parameters:
arg0- The new Listener to be registered
-
removePropertySetChangeListener
Description copied from interface:Container.PropertySetChangeNotifierRemoves a previously registered Property set change listener.- Specified by:
removePropertySetChangeListenerin interfaceContainer.PropertySetChangeNotifier- Parameters:
arg0- Listener to be removed
-
addItemSetChangeListener
Description copied from interface:Container.ItemSetChangeNotifierAdds an Item set change listener for the object.- Specified by:
addItemSetChangeListenerin interfaceContainer.ItemSetChangeNotifier- Parameters:
arg0- listener to be added
-
removeItemSetChangeListener
Description copied from interface:Container.ItemSetChangeNotifierRemoves the Item set change listener from the object.- Specified by:
removeItemSetChangeListenerin interfaceContainer.ItemSetChangeNotifier- Parameters:
arg0- listener to be removed
-
containerItemSetChange
Description copied from interface:Container.ItemSetChangeListenerLets the listener know a Containers visible (filtered and/or sorted, if applicable) Item set has changed.- Specified by:
containerItemSetChangein interfaceContainer.ItemSetChangeListener- Parameters:
arg0- change event text
-
isNewItemsAllowed
default boolean isNewItemsAllowed()Does the select allow adding new options by the user. If true, the new options can be added to the Container. The text entered by the user is used as id. Note that data-source must allow adding new items.- Returns:
- True if additions are allowed.
-
setNewItemsAllowed
default void setNewItemsAllowed(boolean allowNewOptions) Enables or disables possibility to add new options by the user.- Parameters:
allowNewOptions- the New value of property allowNewOptions.
-
setNullSelectionAllowed
default void setNullSelectionAllowed(boolean nullSelectionAllowed) -
isNullSelectionAllowed
default boolean isNullSelectionAllowed() -
setNullSelectionItemId
-
getNullSelectionItemId
-
setItemCaptionPropertyId
-
getItemCaptionPropertyId
-
setItemIcon
-
getItemIcon
-
getItemIconPropertyId
-
setItemIconPropertyId
-
getItemCaption
-
setItemCaptionMode
-
getItemCaptionMode
-