Class Toc<T extends Toc<?>>

  • Type Parameters:
    T - the type of inherit of Toc.
    Direct Known Subclasses:
    TocSidebar, TocTopBar

    public abstract class Toc<T extends Toc<?>>
    extends BsComponent
    Represents the base of Table of content component.
    Since:
    2.0
    Author:
    devacfr
    • Constructor Detail

      • Toc

        protected Toc​(@Nonnull
                      ISkinConfig config,
                      String type,
                      String component)
        Parameters:
        config - a config (can not be null
        type - the String representation of Toc.
        component - the bootstrap component name.
    • Method Detail

      • createToc

        public static Toc<?> createToc​(@Nonnull
                                       ISkinConfig config,
                                       @Nullable
                                       String preferredType)
        Parameters:
        config - a config (can not be null).
        preferredType - the default type of Toc to use.
        Returns:
        Returns new instance corresponding Toc to configuration.
      • createSidebar

        public static Toc<?> createSidebar​(@Nonnull
                                           ISkinConfig config)
        Parameters:
        config - a config (can not be null).
        Returns:
        Returns new instance of Toc sidebar.
      • createTopBar

        public static Toc<?> createTopBar​(@Nonnull
                                          ISkinConfig config)
        Parameters:
        config - a config (can not be null).
        Returns:
        Returns new instance Toc top bar.
      • self

        protected T self()
        Returns:
        Returns the fluent instance.
      • getType

        public String getType()
        Returns:
        Returns the String reprensenting the type of Toc.
      • isEnabled

        public boolean isEnabled()
        Gets the indicating whether is enable.
        Returns:
        Returns true if is enable, otherwise false.
      • withEnabled

        protected T withEnabled​(boolean enabled)
        Sets the indicating whether is enable.
        Parameters:
        enabled - status to use.
        Returns:
        Returns the fluent instance.
      • onPreRender

        protected String onPreRender​(@Nonnull
                                     String bodyContent)
        Description copied from class: Component
        generic pre-rendering method executed on all components of context.
        Overrides:
        onPreRender in class Component
        Parameters:
        bodyContent - the current body content.
        Returns:
        Returns a String representing the transformed body content on pre-rendering.