public class

AnnotationToolbarBuilder

extends Object
implements Parcelable
java.lang.Object
   ↳ com.pdftron.pdf.widget.toolbar.builder.AnnotationToolbarBuilder

Class Overview

Builder class used to create a custom annotation toolbar. Can be used to add supported tools or custom buttons to the toolbar.

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<AnnotationToolbarBuilder> CREATOR
Public Methods
AnnotationToolbarBuilder addCustomButton(int title, int icon, int buttonId)
AnnotationToolbarBuilder addCustomSelectableButton(int title, int icon, int buttonId)
AnnotationToolbarBuilder addCustomSelectableStickyButton(int title, int icon, int buttonId)
Add a selectable sticky button to the annotation toolbar.
AnnotationToolbarBuilder addCustomStickyButton(int title, int icon, int buttonId)
Add a sticky button to the annotation toolbar.
AnnotationToolbarBuilder addToolButton(ToolbarButtonType toolbarButtonType, int buttonId)
Adds a button to the toolbar that controls a specific tool
AnnotationToolbarBuilder addToolStickyButton(ToolbarButtonType toolbarButtonType, int buttonId)
AnnotationToolbarBuilder copy()
AnnotationToolbarBuilder copyWithoutToolbarItems(Set<ToolbarButtonType> itemsToRemove)
int describeContents()
static AnnotationToolbarBuilder fromIdJson(String json, AnnotationToolbarBuilder defaultBuilder)
List<ToolbarItem> getStickyToolbarItems()
int getToolbarIcon()
ToolbarItem getToolbarItem(int buttonId)
List<ToolbarItem> getToolbarItems()
String getToolbarName()
String getToolbarTag()
static LinkedHashMap<Integer, ToolbarButtonType> jsonStrToMap(String jsonStr)
static String mapToJsonStr(LinkedHashMap<Integer, ToolbarButtonType> map)
AnnotationToolbarBuilder removeButtons(Set<ToolManager.ToolMode> removedToolModes)
AnnotationToolbarBuilder setIcon(int icon)
The icon that will shown in the ToolbarSwitcherDialog if there are multiple toolbars available.
void setToolbarItems(List<ToolbarItem> newToolbarItems)
AnnotationToolbarBuilder setToolbarName(String name)
The name of the toolbar that will be shown in the ToolbarSwitcherDialog if there are multiple toolabrs available.
String toIdJson()
static AnnotationToolbarBuilder withTag(String tag)
The tag that will be used to reference the toolbar.
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<AnnotationToolbarBuilder> CREATOR

Public Methods

public AnnotationToolbarBuilder addCustomButton (int title, int icon, int buttonId)

public AnnotationToolbarBuilder addCustomSelectableButton (int title, int icon, int buttonId)

public AnnotationToolbarBuilder addCustomSelectableStickyButton (int title, int icon, int buttonId)

Add a selectable sticky button to the annotation toolbar.

Parameters
title of the button that will be shown when long pressed.
icon of the button that will be shown in the toolbar
buttonId of the button, that is used to reference key press event. All buttons in a single toolbar must have unique menu ids

public AnnotationToolbarBuilder addCustomStickyButton (int title, int icon, int buttonId)

Add a sticky button to the annotation toolbar.

Parameters
title of the button that will be shown when long pressed.
icon of the button that will be shown in the toolbar
buttonId of the button, that is used to reference key press event. All buttons in a single toolbar must have unique menu ids

public AnnotationToolbarBuilder addToolButton (ToolbarButtonType toolbarButtonType, int buttonId)

Adds a button to the toolbar that controls a specific tool

Parameters
toolbarButtonType type of tool to add
buttonId of the button, that is used to reference key press event. All buttons in a single toolbar must have unique menu ids

public AnnotationToolbarBuilder addToolStickyButton (ToolbarButtonType toolbarButtonType, int buttonId)

public AnnotationToolbarBuilder copy ()

public AnnotationToolbarBuilder copyWithoutToolbarItems (Set<ToolbarButtonType> itemsToRemove)

public int describeContents ()

public static AnnotationToolbarBuilder fromIdJson (String json, AnnotationToolbarBuilder defaultBuilder)

public List<ToolbarItem> getStickyToolbarItems ()

public int getToolbarIcon ()

public ToolbarItem getToolbarItem (int buttonId)

public List<ToolbarItem> getToolbarItems ()

public String getToolbarName ()

public String getToolbarTag ()

public static LinkedHashMap<Integer, ToolbarButtonType> jsonStrToMap (String jsonStr)

public static String mapToJsonStr (LinkedHashMap<Integer, ToolbarButtonType> map)

public AnnotationToolbarBuilder removeButtons (Set<ToolManager.ToolMode> removedToolModes)

public AnnotationToolbarBuilder setIcon (int icon)

The icon that will shown in the ToolbarSwitcherDialog if there are multiple toolbars available. Default value is 0 to indicate no icon.

Parameters
icon drawable resource

public void setToolbarItems (List<ToolbarItem> newToolbarItems)

public AnnotationToolbarBuilder setToolbarName (String name)

The name of the toolbar that will be shown in the ToolbarSwitcherDialog if there are multiple toolabrs available. If not set, then the tag is used.

public String toIdJson ()

public static AnnotationToolbarBuilder withTag (String tag)

The tag that will be used to reference the toolbar. Will be used to store toolbar state.

Parameters
tag Identifier used to reference the toolbar.
Returns
  • this ActionToolbarBuilder

public void writeToParcel (Parcel dest, int flags)