public interface Components
Provides static methods to obtain builder for common UI components type, allowing fluent and implementation-agnostic components creation and configuration.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Components.dialog
Dialog builders provider.
|
static interface |
Components.input
|
static interface |
Components.listing
ItemListing builders provider. |
static interface |
Components.view
ViewComponent and PropertyViewGroup builders provider. |
| Modifier and Type | Method and Description |
|---|---|
static ButtonBuilder |
button()
Gets a builder to create
Buttons. |
static com.vaadin.flow.component.button.Button |
button(com.holonplatform.core.i18n.Localizable text,
ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)
Create a
Button with given localizable text and given click event listener. |
static com.vaadin.flow.component.button.Button |
button(String text,
ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)
Create a
Button with given text and given click event listener. |
static com.vaadin.flow.component.button.Button |
button(String defaultText,
String messageCode,
ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)
Create a
Button with given localizable text and given click event listener. |
static ButtonConfigurator.BaseButtonConfigurator |
configure(com.vaadin.flow.component.button.Button button)
Get a
ButtonConfigurator to configure given Button instance. |
static FormLayoutConfigurator.BaseFormLayoutConfigurator |
configure(com.vaadin.flow.component.formlayout.FormLayout layout)
Get a
FormLayoutConfigurator.BaseFormLayoutConfigurator to configure given FormLayout. |
static ThemableFlexComponentConfigurator.HorizontalLayoutConfigurator |
configure(com.vaadin.flow.component.orderedlayout.HorizontalLayout layout)
Get a
ThemableFlexComponentConfigurator.HorizontalLayoutConfigurator to configure given HorizontalLayout. |
static <L extends com.vaadin.flow.component.HtmlContainer & com.vaadin.flow.component.ClickNotifier> |
configure(L label)
Get a
LabelConfigurator to configure given label type component. |
static ThemableFlexComponentConfigurator.VerticalLayoutConfigurator |
configure(com.vaadin.flow.component.orderedlayout.VerticalLayout layout)
Get a
ThemableFlexComponentConfigurator.VerticalLayoutConfigurator to configure given VerticalLayout. |
static ContextMenuBuilder |
contextMenu()
Gets a builder to create
ContextMenus. |
static LabelBuilder<com.vaadin.flow.component.html.Div> |
div()
Obtain a
LabelBuilder to create a label component using a Div tag. |
static FormLayoutBuilder |
formLayout()
Gets a builder to create
FormLayouts. |
static Optional<Locale> |
getCurrentLocale()
Get the current
Locale, if available. |
static Optional<String> |
getLocalization(Locale locale,
com.holonplatform.core.i18n.Localizable localizable)
Get the message localization for given
locale, using the provided Localizable to obtain the
message localization key (Localizable.getMessageCode()) and the optional localization arguments. |
static Optional<String> |
getLocalization(Locale locale,
String messageCode,
Object... arguments)
Get the message localization for given
locale, using the provided messageCode as
message localization key and the optional localization arguments. |
static String |
getLocalization(Locale locale,
String defaultMessage,
String messageCode,
Object... arguments)
Get the message localization for given
locale, using the provided messageCode as
message localization key and the optional localization arguments. |
static LabelBuilder<com.vaadin.flow.component.html.H1> |
h1()
Obtain a
LabelBuilder to create a label component using a H1 tag. |
static LabelBuilder<com.vaadin.flow.component.html.H2> |
h2()
Obtain a
LabelBuilder to create a label component using a H2 tag. |
static LabelBuilder<com.vaadin.flow.component.html.H3> |
h3()
Obtain a
LabelBuilder to create a label component using a H3 tag. |
static LabelBuilder<com.vaadin.flow.component.html.H4> |
h4()
Obtain a
LabelBuilder to create a label component using a H4 tag. |
static LabelBuilder<com.vaadin.flow.component.html.H5> |
h5()
Obtain a
LabelBuilder to create a label component using a H5 tag. |
static LabelBuilder<com.vaadin.flow.component.html.H6> |
h6()
Obtain a
LabelBuilder to create a label component using a H6 tag. |
static HorizontalLayoutBuilder |
hl()
Gets a builder to create
HorizontalLayouts. |
static LabelBuilder<com.vaadin.flow.component.html.Div> |
label()
Obtain a
LabelBuilder to create a label component using a Div tag. |
static Optional<String> |
localize(com.holonplatform.core.i18n.Localizable localizable)
Get the message localization for the current
Locale, using the provided Localizable to obtain the
message localization key (Localizable.getMessageCode()) and the optional localization arguments. |
static Optional<String> |
localize(String messageCode,
Object... arguments)
Get the message localization for the current
Locale, using the provided messageCode as
message localization key and the optional localization arguments. |
static String |
localize(String defaultMessage,
String messageCode,
Object... arguments)
Get the message localization for the current
Locale, using the provided messageCode as
message localization key and the optional localization arguments. |
static NativeButtonBuilder |
nativeButton()
Gets a builder to create
NativeButtons. |
static LabelBuilder<com.vaadin.flow.component.html.Paragraph> |
paragraph()
Obtain a
LabelBuilder to create a label component using a Paragraph tag. |
static LabelBuilder<com.vaadin.flow.component.html.Span> |
span()
Obtain a
LabelBuilder to create a label component using a Span tag. |
static VerticalLayoutBuilder |
vl()
Gets a builder to create
VerticalLayouts. |
static <L extends com.vaadin.flow.component.HtmlContainer & com.vaadin.flow.component.ClickNotifier> LabelConfigurator.BaseLabelConfigurator<L> configure(L label)
LabelConfigurator to configure given label type component.
The component must be a HtmlContainer and a ClickNotifier, such as Span or Div.
L - Label element typelabel - The component to configure (not null)LabelConfiguratorstatic ButtonConfigurator.BaseButtonConfigurator configure(com.vaadin.flow.component.button.Button button)
ButtonConfigurator to configure given Button instance.button - Button to configure (not null)ButtonConfiguratorstatic ThemableFlexComponentConfigurator.VerticalLayoutConfigurator configure(com.vaadin.flow.component.orderedlayout.VerticalLayout layout)
ThemableFlexComponentConfigurator.VerticalLayoutConfigurator to configure given VerticalLayout.layout - Layout to configureThemableFlexComponentConfigurator.VerticalLayoutConfiguratorstatic ThemableFlexComponentConfigurator.HorizontalLayoutConfigurator configure(com.vaadin.flow.component.orderedlayout.HorizontalLayout layout)
ThemableFlexComponentConfigurator.HorizontalLayoutConfigurator to configure given HorizontalLayout.layout - Layout to configureThemableFlexComponentConfigurator.HorizontalLayoutConfiguratorstatic FormLayoutConfigurator.BaseFormLayoutConfigurator configure(com.vaadin.flow.component.formlayout.FormLayout layout)
FormLayoutConfigurator.BaseFormLayoutConfigurator to configure given FormLayout.layout - Layout to configureFormLayoutConfigurator.BaseFormLayoutConfiguratorstatic LabelBuilder<com.vaadin.flow.component.html.Div> label()
LabelBuilder to create a label component using a Div tag.
This is an alias for the div() method.
LabelBuilder to configure and obtain the component instancestatic LabelBuilder<com.vaadin.flow.component.html.Span> span()
LabelBuilder to create a label component using a Span tag.LabelBuilder to configure and obtain the component instancestatic LabelBuilder<com.vaadin.flow.component.html.Div> div()
LabelBuilder to create a label component using a Div tag.LabelBuilder to configure and obtain the component instancestatic LabelBuilder<com.vaadin.flow.component.html.Paragraph> paragraph()
LabelBuilder to create a label component using a Paragraph tag.LabelBuilder to configure and obtain the component instancestatic LabelBuilder<com.vaadin.flow.component.html.H1> h1()
LabelBuilder to create a label component using a H1 tag.LabelBuilder to configure and obtain the component instancestatic LabelBuilder<com.vaadin.flow.component.html.H2> h2()
LabelBuilder to create a label component using a H2 tag.LabelBuilder to configure and obtain the component instancestatic LabelBuilder<com.vaadin.flow.component.html.H3> h3()
LabelBuilder to create a label component using a H3 tag.LabelBuilder to configure and obtain the component instancestatic LabelBuilder<com.vaadin.flow.component.html.H4> h4()
LabelBuilder to create a label component using a H4 tag.LabelBuilder to configure and obtain the component instancestatic LabelBuilder<com.vaadin.flow.component.html.H5> h5()
LabelBuilder to create a label component using a H5 tag.LabelBuilder to configure and obtain the component instancestatic LabelBuilder<com.vaadin.flow.component.html.H6> h6()
LabelBuilder to create a label component using a H6 tag.LabelBuilder to configure and obtain the component instancestatic ButtonBuilder button()
Buttons.ButtonBuilderstatic com.vaadin.flow.component.button.Button button(String text, ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)
Button with given text and given click event listener.text - The button textclickListener - The click listener (not null)Buttonbutton()static com.vaadin.flow.component.button.Button button(String defaultText, String messageCode, ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)
Button with given localizable text and given click event listener.defaultText - The default button textmessageCode - The button text message localization codeclickListener - The click listener (not null)Buttonbutton()static com.vaadin.flow.component.button.Button button(com.holonplatform.core.i18n.Localizable text,
ClickEventListener<com.vaadin.flow.component.button.Button,ClickEvent<com.vaadin.flow.component.button.Button>> clickListener)
Button with given localizable text and given click event listener.text - The Localizable button textclickListener - The click listener (not null)Buttonbutton()static NativeButtonBuilder nativeButton()
NativeButtons.NativeButtonBuilderstatic VerticalLayoutBuilder vl()
VerticalLayouts.VerticalLayoutBuilderstatic HorizontalLayoutBuilder hl()
HorizontalLayouts.HorizontalLayoutBuilderstatic FormLayoutBuilder formLayout()
FormLayouts.FormLayoutBuilderstatic ContextMenuBuilder contextMenu()
ContextMenus.ContextMenuBuilderstatic Optional<Locale> getCurrentLocale()
Locale, if available.
The current Locale retrieving strategy is:
UI is available and a UI Locale is configured, the UI locale is returned.LocalizationContext is available as a Context resource and it is localized, the
LocalizationContext Locale is returned.I18NProvider is available from the VaadinService, the first Locale from
I18NProvider.getProvidedLocales() is returned, if available.LocaleLocalizationContext.getCurrent()static Optional<String> getLocalization(Locale locale, com.holonplatform.core.i18n.Localizable localizable)
locale, using the provided Localizable to obtain the
message localization key (Localizable.getMessageCode()) and the optional localization arguments.
If a I18NProvider is available from the current VaadinService, it is used for message
localization. Otherwise, the current LocalizationContext is used, if it is available as a Context
resource and it is localized.
locale - The Locale for which to obtain the message localization (not null)localizable - The Localizable which represents the message to localize (not null)localizable provides a default message
(Localizable.getMessage()) and a message localization is not available, the default message is
returnedLocalizationContext.getCurrent()static Optional<String> getLocalization(Locale locale, String messageCode, Object... arguments)
locale, using the provided messageCode as
message localization key and the optional localization arguments.
If a I18NProvider is available from the current VaadinService, it is used for message
localization. Otherwise, the current LocalizationContext is used, if it is available as a Context
resource and it is localized.
locale - The Locale for which to obtain the message localization (not null)messageCode - The message localization key (not null)arguments - Optional message localization argumentsLocalizationContext.getCurrent()static String getLocalization(Locale locale, String defaultMessage, String messageCode, Object... arguments)
locale, using the provided messageCode as
message localization key and the optional localization arguments.
If a I18NProvider is available from the current VaadinService, it is used for message
localization. Otherwise, the current LocalizationContext is used, if it is available as a Context
resource and it is localized.
locale - The Locale for which to obtain the message localization (not null)defaultMessage - The default message to use when a message localization is not available for the provided
Locale and message codemessageCode - The message localization key (not null)arguments - Optional message localization argumentsdefaultMessage if not availableLocalizationContext.getCurrent()static Optional<String> localize(com.holonplatform.core.i18n.Localizable localizable)
Locale, using the provided Localizable to obtain the
message localization key (Localizable.getMessageCode()) and the optional localization arguments.
If a I18NProvider is available from the current VaadinService, it is used for message
localization. Otherwise, the current LocalizationContext is used, if it is available as a Context
resource and it is localized.
The message localization will be performed only if a current Locale is available.
localizable - The Localizable which represents the message to localize (not null)localizable provides a default message
(Localizable.getMessage()) and a message localization is not available, the default message is
returnedgetCurrentLocale()static Optional<String> localize(String messageCode, Object... arguments)
Locale, using the provided messageCode as
message localization key and the optional localization arguments.
If a I18NProvider is available from the current VaadinService, it is used for message
localization. Otherwise, the current LocalizationContext is used, if it is available as a Context
resource and it is localized.
The message localization will be performed only if a current Locale is available.
messageCode - The message localization key (not null)arguments - Optional message localization argumentsgetCurrentLocale()static String localize(String defaultMessage, String messageCode, Object... arguments)
Locale, using the provided messageCode as
message localization key and the optional localization arguments.
If a I18NProvider is available from the current VaadinService, it is used for message
localization. Otherwise, the current LocalizationContext is used, if it is available as a Context
resource and it is localized.
The message localization will be performed only if a current Locale is available.
defaultMessage - The default message to use when a message localization is not available for the provided
Locale and message codemessageCode - The message localization key (not null)arguments - Optional message localization argumentsdefaultMessage if not availablegetCurrentLocale()Copyright © 2019 The Holon Platform. All rights reserved.