public class Bookmark
extends java.lang.Object
The typical action for a user-created bookmark is to move to another location in the current document, although any action (see Action) can be specified.
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(Bookmark child)
Add an existing bookmark to be the child bookmark of a parent.
|
void |
addNextSibling(Bookmark NewRightSibling)
Add a bookmark to a tree as the next (right) sibling.
|
void |
addPreviousSibling(Bookmark NewLeftSibling)
Add a bookmark to a tree as the previous (left) sibling.
|
void |
addSubtree(Bookmark subtree,
java.lang.String title)
Add a copy of a subtree as the new last child of a parent bookmark, and gives the subtree an initial title.
|
Bookmark |
createNewChild(Page page,
java.lang.String title)
Deprecated.
|
Bookmark |
createNewChild(java.lang.String title)
Create a new bookmark and add to a parent as the last child bookmark, using supplied string as the initial text.
|
Bookmark |
createNewSibling(java.lang.String title)
Create a new bookmark in a tree as the next (right) sibling, using supplied string as the initial text.
|
void |
delete() |
void |
destroy()
Removes a bookmark subtree from the bookmark tree containing it.
|
boolean |
equals(java.lang.Object rhs) |
Bookmark |
findDescendentBookmark(java.lang.String title)
Find bookmark by its title within the subtree of which this bookmark is the root, searching within the entire subtree.
|
Bookmark |
findDescendentBookmark(java.lang.String title,
int maxDepth)
Find bookmark by its title within the subtree of which this bookmark is the root, searching within the subtree to a depth determined by maxDepth (e.g., 0 = this bookmark only and not any of its children, 1 = search one level below this bookmark level, etc.)
|
Action |
getAction()
Get the Action for a bookmark.
|
Color |
getColor()
Get the color of the bookmark.
|
int |
getCount()
Get the number of open bookmarks in the subtree under this bookmark.
|
Bookmark |
getFirstChild()
Gets a bookmark's first child.
|
java.util.EnumSet<BookmarkFlags> |
getFlags()
Get the flags for the bookmark.
|
int |
getIndent()
Get the indentation level of a bookmark in its containing tree.
|
Bookmark |
getLastChild()
Gets a bookmark's last child.
|
Bookmark |
getNext()
Gets a bookmark's next (right) sibling.
|
boolean |
getOpen()
Is the bookmark open?
|
Bookmark |
getParent()
Gets a bookmark's parent.
|
PDFDict |
getPDFDict()
Get the dictionary associated with the bookmark.
|
Bookmark |
getPrevious()
Gets a bookmark's previous (left) sibling.
|
java.lang.String |
getTitle()
The title of the bookmark.
|
ViewDestination |
getViewDestination()
If this bookmark has a GoTo action, then return the destination of the action, else return null.
|
boolean |
hasChildren()
Does the bookmark have children?
|
boolean |
isOpen()
Is the bookmark open?
|
void |
setAction(Action action)
Set the Action for a bookmark.
|
void |
setColor(Color bookmarkcolor)
Set the color of the bookmark.
|
void |
setFlags(java.util.EnumSet<BookmarkFlags> arg0)
Set the flags for the bookmark to the parameter values.
|
void |
setOpen(boolean openvalue)
Set if the bookmark is open or closed.
|
void |
setTitle(java.lang.String title)
The title of the bookmark.
|
java.lang.String |
toString() |
void |
unlink()
Unlinks the bookmark from the bookmark tree that contains it and adjusts the tree appropriately.
|
public void delete()
public boolean equals(java.lang.Object rhs)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic Bookmark getFirstChild()
public Bookmark getLastChild()
public Bookmark getParent()
public Bookmark getNext()
public Bookmark getPrevious()
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
public ViewDestination getViewDestination()
public Color getColor()
public void setColor(Color bookmarkcolor)
public java.util.EnumSet<BookmarkFlags> getFlags()
public void setFlags(java.util.EnumSet<BookmarkFlags> arg0)
public int getCount()
public int getIndent()
public boolean hasChildren()
public boolean isOpen()
public boolean getOpen()
public void setOpen(boolean openvalue)
public void addChild(Bookmark child)
child - the bookmark being added.public void addNextSibling(Bookmark NewRightSibling)
NewRightSibling - The bookmark to become the new right sibling.public void addPreviousSibling(Bookmark NewLeftSibling)
NewLeftSibling - The bookmark to become the new left sibling.public Bookmark createNewSibling(java.lang.String title)
title - The initial text for the new right sibling.public void addSubtree(Bookmark subtree, java.lang.String title)
subtree - The bookmark subtree to add.title - the title of the newly added subtree.@Deprecated public Bookmark createNewChild(Page page, java.lang.String title)
page - The PDF page of the new child bookmark.title - The initial title of the new child bookmark.public Bookmark createNewChild(java.lang.String title)
title - The initial text of the new child bookmark.public Action getAction()
public void setAction(Action action)
action - The action to set for the bookmark.public void unlink()
public void destroy()
public PDFDict getPDFDict()
public Bookmark findDescendentBookmark(java.lang.String title, int maxDepth)
title - The title of the bookmark for which to search.maxDepth - If supplied, declares the number of levels below this bookmark to search. (If omitted, the entire subtree is searched.)public Bookmark findDescendentBookmark(java.lang.String title)
title - The title of the bookmark for which to search.