/**
  * 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);
 }
Example #10
0
 public void foldSetStartOffset(Fold fold, Document doc, int startOffset)
     throws BadLocationException {
   fold.setStartOffset(doc, startOffset);
 }
Example #11
0
 public void foldSetDescription(Fold fold, String description) {
   fold.setDescription(description);
 }
Example #12
0
 public void foldSetCollapsed(Fold fold, boolean collapsed) {
   fold.setCollapsed(collapsed);
 }
Example #13
0
 public Fold foldReplaceByChildren(Fold fold, int index) {
   return fold.replaceByChildren(index);
 }
Example #14
0
 public void foldExtractToChildren(Fold fold, int index, int length, Fold targetFold) {
   fold.extractToChildren(index, length, targetFold);
 }
Example #15
0
 public void foldSetRawIndex(Fold fold, int rawIndex) {
   fold.setRawIndex(rawIndex);
 }
Example #16
0
 public void foldUpdateRawIndex(Fold fold, int rawIndexDelta) {
   fold.updateRawIndex(rawIndexDelta);
 }
Example #17
0
 public boolean foldIsStartDamaged(Fold fold) {
   return fold.isStartDamaged();
 }
Example #18
0
 @Override
 public XStream<String> fold(final int size) {
   return new XStreamImpl<>(Fold.fold(size).apply(new Stringify<T>().apply(stream)));
 }
Example #19
0
 public boolean foldIsEndDamaged(Fold fold) {
   return fold.isEndDamaged();
 }