com.holonplatform.vaadin.flow.navigator.internal

## Class DefaultNavigationLink.DefaultBuilder

- java.lang.Object
- - com.holonplatform.vaadin.flow.navigator.internal.AbstractNavigationURLBuilder<NavigationLink.Builder>
  - - com.holonplatform.vaadin.flow.navigator.internal.DefaultNavigationLink.DefaultBuilder

- All Implemented Interfaces:
    ComponentConfigurator<NavigationLink.Builder>, DeferrableLocalizationConfigurator<NavigationLink.Builder>, HasDeferrableLocalization, HasElementConfigurator<NavigationLink.Builder>, HasEnabledConfigurator<NavigationLink.Builder>, HasSizeConfigurator<NavigationLink.Builder>, HasStyleConfigurator<NavigationLink.Builder>, HasTextConfigurator<NavigationLink.Builder>, NavigationLink.Builder, NavigationURLBuilder<NavigationLink.Builder>, Serializable
  Enclosing class:
    DefaultNavigationLink

      public static class DefaultNavigationLink.DefaultBuilder
      extends AbstractNavigationURLBuilder<NavigationLink.Builder>
      implements NavigationLink.Builder

  Default `Builder` implementation.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin.flow.components.builders.ComponentConfigurator

      `ComponentConfigurator.BaseComponentConfigurator`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin.flow.components.builders.HasTextConfigurator

      `HasTextConfigurator.BaseHasTextConfigurator`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin.flow.components.builders.HasStyleConfigurator

      `HasStyleConfigurator.BaseHasStyleConfigurator`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin.flow.components.builders.HasSizeConfigurator

      `HasSizeConfigurator.BaseHasSizeConfigurator`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.vaadin.flow.components.builders.HasEnabledConfigurator

      `HasEnabledConfigurator.BaseHasEnabledConfigurator`

  - ### Field Summary

    - ### Fields inherited from interface com.holonplatform.vaadin.flow.components.builders.HasSizeConfigurator

      `FULL_SIZE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultBuilder(Class<? extends com.vaadin.flow.component.Component> navigationTarget)` Constructor with navigation target.
    `DefaultBuilder(Class<? extends com.vaadin.flow.component.Component> navigationTarget, com.vaadin.flow.router.Router router)` Constructor with navigation target.
    `DefaultBuilder(String path)` Constructor with path.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `NavigationLink` | `build()` Build the `NavigationLink`.
    `NavigationLink.Builder` | `elementConfiguration(Consumer<com.vaadin.flow.dom.Element> element)` Configure the component `Element`.
    `NavigationLink.Builder` | `enabled(boolean enabled)` Set whether the component is enabled.
    `NavigationLink.Builder` | `height(String height)` Sets the height of the component.
    `NavigationLink.Builder` | `id(String id)` Sets the id of the root element of this component.
    `boolean` | `isDeferredLocalizationEnabled()` Gets whether the localizable elements of the component (for the example the text or the title) should be localized in deferred mode.
    `NavigationLink.Builder` | `maxHeight(String maxHeight)` Set the max-height of the component.
    `NavigationLink.Builder` | `maxWidth(String maxWidth)` Set the max-width of the component.
    `NavigationLink.Builder` | `minHeight(String minHeight)` Set the min-height of the component.
    `NavigationLink.Builder` | `minWidth(String minWidth)` Set the min-width of the component.
    `NavigationLink.Builder` | `styleName(String styleName)` Adds a CSS style class names to this component.
    `NavigationLink.Builder` | `styleNames(String... styleNames)` Adds one or more CSS style class names to this component.
    `NavigationLink.Builder` | `text(com.holonplatform.core.i18n.Localizable text)` Sets the text content using a `Localizable` message.
    `NavigationLink.Builder` | `visible(boolean visible)` Sets the component visibility.
    `NavigationLink.Builder` | `width(String width)` Sets the width of the component.
    `NavigationLink.Builder` | `withAttachListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.AttachEvent> listener)` Add an `AttachEvent` `ComponentEventListener` to the component, called after the component is attached to the application.
    `NavigationLink.Builder` | `withDeferredLocalization(boolean deferredLocalization)` Sets whether the localizable elements of the component (for the example the text or the title) should be localized in deferred mode.
    `NavigationLink.Builder` | `withDetachListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.DetachEvent> listener)` Add an `DetachEvent` `ComponentEventListener` to the component, called before the component is detached from the application.
    `NavigationLink.Builder` | `withEventListener(String eventType, com.vaadin.flow.dom.DomEventListener listener)` Adds an event listener for the given event type.
    `NavigationLink.Builder` | `withEventListener(String eventType, com.vaadin.flow.dom.DomEventListener listener, String filter)` Adds an event listener for the given event type and configure a filter.
    `NavigationLink.Builder` | `withThemeName(String themeName)` Adds a theme name to this component.

    - ### Methods inherited from class com.holonplatform.vaadin.flow.navigator.internal.AbstractNavigationURLBuilder

      `encodeQueryParameters, withPathParameter, withQueryParameter`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.components.builders.ComponentConfigurator

      `create, hidden`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.components.builders.HasTextConfigurator

      `create, create, text, text`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.components.builders.HasStyleConfigurator

      `create`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.components.builders.HasSizeConfigurator

      `create, fullHeight, fullSize, fullWidth, height, heightUndefined, sizeUndefined, width, widthUndefined`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.components.builders.HasEnabledConfigurator

      `create, disabled`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.navigator.NavigationURLBuilder

      `encodeQueryParameters, withPathParameter, withQueryParameter, withQueryParameter`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.components.builders.DeferrableLocalizationConfigurator

      `deferLocalization`

- - ### Constructor Detail

    - #### DefaultBuilder

          public DefaultBuilder(Class<? extends com.vaadin.flow.component.Component> navigationTarget)

      Constructor with navigation target.
      Parameters:
        `navigationTarget` - The navigation target (not null).

    - #### DefaultBuilder

          public DefaultBuilder(Class<? extends com.vaadin.flow.component.Component> navigationTarget,
                                com.vaadin.flow.router.Router router)

      Constructor with navigation target.
      Parameters:
        `navigationTarget` - The navigation target (not null).
        `router` - The `Router` to use to resolve navigation target URLs (may be null)

    - #### DefaultBuilder

          public DefaultBuilder(String path)

      Constructor with path.
      Parameters:
        `path` - The navigation path.

  - ### Method Detail

    - #### isDeferredLocalizationEnabled

          public boolean isDeferredLocalizationEnabled()

      Description copied from interface: `HasDeferrableLocalization`
      Gets whether the localizable elements of the component (for the example the text or the title) should be localized in deferred mode.

      When the deferred localization mode is enabled, the actual messages localization is triggered when the component is displayed in UI, typically when it is attached to a parent component. Otherwise, the messages localization is performed immediately at component build/configuration time.

      Specified by:
        `isDeferredLocalizationEnabled` in interface `HasDeferrableLocalization`
      Returns:
        whether the deferred localization mode is enabled

    - #### withDeferredLocalization

          public NavigationLink.Builder withDeferredLocalization(boolean deferredLocalization)

      Description copied from interface: `DeferrableLocalizationConfigurator`
      Sets whether the localizable elements of the component (for the example the text or the title) should be localized in deferred mode.

      When the deferred localization mode is enabled, the actual messages localization is triggered when the component is displayed in UI, typically when it is attached to a parent component. Otherwise, the messages localization is performed immediately at component build/configuration time.

      Specified by:
        `withDeferredLocalization` in interface `DeferrableLocalizationConfigurator<NavigationLink.Builder>`
      Parameters:
        `deferredLocalization` - Whether to enable the deferred localization mode
      Returns:
        this

    - #### id

          public NavigationLink.Builder id(String id)

      Description copied from interface: `ComponentConfigurator`
      Sets the id of the root element of this component. The id is used with various APIs to identify the element, and it should be unique on the page.
      Specified by:
        `id` in interface `ComponentConfigurator<NavigationLink.Builder>`
      Parameters:
        `id` - the id to set, or `null` to remove any previously set id
      Returns:
        this

    - #### visible

          public NavigationLink.Builder visible(boolean visible)

      Description copied from interface: `ComponentConfigurator`
      Sets the component visibility.

      When a component is set as invisible, all the updates of the component from the server to the client are blocked until the component is set as visible again.

      Invisible components don't receive any updates from the client-side.

      Specified by:
        `visible` in interface `ComponentConfigurator<NavigationLink.Builder>`
      Parameters:
        `visible` - Whether the component is visible
      Returns:
        this

    - #### elementConfiguration

          public NavigationLink.Builder elementConfiguration(Consumer<com.vaadin.flow.dom.Element> element)

      Description copied from interface: `ComponentConfigurator`
      Configure the component `Element`.
      Specified by:
        `elementConfiguration` in interface `ComponentConfigurator<NavigationLink.Builder>`
      Parameters:
        `element` - The consumer to use to configure the component `Element` (not null)
      Returns:
        this

    - #### withAttachListener

          public NavigationLink.Builder withAttachListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.AttachEvent> listener)

      Description copied from interface: `ComponentConfigurator`
      Add an `AttachEvent` `ComponentEventListener` to the component, called after the component is attached to the application.
      Specified by:
        `withAttachListener` in interface `ComponentConfigurator<NavigationLink.Builder>`
      Parameters:
        `listener` - Listener to add
      Returns:
        this

    - #### withDetachListener

          public NavigationLink.Builder withDetachListener(com.vaadin.flow.component.ComponentEventListener<com.vaadin.flow.component.DetachEvent> listener)

      Description copied from interface: `ComponentConfigurator`
      Add an `DetachEvent` `ComponentEventListener` to the component, called before the component is detached from the application.
      Specified by:
        `withDetachListener` in interface `ComponentConfigurator<NavigationLink.Builder>`
      Parameters:
        `listener` - Listener to add
      Returns:
        this

    - #### withThemeName

          public NavigationLink.Builder withThemeName(String themeName)

      Description copied from interface: `HasElementConfigurator`
      Adds a theme name to this component.
      Specified by:
        `withThemeName` in interface `HasElementConfigurator<NavigationLink.Builder>`
      Parameters:
        `themeName` - the theme name to add, not `null`
      Returns:
        this

    - #### withEventListener

          public NavigationLink.Builder withEventListener(String eventType,
                                                          com.vaadin.flow.dom.DomEventListener listener)

      Description copied from interface: `HasElementConfigurator`
      Adds an event listener for the given event type.

      Event listeners are triggered in the order they are registered.

      Specified by:
        `withEventListener` in interface `HasElementConfigurator<NavigationLink.Builder>`
      Parameters:
        `eventType` - the type of event to listen to, not `null`
        `listener` - the listener to add, not `null`
      Returns:
        this

    - #### withEventListener

          public NavigationLink.Builder withEventListener(String eventType,
                                                          com.vaadin.flow.dom.DomEventListener listener,
                                                          String filter)

      Description copied from interface: `HasElementConfigurator`
      Adds an event listener for the given event type and configure a filter.

      A filter is JavaScript expression that is used for filtering events to this listener. When an event is fired in the browser, the expression is evaluated and an event is sent to the server only if the expression value is `true`-ish according to JavaScript type coercion rules. The expression is evaluated in a context where `element` refers to this element and `event` refers to the fired event. An expression might be e.g. `event.button === 0` to only forward events triggered by the primary mouse button.

      Event listeners are triggered in the order they are registered.

      Specified by:
        `withEventListener` in interface `HasElementConfigurator<NavigationLink.Builder>`
      Parameters:
        `eventType` - the type of event to listen to, not `null`
        `listener` - the listener to add, not `null`
        `filter` - the JavaScript filter expression
      Returns:
        this

    - #### text

          public NavigationLink.Builder text(com.holonplatform.core.i18n.Localizable text)

      Description copied from interface: `HasTextConfigurator`
      Sets the text content using a `Localizable` message.

      The text value is interpred as plain text and the HTML markup is not supported.

      A `null` value is interpreted as an empty text.

      Specified by:
        `text` in interface `HasTextConfigurator<NavigationLink.Builder>`
      Parameters:
        `text` - Localizable text content message (may be null)
      Returns:
        this
      See Also:
        `LocalizationProvider`

    - #### styleNames

          public NavigationLink.Builder styleNames(String... styleNames)

      Description copied from interface: `HasStyleConfigurator`
      Adds one or more CSS style class names to this component.
      Specified by:
        `styleNames` in interface `HasStyleConfigurator<NavigationLink.Builder>`
      Parameters:
        `styleNames` - The CSS style class names to be added to the component
      Returns:
        this

    - #### styleName

          public NavigationLink.Builder styleName(String styleName)

      Description copied from interface: `HasStyleConfigurator`
      Adds a CSS style class names to this component.

      Multiple styles can be specified as a space-separated list of style names.

      Specified by:
        `styleName` in interface `HasStyleConfigurator<NavigationLink.Builder>`
      Parameters:
        `styleName` - The CSS style class name to be added to the component
      Returns:
        this

    - #### enabled

          public NavigationLink.Builder enabled(boolean enabled)

      Description copied from interface: `HasEnabledConfigurator`
      Set whether the component is enabled.
      Specified by:
        `enabled` in interface `HasEnabledConfigurator<NavigationLink.Builder>`
      Parameters:
        `enabled` - if `false` then explicitly disables the object, if `true` then enables the object so that its state depends on parent
      Returns:
        this

    - #### width

          public NavigationLink.Builder width(String width)

      Description copied from interface: `HasSizeConfigurator`
      Sets the width of the component.

      The width should be in a format understood by the browser, e.g. "100px" or "2.5em".

      If the provided `width` value is `null` then width is removed.

      Specified by:
        `width` in interface `HasSizeConfigurator<NavigationLink.Builder>`
      Parameters:
        `width` - the width to set, may be `null`
      Returns:
        this

    - #### height

          public NavigationLink.Builder height(String height)

      Description copied from interface: `HasSizeConfigurator`
      Sets the height of the component.

      The height should be in a format understood by the browser, e.g. "100px" or "2.5em".

      If the provided `height` value is `null` then height is removed.

      Specified by:
        `height` in interface `HasSizeConfigurator<NavigationLink.Builder>`
      Parameters:
        `height` - the height to set, may be `null`
      Returns:
        this

    - #### minWidth

          public NavigationLink.Builder minWidth(String minWidth)

      Description copied from interface: `HasSizeConfigurator`
      Set the min-width of the component.

      The width should be in a format understood by the browser, e.g. "100px" or "2.5em".

      Specified by:
        `minWidth` in interface `HasSizeConfigurator<NavigationLink.Builder>`
      Parameters:
        `minWidth` - the min width to set, may be `null`
      Returns:
        this

    - #### maxWidth

          public NavigationLink.Builder maxWidth(String maxWidth)

      Description copied from interface: `HasSizeConfigurator`
      Set the max-width of the component.

      The width should be in a format understood by the browser, e.g. "100px" or "2.5em".

      Specified by:
        `maxWidth` in interface `HasSizeConfigurator<NavigationLink.Builder>`
      Parameters:
        `maxWidth` - the max width to set, may be `null`
      Returns:
        this

    - #### minHeight

          public NavigationLink.Builder minHeight(String minHeight)

      Description copied from interface: `HasSizeConfigurator`
      Set the min-height of the component.

      The height should be in a format understood by the browser, e.g. "100px" or "2.5em".

      Specified by:
        `minHeight` in interface `HasSizeConfigurator<NavigationLink.Builder>`
      Parameters:
        `minHeight` - the min height to set, may be `null`
      Returns:
        this

    - #### maxHeight

          public NavigationLink.Builder maxHeight(String maxHeight)

      Description copied from interface: `HasSizeConfigurator`
      Set the max-height of the component.

      The height should be in a format understood by the browser, e.g. "100px" or "2.5em".

      Specified by:
        `maxHeight` in interface `HasSizeConfigurator<NavigationLink.Builder>`
      Parameters:
        `maxHeight` - the max height to set, may be `null`
      Returns:
        this

    - #### build

          public NavigationLink build()

      Description copied from interface: `NavigationLink.Builder`
      Build the `NavigationLink`.
      Specified by:
        `build` in interface `NavigationLink.Builder`
      Returns:
        A new `NavigationLink` instance

Copyright © 2020 The Holon Platform. All rights reserved.