com.intellij.lang.folding
Interface FoldingBuilder


public interface FoldingBuilder

Allows a custom language plugin to define rules for folding code in the language handled by the plugin.

See Also:
Language.getFoldingBuilder()

Method Summary
 FoldingDescriptor[] buildFoldRegions(ASTNode node, Document document)
          Builds the folding regions for the specified node in the AST tree and its children.
 java.lang.String getPlaceholderText(ASTNode node)
          Returns the text which is displayed in the editor for the folding region related to the specified node when the folding region is collapsed.
 boolean isCollapsedByDefault(ASTNode node)
          Returns the default collapsed state for the folding region related to the specified node.
 

Method Detail

buildFoldRegions

FoldingDescriptor[] buildFoldRegions(ASTNode node,
                                     Document document)
Builds the folding regions for the specified node in the AST tree and its children.

Parameters:
node - the node for which folding is requested.
document - the document for which folding is built. Can be used to retrieve line numbers for folding regions.
Returns:
the array of folding descriptors.

getPlaceholderText

java.lang.String getPlaceholderText(ASTNode node)
Returns the text which is displayed in the editor for the folding region related to the specified node when the folding region is collapsed.

Parameters:
node - the node for which the placeholder text is requested.
Returns:
the placeholder text.

isCollapsedByDefault

boolean isCollapsedByDefault(ASTNode node)
Returns the default collapsed state for the folding region related to the specified node.

Parameters:
node - the node for which the collapsed state is requested.
Returns:
true if the region is collapsed by default, false otherwise.