本文整理匯總了Java中org.eclipse.text.edits.TextEdit.getChildren方法的典型用法代碼示例。如果您正苦於以下問題:Java TextEdit.getChildren方法的具體用法?Java TextEdit.getChildren怎麽用?Java TextEdit.getChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.text.edits.TextEdit
的用法示例。
在下文中一共展示了TextEdit.getChildren方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: flatten
import org.eclipse.text.edits.TextEdit; //導入方法依賴的package包/類
private static void flatten(TextEdit edit, MultiTextEdit result) {
if (!edit.hasChildren()) {
result.addChild(edit);
} else {
TextEdit[] children = edit.getChildren();
for (int i = 0; i < children.length; i++) {
TextEdit child = children[i];
child.getParent().removeChild(0);
flatten(child, result);
}
}
}
示例2: flatten
import org.eclipse.text.edits.TextEdit; //導入方法依賴的package包/類
private void flatten(List result, TextEdit edit) {
result.add(edit);
TextEdit[] children = edit.getChildren();
for (int i = 0; i < children.length; i++) {
flatten(result, children[i]);
}
}
示例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;
}
示例4: cacheEdit
import org.eclipse.text.edits.TextEdit; //導入方法依賴的package包/類
private final void cacheEdit(final TextEdit edit) {
fEdits.add(edit);
final TextEdit[] edits = edit.getChildren();
for (int index = 0; index < edits.length; index++) cacheEdit(edits[index]);
}