public class FoldingDescriptor
extends java.lang.Object
ModificationTracker,
more info - here),
which can be tracked for changes, that should trigger folding regions recalculation for an editor (initiating code folding pass).FoldingBuilder| Modifier and Type | Field and Description |
|---|---|
static FoldingDescriptor[] |
EMPTY |
| Constructor and Description |
|---|
FoldingDescriptor(ASTNode node,
TextRange range)
Creates a folding region related to the specified AST node and covering the specified
text range.
|
FoldingDescriptor(ASTNode node,
TextRange range,
FoldingGroup group)
Creates a folding region related to the specified AST node and covering the specified
text range.
|
FoldingDescriptor(ASTNode node,
TextRange range,
FoldingGroup group,
java.util.Set<java.lang.Object> dependencies)
Creates a folding region related to the specified AST node and covering the specified
text range.
|
FoldingDescriptor(ASTNode node,
TextRange range,
FoldingGroup group,
java.util.Set<java.lang.Object> dependencies,
boolean neverExpands)
Creates a folding region related to the specified AST node and covering the specified
text range.
|
FoldingDescriptor(ASTNode node,
TextRange range,
FoldingGroup group,
java.util.Set<java.lang.Object> dependencies,
boolean neverExpands,
java.lang.String placeholderText,
java.lang.Boolean collapsedByDefault)
Creates a folding region related to the specified AST node and covering the specified
text range.
|
FoldingDescriptor(ASTNode node,
TextRange range,
FoldingGroup group,
java.lang.String placeholderText)
Creates a folding region related to the specified AST node and covering the specified
text range.
|
FoldingDescriptor(ASTNode node,
TextRange range,
FoldingGroup group,
java.lang.String placeholderText,
java.lang.Boolean collapsedByDefault,
java.util.Set<java.lang.Object> dependencies)
Creates a folding region related to the specified AST node and covering the specified
text range.
|
FoldingDescriptor(PsiElement e,
int start,
int end,
FoldingGroup group,
java.lang.String placeholderText)
Creates a folding region related to the specified AST node and covering the specified
text range.
|
FoldingDescriptor(PsiElement element,
TextRange range) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canBeRemovedWhenCollapsed() |
java.util.Set<java.lang.Object> |
getDependencies() |
ASTNode |
getElement() |
FoldingGroup |
getGroup() |
java.lang.String |
getPlaceholderText() |
TextRange |
getRange()
Returns the folded text range.
|
java.lang.Boolean |
isCollapsedByDefault() |
boolean |
isGutterMarkEnabledForSingleLine() |
boolean |
isNonExpandable() |
void |
setCanBeRemovedWhenCollapsed(boolean canBeRemovedWhenCollapsed)
By default, collapsed regions are not removed automatically, even if related PSI elements become invalid.
|
void |
setGutterMarkEnabledForSingleLine(boolean value)
See javadoc for
FoldRegion.setGutterMarkEnabledForSingleLine(boolean). |
void |
setPlaceholderText(java.lang.String placeholderText) |
java.lang.String |
toString() |
public static final FoldingDescriptor[] EMPTY
public FoldingDescriptor(ASTNode node, TextRange range)
node - The node to which the folding region is related. The node is then passed to
FoldingBuilder.getPlaceholderText(ASTNode) and
FoldingBuilder.isCollapsedByDefault(ASTNode).range - The folded text range in filepublic FoldingDescriptor(PsiElement element, TextRange range)
public FoldingDescriptor(ASTNode node, TextRange range, FoldingGroup group)
node - The node to which the folding region is related. The node is then passed to
FoldingBuilder.getPlaceholderText(ASTNode) and
FoldingBuilder.isCollapsedByDefault(ASTNode).range - The folded text range in filegroup - Regions with the same group instance expand and collapse together.public FoldingDescriptor(ASTNode node, TextRange range, FoldingGroup group, java.util.Set<java.lang.Object> dependencies)
node - The node to which the folding region is related. The node is then passed to
FoldingBuilder.getPlaceholderText(ASTNode) and
FoldingBuilder.isCollapsedByDefault(ASTNode).range - The folded text range in filegroup - Regions with the same group instance expand and collapse together.dependencies - folding dependencies: other files or elements that could change
folding description, see Dependenciespublic FoldingDescriptor(ASTNode node, TextRange range, FoldingGroup group, java.util.Set<java.lang.Object> dependencies, boolean neverExpands)
node - The node to which the folding region is related. The node is then passed to
FoldingBuilder.getPlaceholderText(ASTNode) and
FoldingBuilder.isCollapsedByDefault(ASTNode).range - The folded text range in filegroup - Regions with the same group instance expand and collapse together.dependencies - folding dependencies: other files or elements that could change, see DependenciesneverExpands - shall be true for fold regions that must not be ever expanded.public FoldingDescriptor(PsiElement e, int start, int end, FoldingGroup group, java.lang.String placeholderText)
e - PSI element to which the folding region is related.start - Folded text range's start offset in fileend - Folded text range's end offset in filegroup - Regions with the same group instance expand and collapse together.placeholderText - Text displayed instead of folded text, when the region is collapsedpublic FoldingDescriptor(ASTNode node, TextRange range, FoldingGroup group, java.lang.String placeholderText)
node - The node to which the folding region is related. The node is then passed to
FoldingBuilder.isCollapsedByDefault(ASTNode).range - The folded text range in filegroup - Regions with the same group instance expand and collapse together.placeholderText - Text displayed instead of folded text, when the region is collapsedpublic FoldingDescriptor(ASTNode node, TextRange range, FoldingGroup group, java.lang.String placeholderText, java.lang.Boolean collapsedByDefault, java.util.Set<java.lang.Object> dependencies)
node - The node to which the folding region is related. The node is then passed to
FoldingBuilder.isCollapsedByDefault(ASTNode).range - The folded text range in filegroup - Regions with the same group instance expand and collapse together.placeholderText - Text displayed instead of folded text, when the region is collapsedcollapsedByDefault - Whether the region should be collapsed for newly opened filesdependencies - folding dependencies: other files or elements that could change, see Dependenciespublic FoldingDescriptor(ASTNode node, TextRange range, FoldingGroup group, java.util.Set<java.lang.Object> dependencies, boolean neverExpands, java.lang.String placeholderText, java.lang.Boolean collapsedByDefault)
node - The node to which the folding region is related. The node is then passed to
FoldingBuilder.getPlaceholderText(ASTNode) and
FoldingBuilder.isCollapsedByDefault(ASTNode).range - The folded text range in filegroup - Regions with the same group instance expand and collapse together.dependencies - folding dependencies: other files or elements that could change, see DependenciesneverExpands - shall be true for fold regions that must not be ever expanded.placeholderText - Text displayed instead of folded text, when the region is collapsedcollapsedByDefault - Whether the region should be collapsed for newly opened filespublic ASTNode getElement()
public TextRange getRange()
public FoldingGroup getGroup()
public java.lang.String getPlaceholderText()
public void setPlaceholderText(java.lang.String placeholderText)
public java.util.Set<java.lang.Object> getDependencies()
public boolean isNonExpandable()
public boolean canBeRemovedWhenCollapsed()
public java.lang.Boolean isCollapsedByDefault()
public void setCanBeRemovedWhenCollapsed(boolean canBeRemovedWhenCollapsed)
public boolean isGutterMarkEnabledForSingleLine()
public void setGutterMarkEnabledForSingleLine(boolean value)
FoldRegion.setGutterMarkEnabledForSingleLine(boolean).isGutterMarkEnabledForSingleLine()public java.lang.String toString()
toString in class java.lang.Object