Class TwinColumn<V>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<JmixTwinColumn<V>,Collection<V>>
io.jmix.flowui.kit.component.twincolumn.JmixTwinColumn<V>
io.jmix.flowui.component.twincolumn.TwinColumn<V>
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasAriaLabel, 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<JmixTwinColumn<V>,Collection<V>>,Collection<V>>, com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,Collection<V>>,Collection<V>>, com.vaadin.flow.component.shared.HasThemeVariant<TwinColumnVariant>, com.vaadin.flow.component.shared.HasValidationProperties, com.vaadin.flow.data.provider.HasDataView<V,Void,TwinColumnDataView<V>>, com.vaadin.flow.data.provider.HasListDataView<V,TwinColumnListDataView<V>>, HasRequired, SupportsValidation<Collection<V>>, SupportsDataProvider<V>, SupportsItemsContainer<V>, SupportsItemsEnum<V>, SupportsValueSource<Collection<V>>, Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationContextAware

public class TwinColumn<V> extends JmixTwinColumn<V> implements SupportsItemsContainer<V>, SupportsValueSource<Collection<V>>, SupportsItemsEnum<V>, SupportsDataProvider<V>, SupportsValidation<Collection<V>>, HasRequired, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
See Also:
  • Field Details

  • Constructor Details

    • TwinColumn

      public TwinColumn()
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Throws:
      org.springframework.beans.BeansException
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
    • setValueSource

      public void setValueSource(@Nullable ValueSource<Collection<V>> valueSource)
      Specified by:
      setValueSource in interface SupportsValueSource<V>
    • getValueSource

      public ValueSource<Collection<V>> getValueSource()
      Specified by:
      getValueSource in interface SupportsValueSource<V>
    • setItems

      public void setItems(CollectionContainer<V> container)
      Description copied from interface: SupportsItemsContainer
      Sets items from the passed CollectionContainer.
      Specified by:
      setItems in interface SupportsItemsContainer<V>
      Parameters:
      container - a CollectionContainer to be used as items source
      See Also:
    • setItems

      public void setItems(Class<V> itemsEnum)
      Description copied from interface: SupportsItemsEnum
      Sets items from the passed EnumClass.
      Specified by:
      setItems in interface SupportsItemsEnum<V>
      Parameters:
      itemsEnum - a EnumClass to be used as items source
      See Also:
    • setItems

      public TwinColumnDataView<V> setItems(com.vaadin.flow.data.provider.DataProvider<V,Void> dataProvider)
      Specified by:
      setItems in interface com.vaadin.flow.data.provider.HasDataView<V,Void,TwinColumnDataView<V>>
      Overrides:
      setItems in class JmixTwinColumn<V>
    • setItems

      public TwinColumnDataView<V> setItems(com.vaadin.flow.data.provider.InMemoryDataProvider<V> dataProvider)
      Specified by:
      setItems in interface com.vaadin.flow.data.provider.HasDataView<V,Void,TwinColumnDataView<V>>
      Overrides:
      setItems in class JmixTwinColumn<V>
    • setItems

      public TwinColumnListDataView<V> setItems(com.vaadin.flow.data.provider.ListDataProvider<V> dataProvider)
      Specified by:
      setItems in interface com.vaadin.flow.data.provider.HasListDataView<V,TwinColumnListDataView<V>>
      Overrides:
      setItems in class JmixTwinColumn<V>
    • getDataProvider

      @Nullable public com.vaadin.flow.data.provider.DataProvider<V,?> getDataProvider()
      Specified by:
      getDataProvider in interface SupportsDataProvider<V>
      Overrides:
      getDataProvider in class JmixTwinColumn<V>
    • addValidator

      public com.vaadin.flow.shared.Registration addValidator(Validator<? super Collection<V>> validator)
      Specified by:
      addValidator in interface SupportsValidation<V>
    • executeValidators

      public void executeValidators() throws ValidationException
      Specified by:
      executeValidators in interface SupportsValidation<V>
      Throws:
      ValidationException
    • setInvalid

      public void setInvalid(boolean invalid)
      Description copied from interface: SupportsValidation
      Sets invalid state to the field considering result of field validation.
      • Invalid - false and validation passed - false = field is invalid
      • Invalid - false and validation passed - true = field is valid
      • Invalid - true and validation passed - false = field is invalid
      • Invalid - true and validation passed - true = field is invalid
      Specified by:
      setInvalid in interface com.vaadin.flow.component.HasValidation
      Specified by:
      setInvalid in interface com.vaadin.flow.component.shared.HasValidationProperties
      Specified by:
      setInvalid in interface SupportsValidation<V>
      Parameters:
      invalid - whether field should be invalid
    • isInvalid

      public boolean isInvalid()
      Specified by:
      isInvalid in interface com.vaadin.flow.component.HasValidation
      Specified by:
      isInvalid in interface com.vaadin.flow.component.shared.HasValidationProperties
    • getRequiredMessage

      @Nullable public String getRequiredMessage()
      Specified by:
      getRequiredMessage in interface HasRequired
    • setRequiredMessage

      public void setRequiredMessage(@Nullable String requiredMessage)
      Specified by:
      setRequiredMessage in interface HasRequired
    • setRequired

      public void setRequired(boolean required)
      Specified by:
      setRequired in interface HasRequired
    • setRequiredIndicatorVisible

      public void setRequiredIndicatorVisible(boolean requiredIndicatorVisible)
      Specified by:
      setRequiredIndicatorVisible in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,Collection<V>>,Collection<V>>
      Specified by:
      setRequiredIndicatorVisible in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,Collection<V>>,Collection<V>>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,Collection<V>>,Collection<V>>
      Overrides:
      isEmpty in class com.vaadin.flow.component.AbstractField<JmixTwinColumn<V>,Collection<V>>
    • isRequiredIndicatorVisible

      public boolean isRequiredIndicatorVisible()
      Specified by:
      isRequiredIndicatorVisible in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,Collection<V>>,Collection<V>>
      Specified by:
      isRequiredIndicatorVisible in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,Collection<V>>,Collection<V>>
    • setErrorMessage

      public void setErrorMessage(@Nullable String errorMessage)
      Specified by:
      setErrorMessage in interface com.vaadin.flow.component.HasValidation
      Specified by:
      setErrorMessage in interface com.vaadin.flow.component.shared.HasValidationProperties
      Specified by:
      setErrorMessage in interface SupportsValidation<V>
    • getErrorMessage

      public String getErrorMessage()
      Specified by:
      getErrorMessage in interface com.vaadin.flow.component.HasValidation
      Specified by:
      getErrorMessage in interface com.vaadin.flow.component.shared.HasValidationProperties
      Specified by:
      getErrorMessage in interface SupportsValidation<V>
    • setValue

      public void setValue(Collection<V> value)
      Specified by:
      setValue in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,Collection<V>>,Collection<V>>
      Overrides:
      setValue in class com.vaadin.flow.component.AbstractField<JmixTwinColumn<V>,Collection<V>>
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,Collection<V>>,Collection<V>>
      Specified by:
      setReadOnly in interface com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixTwinColumn<V>,Collection<V>>,Collection<V>>
      Overrides:
      setReadOnly in class JmixTwinColumn<V>
    • setEnabled

      public void setEnabled(boolean enabled)
      Specified by:
      setEnabled in interface com.vaadin.flow.component.HasEnabled
    • setSelectAllButtonsVisible

      public void setSelectAllButtonsVisible(Boolean selectAllButtonsVisible)
      Description copied from class: JmixTwinColumn
      Component provides the ability to select or deselect all items. This feature is disabled by default. Setting true shows two buttons to select or deselect all items.
      Overrides:
      setSelectAllButtonsVisible in class JmixTwinColumn<V>
    • autowireDependencies

      protected void autowireDependencies()
    • initComponentMessages

      protected void initComponentMessages()
    • createValueChangeListener

      protected void createValueChangeListener()
    • onDataChange

      protected void onDataChange(com.vaadin.flow.data.provider.DataChangeEvent<V> event)
      Overrides:
      onDataChange in class JmixTwinColumn<V>
    • bindDataProvider

      protected void bindDataProvider(com.vaadin.flow.data.provider.DataProvider<V,?> dataProvider)
    • createFieldDelegate

      protected TwinColumnDelegate<TwinColumn<V>,Collection<V>,Collection<V>> createFieldDelegate()
    • createDataViewDelegate

      protected DataViewDelegate<TwinColumn<V>,V> createDataViewDelegate()
    • applyColumnItemLabelFormat

      protected String applyColumnItemLabelFormat(V value)
      Overrides:
      applyColumnItemLabelFormat in class JmixTwinColumn<V>