当前位置: 首页>>代码示例>>Java>>正文


Java CompositeChange.remove方法代码示例

本文整理汇总了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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:24,代码来源:RenamePackageProcessor.java

示例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]);
    }
  }
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:30,代码来源:ChangeUtilities.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:RenamePackageProcessor.java

示例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;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:15,代码来源:ChangeUtilities.java


注:本文中的org.eclipse.ltk.core.refactoring.CompositeChange.remove方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。