java.lang.Object
org.gjt.sp.jedit.buffer.FoldHandler
- Direct Known Subclasses:
DummyFoldHandler
,ExplicitFoldHandler
,IndentFoldHandler
,StringFoldHandler
Interface for obtaining the fold level of a specified line.
Plugins can provide fold handlers by defining entries in their
services.xml
files like so:
<SERVICE CLASS="org.gjt.sp.jedit.buffer.FoldHandler" NAME="name"> new MyFoldHandler(); </SERVICE>See
ServiceManager
for details.- Since:
- jEdit 4.3pre3
- Version:
- $Id: FoldHandler.java 23981 2015-08-10 14:56:24Z daleanson $
- Author:
- Slava Pestov
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns if the specified fold handler is equal to this one.static FoldHandler
getFoldHandler
(String name) Returns the fold handler with the specified name, or null if there is no registered handler with that name.abstract int
getFoldLevel
(JEditBuffer buffer, int lineIndex, Segment seg) Returns the fold level of the specified line.static String[]
Returns an array containing the names of all registered fold handlers.getName()
Returns the internal name of this FoldHandlergetPrecedingFoldLevels
(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.int
hashCode()
toString()
-
Field Details
-
foldHandlerProvider
The FoldHandlerProvider.
-
-
Constructor Details
-
FoldHandler
-
-
Method Details
-
getName
Returns the internal name of this FoldHandler- Returns:
- The internal name of this FoldHandler
- Since:
- jEdit 4.0pre6
-
getFoldLevel
Returns the fold level of the specified line.- 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.- 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
-
equals
Returns if the specified fold handler is equal to this one. -
hashCode
public int hashCode() -
getFoldHandler
Returns the fold handler with the specified name, or null if there is no registered handler with that name.- Parameters:
name
- The name of the desired fold handler- Since:
- jEdit 4.0pre6
-
getFoldModes
Returns an array containing the names of all registered fold handlers.- Since:
- jEdit 4.0pre6
-
toString
-