public final class FoldInfo extends Object
Modifier and Type | Method and Description |
---|---|
FoldInfo |
attach(Object extraInfo)
Attaches custom extra info to the fold.
|
FoldInfo |
collapsed(boolean state)
Records the desired collapsed state.
|
Boolean |
getCollapsed()
Provides the desired collapsed state or
null , if no specific
state is required. |
String |
getDescriptionOverride()
Returns description override.
|
int |
getEnd()
Provides end offset of the folded content
|
Object |
getExtraInfo()
Returns the extra information attached to a fold.
|
int |
getStart()
Provides start offset of the folded content
|
FoldTemplate |
getTemplate()
Provides FoldTemplate to be used with the Fold.
|
FoldType |
getType()
Provides FoldType for the fold.
|
static FoldInfo |
range(int start,
int end,
FoldType type)
Creates a FoldInfo for the specified range.
|
String |
toString() |
FoldInfo |
withDescription(String desc)
Use to provide a custom description for the fold.
|
FoldInfo |
withTemplate(FoldTemplate t)
Attaches FoldTemplate to the FoldInfo.
|
public static FoldInfo range(int start, int end, FoldType type)
start
- start offsetend
- end offsettype
- type of the foldpublic FoldInfo withTemplate(FoldTemplate t)
FoldType.getTemplate()
.t
- fold templatepublic FoldInfo withDescription(String desc)
FoldTemplate
for explanation. When null
is set, the
description Fold reverts back to the one provided by FoldTemplates (the override is cleared).desc
- description text.public FoldInfo attach(Object extraInfo)
extraInfo
- custom datapublic String getDescriptionOverride()
null
, information from FoldTemplates should be used.null
.public Object getExtraInfo()
null
if no data is presentpublic FoldInfo collapsed(boolean state)
state
- the desired collapsed statepublic int getStart()
public int getEnd()
public FoldTemplate getTemplate()
FoldType.getTemplate()
.
Null
return value means that the FoldTemplate from the FoldType is in effect.null
public FoldType getType()
FoldOperation.update(java.util.Collection<org.netbeans.spi.editor.fold.FoldInfo>, java.util.Collection<org.netbeans.api.editor.fold.Fold>, java.util.Collection<org.netbeans.spi.editor.fold.FoldInfo>)
, the fold will be destroyed and re-created. It is not possible to change FoldType
of a Fold.null
.public Boolean getCollapsed()
null
, if no specific
state is required.
When null
is reported, the infrastructure can assign an an appropriate initial state to the fold,
e.g. based on user preferences. States of existing fold is never changed during update.null
Built on October 25 2023. | Copyright © 2017-2023 Apache Software Foundation. All Rights Reserved.