public class OutlineItem
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
OutlineItem.Visitor |
Constructor and Description |
---|
OutlineItem(OutlineItem parent,
int level,
java.lang.String id,
int offset,
int length,
java.lang.String label) |
Modifier and Type | Method and Description |
---|---|
void |
accept(OutlineItem.Visitor visitor) |
void |
clear() |
boolean |
contains(OutlineItem item)
Indicate if this outline item contains the given outline item.
|
int |
distance(int offset) |
boolean |
equals(java.lang.Object obj) |
OutlineItem |
findItemById(java.lang.String id) |
OutlineItem |
findNearestMatchingOffset(int offset) |
java.util.List<OutlineItem> |
getChildren() |
java.lang.String |
getId()
the id of the heading, which is typically (though not guaranteed to be) unique within a document.
|
java.lang.String |
getKind() |
java.lang.String |
getLabel()
the text of the heading which could be truncated
|
int |
getLength()
get the length of the outline item, which corresponds to the length of the heading text.
|
int |
getLevel()
the level of the document which is positive and usually <= 6 except for the root item where the value is
undefined.
|
int |
getOffset() |
OutlineItem |
getParent() |
OutlineItem |
getPrevious()
Get the previous item.
|
java.lang.String |
getResourcePath()
the resource path to the resource of this outline item
|
int |
getSectionLength()
get the length of the section, which is the length of the heading text plus the length of any following content
up to the next peer-leveled heading or the parent's following sibling.
|
java.lang.String |
getTooltip() |
int |
hashCode() |
boolean |
isRootItem()
indicate if this is the root item (that is, the item representing the whole document)
|
void |
moveChildren(OutlineItem otherParent)
move children from the given outline item to this
|
void |
setKind(java.lang.String kind) |
void |
setLabel(java.lang.String label) |
void |
setResourcePath(java.lang.String resourcePath)
the resource path to the resource of this outline item
|
void |
setTooltip(java.lang.String tooltip) |
java.lang.String |
toString() |
public OutlineItem(OutlineItem parent, int level, java.lang.String id, int offset, int length, java.lang.String label)
public int getLength()
getSectionLength()
public int getSectionLength()
getLength()
public java.lang.String getKind()
public void setKind(java.lang.String kind)
public java.lang.String getLabel()
public java.lang.String getId()
public int getLevel()
public void setLabel(java.lang.String label)
public OutlineItem getParent()
public boolean isRootItem()
public OutlineItem getPrevious()
public java.util.List<OutlineItem> getChildren()
public int getOffset()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public void clear()
public OutlineItem findNearestMatchingOffset(int offset)
public OutlineItem findItemById(java.lang.String id)
public int distance(int offset)
public void accept(OutlineItem.Visitor visitor)
public void setTooltip(java.lang.String tooltip)
public java.lang.String getTooltip()
public java.lang.String getResourcePath()
public void setResourcePath(java.lang.String resourcePath)
resourcePath
- the resource path, or null if it's unknown.public void moveChildren(OutlineItem otherParent)
public boolean contains(OutlineItem item)
offset
and section length
.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2007, 2013 David Green and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html