com.holonplatform.vaadin.components.builders

## Interface ComponentConfigurator<B extends ComponentConfigurator<B>>

- Type Parameters:
    `B` - Concrete configurator type
  All Known Subinterfaces:
    BaseItemDataSourceComponentBuilder<B>, BaseLayoutBuilder<C,B>, BaseSelectInputBuilder<T,C,S,ITEM,B>, BaseSelectInputBuilder.MultiSelectConfigurator<T,ITEM,B>, BaseSelectInputBuilder.SingleSelectConfigurator<T,ITEM,B>, BaseSelectModeMultiPropertySelectInputBuilder<T,B>, BaseSelectModeMultiPropertySelectInputBuilder.OptionsModeMultiPropertySelectInputBuilder<T>, BaseSelectModeMultiPropertySelectInputBuilder.SelectModeMultiPropertySelectInputBuilder<T>, BaseSelectModeMultiSelectInputBuilder<T,B>, BaseSelectModeMultiSelectInputBuilder.OptionsModeMultiSelectInputBuilder<T>, BaseSelectModeMultiSelectInputBuilder.SelectModeMultiSelectInputBuilder<T>, BaseSelectModeSinglePropertySelectInputBuilder<T,B>, BaseSelectModeSinglePropertySelectInputBuilder.NativeModeSinglePropertySelectInputBuilder<T>, BaseSelectModeSinglePropertySelectInputBuilder.OptionsModeSinglePropertySelectInputBuilder<T>, BaseSelectModeSinglePropertySelectInputBuilder.SelectModeSinglePropertySelectInputBuilder<T>, BaseSelectModeSingleSelectInputBuilder<T,B>, BaseSelectModeSingleSelectInputBuilder.NativeModeSingleSelectInputBuilder<T>, BaseSelectModeSingleSelectInputBuilder.OptionsModeSingleSelectInputBuilder<T>, BaseSelectModeSingleSelectInputBuilder.SelectModeSingleSelectInputBuilder<T>, BooleanInputBuilder, ButtonBuilder, ButtonConfigurator<B>, ButtonConfigurator.BaseButtonConfigurator, CalendarInputBuilder<T,B>, ClickableLayoutConfigurator<B>, ClickableLayoutConfigurator.BaseClickableLayoutConfigurator, ComponentBuilder<C,B>, ComponentConfigurator.BaseComponentConfigurator, ComponentContainerBuilder<C,B>, ComponentContainerConfigurator<B>, CssLayoutBuilder, DateInputBuilder, Dialog.Builder<B>, Dialog.DialogBuilder, Dialog.QuestionDialogBuilder, FormLayoutBuilder, GridLayoutBuilder, HorizontalLayoutBuilder, InputBuilder<T,C,B>, InputConfigurator<T,B>, InputConfigurator.BaseFieldConfigurator<T>, ItemDataSourceComponentBuilder<ITEM,C,B>, ItemListingBuilder<T,P,C,B,X>, ItemListingBuilder.BaseGridItemListingBuilder<T,P,C,B>, ItemListingBuilder.GridItemListingBuilder<T>, LabelBuilder, LayoutBuilder<C,B>, LayoutConfigurator<B>, LayoutConfigurator.BaseLayoutConfigurator, MultiPropertySelectInputBuilder<T,B>, MultiPropertySelectInputBuilder.GenericMultiPropertySelectInputBuilder<T>, MultiSelectInputBuilder<T,B>, MultiSelectInputBuilder.GenericMultiSelectInputBuilder<T>, NumberInputBuilder<T>, OrderedLayoutBuilder<C,B>, OrderedLayoutConfigurator<B>, OrderedLayoutConfigurator.BaseOrderedLayoutConfigurator, PanelBuilder, PropertyInputForm.PropertyInputFormBuilder<C>, PropertyListingBuilder<B,X>, PropertyListingBuilder.GridPropertyListingBuilder, PropertySelectInputBuilder<T,C,S,B>, PropertyViewForm.PropertyViewFormBuilder<C>, SecretInputBuilder, SelectInputBuilder<T,C,S,ITEM,B>, SelectItemDataSourceBuilder<T,C,S,ITEM,B>, SingleComponentContainerBuilder<C,B>, SinglePropertySelectInputBuilder<T,B>, SinglePropertySelectInputBuilder.GenericSinglePropertySelectInputBuilder<T>, SingleSelectInputBuilder<T,B>, SingleSelectInputBuilder.GenericSingleSelectInputBuilder<T>, SliderInputBuilder<T>, StringInputBuilder, TemporalInputBuilder<T,B>, TemporalInputBuilder.TemporalWithoutTimeFieldBuilder<T>, TemporalInputBuilder.TemporalWithTimeFieldBuilder<T>, TextInputBuilder<T,C,B>, VerticalLayoutBuilder, ViewComponentBuilder<T>, ViewWindowConfigurator

      public interface ComponentConfigurator<B extends ComponentConfigurator<B>>

  Interface to configure a `Component`.
  Since:
    5.0.0

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `ComponentConfigurator.BaseComponentConfigurator` Base component configurator.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `B` | `caption(com.holonplatform.core.i18n.Localizable caption)` Sets the caption of the component using a `Localizable` message.
    `default B` | `caption(String caption)` Sets the caption of the component.
    `default B` | `caption(String defaultCaption, String messageCode, Object... arguments)` Sets the caption of the component using a localizable `messageCode`.
    `B` | `captionAsHtml()` Sets the caption rendered as HTML.
    `B` | `description(com.holonplatform.core.i18n.Localizable description)` Sets the component's description using a `Localizable` message.
    `default B` | `description(String description)` Sets the component's description.
    `default B` | `description(String defaultDescription, String messageCode, Object... arguments)` Sets the component's description using a localizable `messageCode`.
    `B` | `disabled()` Disables the component.
    `B` | `errorHandler(com.vaadin.server.ErrorHandler errorHandler)` Sets the error handler for the component.
    `B` | `fullHeight()` Set the component heigth to 100%
    `B` | `fullSize()` Set the component width and heigth to 100%
    `B` | `fullWidth()` Set the component width to 100%
    `B` | `height(float height, com.vaadin.server.Sizeable.Unit unit)` Sets the height of the object.
    `B` | `height(String height)` Sets the height of the component using String presentation.
    `B` | `heightUndefined()` Clears any defined height
    `B` | `hidden()` Set the component as not visible.
    `B` | `icon(com.vaadin.server.Resource icon)` Sets the icon of the component.
    `B` | `id(String id)` Adds an unique id for component that is used in the client-side for testing purposes.
    `B` | `notVisible()` Sets the components as not visible.
    `B` | `primaryStyleName(String style)` Changes the primary style name of the component.
    `B` | `replaceStyleName(String styleName)` Sets one or more user-defined style names of the component, replacing any previous user-defined styles.
    `B` | `responsive()` Enables responsiveness for this component
    `B` | `sizeUndefined()` Clears any size settings
    `B` | `styleName(String styleName)` Adds one or more style names to this component.
    `B` | `width(float width, com.vaadin.server.Sizeable.Unit unit)` Sets the width of the object.
    `B` | `width(String width)` Sets the width of the component using String presentation.
    `B` | `widthUndefined()` Clears any defined width
    `B` | `withAttachListener(com.vaadin.server.ClientConnector.AttachListener listener)` Add an `ClientConnector.AttachListener` to the component, called after the component is attached to the application.
    `B` | `withContextClickListener(com.vaadin.event.ContextClickEvent.ContextClickListener listener)` Add a `ContextClickEvent.ContextClickListener` to this component, that gets notified when a context click happens.
    `B` | `withData(Object data)` Sets the data object, that can be used for any application specific data.
    `B` | `withDetachListener(com.vaadin.server.ClientConnector.DetachListener listener)` Add an `ClientConnector.DetachListener` to the component, called before the component is detached from the application.
    `B` | `withShortcutListener(com.vaadin.event.ShortcutListener shortcut)` Add a `ShortcutListener` to this component

- - ### Method Detail

    - #### width

          B width(float width,
                  com.vaadin.server.Sizeable.Unit unit)

      Sets the width of the object. Negative number implies unspecified size.
      Parameters:
        `width` - The width of the component
        `unit` - The unit used for the width
      Returns:
        this

    - #### width

          B width(String width)

      Sets the width of the component using String presentation.

      String presentation is similar to what is used in Cascading Style Sheets. Size can be length or percentage of available size.

      The empty string ("") or null will unset the width and set the units to pixels.

      Parameters:
        `width` - Width in CSS style string representation.
      Returns:
        this

    - #### height

          B height(float height,
                   com.vaadin.server.Sizeable.Unit unit)

      Sets the height of the object. Negative number implies unspecified size.
      Parameters:
        `height` - The height of the component
        `unit` - The unit used for the height
      Returns:
        this

    - #### height

          B height(String height)

      Sets the height of the component using String presentation.

      String presentation is similar to what is used in Cascading Style Sheets. Size can be length or percentage of available size.

      The empty string ("") or null will unset the height and set the units to pixels.

      Parameters:
        `height` - Height in CSS style string representation.
      Returns:
        this

    - #### fullWidth

          B fullWidth()

      Set the component width to 100%
      Returns:
        this

    - #### fullHeight

          B fullHeight()

      Set the component heigth to 100%
      Returns:
        this

    - #### fullSize

          B fullSize()

      Set the component width and heigth to 100%
      Returns:
        this

    - #### widthUndefined

          B widthUndefined()

      Clears any defined width
      Returns:
        this

    - #### heightUndefined

          B heightUndefined()

      Clears any defined height
      Returns:
        this

    - #### sizeUndefined

          B sizeUndefined()

      Clears any size settings
      Returns:
        this

    - #### styleName

          B styleName(String styleName)

      Adds one or more style names to this component. Multiple styles can be specified as a space-separated list of style names. The style name will be rendered as a HTML class name, which can be used in a CSS definition.

      Each style name will occur in two versions: one as specified and one that is prefixed with the style name of the component.

      Parameters:
        `styleName` - The new style to be added to the component
      Returns:
        this

    - #### replaceStyleName

          B replaceStyleName(String styleName)

      Sets one or more user-defined style names of the component, replacing any previous user-defined styles. Multiple styles can be specified as a space-separated list of style names. The style names must be valid CSS class names and should not conflict with any built-in style names in Vaadin or GWT.

      Each style name will occur in two versions: one as specified and one that is prefixed with the style name of the component.

      Parameters:
        `styleName` - The new style or styles of the component as a space-separated list
      Returns:
        this

    - #### primaryStyleName

          B primaryStyleName(String style)

      Changes the primary style name of the component.

      The primary style name identifies the component when applying the CSS theme to the Component. By changing the style name all CSS rules targeted for that style name will no longer apply, and might result in the component not working as intended.

      Parameters:
        `style` - The new primary style name
      Returns:
        this

    - #### disabled

          B disabled()

      Disables the component. The user can not interact with disabled components, which are shown with a style that indicates the status, usually shaded in light gray color.
      Returns:
        this

    - #### notVisible

          B notVisible()

      Sets the components as not visible.
      Returns:
        this

    - #### hidden

          B hidden()

      Set the component as not visible.

      Invisible components are not drawn in the user interface. The effect is not merely 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.

      Returns:
        this

    - #### captionAsHtml

          B captionAsHtml()

      Sets the caption rendered as HTML.

      When the captions are rendered in the browser as HTML, the developer is responsible for ensuring no harmful HTML is used.

      Returns:
        this

    - #### caption

          default B caption(String caption)

      Sets the caption of the component.

      A caption is an explanatory textual label accompanying a user interface component, usually shown above, left of, or inside the component.

      Parameters:
        `caption` - The new caption for the component. If the caption is `null`, no caption is shown
      Returns:
        this

    - #### caption

          default B caption(String defaultCaption,
                            String messageCode,
                            Object... arguments)

      Sets the caption of the component using a localizable `messageCode`.

      For caption localization, a `LocalizationContext` must be available and localized as `Context` resource when component is built.

      Parameters:
        `defaultCaption` - Default caption if no translation is available for given `messageCode` for current Locale, or no `LocalizationContext` is available at all
        `messageCode` - Caption translation message key
        `arguments` - Optional translation arguments
      Returns:
        this

    - #### caption

          B caption(com.holonplatform.core.i18n.Localizable caption)

      Sets the caption of the component using a `Localizable` message.

      For caption localization, a `LocalizationContext` must be available and localized as `Context` resource when component is built.

      Parameters:
        `caption` - Caption `Localizable` message
      Returns:
        this

    - #### description

          default B description(String description)

      Sets the component's description.

      The description is displayed as HTML in tooltips or directly in certain components so care should be taken to avoid creating the possibility for HTML injection and possibly XSS vulnerabilities.

      Parameters:
        `description` - The description to set
      Returns:
        this

    - #### description

          default B description(String defaultDescription,
                                String messageCode,
                                Object... arguments)

      Sets the component's description using a localizable `messageCode`.

      For description localization, a `LocalizationContext` must be available and localized as `Context` resource when component is built.

      Parameters:
        `defaultDescription` - Default description if no translation is available for given `messageCode` for current Locale, or no `LocalizationContext` is available at all
        `messageCode` - Description translation message key
        `arguments` - Optional translation arguments
      Returns:
        this

    - #### description

          B description(com.holonplatform.core.i18n.Localizable description)

      Sets the component's description using a `Localizable` message.

      For description localization, a `LocalizationContext` must be available and localized as `Context` resource when component is built.

      Parameters:
        `description` - Description `Localizable` message
      Returns:
        this

    - #### icon

          B icon(com.vaadin.server.Resource icon)

      Sets the icon of the component.

      An icon is an explanatory graphical label accompanying a user interface component, usually shown above, left of, or inside the component. Icon is closely related to caption and is usually displayed horizontally before or after it, depending on the component and the containing layout.

      Parameters:
        `icon` - The icon of the component. If `null`, no icon is shown.
      Returns:
        this

    - #### id

          B id(String id)

      Adds an unique id for component that is used in the client-side for testing purposes. Keeping identifiers unique is the responsibility of the programmer.
      Parameters:
        `id` - An alphanumeric id
      Returns:
        this

    - #### errorHandler

          B errorHandler(com.vaadin.server.ErrorHandler errorHandler)

      Sets the error handler for the component.

      The error handler is dispatched whenever there is an error processing the data coming from the client for this component.

      Parameters:
        `errorHandler` - The error handler for this component
      Returns:
        this

    - #### withData

          B withData(Object data)

      Sets the data object, that can be used for any application specific data. The component does not use or modify this data.
      Parameters:
        `data` - The Application specific data.
      Returns:
        this

    - #### responsive

          B responsive()

      Enables responsiveness for this component
      Returns:
        this

    - #### withAttachListener

          B withAttachListener(com.vaadin.server.ClientConnector.AttachListener listener)

      Add an `ClientConnector.AttachListener` to the component, called after the component is attached to the application.
      Parameters:
        `listener` - Listener to add
      Returns:
        this

    - #### withDetachListener

          B withDetachListener(com.vaadin.server.ClientConnector.DetachListener listener)

      Add an `ClientConnector.DetachListener` to the component, called before the component is detached from the application.
      Parameters:
        `listener` - Listener to add
      Returns:
        this

    - #### withShortcutListener

          B withShortcutListener(com.vaadin.event.ShortcutListener shortcut)

      Add a `ShortcutListener` to this component
      Parameters:
        `shortcut` - ShortcutListener to add
      Returns:
        this

    - #### withContextClickListener

          B withContextClickListener(com.vaadin.event.ContextClickEvent.ContextClickListener listener)

      Add a `ContextClickEvent.ContextClickListener` to this component, that gets notified when a context click happens.
      Parameters:
        `listener` - ContextClickListener to add
      Returns:
        this

Copyright © 2017 The Holon Platform. All rights reserved.