Class TabbedDemo

All Implemented Interfaces:
AttachNotifier, ClickNotifier<VerticalLayout>, DetachNotifier, HasComponents, HasElement, HasEnabled, HasOrderedComponents, HasSize, HasStyle, FlexComponent, ThemableLayout, RouterLayout, Serializable

@StyleSheet("context://frontend/styles/commons-demo/shared-styles.css") public class TabbedDemo extends VerticalLayout implements RouterLayout
See Also:
  • Constructor Details

    • TabbedDemo

      public TabbedDemo()
  • Method Details

    • addDemo

      @Deprecated public void addDemo(Component demo)
      Deprecated.
      Add a tab with a demo component. The tab label and source code URL are retrieved from the PageTitle (required) and DemoSource (optional) annotations in the demo class, respectively.
      Parameters:
      demo - the demo instance
    • addDemo

      @Deprecated public void addDemo(Component demo, String label, String sourceCodeUrl)
      Deprecated.
      Parameters:
      demo - the demo instance
      label - the demo name (tab label)
      sourceCodeUrl - ignored.
    • addDemo

      public void addDemo(Class<? extends Component> clazz, String label)
      Add a tab with a demo component.
      Parameters:
      clazz - the class of routed demo view component
      label - the demo name (tab label)
    • setAutoVisibility

      public void setAutoVisibility(boolean autoVisibility)
      Sets the autovisibility mode. When autovisibility is enabled, the tabs component is hidden unless it contains two or more tabs.
    • addDemo

      public void addDemo(Class<? extends Component> clazz)
      Add a tab with a demo component. The tab label is retrieved from the PageTitle annotations in the demo class.
      Parameters:
      clazz - the class of routed demo view component
    • addDemo

      @Deprecated public void addDemo(Component demo, String label)
      Deprecated.
    • showRouterLayoutContent

      public void showRouterLayoutContent(HasElement content)
      Specified by:
      showRouterLayoutContent in interface RouterLayout
    • configureSourceUrlResolver

      public static void configureSourceUrlResolver(@NonNull @NonNull SourceUrlResolver resolver)
      Configures the SourceUrlResolver for resolving source URLs. This method can only be called once; subsequent calls will result in an exception.
      Parameters:
      resolver - The SourceUrlResolver to be used. Must not be null.
      Throws:
      IllegalStateException - if a resolver has already been set.
      NullPointerException - if the provided resolver is null.
    • lookupGithubBranch

      public static String lookupGithubBranch(Class<? extends TabbedDemo> clazz)
    • removeRouterLayoutContent

      public void removeRouterLayoutContent(HasElement oldContent)
      Specified by:
      removeRouterLayoutContent in interface RouterLayout
    • setSourceVisible

      public void setSourceVisible(boolean visible)
    • toggleSourcePosition

      public void toggleSourcePosition()
    • getOrientation

      public SplitLayout.Orientation getOrientation()
    • setOrientation

      public void setOrientation(SplitLayout.Orientation orientation)
    • getThemeName

      public static String getThemeName()
    • applyTheme

      @Deprecated public static void applyTheme(Element element, boolean useDarkTheme)
      Deprecated.
    • applyTheme

      public static void applyTheme(Element element, String theme)
    • addTabbedDemoSourceListener

      public void addTabbedDemoSourceListener(ComponentEventListener<TabbedDemoSourceEvent> listener)
    • onAttach

      protected void onAttach(AttachEvent attachEvent)
      Overrides:
      onAttach in class Component
    • setDemoHelperViewer

      public void setDemoHelperViewer(DemoHelperViewer demoHelperViewer)