本文整理匯總了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;
}