use of org.fife.ui.rsyntaxtextarea.folding.Fold in project knime-core by knime.
the class GuardedSectionsFoldParser method getFolds.
/**
* {@inheritDoc}
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public List getFolds(final RSyntaxTextArea textArea) {
List folds = new ArrayList();
GuardedDocument doc = (GuardedDocument) textArea.getDocument();
for (String name : doc.getGuardedSections()) {
GuardedSection guard = doc.getGuardedSection(name);
Fold fold;
try {
fold = new Fold(FoldType.FOLD_TYPE_USER_DEFINED_MIN, textArea, guard.getStart().getOffset());
fold.setEndOffset(guard.getEnd().getOffset());
folds.add(fold);
} catch (BadLocationException e) {
LOGGER.debug(e.getMessage());
}
}
return folds;
}
use of org.fife.ui.rsyntaxtextarea.folding.Fold in project fql by CategoricalData.
the class CodeEditor method foldAll.
public void foldAll(boolean b) {
int i = topArea.getFoldManager().getFoldCount();
for (int j = 0; j < i; j++) {
Fold fold = topArea.getFoldManager().getFold(j);
fold.setCollapsed(b);
}
setCaretPos(topArea.getCaretPosition());
topArea.revalidate();
sp.revalidate();
}
use of org.fife.ui.rsyntaxtextarea.folding.Fold in project knime-core by knime.
the class JavaSnippetNodeDialog method collapseAllFolds.
/* Collapse all folds */
private void collapseAllFolds() {
final FoldManager foldManager = m_snippetTextArea.getFoldManager();
final int foldCount = foldManager.getFoldCount();
for (int i = 0; i < foldCount; i++) {
final Fold fold = foldManager.getFold(i);
fold.setCollapsed(true);
}
}
Aggregations