本文整理汇总了Java中org.eclipse.ltk.core.refactoring.CompositeChange.remove方法的典型用法代码示例。如果您正苦于以下问题:Java CompositeChange.remove方法的具体用法?Java CompositeChange.remove怎么用?Java CompositeChange.remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ltk.core.refactoring.CompositeChange
的用法示例。
在下文中一共展示了CompositeChange.remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: postCreateChange
import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
@Override
public Change postCreateChange(Change[] participantChanges, IProgressMonitor pm)
throws CoreException {
if (fQualifiedNameSearchResult != null) {
CompositeChange parent = (CompositeChange) fRenamePackageChange.getParent();
try {
/*
* Sneak text changes in before the package rename to ensure
* modified files are still at original location (see
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=154238)
*/
parent.remove(fRenamePackageChange);
parent.add(
fQualifiedNameSearchResult.getSingleChange(
Changes.getModifiedFiles(participantChanges)));
} finally {
fQualifiedNameSearchResult = null;
parent.add(fRenamePackageChange);
fRenamePackageChange = null;
}
}
return null;
}
示例2: insertChange
import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
/**
* Inserts a change at the specified index.
*
* @param change the change to insert
* @param insertIndex the index to insert at (if >= the number of children, it
* will be added to the end)
* @param parentChange the new parent of the change
*/
public static void insertChange(Change change, int insertIndex,
CompositeChange parentChange) {
Change[] changes = parentChange.getChildren();
if (insertIndex >= changes.length) {
parentChange.add(change);
} else {
// CompositeChange.clear does not clear the parent field on the removed
// changes, but CompositeChange.remove does
for (Change curChange : changes) {
parentChange.remove(curChange);
}
for (int i = 0; i < changes.length; i++) {
if (i == insertIndex) {
parentChange.add(change);
}
parentChange.add(changes[i]);
}
}
}
示例3: postCreateChange
import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
@Override
public Change postCreateChange(Change[] participantChanges, IProgressMonitor pm) throws CoreException {
if (fQualifiedNameSearchResult != null) {
CompositeChange parent= (CompositeChange) fRenamePackageChange.getParent();
try {
/*
* Sneak text changes in before the package rename to ensure
* modified files are still at original location (see
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=154238)
*/
parent.remove(fRenamePackageChange);
parent.add(fQualifiedNameSearchResult.getSingleChange(Changes.getModifiedFiles(participantChanges)));
} finally {
fQualifiedNameSearchResult= null;
parent.add(fRenamePackageChange);
fRenamePackageChange= null;
}
}
return null;
}
示例4: removeChange
import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
/**
* Removes a change and returns its old index, or -1 if it was not found.
*/
public static int removeChange(Change change, CompositeChange parentChange) {
Change[] changes = parentChange.getChildren();
for (int index = 0; index < changes.length; index++) {
if (changes[index] == change) {
parentChange.remove(change);
return index;
}
}
return -1;
}