public abstract class PDOutlineNode extends PDDictionaryWrapper
Constructor and Description |
---|
PDOutlineNode()
Default Constructor.
|
PDOutlineNode(COSDictionary dict) |
Modifier and Type | Method and Description |
---|---|
void |
addFirst(PDOutlineItem newChild)
Adds the given node to the top of the children list.
|
void |
addLast(PDOutlineItem newChild)
Adds the given node to the bottom of the children list.
|
private void |
append(PDOutlineItem newChild)
Appends the child to the linked list of children.
|
java.lang.Iterable<PDOutlineItem> |
children() |
void |
closeNode()
Close this node.
|
PDOutlineItem |
getFirstChild() |
PDOutlineItem |
getLastChild() |
int |
getOpenCount()
Get the number of open nodes or a negative number if this node is closed.
|
(package private) PDOutlineItem |
getOutlineItem(COSName name) |
(package private) PDOutlineNode |
getParent() |
boolean |
hasChildren() |
boolean |
isNodeOpen() |
void |
openNode()
This will set this node to be open when it is shown in the viewer.
|
private void |
prepend(PDOutlineItem newChild)
Prepends the child to the linked list of children.
|
(package private) void |
requireSingleNode(PDOutlineItem node) |
(package private) void |
setFirstChild(PDOutlineNode outlineNode)
Set the first child, this will be maintained by this class.
|
(package private) void |
setLastChild(PDOutlineNode outlineNode)
Set the last child, this will be maintained by this class.
|
(package private) void |
setOpenCount(int openCount)
Set the open count.
|
(package private) void |
setParent(PDOutlineNode parent) |
private void |
switchNodeCount() |
(package private) void |
updateParentOpenCount(int delta)
The count parameter needs to be updated when you add, remove, open or close outline items.
|
(package private) void |
updateParentOpenCountForAddedChild(PDOutlineItem newChild) |
equals, getCOSObject, hashCode
public PDOutlineNode()
public PDOutlineNode(COSDictionary dict)
dict
- The dictionary storage.PDOutlineNode getParent()
void setParent(PDOutlineNode parent)
public void addLast(PDOutlineItem newChild)
newChild
- The node to add.java.lang.IllegalArgumentException
- if the given node is part of a list (i.e. if it has a previous or a next
sibling)public void addFirst(PDOutlineItem newChild)
newChild
- The node to add.java.lang.IllegalArgumentException
- if the given node is part of a list (i.e. if it has a previous or a next
sibling)void requireSingleNode(PDOutlineItem node)
node
- java.lang.IllegalArgumentException
- if the given node is part of a list (i.e. if it has a previous or a next
sibling)private void append(PDOutlineItem newChild)
newChild
- private void prepend(PDOutlineItem newChild)
newChild
- void updateParentOpenCountForAddedChild(PDOutlineItem newChild)
public boolean hasChildren()
PDOutlineItem getOutlineItem(COSName name)
public PDOutlineItem getFirstChild()
void setFirstChild(PDOutlineNode outlineNode)
outlineNode
- The new first child.public PDOutlineItem getLastChild()
void setLastChild(PDOutlineNode outlineNode)
outlineNode
- The new last child.public int getOpenCount()
void setOpenCount(int openCount)
openCount
- The new open count.public void openNode()
public void closeNode()
private void switchNodeCount()
public boolean isNodeOpen()
void updateParentOpenCount(int delta)
delta
- The amount to update by.public java.lang.Iterable<PDOutlineItem> children()
Iterable
view of the items children