/** * Collapse the given fold if it's expanded and expand it if it's collapsed. * * <p><b>Note:</b> The hierarchy must be locked prior using of this method. * * @param f fold which state should be toggled. */ public void toggle(Fold f) { if (f.isCollapsed()) { expand(f); } else { // expanded collapse(f); } }
public int foldGetRawIndex(Fold fold) { return fold.getRawIndex(); }
public FoldOperationImpl foldGetOperation(Fold fold) { return fold.getOperation(); }
public void foldRemoveUpdate(Fold fold, DocumentEvent evt) { fold.removeUpdate(evt); }
public void foldInsertUpdate(Fold fold, DocumentEvent evt) { fold.insertUpdate(evt); }
public boolean foldIsExpandNecessary(Fold fold) { return fold.isExpandNecessary(); }
public void foldSetParent(Fold fold, Fold parent) { fold.setParent(parent); }
public Object foldGetExtraInfo(Fold fold) { return fold.getExtraInfo(); }
public void foldSetEndOffset(Fold fold, Document doc, int endOffset) throws BadLocationException { fold.setEndOffset(doc, endOffset); }
public void foldSetStartOffset(Fold fold, Document doc, int startOffset) throws BadLocationException { fold.setStartOffset(doc, startOffset); }
public void foldSetDescription(Fold fold, String description) { fold.setDescription(description); }
public void foldSetCollapsed(Fold fold, boolean collapsed) { fold.setCollapsed(collapsed); }
public Fold foldReplaceByChildren(Fold fold, int index) { return fold.replaceByChildren(index); }
public void foldExtractToChildren(Fold fold, int index, int length, Fold targetFold) { fold.extractToChildren(index, length, targetFold); }
public void foldSetRawIndex(Fold fold, int rawIndex) { fold.setRawIndex(rawIndex); }
public void foldUpdateRawIndex(Fold fold, int rawIndexDelta) { fold.updateRawIndex(rawIndexDelta); }
public boolean foldIsStartDamaged(Fold fold) { return fold.isStartDamaged(); }
@Override public XStream<String> fold(final int size) { return new XStreamImpl<>(Fold.fold(size).apply(new Stringify<T>().apply(stream))); }
public boolean foldIsEndDamaged(Fold fold) { return fold.isEndDamaged(); }