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

  • Method Details

    • getFAbstractSelect

      default FAbstractSelect getFAbstractSelect()
    • validate

      default void validate() throws Validator.InvalidValueException
      Description copied from interface: Validatable

      Checks 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:
      validate in interface Validatable
      Throws:
      Validator.InvalidValueException - if the value is not valid
    • getValue

      default Object getValue()
      Description copied from interface: Property
      Gets the value stored in the Property. The returned object is compatible with the class returned by getType().
      Specified by:
      getValue in interface Property<Object>
      Returns:
      the value stored in the Property
    • setValue

      default void setValue(Object newValue) throws Property.ReadOnlyException
      Description copied from interface: Property
      Sets 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 Property.ReadOnlyException in this function.

      Note : Since Vaadin 7.0, setting the value of a non-String property as a String is no longer supported.
      Specified by:
      setValue in interface Property<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

      default void readOnlyStatusChange(Property.ReadOnlyStatusChangeEvent arg0)
      Description copied from interface: Property.ReadOnlyStatusChangeListener
      Notifies this listener that a Property's read-only status has changed.
      Specified by:
      readOnlyStatusChange in interface Field<Object>
      Specified by:
      readOnlyStatusChange in interface Property.ReadOnlyStatusChangeListener
      Parameters:
      arg0 - Read-only status change event object
    • addReadOnlyStatusChangeListener

      default void addReadOnlyStatusChangeListener(Property.ReadOnlyStatusChangeListener arg0)
      Description copied from interface: Property.ReadOnlyStatusChangeNotifier
      Registers a new read-only status change listener for this Property.
      Specified by:
      addReadOnlyStatusChangeListener in interface Field<Object>
      Specified by:
      addReadOnlyStatusChangeListener in interface Property.ReadOnlyStatusChangeNotifier
      Parameters:
      arg0 - the new Listener to be registered
    • removeReadOnlyStatusChangeListener

      default void removeReadOnlyStatusChangeListener(Property.ReadOnlyStatusChangeListener arg0)
      Description copied from interface: Property.ReadOnlyStatusChangeNotifier
      Removes a previously registered read-only status change listener.
      Specified by:
      removeReadOnlyStatusChangeListener in interface Field<Object>
      Specified by:
      removeReadOnlyStatusChangeListener in interface Property.ReadOnlyStatusChangeNotifier
      Parameters:
      arg0 - listener to be removed
    • getItem

      default Item getItem(Object itemId)
      Description copied from interface: Container
      Gets the Item with the given Item ID from the Container. If the Container does not contain the requested Item, null is returned.

      Containers should not return Items that are filtered out.

      Specified by:
      getItem in interface Container
      Parameters:
      itemId - ID of the Item to retrieve
      Returns:
      the Item with the given ID or null if the Item is not found in the Container
    • getContainerPropertyIds

      default Collection<?> getContainerPropertyIds()
      Description copied from interface: Container
      Gets the ID's of all Properties stored in the Container. The ID's cannot be modified through the returned collection.
      Specified by:
      getContainerPropertyIds in interface Container
      Returns:
      unmodifiable collection of Property IDs
    • getItemIds

      default Collection<?> getItemIds()
      Description copied from interface: Container
      Gets 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 is Container.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:
      getItemIds in interface Container
      Returns:
      unmodifiable collection of Item IDs
    • getItemIdByItem

      @Deprecated default Object getItemIdByItem(Item item)
      Deprecated.
      Returns the itemId for a given item ID.
      Parameters:
      item -
      Returns:
    • isMultiSelect

      default boolean isMultiSelect()
    • setMultiSelect

      default void setMultiSelect(boolean multiSelect)
    • getContainerProperty

      default Property getContainerProperty(Object itemId, Object propertyId)
      Description copied from interface: Container
      Gets 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, null is returned.
      Specified by:
      getContainerProperty in interface Container
      Parameters:
      itemId - ID of the visible Item which contains the Property
      propertyId - ID of the Property to retrieve
      Returns:
      Property with the given ID or null
    • getType

      default Class<?> getType(Object propertyId)
      Description copied from interface: Container
      Gets the data type of all Properties identified by the given Property ID.
      Specified by:
      getType in interface Container
      Parameters:
      propertyId - ID identifying the Properties
      Returns:
      data type of the Properties
    • size

      default int size()
      Description copied from interface: Container
      Gets the number of visible Items in the Container.

      Filtering can hide items so that they will not be visible through the container API.

      Specified by:
      size in interface Container
      Returns:
      number of Items in the Container
    • containsId

      default boolean containsId(Object itemId)
      Description copied from interface: Container
      Tests 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:
      containsId in interface Container
      Parameters:
      itemId - ID the of Item to be tested
      Returns:
      boolean indicating if the Container holds the specified Item
    • addItem

      default Item addItem(Object itemId) throws UnsupportedOperationException
      Description copied from interface: Container
      Creates 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 null if the operation fails or the Container already contains a Item with the given ID.

      This functionality is optional.

      Specified by:
      addItem in interface Container
      Parameters:
      itemId - ID of the Item to be created
      Returns:
      Created new Item, or null in case of a failure
      Throws:
      UnsupportedOperationException - if adding an item with an explicit item ID is not supported by the container
    • addItem

      default Object addItem() throws UnsupportedOperationException
      Description copied from interface: Container
      Creates a new Item into the Container, and assign it an automatic ID.

      The new ID is returned, or null if the operation fails. After a successful call you can use the getItemmethod to fetch the Item.

      This functionality is optional.

      Specified by:
      addItem in interface Container
      Returns:
      ID of the newly created Item, or null in case of a failure
      Throws:
      UnsupportedOperationException - if adding an item without an explicit item ID is not supported by the container
    • select

      default void select(Object itemId)
    • removeItem

      default boolean removeItem(Object itemId) throws UnsupportedOperationException
      Description copied from interface: Container
      Removes the Item identified by ItemId from the Container.

      Containers that support filtering should also allow removing an item that is currently filtered out.

      This functionality is optional.

      Specified by:
      removeItem in interface Container
      Parameters:
      itemId - ID of the Item to remove
      Returns:
      true if the operation succeeded, false if 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: Container
      Adds 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:
      addContainerProperty in interface Container
      Parameters:
      propertyId - ID of the Property
      type - Data type of the new Property
      defaultValue - The value all created Properties are initialized to
      Returns:
      true if the operation succeeded, false if not
      Throws:
      UnsupportedOperationException - if the container does not support explicitly adding container properties
    • removeContainerProperty

      default boolean removeContainerProperty(Object propertyId)
      Description copied from interface: Container
      Removes 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:
      removeContainerProperty in interface Container
      Parameters:
      propertyId - ID of the Property to remove
      Returns:
      true if the operation succeeded, false if not
    • removeAllItems

      default boolean removeAllItems() throws UnsupportedOperationException
      Description copied from interface: Container
      Removes all Items from the Container.

      Note that Property ID and type information is preserved. This functionality is optional.

      Specified by:
      removeAllItems in interface Container
      Returns:
      true if the operation succeeded, false if not
      Throws:
      UnsupportedOperationException - if the container does not support removing all items
    • setContainerDataSource

      default void setContainerDataSource(Container newDataSource)
      Description copied from interface: Container.Viewer
      Sets the Container that serves as the data source of the viewer.
      Specified by:
      setContainerDataSource in interface Container.Viewer
      Parameters:
      newDataSource - The new data source Item
    • getContainerDataSource

      default Container getContainerDataSource()
      Description copied from interface: Container.Viewer
      Gets the Container serving as the data source of the viewer.
      Specified by:
      getContainerDataSource in interface Container.Viewer
      Returns:
      data source Container
    • containerPropertySetChange

      default void containerPropertySetChange(Container.PropertySetChangeEvent arg0)
      Description copied from interface: Container.PropertySetChangeListener
      Notifies this listener that the set of property IDs supported by the Container has changed.
      Specified by:
      containerPropertySetChange in interface Container.PropertySetChangeListener
      Parameters:
      arg0 - Change event.
    • addPropertySetChangeListener

      default void addPropertySetChangeListener(Container.PropertySetChangeListener arg0)
      Description copied from interface: Container.PropertySetChangeNotifier
      Registers a new Property set change listener for this Container.
      Specified by:
      addPropertySetChangeListener in interface Container.PropertySetChangeNotifier
      Parameters:
      arg0 - The new Listener to be registered
    • removePropertySetChangeListener

      default void removePropertySetChangeListener(Container.PropertySetChangeListener arg0)
      Description copied from interface: Container.PropertySetChangeNotifier
      Removes a previously registered Property set change listener.
      Specified by:
      removePropertySetChangeListener in interface Container.PropertySetChangeNotifier
      Parameters:
      arg0 - Listener to be removed
    • addItemSetChangeListener

      default void addItemSetChangeListener(Container.ItemSetChangeListener arg0)
      Description copied from interface: Container.ItemSetChangeNotifier
      Adds an Item set change listener for the object.
      Specified by:
      addItemSetChangeListener in interface Container.ItemSetChangeNotifier
      Parameters:
      arg0 - listener to be added
    • removeItemSetChangeListener

      default void removeItemSetChangeListener(Container.ItemSetChangeListener arg0)
      Description copied from interface: Container.ItemSetChangeNotifier
      Removes the Item set change listener from the object.
      Specified by:
      removeItemSetChangeListener in interface Container.ItemSetChangeNotifier
      Parameters:
      arg0 - listener to be removed
    • containerItemSetChange

      default void containerItemSetChange(Container.ItemSetChangeEvent arg0)
      Description copied from interface: Container.ItemSetChangeListener
      Lets the listener know a Containers visible (filtered and/or sorted, if applicable) Item set has changed.
      Specified by:
      containerItemSetChange in interface Container.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

      default void setNullSelectionItemId(Object nullSelectionItemId)
    • getNullSelectionItemId

      default Object getNullSelectionItemId()
    • setItemCaptionPropertyId

      default void setItemCaptionPropertyId(Object propertyId)
    • getItemCaptionPropertyId

      default Object getItemCaptionPropertyId()
    • setItemIcon

      default void setItemIcon(Object itemId, Resource icon)
    • getItemIcon

      default Resource getItemIcon(Object itemId)
    • getItemIconPropertyId

      default Object getItemIconPropertyId()
    • setItemIconPropertyId

      default void setItemIconPropertyId(Object propertyId)
    • getItemCaption

      default String getItemCaption(Object itemId)
    • setItemCaptionMode

      default void setItemCaptionMode(FAbstractSelect.ItemCaptionMode mode)
    • getItemCaptionMode

      default FAbstractSelect.ItemCaptionMode getItemCaptionMode()