Class DetailButtonRenderer<E>

java.lang.Object
com.vaadin.flow.data.renderer.Renderer<E>
com.vaadin.flow.data.renderer.LitRenderer<E>
com.vaadin.flow.data.renderer.ComponentRenderer<JmixButton,E>
io.jmix.flowui.component.grid.renderer.AbstractDetailRenderer<JmixButton,E,DetailButtonRenderer<E>>
io.jmix.flowui.component.grid.renderer.DetailButtonRenderer<E>
Type Parameters:
E - entity item type
All Implemented Interfaces:
Serializable

public class DetailButtonRenderer<E> extends AbstractDetailRenderer<JmixButton,E,DetailButtonRenderer<E>>
A renderer that creates a server-side JmixButton opening an entity detail view.

The detail view can be opened either by navigation or in a dialog depending on the configured OpenMode.

See Also:
  • Field Details

    • uiComponents

      protected UiComponents uiComponents
    • viewNavigators

      protected ViewNavigators viewNavigators
    • dialogWindows

      protected DialogWindows dialogWindows
    • ownerComponent

      protected ListDataComponent<E> ownerComponent
    • iconProvider

      protected com.vaadin.flow.function.SerializableFunction<E,com.vaadin.flow.component.Component> iconProvider
    • clickHandler

      protected Consumer<E> clickHandler
    • themeNames

      protected String themeNames
    • openMode

      protected OpenMode openMode
  • Constructor Details

    • DetailButtonRenderer

      public DetailButtonRenderer(UiComponents uiComponents, ViewNavigators viewNavigators, DialogWindows dialogWindows, ListDataComponent<E> ownerComponent, com.vaadin.flow.function.ValueProvider<E,String> textValueProvider)
      Creates a detail button renderer.
      Parameters:
      uiComponents - factory for creating UI components
      viewNavigators - view navigation entry point
      dialogWindows - dialog windows entry point
      ownerComponent - list data component that owns the rendered column
      textValueProvider - value provider for button text when explicit text is not configured
    • DetailButtonRenderer

      public DetailButtonRenderer(UiComponents uiComponents, ViewNavigators viewNavigators, DialogWindows dialogWindows, ListDataComponent<E> ownerComponent, com.vaadin.flow.function.ValueProvider<E,String> textValueProvider, com.vaadin.flow.function.SerializableFunction<E,com.vaadin.flow.component.Component> iconProvider)
      Creates a detail button renderer.
      Parameters:
      uiComponents - factory for creating UI components
      viewNavigators - view navigation entry point
      dialogWindows - dialog windows entry point
      ownerComponent - list data component that owns the rendered column
      textValueProvider - value provider for button text when explicit text is not configured
      iconProvider - provider for button icons, or null if no icon should be set
  • Method Details

    • initRenderer

      protected void initRenderer()
    • createComponentInternal

      protected JmixButton createComponentInternal()
      Specified by:
      createComponentInternal in class AbstractDetailRenderer<JmixButton,E,DetailButtonRenderer<E>>
    • configureComponent

      protected void configureComponent(JmixButton button, E item)
      Specified by:
      configureComponent in class AbstractDetailRenderer<JmixButton,E,DetailButtonRenderer<E>>
    • openDetailView

      protected void openDetailView(E item)
    • openDialog

      protected void openDialog(E item)
    • withOpenMode

      public DetailButtonRenderer<E> withOpenMode(OpenMode openMode)
      Sets how the detail view is opened.
      Parameters:
      openMode - open mode
      Returns:
      this renderer
    • withIconProvider

      public DetailButtonRenderer<E> withIconProvider(@Nullable com.vaadin.flow.function.SerializableFunction<E,com.vaadin.flow.component.Component> iconProvider)
      Sets a provider used to create button icons.
      Parameters:
      iconProvider - icon provider, or null to render buttons without icons
      Returns:
      this renderer
    • withThemeNames

      public DetailButtonRenderer<E> withThemeNames(@Nullable String themeNames)
      Sets theme names for the rendered button.
      Parameters:
      themeNames - space- or comma-separated theme names, or null to clear them
      Returns:
      this renderer
    • withClickHandler

      public DetailButtonRenderer<E> withClickHandler(Consumer<E> clickHandler)
      Sets a custom click handler.
      Parameters:
      clickHandler - click handler invoked with the current grid item
      Returns:
      this renderer