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 addCustomSelectableLeadingStickyButton(int title, int icon, int buttonId)
Add a selectable leading sticky button to the annotation toolbar.
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 addLeadingCustomStickyButton(int title, int icon, int buttonId)
Add a leading sticky button to the annotation toolbar.
AnnotationToolbarBuilder addLeadingToolStickyButton(ToolbarButtonType toolbarButtonType, int buttonId)
AnnotationToolbarBuilder addToolButton(ToolbarButtonType toolbarButtonType, int buttonId)
Adds a button to the toolbar that controls a specific tool
AnnotationToolbarBuilder addToolButton(ToolbarButtonType toolbarButtonType, int buttonId, int order)
Adds a button to the toolbar that controls a specific tool
AnnotationToolbarBuilder addToolLeadingStickyButton(ToolbarButtonType toolbarButtonType, int buttonId)
AnnotationToolbarBuilder addToolStickyButton(ToolbarButtonType toolbarButtonType, int buttonId)
AnnotationToolbarBuilder addToolStickyButton(ToolbarButtonType toolbarButtonType, int buttonId, int order)
AnnotationToolbarBuilder addToolStickyOptionButton(ToolbarButtonType toolbarButtonType, int buttonId)
AnnotationToolbarBuilder copy()
AnnotationToolbarBuilder copyWithNewOrder(Set<ToolbarItemEntity> toolbarItemEntities)
Copies AnnotationToolbarBuilder with existing toolbar items in the new specified toolbar orders.
AnnotationToolbarBuilder copyWithNewToolbarItems(Set<ToolbarItemEntity> toolbarItemEntities)
Copy toolbar with new specified toolbar items.
AnnotationToolbarBuilder copyWithoutToolbarItems(Set<ToolbarButtonType> itemsToRemove)
int describeContents()
boolean equals(Object o)
List<ToolbarItem> getLeadingStickyToolbarItems()
List<ToolbarItem> getStickyToolbarItems()
int getToolbarIcon()
List<ToolbarItem> getToolbarItems()
String getToolbarName(Context context)
String getToolbarTag()
int hashCode()
AnnotationToolbarBuilder removeButtons(Set<ToolManager.ToolMode> removedToolModes)
Removes toolbar items from AnnotationToolbarBuilder that match the provided tool types from the given list of Toolbar items
static void removeItems(List<ToolbarItem> toolbarItems, Set<ToolManager.ToolMode> removedToolModes)
Removes toolbar items that match the provided tool types from the given list of Toolbar items
AnnotationToolbarBuilder removeToolLeadingStickyButton(int buttonId)
Removes the leading sticky toolbar button with given id
AnnotationToolbarBuilder removeToolStickyButton(int buttonId)
Removes the sticky toolbar button with given id
AnnotationToolbarBuilder setIcon(int icon)
The icon that will shown in the ToolbarSwitcherDialog if there are multiple toolbars available.
AnnotationToolbarBuilder setToolbarName(int name)
The name of the toolbar that will be shown in the ToolbarSwitcherDialog if there are multiple toolbars available.
AnnotationToolbarBuilder setToolbarName(String name)
The name of the toolbar that will be shown in the ToolbarSwitcherDialog if there are multiple toolbars available.
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 addCustomSelectableLeadingStickyButton (int title, int icon, int buttonId)

Add a selectable leading 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 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 addLeadingCustomStickyButton (int title, int icon, int buttonId)

Add a leading 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 addLeadingToolStickyButton (ToolbarButtonType toolbarButtonType, int buttonId)

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 addToolButton (ToolbarButtonType toolbarButtonType, int buttonId, int order)

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 addToolLeadingStickyButton (ToolbarButtonType toolbarButtonType, int buttonId)

public AnnotationToolbarBuilder addToolStickyButton (ToolbarButtonType toolbarButtonType, int buttonId)

public AnnotationToolbarBuilder addToolStickyButton (ToolbarButtonType toolbarButtonType, int buttonId, int order)

public AnnotationToolbarBuilder addToolStickyOptionButton (ToolbarButtonType toolbarButtonType, int buttonId)

public AnnotationToolbarBuilder copy ()

public AnnotationToolbarBuilder copyWithNewOrder (Set<ToolbarItemEntity> toolbarItemEntities)

Copies AnnotationToolbarBuilder with existing toolbar items in the new specified toolbar orders.

Parameters
toolbarItemEntities the list containing toolbar ordering
Returns
  • the copied AnnotationToolbarBuilder

public AnnotationToolbarBuilder copyWithNewToolbarItems (Set<ToolbarItemEntity> toolbarItemEntities)

Copy toolbar with new specified toolbar items.

Parameters
toolbarItemEntities toolbar items to add to the new builder
Returns
  • the copied AnnotationToolbarBuilder

public AnnotationToolbarBuilder copyWithoutToolbarItems (Set<ToolbarButtonType> itemsToRemove)

public int describeContents ()

public boolean equals (Object o)

public List<ToolbarItem> getLeadingStickyToolbarItems ()

public List<ToolbarItem> getStickyToolbarItems ()

public int getToolbarIcon ()

public List<ToolbarItem> getToolbarItems ()

public String getToolbarName (Context context)

Parameters
context to obtain string resources
Returns
  • String representing the toolbar's name. If setToolbarName(int) is set, then the string will be obtained from the resource, otherwise return value set by setToolbarName(String). If no toolbar names have been set in any way, then return the toolbar tag.

public String getToolbarTag ()

public int hashCode ()

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

Removes toolbar items from AnnotationToolbarBuilder that match the provided tool types from the given list of Toolbar items

Parameters
removedToolModes tool modes to remove

public static void removeItems (List<ToolbarItem> toolbarItems, Set<ToolManager.ToolMode> removedToolModes)

Removes toolbar items that match the provided tool types from the given list of Toolbar items

Parameters
toolbarItems to remove items from
removedToolModes tool modes to remove

public AnnotationToolbarBuilder removeToolLeadingStickyButton (int buttonId)

Removes the leading sticky toolbar button with given id

Parameters
buttonId of the button to remove

public AnnotationToolbarBuilder removeToolStickyButton (int buttonId)

Removes the sticky toolbar button with given id

Parameters
buttonId of the button to remove

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 AnnotationToolbarBuilder setToolbarName (int name)

The name of the toolbar that will be shown in the ToolbarSwitcherDialog if there are multiple toolbars available. If a resource is set, then setToolbarName(String) is ignored.

Parameters
name string resource for toolbar name

public AnnotationToolbarBuilder setToolbarName (String name)

The name of the toolbar that will be shown in the ToolbarSwitcherDialog if there are multiple toolbars available. If not set, then the tag is used. If a resource is set for toolbar name via setToolbarName(int), then the strng name set by this method is ignored.

Parameters
name string toolbar name

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)