Interface Component

All Known Subinterfaces:
Accordion, ActionsHolder, AngularGaugeChart, AppMenu, AppWorkArea, BoxLayout, BpmnModeler, BpmnViewer, BrowserFrame, Button, ButtonsPanel, Calendar<V>, CanvasLayout, CapsLockIndicator, Chart<T>, CheckBox, CheckBoxGroup<I>, ChildEditableController, Collapsable, ColorPicker, ComboBox<V>, Component.BelongToFrame, Component.Editable, Component.Focusable, Component.Wrapper, ComponentContainer, CoordinateChart<T>, CssLayout, CurrencyField<V>, CustomChart, Dashboard, DataGrid<E>, DateField<V>, DatePicker<V>, DialogWindow, Drawer, EntityComboBox<V>, EntityLinkField<V>, EntityPicker<V>, EntitySuggestionField<V>, ExpandingLayout, Field<V>, FileMultiUploadField, FileStorageUploadField, FileUploadField, Filter, FilterComponent, FlowBoxLayout, Form, Fragment, FragmentImplementation, Frame, FullTextFilter, FunnelChart, GanttChart, GeoMap, GrapesJsHtmlEditor, GrapesJsNewsletterHtmlEditor, GrapesJsWebpageHtmlEditor, GridLayout, GroupBoxLayout, GroupFilter, GroupTable<E>, HasItemCaptionProvider<I>, HasOptionCaptionProvider<I>, HasOptionDescriptionProvider<T>, HasOptionIconProvider<T>, HasOptionImageProvider<T>, HasOptionStyleProvider<I>, HasValue<V>, HBoxLayout, HtmlBoxLayout, Image<T>, JavaScriptComponent, JpqlFilter<V>, Label<V>, Link, LinkButton, ListComponent<E>, LogicalFilterComponent, LogoutButton, LookupComponent<E>, LookupComponent.LookupSelectionChangeNotifier<T>, MaskedField<V>, MultiSelectList<V>, NewWindowButton, NotificationsIndicator, OptionsField<V,I>, OrderedContainer, OutcomesPanel, Pagination, PaginationComponent, PasswordField, PieChart, PivotTable, PopupButton, PopupView, ProgressBar, PropertyFilter<V>, RadarChart, RadioButtonGroup<I>, RectangularChart<T>, RelatedEntities<E>, ResizableTextArea<V>, ResourceView, ResponsiveGridLayout, RichTextArea, RootWindow, ScrollBoxLayout, SearchField, SecuredActionsHolder, SelectList<V,I>, SerialChart, SeriesBasedChart<T>, SideMenu, SimplePagination, SingleFileUploadField, SingleFilterComponent<V>, SingleSelectList<V>, SlicedChart<T>, Slider<V>, SourceCodeEditor, SplitPanel, StockChart, SuggestionField<V>, SuggestionFieldComponent<V,I>, SupportsChildrenSelection, Table<E>, TabSheet, TabWindow, TagField<V>, TagPicker<V>, TextArea<V>, TextField<V>, TextInputField<V>, TimeField<V>, TimeZoneIndicator, Tree<E>, TreeDataGrid<E>, TreeTable<E>, TwinColumn<V>, UploadField, UserActionsButton, UserIndicator, ValuePicker<V>, ValuesPicker<V>, VBoxLayout, WebdavDocumentLink, WebdavDocumentUploadField, WebdavDocumentVersionLink, Window, WindowImplementation, XYChart
All Known Implementing Classes:
AbstractActionsHolderComponent, AbstractBox, AbstractCanvasLayout, AbstractComponent, AbstractDataGrid, AbstractField, AbstractFileStorageUploadField, AbstractOrderedLayout, AbstractPagination, AbstractResourceView, AbstractSelectList, AbstractSingleFileUploadField, AbstractSingleFilterComponent, AbstractSuggestionField, AbstractTable, AbstractTextArea, AbstractValueComponent, AbstractViewComponent, AccordionImpl, AngularGaugeChartImpl, AppMenuImpl, AppWorkAreaImpl, BpmnModelerImpl, BpmnViewerImpl, BrowserFrameImpl, ButtonImpl, ButtonsPanelImpl, CalendarImpl, CanvasCssLayout, CanvasGridLayout, CanvasHorizontalLayout, CanvasResponsiveLayout, CanvasRootLayout, CanvasVerticalLayout, CanvasWidgetLayout, CapsLockIndicatorImpl, ChartImpl, CheckBoxGroupImpl, CheckBoxImpl, ColorPickerImpl, ComboBoxImpl, CompositeComponent, CoordinateChartImpl, CssLayoutImpl, CurrencyFieldImpl, CustomChartImpl, DashboardImpl, DataGridImpl, DateFieldImpl, DatePickerImpl, DialogWindowImpl, DrawerImpl, DynamicAttributesPanel, EntityComboBoxImpl, EntityLinkFieldImpl, EntityPickerImpl, EntitySuggestionFieldImpl, FileMultiUploadFieldImpl, FileStorageUploadFieldImpl, FileUploadFieldImpl, FilterImpl, FlowBoxLayoutImpl, FormImpl, FragmentImpl, FullTextFilterImpl, FunnelChartImpl, GanttChartImpl, GeoMapImpl, GrapesJsHtmlEditorImpl, GrapesJsNewsletterHtmlEditorImpl, GrapesJsWebpageHtmlEditorImpl, GridLayoutImpl, GroupBoxImpl, GroupFilterImpl, GroupTableImpl, HBoxLayoutImpl, HtmlBoxLayoutImpl, ImageImpl, JavaScriptComponentImpl, JpqlFilterImpl, LabelImpl, LinkButtonImpl, LinkImpl, LogoutButtonImpl, MaskedFieldImpl, MultiSelectListImpl, NewWindowButtonImpl, NotificationsIndicatorImpl, OutcomesPanelImpl, PaginationImpl, PaletteButton, PasswordFieldImpl, PieChartImpl, PivotTableImpl, PopupButtonImpl, PopupViewImpl, ProgressBarImpl, PropertyFilterImpl, RadarChartImpl, RadioButtonGroupImpl, RectangularChartImpl, RelatedEntitiesImpl, ResizableTextAreaImpl, ResponsiveGridLayoutImpl, RichTextAreaImpl, RootWindowImpl, ScrollBoxLayoutImpl, SearchFieldImpl, SerialChartImpl, SeriesBasedChartImpl, SideMenuImpl, SimplePaginationImpl, SingleSelectListImpl, SlicedChartImpl, SliderImpl, SourceCodeEditorImpl, SplitPanelImpl, StockChartImpl, SuggestionFieldImpl, Table.PlainTextCell, TableImpl, TabSheetImpl, TabWindowImpl, TagFieldImpl, TagPickerImpl, TextAreaImpl, TextFieldImpl, TimeFieldImpl, TimeZoneIndicatorImpl, TreeDataGridImpl, TreeImpl, TreeTableImpl, TwinColumnImpl, UserActionsButtonImpl, UserIndicatorImpl, ValuePickerImpl, ValuesPickerImpl, VBoxLayoutImpl, WebdavDocumentLinkImpl, WebdavDocumentUploadFieldImpl, WebdavDocumentVersionLinkImpl, WindowImpl, XYChartImpl

public interface Component
Root of the Generic UI components hierarchy.
  • Field Details

  • Method Details

    • getId

      @Nullable String getId()
      Component ID as defined in id attribute
    • setId

      @StudioProperty(type=COMPONENT_ID) void setId(@Nullable String id)
      Set component ID
    • getParent

      @Nullable Component getParent()
      Returns:
      parent of component.
    • setParent

      void setParent(@Nullable Component parent)
      INTERNAL.
      ComponentContainer.add(Component) is normally used for adding components to a parent and the used method will call this method implicitly.
      Parameters:
      parent - Parent component
    • isEnabled

      boolean isEnabled()
      Is the component enabled?
      Note that this method only returns the status of the component and does not take parents into account. Even though this method returns true the component can be disabled to the user if a parent is disabled.
      Returns:
      true if the component enabled flag is set to true
    • setEnabled

      @StudioProperty(name="enable", defaultValue="true") void setEnabled(boolean enabled)
      Sets the component enabled state.
      The user can not interact with disabled components, which are shown with a style that indicates the status. Components are enabled by default.
      Parameters:
      enabled - enabled flag
    • isResponsive

      boolean isResponsive()
      Is the component responsive?
      Returns:
      true if the component applies conditional CSS rules for width / height sizes.
    • setResponsive

      @StudioProperty(defaultValue="false") void setResponsive(boolean responsive)
      Sets component to be responsive by width and height.
      If responsive flag is true then you can use conditional CSS rules that respond to size changes in the browser. You can set specific rules using "width-range" or "height-range" properties in CSS files.
      Parameters:
      responsive - responsive flag
    • isVisible

      boolean isVisible()
      Is the component visible?
      A component is visible only if all its parents are also visible. This is not checked by this method though, so even if this method returns true, the component can be hidden from the user because a parent is set to invisible.
      Returns:
      true if the component visibility is set to true
    • setVisible

      @StudioProperty(defaultValue="true") void setVisible(boolean visible)
      Sets visibility value for the component.
      Visible components are drawn in the user interface, while invisible ones are not. The effect is not a cosmetic CSS change - no information about an invisible component will be sent to the client. The effect is thus the same as removing the component from its parent.
      Parameters:
      visible - visible flag
    • isVisibleRecursive

      boolean isVisibleRecursive()
      Returns:
      true if the component and all its parent components are visible
    • isEnabledRecursive

      boolean isEnabledRecursive()
      Returns:
      true if the component and all its parent components are enabled
    • getHeight

      float getHeight()
      Get component height in getHeightSizeUnit()
    • getHeightSizeUnit

      SizeUnit getHeightSizeUnit()
      Gets the height property units.
      Returns:
      units used in height property.
    • setHeight

      @StudioProperty(type=SIZE, defaultValue="-1px") void setHeight(@Nullable String height)
      Set component height in getHeightSizeUnit()
    • setHeightAuto

      default void setHeightAuto()
      Set component height to AUTO_SIZE
    • setHeightFull

      default void setHeightFull()
      Set component height to 100%
    • getWidth

      float getWidth()
      Get component width in getWidthSizeUnit()
    • getWidthSizeUnit

      SizeUnit getWidthSizeUnit()
      Gets the width property units.
      Returns:
      units used in the width property.
    • setWidth

      @StudioProperty(type=SIZE, defaultValue="-1px") void setWidth(@Nullable String width)
      Set component width in getWidthSizeUnit()}
    • setWidthAuto

      default void setWidthAuto()
      Set component width to AUTO_SIZE
    • setWidthFull

      default void setWidthFull()
      Set component width to 100%
    • setSizeFull

      default void setSizeFull()
      Set component width and height to 100%
    • setSizeAuto

      default void setSizeAuto()
      Set component width and height to AUTO_SIZE
    • getAlignment

      Component.Alignment getAlignment()
    • setAlignment

      @StudioProperty(name="align", type=ENUMERATION, defaultValue="TOP_LEFT") void setAlignment(Component.Alignment alignment)
    • getStyleName

      String getStyleName()
      Styles implementation is client-type-specific.
      Returns:
      current style name.
    • setStyleName

      @StudioProperty(name="stylename", type=CSS_CLASSNAME_LIST) void setStyleName(@Nullable String styleName)
      Sets one or more style names of the component, replacing any previous styles. Multiple styles can be specified as a space-separated list of style names. Styles implementation is client-type-specific.
      Parameters:
      styleName - one or more style names separated by space.
    • addStyleName

      void addStyleName(String styleName)
      Adds one or more style names to this component. Multiple styles can be specified as a space-separated list of style names.
      Parameters:
      styleName - one or more style names separated by space.
    • removeStyleName

      void removeStyleName(String styleName)
      Removes one or more style names from component. Multiple styles can be specified as a space-separated list of style names.
      Parameters:
      styleName - one or more style names separated by space.
    • unwrap

      <X> X unwrap(Class<X> internalComponentClass)
      Get client specific component instance. Can be used in client module to simplify invocation of underlying API.
      Example:
       com.vaadin.ui.TextField vTextField = textField.unwrap(com.vaadin.ui.TextField.class);
       
      Type Parameters:
      X - type of internal class
      Parameters:
      internalComponentClass - class of underlying component implementation based on Vaadin or Swing
      Returns:
      internal client specific component
    • unwrapOrNull

      @Nullable <X> X unwrapOrNull(Class<X> internalComponentClass)
      Get client specific component instance. Can be used in client module to simplify invocation of underlying API.
      Returns null if underlying component cannot be casted to the given internalComponentClass. Example:
       com.vaadin.ui.TextField vTextField = textField.unwrapOrNull(com.vaadin.ui.TextField.class);
       
      Type Parameters:
      X - type of internal class
      Parameters:
      internalComponentClass - class of underlying component implementation based on Vaadin or Swing
      Returns:
      internal client specific component or null if it cannot be casted to given class
    • withUnwrapped

      <X> void withUnwrapped(Class<X> internalComponentClass, Consumer<X> action)
      Performs the given action with underlying component if it can be casted to the given internalComponentClass. Example:
       textField.withUnwrapped(com.vaadin.ui.TextField.class, vTextField -> {
           // do something
       });
       
      Type Parameters:
      X - type of internal class
      Parameters:
      internalComponentClass - class of underlying component implementation based on Vaadin or Swing
      action - action to perform if underlying component can be casted to given class
    • unwrapComposition

      <X> X unwrapComposition(Class<X> internalCompositionClass)
      Get the outmost external container of client specific component instance. Can be used in client module to simplify invocation of underlying API.
      Example:
       com.vaadin.ui.Layout vLayout = table.unwrapComposition(com.vaadin.ui.Layout.class);
       
      Type Parameters:
      X - type of internal class
      Parameters:
      internalCompositionClass - class of underlying composition implementation based on Vaadin or Swing
      Returns:
      internal client specific component
    • unwrapCompositionOrNull

      @Nullable <X> X unwrapCompositionOrNull(Class<X> internalCompositionClass)
      Get the outmost external container of client specific component instance. Can be used in client module to simplify invocation of underlying API.
      Returns null if composition cannot be casted to given internalCompositionClass. Example:
       com.vaadin.ui.Layout vLayout = table.unwrapCompositionOrNull(com.vaadin.ui.Layout.class);
       
      Type Parameters:
      X - type of internal class
      Parameters:
      internalCompositionClass - class of underlying composition implementation based on Vaadin or Swing
      Returns:
      internal client specific component or null if cannot be casted to given class
    • withUnwrappedComposition

      <X> void withUnwrappedComposition(Class<X> internalCompositionClass, Consumer<X> action)
      Get the outmost external container of client specific component instance and performs the given action.
      Can be used in client module to simplify invocation of underlying API.
      Example:
       table.withUnwrappedComposition(com.vaadin.ui.Layout.class, vLayout -> {
           // do something
       });
       
      Type Parameters:
      X - type of internal class
      Parameters:
      internalCompositionClass - class of underlying composition implementation based on Vaadin or Swing
      action - to perform if underlying composition can be casted to given class