|
org.netbeans.modules.editor.fold/1 1.5.31 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.netbeans.api.editor.fold.Fold
public final class Fold
Fold is a building block of the code folding tree-based hierarchy.
Folds cannot overlap but they can be nested arbitrarily.
It's possible to determine the fold's type, description
and whether it is collapsed or expanded
and explore the nested (children) folds.
There are various useful utility methods for folds in the FoldUtilities
.
There is one root fold at the top of the code folding hierarchy.
The root fold is special uncollapsable fold covering the whole document.
It can be obtained by using FoldHierarchy.getRootFold()
.
The regular top-level folds are children of the root fold.
Method Summary | |
---|---|
String |
getDescription()
Get text description that should be displayed when the fold is collapsed instead of the text contained in the fold. |
int |
getEndOffset()
Get an absolute ending offset of this fold in the associated document. |
Fold |
getFold(int index)
Get child fold of this fold at the given index. |
int |
getFoldCount()
Get total count of child folds contained in this fold. |
int |
getFoldIndex(Fold child)
Get index of the given child fold in this fold. |
FoldHierarchy |
getHierarchy()
Get the code folding hierarchy for which this fold was created. |
Fold |
getParent()
Get parent fold of this fold. |
int |
getStartOffset()
Get an absolute starting offset of this fold in the associated document. |
FoldType |
getType()
Get type of this fold. |
boolean |
isCollapsed()
Return whether this fold is collapsed or expanded. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public FoldType getType()
public Fold getParent()
FoldUtilities.isRootFold(Fold)
can be used to check
whether this is root fold.public FoldHierarchy getHierarchy()
public int getStartOffset()
Position
-like form).
public int getEndOffset()
Position
-like form).
>=getStartOffset()
offset of the first character in the document that is not part
of this fold.public boolean isCollapsed()
FoldHierarchy.collapse(Fold)
can be used.
public String getDescription()
public int getFoldCount()
public Fold getFold(int index)
index
- >=0 && <getFoldCount()
index of child of this fold.public int getFoldIndex(Fold child)
child
- non-null child fold of this fold but in general
it can be any non-null fold (see return value).
public String toString()
|
org.netbeans.modules.editor.fold/1 1.5.31 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |