Package com.pspdfkit.document
Class OutlineElement.Builder
-
- All Implemented Interfaces:
public final class OutlineElement.Builder
Builder for OutlineElement.
-
-
Constructor Summary
Constructors Constructor Description OutlineElement.Builder(String title)
Creates the builder with default properties. OutlineElement.Builder(PdfDocument document, String title, int targetPageIndex)
Creates the builder for outline element that represents element in a table of contents.
-
Method Summary
Modifier and Type Method Description OutlineElement
build()
Builds the outline element with data set on this builder. OutlineElement.Builder
setTitle(@NonNull() String title)
Sets outline title. OutlineElement.Builder
setColor(@ColorInt() int textColor)
Sets outline element text color. OutlineElement.Builder
setStyle(int textStyle)
Sets outline element text style. OutlineElement.Builder
setExpanded(boolean isExpanded)
Expands/collapses the outline element. OutlineElement.Builder
setAction(@Nullable() Action action)
Sets action that will be executed when clicking on this outline element. OutlineElement.Builder
setPageLabel(@Nullable() String pageLabel)
Sets page label of the target page if one exists and outline action is GoToAction OutlineElement.Builder
setChildren(@NonNull() List<OutlineElement> children)
Sets element children - outline elements are organized in a tree-like fashion. -
-
Constructor Detail
-
OutlineElement.Builder
OutlineElement.Builder(String title)
Creates the builder with default properties.- Parameters:
title
- Outline element title.
-
OutlineElement.Builder
OutlineElement.Builder(PdfDocument document, String title, int targetPageIndex)
Creates the builder for outline element that represents element in a table of contents.- Parameters:
document
- Document used for resolving target page label.title
- Outline element title.targetPageIndex
- Target page index.
-
-
Method Detail
-
build
@NonNull() OutlineElement build()
Builds the outline element with data set on this builder.
- Returns:
Instance of OutlineElement.
-
setTitle
@NonNull() OutlineElement.Builder setTitle(@NonNull() String title)
Sets outline title.
- Parameters:
title
- Human readable outline title.
-
setColor
@NonNull() OutlineElement.Builder setColor(@ColorInt() int textColor)
Sets outline element text color.
- Parameters:
textColor
- Color of the outline title text.
-
setStyle
@NonNull() 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,
-
setExpanded
@NonNull() OutlineElement.Builder setExpanded(boolean isExpanded)
Expands/collapses the outline element.
- Parameters:
isExpanded
-true
if the outline element is expanded,false
otherwise.
-
setAction
@NonNull() OutlineElement.Builder setAction(@Nullable() Action action)
Sets action that will be executed when clicking on this outline element.
- Parameters:
action
- Action tied to this outline element, may benull
.
-
setPageLabel
@NonNull() OutlineElement.Builder setPageLabel(@Nullable() 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.
-
setChildren
@NonNull() OutlineElement.Builder setChildren(@NonNull() List<OutlineElement> children)
Sets element children - outline elements are organized in a tree-like fashion.
- Parameters:
children
- Children of this outline element.
-
-
-
-