public final class FoldHandle extends Object
Modifier and Type | Method and Description |
---|---|
void |
finish()
Finish the fold at the current last line in the output window.
|
FoldHandle |
getCurrentNestedFold()
Get current nested fold.
|
FoldHandle |
getLastNestedFold()
Get handle created by the last invocation of
FoldHandle.startFold(boolean)
or FoldHandle.silentStartFold(boolean) . |
boolean |
isFinished()
Check whether this fold handle has been finished.
|
void |
setExpanded(boolean expanded)
Set state of the fold.
|
void |
silentFinish()
Similar to
FoldHandle.finish() , but no exception is thrown if the fold
handle has been already finished. |
FoldHandle |
silentStartFold(boolean expanded)
Similar to
FoldHandle.startFold(boolean) , but no exception is thrown if the
fold is already finished, as well as if an unfinished nested fold exists. |
FoldHandle |
startFold(boolean expanded)
Start a nested fold at the current last line in output window.
|
public void finish()
IllegalStateException
- if parent fold has been already finished,
or if there is an unfinished child fold.public FoldHandle startFold(boolean expanded)
expanded
- True to expand the new fold, false to collapse it, parent
folds will not be collapsed/expanded.IllegalStateException
- if the fold has been already finished, or
if an unfinished nested fold exists.public void setExpanded(boolean expanded)
expanded
- True to expand the fold, false to collapse it.public boolean isFinished()
FoldHandle.finish()
or FoldHandle.silentFinish()
has been
already called on this fold handle, false otherwise.@CheckForNull public FoldHandle getLastNestedFold()
FoldHandle.startFold(boolean)
or FoldHandle.silentStartFold(boolean)
. The handle can be finished or
unfinished.@CheckForNull public FoldHandle getCurrentNestedFold()
FoldHandle.getLastNestedFold()
, but
returns null if the last nested fold has been already finished.public void silentFinish()
FoldHandle.finish()
, but no exception is thrown if the fold
handle has been already finished. If an unfinished child fold exists, it
will be finished too. Any exception that could happen will be caught and
logged.@CheckForNull public FoldHandle silentStartFold(boolean expanded)
FoldHandle.startFold(boolean)
, but no exception is thrown if the
fold is already finished, as well as if an unfinished nested fold exists.
If an unfinished nested fold exists, it will be finished before creation
of the new one.expanded
- True to expand the new fold, false to collapse it, parent
folds will not be collapsed/expanded.