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


Java CompositeChange.markAsSynthetic方法代码示例

本文整理汇总了Java中org.eclipse.ltk.core.refactoring.CompositeChange.markAsSynthetic方法的典型用法代码示例。如果您正苦于以下问题:Java CompositeChange.markAsSynthetic方法的具体用法?Java CompositeChange.markAsSynthetic怎么用?Java CompositeChange.markAsSynthetic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.ltk.core.refactoring.CompositeChange的用法示例。


在下文中一共展示了CompositeChange.markAsSynthetic方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createChange

import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
public Change createChange(IProgressMonitor pm, INewNameQueries copyQueries) {
  IFile[] file = getFiles();
  IFolder[] folders = getFolders();
  ICompilationUnit[] cus = getCus();
  pm.beginTask("", cus.length + file.length + folders.length); // $NON-NLS-1$
  NewNameProposer nameProposer = new NewNameProposer();
  CompositeChange composite =
      new DynamicValidationStateChange(RefactoringCoreMessages.ReorgPolicy_copy);
  composite.markAsSynthetic();
  for (int i = 0; i < cus.length; i++) {
    composite.add(createChange(cus[i], nameProposer, copyQueries));
    pm.worked(1);
  }
  if (pm.isCanceled()) throw new OperationCanceledException();
  for (int i = 0; i < file.length; i++) {
    composite.add(createChange(file[i], nameProposer, copyQueries));
    pm.worked(1);
  }
  if (pm.isCanceled()) throw new OperationCanceledException();
  for (int i = 0; i < folders.length; i++) {
    composite.add(createChange(folders[i], nameProposer, copyQueries));
    pm.worked(1);
  }
  pm.done();
  return composite;
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:ReorgPolicyFactory.java

示例2: createSimpleMoveChange

import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
private Change createSimpleMoveChange(IProgressMonitor pm) {
  CompositeChange result =
      new DynamicValidationStateChange(RefactoringCoreMessages.ReorgPolicy_move);
  result.markAsSynthetic();
  IFile[] files = getFiles();
  IFolder[] folders = getFolders();
  ICompilationUnit[] cus = getCus();
  pm.beginTask("", files.length + folders.length + cus.length); // $NON-NLS-1$
  for (int i = 0; i < files.length; i++) {
    result.add(createChange(files[i]));
    pm.worked(1);
  }
  if (pm.isCanceled()) throw new OperationCanceledException();
  for (int i = 0; i < folders.length; i++) {
    result.add(createChange(folders[i]));
    pm.worked(1);
  }
  if (pm.isCanceled()) throw new OperationCanceledException();
  for (int i = 0; i < cus.length; i++) {
    result.add(createChange(cus[i]));
    pm.worked(1);
  }
  pm.done();
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:ReorgPolicyFactory.java

示例3: getSingleChange

import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
public Change getSingleChange(IFile[] alreadyTouchedFiles) {
  Collection<TextChange> values = fChanges.values();
  if (values.size() == 0) return null;

  CompositeChange result =
      new CompositeChange(RefactoringCoreMessages.QualifiedNameSearchResult_change_name);
  result.markAsSynthetic();
  List<IFile> files = Arrays.asList(alreadyTouchedFiles);
  for (Iterator<TextChange> iter = values.iterator(); iter.hasNext(); ) {
    TextFileChange change = (TextFileChange) iter.next();
    if (!files.contains(change.getFile())) {
      result.add(change);
    }
  }
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:QualifiedNameSearchResult.java

示例4: createChange

import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
public Change createChange(IProgressMonitor pm) throws CoreException {
  pm.beginTask("", fResourcesToMove.length); // $NON-NLS-1$
  try {
    CompositeChange compositeChange = new CompositeChange(getMoveDescription());
    compositeChange.markAsSynthetic();

    RefactoringChangeDescriptor descriptor = new RefactoringChangeDescriptor(createDescriptor());
    for (int i = 0; i < fResourcesToMove.length; i++) {
      MoveResourceChange moveChange = new MoveResourceChange(fResourcesToMove[i], fDestination);
      moveChange.setDescriptor(descriptor);
      compositeChange.add(moveChange);
    }
    return compositeChange;
  } finally {
    pm.done();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:MoveResourcesProcessor.java

示例5: createChange

import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
  pm.beginTask(RefactoringCoreMessages.DeleteResourcesProcessor_create_task, fResources.length);
  try {
    RefactoringChangeDescriptor descriptor = new RefactoringChangeDescriptor(createDescriptor());
    CompositeChange change =
        new CompositeChange(RefactoringCoreMessages.DeleteResourcesProcessor_change_name);
    change.markAsSynthetic();
    for (int i = 0; i < fResources.length; i++) {
      pm.worked(1);
      DeleteResourceChange dc =
          new DeleteResourceChange(fResources[i].getFullPath(), true, fDeleteContents);
      dc.setDescriptor(descriptor);
      change.add(dc);
    }
    return change;
  } finally {
    pm.done();
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:DeleteResourcesProcessor.java

示例6: createChange

import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
public Change createChange(IProgressMonitor pm, INewNameQueries copyQueries) {
	NewNameProposer nameProposer= new NewNameProposer();
	IPackageFragmentRoot[] roots= getPackageFragmentRoots();
	pm.beginTask("", roots.length); //$NON-NLS-1$
	CompositeChange composite= new DynamicValidationStateChange(RefactoringCoreMessages.ReorgPolicy_copy_source_folder);
	composite.markAsSynthetic();
	IJavaProject destination= getDestinationJavaProject();
	for (int i= 0; i < roots.length; i++) {
		if (destination == null) {
			composite.add(createChange(roots[i], (IContainer) getResourceDestination(), nameProposer, copyQueries));
		} else {
			composite.add(createChange(roots[i], destination, nameProposer, copyQueries));
		}
		pm.worked(1);
	}
	pm.done();
	return composite;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:ReorgPolicyFactory.java

示例7: createSimpleMoveChange

import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
private Change createSimpleMoveChange(IProgressMonitor pm) {
	CompositeChange result= new DynamicValidationStateChange(RefactoringCoreMessages.ReorgPolicy_move);
	result.markAsSynthetic();
	IFile[] files= getFiles();
	IFolder[] folders= getFolders();
	ICompilationUnit[] cus= getCus();
	pm.beginTask("", files.length + folders.length + cus.length); //$NON-NLS-1$
	for (int i= 0; i < files.length; i++) {
		result.add(createChange(files[i]));
		pm.worked(1);
	}
	if (pm.isCanceled())
		throw new OperationCanceledException();
	for (int i= 0; i < folders.length; i++) {
		result.add(createChange(folders[i]));
		pm.worked(1);
	}
	if (pm.isCanceled())
		throw new OperationCanceledException();
	for (int i= 0; i < cus.length; i++) {
		result.add(createChange(cus[i]));
		pm.worked(1);
	}
	pm.done();
	return result;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:27,代码来源:ReorgPolicyFactory.java

示例8: getSingleChange

import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
public Change getSingleChange(IFile[] alreadyTouchedFiles) {
	Collection<TextChange> values= fChanges.values();
	if (values.size() == 0)
		return null;

	CompositeChange result= new CompositeChange(RefactoringCoreMessages.QualifiedNameSearchResult_change_name);
	result.markAsSynthetic();
	List<IFile> files= Arrays.asList(alreadyTouchedFiles);
	for (Iterator<TextChange> iter= values.iterator(); iter.hasNext();) {
		TextFileChange change= (TextFileChange)iter.next();
		if (!files.contains(change.getFile())) {
			result.add(change);
		}
	}
	return result;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:QualifiedNameSearchResult.java

示例9: createChangeFromMethodsToRefactor

import org.eclipse.ltk.core.refactoring.CompositeChange; //导入方法依赖的package包/类
private Change createChangeFromMethodsToRefactor() {
  CompositeChange changes = new CompositeChange(
      "GWT RPC paired method renames");
  changes.markAsSynthetic();

  // Traverse the methods to refactor and create a rename change for each
  // Note: due to the recursive nature, this List could grow through each
  // iteration
  while (refactoringContext.toRefactorMethods.size() > 0) {
    IMethod method = refactoringContext.toRefactorMethods.remove(0);
    try {
      // Call to JDT to get a change that renames this method
      Change change = createChangeForMethodRename(method);
      if (change != null) {
        if (ChangeUtilities.mergeParticipantTextChanges(this, change)) {
          // This change was completely merged into existing changes
          continue;
        }

        // Walk through the created change tree and weave a change that, at
        // perform-time, will update the text regions
        ChangeUtilities.acceptOnChange(change,
            new RegionUpdaterChangeWeavingVisitor(
                new RenamedElementAstMatcher(pairedMethod.getElementName(),
                    newMethodName), new ReferenceUpdater()));
        changes.add(change);
      }
    } catch (RefactoringException e) {
      GWTPluginLog.logError("Could not rename method " + method);
      // TODO: warn
    }
  }

  return (changes.getChildren().length > 0) ? changes : null;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:36,代码来源:PairedMethodRenameParticipant.java


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