Class FoldCollapser


  • public class FoldCollapser
    extends Object
    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.
    • Constructor Detail

      • 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:
        FoldType
    • Method Detail

      • addTypeToCollapse

        public void addTypeToCollapse​(int typeToCollapse)
        Adds a type of fold to collapse.
        Parameters:
        typeToCollapse - The type of fold to collapse.
      • collapseFolds

        public void collapseFolds​(FoldManager fm)
        Collapses any relevant folds known by the fold manager.
        Parameters:
        fm - The fold manager.
      • collapseImpl

        protected void collapseImpl​(Fold fold)
        Collapses the specified fold, and any of its child folds, as appropriate.
        Parameters:
        fold - The fold to examine.
        See Also:
        getShouldCollapse(Fold)
      • getShouldCollapse

        public boolean getShouldCollapse​(Fold fold)
        Returns whether a specific fold should be collapsed.
        Parameters:
        fold - The fold to examine.
        Returns:
        Whether the fold should be collapsed.