public static final class

OutlineElement.Builder

extends Object
java.lang.Object
   ↳ com.pspdfkit.document.OutlineElement.Builder

Class Overview

Builder for OutlineElement.

Summary

Public Constructors
Builder(String title)
Creates the builder with default properties.
Builder(PdfDocument document, String title, int targetPageIndex)
Creates the builder for outline element that represents element in a table of contents.
Public Methods
OutlineElement build()
Builds the outline element with data set on this builder.
OutlineElement.Builder setAction(Action action)
Sets action that will be executed when clicking on this outline element.
OutlineElement.Builder setChildren(List<OutlineElement> children)
Sets element children - outline elements are organized in a tree-like fashion.
OutlineElement.Builder setColor(int textColor)
Sets outline element text color.
OutlineElement.Builder setExpanded(boolean isExpanded)
Expands/collapses the outline element.
OutlineElement.Builder setPageLabel(String pageLabel)
Sets page label of the target page if one exists and outline action is GoToAction
OutlineElement.Builder setStyle(int textStyle)
Sets outline element text style.
OutlineElement.Builder setTitle(String title)
Sets outline title.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Builder (String title)

Creates the builder with default properties.

Parameters
title Outline element title.

public Builder (PdfDocument document, String title, int targetPageIndex)

Creates the builder for outline element that represents element in a table of contents. Builder will be prefilled with resolved label for the target page and an action (GoToAction for switching to targetPageIndex.

Parameters
document Document used for resolving target page label.
title Outline element title.
targetPageIndex Target page index.

Public Methods

public OutlineElement build ()

Builds the outline element with data set on this builder.

Returns

public OutlineElement.Builder setAction (Action action)

Sets action that will be executed when clicking on this outline element.

Parameters
action Action tied to this outline element, may be null.

public OutlineElement.Builder setChildren (List<OutlineElement> children)

Sets element children - outline elements are organized in a tree-like fashion.

Parameters
children Children of this outline element.

public OutlineElement.Builder setColor (int textColor)

Sets outline element text color.

Parameters
textColor Color of the outline title text.

public OutlineElement.Builder setExpanded (boolean isExpanded)

Expands/collapses the outline element.

Parameters
isExpanded true if the outline element is expanded, false otherwise.

public OutlineElement.Builder setPageLabel (String pageLabel)

Sets page label of the target page if one exists and outline action is GoToAction

Parameters
pageLabel Page label if applicable, null otherwise.

public OutlineElement.Builder setStyle (int textStyle)

Sets outline element text style.

Parameters
textStyle Style of the element, may be one of android.graphics.Typeface class constants: NORMAL, BOLD, ITALIC or BOLD_ITALIC,

public OutlineElement.Builder setTitle (String title)

Sets outline title.

Parameters
title Human readable outline title.