Package org.gjt.sp.jedit.buffer
Class FoldHandler
- java.lang.Object
-
- org.gjt.sp.jedit.buffer.FoldHandler
-
- Direct Known Subclasses:
DummyFoldHandler,ExplicitFoldHandler,IndentFoldHandler
public abstract class FoldHandler extends java.lang.ObjectInterface for obtaining the fold level of a specified line.Plugins can provide fold handlers by defining entries in their
services.xmlfiles like so:<SERVICE CLASS="org.gjt.sp.jedit.buffer.FoldHandler" NAME="name"> new MyFoldHandler(); </SERVICE>SeeServiceManagerfor details.- Since:
- jEdit 4.3pre3
-
-
Field Summary
Fields Modifier and Type Field Description static FoldHandlerProviderfoldHandlerProviderThe FoldHandlerProvider.
-
Constructor Summary
Constructors Modifier Constructor Description protectedFoldHandler(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Returns if the specified fold handler is equal to this one.static FoldHandlergetFoldHandler(java.lang.String name)Returns the fold handler with the specified name, or null if there is no registered handler with that name.abstract intgetFoldLevel(JEditBuffer buffer, int lineIndex, javax.swing.text.Segment seg)Returns the fold level of the specified line.static java.lang.String[]getFoldModes()Returns an array containing the names of all registered fold handlers.java.lang.StringgetName()Returns the internal name of this FoldHandlerjava.util.List<java.lang.Integer>getPrecedingFoldLevels(JEditBuffer buffer, int lineIndex, javax.swing.text.Segment seg, int lineFoldLevel)Returns the fold levels of the lines preceding the specified line, which depend on the specified line.inthashCode()java.lang.StringtoString()
-
-
-
Field Detail
-
foldHandlerProvider
public static FoldHandlerProvider foldHandlerProvider
The FoldHandlerProvider.
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the internal name of this FoldHandler- Returns:
- The internal name of this FoldHandler
- Since:
- jEdit 4.0pre6
-
getFoldLevel
public abstract int getFoldLevel(JEditBuffer buffer, int lineIndex, javax.swing.text.Segment seg)
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 java.util.List<java.lang.Integer> getPrecedingFoldLevels(JEditBuffer buffer, int lineIndex, javax.swing.text.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
public boolean equals(java.lang.Object o)
Returns if the specified fold handler is equal to this one.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- The object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
getFoldHandler
public static FoldHandler getFoldHandler(java.lang.String name)
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
public static java.lang.String[] getFoldModes()
Returns an array containing the names of all registered fold handlers.- Since:
- jEdit 4.0pre6
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-