本文整理汇总了Java中org.eclipse.text.edits.TextEdit.getExclusiveEnd方法的典型用法代码示例。如果您正苦于以下问题:Java TextEdit.getExclusiveEnd方法的具体用法?Java TextEdit.getExclusiveEnd怎么用?Java TextEdit.getExclusiveEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.text.edits.TextEdit
的用法示例。
在下文中一共展示了TextEdit.getExclusiveEnd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: annotateEdit
import org.eclipse.text.edits.TextEdit; //导入方法依赖的package包/类
protected boolean annotateEdit(TextEdit edit, String startTag, String endTag) {
unchangedUntil(edit.getOffset());
fBuf.append(startTag);
appendContent(fPreviewDocument, edit.getOffset(), edit.getExclusiveEnd(), false);
fBuf.append(endTag);
fWrittenToPos= edit.getExclusiveEnd();
return false;
}
示例2: annotateEdit
import org.eclipse.text.edits.TextEdit; //导入方法依赖的package包/类
protected boolean annotateEdit(TextEdit edit, String startTag, String endTag) {
unchangedUntil(edit.getOffset());
fBuf.append(startTag);
appendContent(fPreviewDocument, edit.getOffset(), edit.getExclusiveEnd(), false);
fBuf.append(endTag);
fWrittenToPos = edit.getExclusiveEnd();
return false;
}
示例3: isPacked
import org.eclipse.text.edits.TextEdit; //导入方法依赖的package包/类
/**
* Returns true if the given <code>edit</code> is minimal.
*
* <p>That is if:
*
* <ul>
* <li><b>true</b> if <code>edit</code> is a leaf
* <li>if <code>edit</code> is a inner node then <b>true</b> if
* <ul>
* <li><code>edit</code> has same size as all its children
* <li><code>isPacked</code> is <b>true</b> for all children
* </ul>
* </ul>
*
* @param edit the edit to verify
* @return true if edit is minimal
* @since 3.4
*/
public static boolean isPacked(TextEdit edit) {
if (!(edit instanceof MultiTextEdit)) return true;
if (!edit.hasChildren()) return true;
TextEdit[] children = edit.getChildren();
if (edit.getOffset() != children[0].getOffset()) return false;
if (edit.getExclusiveEnd() != children[children.length - 1].getExclusiveEnd()) return false;
for (int i = 0; i < children.length; i++) {
if (!isPacked(children[i])) return false;
}
return true;
}