Class FTwinColSelect

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<com.vaadin.flow.component.customfield.CustomField<Object>,Object>
com.vaadin.flow.component.customfield.CustomField<Object>
com.vaadin.featurepack.ui.FTwinColSelect
All Implemented Interfaces:
Buffered, BufferedValidatable, Container, Container.ItemSetChangeListener, Container.ItemSetChangeNotifier, Container.PropertySetChangeListener, Container.PropertySetChangeNotifier, Container.Viewer, Property<Object>, Property.Editor, Property.ReadOnlyStatusChangeListener, Property.ReadOnlyStatusChangeNotifier, Property.ValueChangeListener, Property.ValueChangeNotifier, Property.Viewer, Field<Object>, Select, Validatable, ClientConnector, FAbstractClientConnector, FSizeable, HasSizeable, FAbstractComponent, com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<com.vaadin.flow.component.customfield.CustomField<Object>>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<com.vaadin.flow.component.customfield.CustomField<Object>>, com.vaadin.flow.component.FocusNotifier<com.vaadin.flow.component.customfield.CustomField<Object>>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.HasLabel, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, com.vaadin.flow.component.HasValidation, com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Object>,Object>,Object>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Object>,Object>,Object>, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.shared.HasValidationProperties, com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<com.vaadin.flow.component.customfield.CustomField<Object>,Object>,Object>, Serializable

@CssImport("@vaadin/vaadin-lumo-styles/lumo.css") public class FTwinColSelect extends com.vaadin.flow.component.customfield.CustomField<Object> implements FAbstractComponent, Select, HasSizeable
A Vaadin 24-compatible TwinColSelect component that replicates the API of Vaadin 7's TwinColSelect. Supports Vaadin 7-style container APIs.
See Also:
  • Constructor Details

    • FTwinColSelect

      public FTwinColSelect()
    • FTwinColSelect

      public FTwinColSelect(String caption)
    • FTwinColSelect

      public FTwinColSelect(String caption, Collection<?> options)
    • FTwinColSelect

      public FTwinColSelect(String caption, Container dataSource)
  • Method Details

    • getLeftColumnCaption

      public String getLeftColumnCaption()
      Returns the text shown above the left column.
      Returns:
      The text shown or null if not set.
    • setLeftColumnCaption

      public void setLeftColumnCaption(String caption)
      Sets the text shown above the left column.
      Parameters:
      caption - The text to show
    • getRightColumnCaption

      public String getRightColumnCaption()
      Returns the text shown above the right column.
      Returns:
      The text shown or null if not set.
    • setRightColumnCaption

      public void setRightColumnCaption(String caption)
      Sets the text shown above the right column.
      Parameters:
      caption - The text to show
    • getRows

      public int getRows()
    • setRows

      public void setRows(int rows)
      Sets the number of rows in the editor. If the number of rows is set 0, the actual number of displayed rows is determined implicitly by the adapter.
      Parameters:
      rows - the number of rows to set.
    • setHeight

      public void setHeight(float height, com.vaadin.flow.component.Unit unit)
      Description copied from interface: FSizeable
      Sets the height of the object. Negative number implies unspecified size (terminal is free to set the size).
      Specified by:
      setHeight in interface FSizeable
      Specified by:
      setHeight in interface com.vaadin.flow.component.HasSize
      Specified by:
      setHeight in interface HasSizeable
      Parameters:
      height - the height of the object.
      unit - the unit used for the width.
    • setWidth

      public void setWidth(float width, com.vaadin.flow.component.Unit unit)
      Description copied from interface: FSizeable
      Sets the width of the object. Negative number implies unspecified size (terminal is free to set the size).
      Specified by:
      setWidth in interface FSizeable
      Specified by:
      setWidth in interface com.vaadin.flow.component.HasSize
      Specified by:
      setWidth in interface HasSizeable
      Parameters:
      width - the width of the object.
      unit - the unit used for the width.
    • setMultiSelect

      public void setMultiSelect(boolean isMultiSelect)
      Specified by:
      setMultiSelect in interface Select
    • setLabelComponent

      public void setLabelComponent(com.vaadin.flow.component.Component labelComponent)
      Description copied from interface: FAbstractComponent
      Sets the component's label component. Flow components that support caption component usually overrides this.
      Specified by:
      setLabelComponent in interface FAbstractComponent
      Parameters:
      labelComponent - the new label component for the component.
    • setContainerDataSource

      public 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
      Specified by:
      setContainerDataSource in interface Select
      Parameters:
      newDataSource - The new data source Item
    • setItemCaption

      public void setItemCaption(Object itemId, String caption)
      Override the caption of an item. Setting caption explicitly overrides id, item and index captions.
      Parameters:
      itemId - the id of the item to be recaptioned.
      caption - the New caption.
    • getType

      public Class<Object> getType()
      Description copied from interface: Property
      Returns the type of the Property. The methods getValue and setValue must be compatible with this type: one must be able to safely cast the value returned from getValue to the given type and pass any variable assignable to this type as an argument to setValue.
      Specified by:
      getType in interface Field<Object>
      Specified by:
      getType in interface Property<Object>
      Returns:
      type of the Property
    • removeItem

      public 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
      Specified by:
      removeItem in interface Select
      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
    • addItem

      public 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
      Specified by:
      addItem in interface Select
      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
    • addItem

      public 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
      Specified by:
      addItem in interface Select
      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
    • setItemCaptionPropertyId

      public void setItemCaptionPropertyId(Object propertyId)
      Specified by:
      setItemCaptionPropertyId in interface Select
    • setItemIcon

      public void setItemIcon(Object itemId, Resource icon)
      Specified by:
      setItemIcon in interface Select
    • setItemIconPropertyId

      public void setItemIconPropertyId(Object propertyId)
      Specified by:
      setItemIconPropertyId in interface Select
    • setItemCaptionMode

      public void setItemCaptionMode(FAbstractSelect.ItemCaptionMode mode)
      Specified by:
      setItemCaptionMode in interface Select
    • generateModelValue

      protected Object generateModelValue()
      Specified by:
      generateModelValue in class com.vaadin.flow.component.customfield.CustomField<Object>
    • setPresentationValue

      protected void setPresentationValue(Object newValue)
      Specified by:
      setPresentationValue in class com.vaadin.flow.component.customfield.CustomField<Object>
    • onAttach

      protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent)
      Overrides:
      onAttach in class com.vaadin.flow.component.Component
    • onDetach

      protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent)
      Overrides:
      onDetach in class com.vaadin.flow.component.Component
    • fireEvent

      protected void fireEvent(com.vaadin.flow.component.ComponentEvent<?> componentEvent)
      Overrides:
      fireEvent in class com.vaadin.flow.component.Component