• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CheckConditionsOperation类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



CheckConditionsOperation类属于org.eclipse.ltk.core.refactoring包,在下文中一共展示了CheckConditionsOperation类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: checkInitialConditions

import org.eclipse.ltk.core.refactoring.CheckConditionsOperation; //导入依赖的package包/类
/**
 * CHANGED to protected
 * CHANGED do not fork as we are keeping the resource lock.
 */
protected RefactoringStatus checkInitialConditions(Refactoring refactoring, Shell parent, String title,
		IRunnableContext context) throws InterruptedException {
	try {
		CheckConditionsOperation cco = new CheckConditionsOperation(refactoring,
				CheckConditionsOperation.INITIAL_CONDITONS);
		WorkbenchRunnableAdapter workbenchRunnableAdapter = new WorkbenchRunnableAdapter(cco, ResourcesPlugin
				.getWorkspace().getRoot());
		/* CHANGE: don't fork (or use busyCursorWhile) as this will cause a deadlock */
		if (context == null) {
			PlatformUI.getWorkbench().getProgressService().run(false, true, workbenchRunnableAdapter);
		} else if (context instanceof IProgressService) {
			((IProgressService) context).run(false, true, workbenchRunnableAdapter);
		} else {
			context.run(false, true, workbenchRunnableAdapter);
		}
		return cco.getStatus();
	} catch (InvocationTargetException e) {
		ExceptionHandler.handle(e, parent, title, RefactoringUIMessages.RefactoringUI_open_unexpected_exception);
		return RefactoringStatus
				.createFatalErrorStatus(RefactoringUIMessages.RefactoringUI_open_unexpected_exception);
	}
}
 
开发者ID:cplutte,项目名称:bts,代码行数:27,代码来源:RefactoringWizardOpenOperation_NonForking.java


示例2: createChange

import org.eclipse.ltk.core.refactoring.CheckConditionsOperation; //导入依赖的package包/类
public ChangeCreationResult createChange() throws RefactoringException {
  Change change =
      createChange(
          new CreateChangeOperation(
              new CheckConditionsOperation(
                  refactoring, CheckConditionsOperation.FINAL_CONDITIONS),
              RefactoringStatus.FATAL),
          true);
  // Status has been updated since we have passed true
  RefactoringStatus status = conditionCheckingStatus;
  // Creating the change has been canceled
  if (change == null && status == null) {
    internalSetChange(change);
    throw new RefactoringException("Creating the change has been canceled");
  }

  // Set change if we don't have fatal errors.
  if (!status.hasFatalError()) {
    internalSetChange(change);
  }

  ChangeCreationResult result = DtoFactory.newDto(ChangeCreationResult.class);
  result.setStatus(DtoConverter.toRefactoringStatusDto(status));
  result.setCanShowPreviewPage(status.isOK());
  return result;
}
 
开发者ID:eclipse,项目名称:che,代码行数:27,代码来源:RefactoringSession.java


示例3: perform

import org.eclipse.ltk.core.refactoring.CheckConditionsOperation; //导入依赖的package包/类
@Override
public Change perform(IProgressMonitor pm) throws CoreException {

	RefactoringContribution refactoringContribution = RefactoringCore
			.getRefactoringContribution(IJavaRefactorings.MOVE);
	RefactoringDescriptor desc = refactoringContribution.createDescriptor();
	MoveDescriptor moveDes = (MoveDescriptor) desc;
	moveDes.setComment("Moving " + originalFile);
	moveDes.setDescription("Moving " + originalFile);
	IFolder dest = computeCompilationUnitDestination();
	moveDes.setDestination(JavaCore.create(dest));
	moveDes.setProject(originalFile.getProject().getName());
 
	moveDes.setMoveResources(new IFile[0], new IFolder[0],
			new ICompilationUnit[] { JavaCore.createCompilationUnitFrom(originalFile) });
	moveDes.setUpdateReferences(true);

	RefactoringStatus status = new RefactoringStatus();

	RefactoringContext context = moveDes.createRefactoringContext(status);
	PerformRefactoringOperation op = new PerformRefactoringOperation(context,
			CheckConditionsOperation.ALL_CONDITIONS);
	Job job = new WorkspaceJob("GW4E Moving Job") {
		@Override
		public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
			Display.getDefault().syncExec(() -> {
				try {
					
					op.run(monitor);
				} catch (Exception e) {
					ResourceManager.logException(e);
				}
			});
			return Status.OK_STATUS;
		}
	};
	job.setRule(originalFile.getProject()); // lock so that we serialize the
											// refactoring of the "test
											// interface" AND the "test
											// implementation"
	job.setUser(true);
	job.schedule();

	return op.getUndoChange();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:46,代码来源:MoveCompilationUnitChange.java


示例4: createCreateChangeOperation

import org.eclipse.ltk.core.refactoring.CheckConditionsOperation; //导入依赖的package包/类
private static CreateChangeOperation createCreateChangeOperation(
    Refactoring refactoring, int errorLevel) {
  CheckConditionsOperation checkConditionsOperation = new CheckConditionsOperation(
      refactoring, CheckConditionsOperation.ALL_CONDITIONS);
  return new CreateChangeOperation(checkConditionsOperation, errorLevel);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:7,代码来源:ChangeUtilities.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PipeAdapter类代码示例发布时间:2022-05-23
下一篇:
Java OFFeaturesRequest类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap