Class FoldCollapser
java.lang.Object
org.fife.ui.rsyntaxtextarea.folding.FoldCollapser
Collapses folds based on their type. You can create an instance of this
class to collapse all comment blocks when opening a new file, for example.
- Version:
- 1.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance that collapses all comment blocks.FoldCollapser(int typeToCollapse) Creates an instance that collapses all blocks of the specified type. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTypeToCollapse(int typeToCollapse) Adds a type of fold to collapse.voidCollapses any relevant folds known by the fold manager.protected voidcollapseImpl(Fold fold) Collapses the specified fold, and any of its child folds, as appropriate.booleangetShouldCollapse(Fold fold) Returns whether a specific fold should be collapsed.
-
Field Details
-
typesToCollapse
-
-
Constructor Details
-
FoldCollapser
public FoldCollapser()Creates an instance that collapses all comment blocks. -
FoldCollapser
public FoldCollapser(int typeToCollapse) Creates an instance that collapses all blocks of the specified type.- Parameters:
typeToCollapse- The type to collapse.- See Also:
-
-
Method Details
-
addTypeToCollapse
public void addTypeToCollapse(int typeToCollapse) Adds a type of fold to collapse.- Parameters:
typeToCollapse- The type of fold to collapse.
-
collapseFolds
Collapses any relevant folds known by the fold manager.- Parameters:
fm- The fold manager.
-
collapseImpl
Collapses the specified fold, and any of its child folds, as appropriate.- Parameters:
fold- The fold to examine.- See Also:
-
getShouldCollapse
Returns whether a specific fold should be collapsed.- Parameters:
fold- The fold to examine.- Returns:
- Whether the fold should be collapsed.
-