Class Toc<T extends Toc<?>>
- java.lang.Object
-
- org.devacfr.maven.skins.reflow.model.Component
-
- org.devacfr.maven.skins.reflow.model.BsComponent
-
- org.devacfr.maven.skins.reflow.model.Toc<T>
-
- Type Parameters:
T- the type of inherit ofToc.
- 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 Summary
Constructors Modifier Constructor Description protectedToc(ISkinConfig config, String type, String component)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Toc<?>createSidebar(ISkinConfig config)static Toc<?>createToc(ISkinConfig config, String preferredType)static Toc<?>createTopBar(ISkinConfig config)List<? extends HtmlTool.IdElement>getTocItems()StringgetType()booleanisEnabled()Gets the indicating whether is enable.protected StringonPreRender(String bodyContent)generic pre-rendering method executed on all components of context.protected Tself()StringtoString()protected TwithEnabled(boolean enabled)Sets the indicating whether is enable.-
Methods inherited from class org.devacfr.maven.skins.reflow.model.BsComponent
getBackground, getCssClass, getTheme, setBackground, setTheme
-
Methods inherited from class org.devacfr.maven.skins.reflow.model.Component
addChildren, addCssOptions, getCssOptions, setCssClass
-
-
-
-
Field Detail
-
COMPONENT
public static final String COMPONENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Toc
protected Toc(@Nonnull ISkinConfig config, String type, String component)
- Parameters:
config- a config (can not benulltype- theStringrepresentation 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 benull).preferredType- the default type of Toc to use.- Returns:
- Returns new instance corresponding
Tocto configuration.
-
createSidebar
public static Toc<?> createSidebar(@Nonnull ISkinConfig config)
- Parameters:
config- a config (can not benull).- Returns:
- Returns new instance of Toc sidebar.
-
createTopBar
public static Toc<?> createTopBar(@Nonnull ISkinConfig config)
- Parameters:
config- a config (can not benull).- Returns:
- Returns new instance Toc top bar.
-
self
protected T self()
- Returns:
- Returns the fluent instance.
-
isEnabled
public boolean isEnabled()
Gets the indicating whether is enable.- Returns:
- Returns
trueif is enable, otherwisefalse.
-
getTocItems
public List<? extends HtmlTool.IdElement> getTocItems()
- Returns:
- Returns a list of
HtmlTool.IdElementrepresenting the heading tree containing in current page. - Since:
- 2.1
-
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:Componentgeneric pre-rendering method executed on all components of context.- Overrides:
onPreRenderin classComponent- Parameters:
bodyContent- the current body content.- Returns:
- Returns a
Stringrepresenting the transformed body content on pre-rendering.
-
-