public void addToHierarchy(FoldHierarchyTransaction transaction) throws BadLocationException { if (FoldOperation.isBoundsValid(startOffset, endOffset, template.getStartGuardedLength(), template.getEndGuardedLength())) { if (log.isLoggable(Level.FINE)){ log.log(Level.FINE, "CFM.BlockFoldInfo.updateHierarchy: Creating fold at ({0}, {1})", // NOI18N new Object[]{startOffset, endOffset}); } fold = getOperation().addToHierarchy( template.getType(), template.getDescription(), collapse, startOffset, endOffset, template.getStartGuardedLength(), template.getEndGuardedLength(), this, transaction); } }
&& f.start < f.end && f.end <= doc.getLength()) { operation.addToHierarchy(f.type, f.foldName, false, f.start , f.end , 0, 0, fh, transaction);
public void ensureFoldExists(FoldHierarchyTransaction transaction) { if (isSolitaire() || !isStartMark()) { throw new IllegalStateException(); } if (fold == null) { try { if (!startMark) { throw new IllegalStateException("Not start mark: " + this); // NOI18N } if (pairMark == null) { throw new IllegalStateException("No pairMark for mark:" + this); // NOI18N } int startOffset = getOffset(); int startGuardedLength = getLength(); int endGuardedLength = pairMark.getLength(); int endOffset = pairMark.getOffset() + endGuardedLength; fold = getOperation().addToHierarchy( CUSTOM_FOLD_TYPE, getDescription(), collapsed, startOffset, endOffset, startGuardedLength, endGuardedLength, this, transaction ); } catch (BadLocationException e) { ErrorManager.getDefault().notify(e); } } }
Fold f = operation.addToHierarchy(i.template.getType(), i.template.getDescription(), i.collapseByDefault,