public final class Fold extends Object
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.
Modifier and Type | Method and Description |
---|---|
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.
|
int |
getGuardedEnd()
End of the fold content before the guarded area.
|
int |
getGuardedStart()
Start of the fold content past the guarded area.
|
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() |
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 && <Fold.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 int getGuardedStart()
public int getGuardedEnd()