org.icepdf.core.pobjects
Class OutlineItem

java.lang.Object
  extended by org.icepdf.core.pobjects.Dictionary
      extended by org.icepdf.core.pobjects.OutlineItem

public class OutlineItem
extends Dictionary

The OutlineItem represents the individual outline item within the hierarchy defined by an Outlines class. The outlines items are chained together through their Prev and Next entries. Each outline item has a title and a destination which can be accessed by the visual representation to create a function document outlines (sometimes called bookmarks).

This class is used mainly by the Outlines class to build the outline hierarchy. The root node of the outline hierarchy can be accessed through the Outlines class.

Since:
2.0
See Also:
org.icepdf.ri.common.utility.outline.OutlineItemTreeNode, Outlines

Field Summary
static Name A_KEY
           
static Name COUNT_KEY
           
static Name DEST_KEY
           
static Name FIRST_KEY
           
static Name LAST_KEY
           
static Name NEXT_KEY
           
static Name PARENT_KEY
           
static Name PREV_KEY
           
static Name TITLE_KEY
           
 
Fields inherited from class org.icepdf.core.pobjects.Dictionary
entries, FORM_TYPE_KEY, inited, isDeleted, isNew, LENGTH_KEY, library, SUBTYPE_KEY, TYPE_KEY
 
Constructor Summary
OutlineItem(Library l, java.util.HashMap h)
          Creates a new instance of an OutlineItem.
 
Method Summary
 Action getAction()
          Gets the action associated with this OutlineItem.
 Destination getDest()
          Gets the destination to be displayed when this item is activated.
 Reference getFirst()
          Gets a reference to an outline item dictionary representing the first top-level item in the outline.
 Reference getLast()
          Gets a reference to an outline item dictionary representing the last top-level item in the outline.
 Reference getNext()
          Gets the next outline item at this outline level.
 Reference getParent()
          Gets the parent of this outline item in the outline hierarchy.
 Reference getPrev()
          Gets the previous outline item at this outline level.
 OutlineItem getSubItem(int index)
          Gets the child outline item specified by the index.
 int getSubItemCount()
          Gets the number of descendants that would appear under this outline item.
 java.lang.String getTitle()
          Gets the text to be displayed on the screen for this item.
 boolean isEmpty()
          Indicates if the Outline item is empty.
 
Methods inherited from class org.icepdf.core.pobjects.Dictionary
getEntries, getFloat, getInt, getLibrary, getNumber, getObject, getPObjectReference, init, isDeleted, isNew, setDeleted, setNew, setPObjectReference, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

A_KEY

public static final Name A_KEY

COUNT_KEY

public static final Name COUNT_KEY

TITLE_KEY

public static final Name TITLE_KEY

DEST_KEY

public static final Name DEST_KEY

FIRST_KEY

public static final Name FIRST_KEY

LAST_KEY

public static final Name LAST_KEY

NEXT_KEY

public static final Name NEXT_KEY

PREV_KEY

public static final Name PREV_KEY

PARENT_KEY

public static final Name PARENT_KEY
Constructor Detail

OutlineItem

public OutlineItem(Library l,
                   java.util.HashMap h)
Creates a new instance of an OutlineItem.

Parameters:
l - document library.
h - OutlineItem dictionary entries.
Method Detail

isEmpty

public boolean isEmpty()
Indicates if the Outline item is empty. An outline item is empty if it has no title, destination and action dictionary entries.

Returns:
true, if the outline entry is empty; false, otherwise.

getSubItemCount

public int getSubItemCount()
Gets the number of descendants that would appear under this outline item.

Returns:
descendant count.

getSubItem

public OutlineItem getSubItem(int index)
Gets the child outline item specified by the index. All children of the outline items are ordered and numbered.

Parameters:
index - child index number of desired outline item.
Returns:
outline specified by index.

getAction

public Action getAction()
Gets the action associated with this OutlineItem.

Returns:
the associated action; null, if there is no action.

getFirst

public Reference getFirst()
Gets a reference to an outline item dictionary representing the first top-level item in the outline.

Returns:
reference to first top-level item

getLast

public Reference getLast()
Gets a reference to an outline item dictionary representing the last top-level item in the outline.

Returns:
reference to last top-level item

getNext

public Reference getNext()
Gets the next outline item at this outline level.

Returns:
next item at this outline level.

getPrev

public Reference getPrev()
Gets the previous outline item at this outline level.

Returns:
previous item at this outline level.

getParent

public Reference getParent()
Gets the parent of this outline item in the outline hierarchy. The parent of a top-level item is the outline dictionary itself.

Returns:
parent of this item.

getTitle

public java.lang.String getTitle()
Gets the text to be displayed on the screen for this item.

Returns:
text to be displayed

getDest

public Destination getDest()
Gets the destination to be displayed when this item is activated.

Returns:
destination to be displayed.