本文整理汇总了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;未经允许,请勿转载。 |
请发表评论