Class YamlFoldParser
- java.lang.Object
-
- org.fife.ui.rsyntaxtextarea.folding.YamlFoldParser
-
- All Implemented Interfaces:
FoldParser
public class YamlFoldParser extends java.lang.Object implements FoldParser
Fold parser for YAML. Based on org.fife.ui.rsyntaxtextarea.folding.HtmlFoldParser. Fold is started by each line. Each fold contains all following lines with indent higher than the current line.
-
-
Constructor Summary
Constructors Constructor Description YamlFoldParser()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<Fold>
getFolds(RSyntaxTextArea textArea)
Returns a list of all folds in the text area.private static boolean
isSpaces(Token t)
private static void
removeFold(Fold fold, java.util.List<Fold> folds)
If this fold has a parent fold, this method removes it from its parent.
-
-
-
Method Detail
-
isSpaces
private static boolean isSpaces(Token t)
-
getFolds
public java.util.List<Fold> getFolds(RSyntaxTextArea textArea)
Description copied from interface:FoldParser
Returns a list of all folds in the text area.- Specified by:
getFolds
in interfaceFoldParser
- Parameters:
textArea
- The text area whose contents should be analyzed.- Returns:
- The list of folds. If this method returns
null
, it is treated as if no folds were found.
-
removeFold
private static void removeFold(Fold fold, java.util.List<Fold> folds)
If this fold has a parent fold, this method removes it from its parent. Otherwise, it's assumed to be the most recent (top-level) fold in thefolds
list, and is removed from that.- Parameters:
fold
- The fold to remove.folds
- The list of top-level folds.
-
-