java.lang.Object
org.gjt.sp.jedit.buffer.FoldHandler
org.gjt.sp.jedit.buffer.IndentFoldHandler
A fold handler that folds lines based on their indent level.
- Since:
- jEdit 4.0pre1
- Version:
- $Id: IndentFoldHandler.java 25194 2020-04-11 17:03:59Z kpouer $
- Author:
- Slava Pestov
-
Field Summary
Fields inherited from class org.gjt.sp.jedit.buffer.FoldHandler
foldHandlerProvider
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getFoldLevel
(JEditBuffer buffer, int lineIndex, Segment seg) Returns the fold level of the specified line.getPrecedingFoldLevels
(JEditBuffer buffer, int lineIndex, Segment seg, int lineFoldLevel) Returns the fold levels of the lines preceding the specified line, which depend on the specified line.Methods inherited from class org.gjt.sp.jedit.buffer.FoldHandler
equals, getFoldHandler, getFoldModes, getName, hashCode, toString
-
Constructor Details
-
IndentFoldHandler
public IndentFoldHandler()
-
-
Method Details
-
getFoldLevel
Returns the fold level of the specified line. For a whitespace-only line, returns the fold level of the next non-whitespace line, or the level of the previous line if no non-whitespace line follows or if the level of the previous line is higher.- Specified by:
getFoldLevel
in classFoldHandler
- Parameters:
buffer
- The buffer in questionlineIndex
- The line indexseg
- A segment the fold handler can use to obtain any text from the buffer, if necessary- Returns:
- The fold level of the specified line
- Since:
- jEdit 4.0pre1
-
getPrecedingFoldLevels
public List<Integer> getPrecedingFoldLevels(JEditBuffer buffer, int lineIndex, Segment seg, int lineFoldLevel) Returns the fold levels of the lines preceding the specified line, which depend on the specified line.- Overrides:
getPrecedingFoldLevels
in classFoldHandler
- Parameters:
buffer
- The buffer in questionlineIndex
- The line indexseg
- A segment the fold handler can use to obtain anylineFoldLevel
- The fold level of the specified line- Returns:
- The fold levels of the preceding lines, in decreasing line number order (i.e. bottomost line first).
- Since:
- jEdit 4.3pre18
-