本文整理汇总了Java中org.eclipse.ltk.core.refactoring.RefactoringStatus.getSeverity方法的典型用法代码示例。如果您正苦于以下问题:Java RefactoringStatus.getSeverity方法的具体用法?Java RefactoringStatus.getSeverity怎么用?Java RefactoringStatus.getSeverity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ltk.core.refactoring.RefactoringStatus
的用法示例。
在下文中一共展示了RefactoringStatus.getSeverity方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
public RefactoringStatus initialize(ASTNode invocation, int severity) {
RefactoringStatus result = new RefactoringStatus();
fInvocation = invocation;
fLocals = new ArrayList<VariableDeclarationStatement>(3);
checkMethodDeclaration(result, severity);
if (result.getSeverity() >= severity) return result;
initializeRewriteState();
initializeTargetNode();
flowAnalysis();
fContext =
new CallContext(fInvocation, fInvocationScope, fTargetNode.getNodeType(), fImportRewrite);
try {
computeRealArguments();
computeReceiver();
} catch (BadLocationException exception) {
JavaPlugin.log(exception);
}
checkInvocationContext(result, severity);
return result;
}
示例2: createChange
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
/**
* Creates a {@link Change} from the given {@link Refactoring}.
*
* @param errorLevel the error level for the condition checking which should
* cause the change creation to fail
*
* @return a non-null {@link Change}
* @throws RefactoringException if there was a problem creating the change
*/
public static Change createChange(IWorkspace workspace, IProgressMonitor pm,
Refactoring refactoring, int errorLevel) throws RefactoringException {
CreateChangeOperation createChangeOperation = ChangeUtilities.createCreateChangeOperation(
refactoring, errorLevel);
try {
workspace.run(createChangeOperation, pm);
RefactoringStatus status = createChangeOperation.getConditionCheckingStatus();
if (status.getSeverity() >= errorLevel) {
// Could not create the change, throw an exception with the failure
// status message
throw new RefactoringException(
status.getMessageMatchingSeverity(status.getSeverity()));
}
} catch (CoreException e) {
throw new RefactoringException(e);
}
return createChangeOperation.getChange();
}
示例3: run
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
@Override
public void run(IProgressMonitor pm) throws CoreException {
try {
pm.beginTask("", fForked && !fForkChangeExecution ? 7 : 11); //$NON-NLS-1$
pm.subTask(""); //$NON-NLS-1$
final RefactoringStatus status= fRefactoring.checkAllConditions(new SubProgressMonitor(pm, 4, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
if (status.getSeverity() >= fStopSeverity) {
final boolean[] canceled= { false };
if (fForked) {
fParent.getDisplay().syncExec(new Runnable() {
@Override
public void run() {
canceled[0]= showStatusDialog(status);
}
});
} else {
canceled[0]= showStatusDialog(status);
}
if (canceled[0]) {
throw new OperationCanceledException();
}
}
fChange= fRefactoring.createChange(new SubProgressMonitor(pm, 2, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
fChange.initializeValidationData(new SubProgressMonitor(pm, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
fPerformChangeOperation= new PerformChangeOperation(fChange);//RefactoringUI.createUIAwareChangeOperation(fChange);
fPerformChangeOperation.setUndoManager(RefactoringCore.getUndoManager(), fRefactoring.getName());
if (fRefactoring instanceof IScheduledRefactoring)
fPerformChangeOperation.setSchedulingRule(((IScheduledRefactoring)fRefactoring).getSchedulingRule());
if (!fForked || fForkChangeExecution)
fPerformChangeOperation.run(new SubProgressMonitor(pm, 4, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
} finally {
pm.done();
}
}
示例4: run
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
public void run(IProgressMonitor pm) throws CoreException {
try {
pm.beginTask("", 11);
pm.subTask("");
final RefactoringStatus status = refactoring.checkAllConditions(new SubProgressMonitor(pm, 4,
SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
if (status.getSeverity() >= RefactoringStatus.WARNING) {
final boolean[] canceled = { false };
shell.getDisplay().syncExec(new Runnable() {
public void run() {
canceled[0] = showStatusDialog(status);
}
});
if (canceled[0]) {
throw new OperationCanceledException();
}
}
Change change = refactoring.createChange(new SubProgressMonitor(pm, 2,
SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
change.initializeValidationData(new SubProgressMonitor(pm, 1,
SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
performChangeOperation = new PerformChangeOperation(change);
performChangeOperation.setUndoManager(RefactoringCore.getUndoManager(), refactoring.getName());
performChangeOperation.setSchedulingRule(ResourcesPlugin.getWorkspace().getRoot());
} finally {
pm.done();
}
}
示例5: run
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
public void run(IProgressMonitor pm) throws CoreException {
try {
pm.beginTask("", fForked && !fForkChangeExecution ? 7 : 11); // $NON-NLS-1$
pm.subTask(""); // $NON-NLS-1$
final RefactoringStatus status =
fRefactoring.checkAllConditions(
new SubProgressMonitor(pm, 4, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
if (status.getSeverity() >= fStopSeverity) {
// final boolean[] canceled = {false};
// if (fForked) {
// fParent.getDisplay().syncExec(new Runnable() {
// public void run() {
// canceled[0] = showStatusDialog(status);
// }
// });
// } else {
// canceled[0] = showStatusDialog(status);
// }
// if (canceled[0]) {
allConditions = status;
throw new OperationCanceledException();
// }
}
fChange =
fRefactoring.createChange(
new SubProgressMonitor(pm, 2, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
fChange.initializeValidationData(
new SubProgressMonitor(pm, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
fPerformChangeOperation =
new PerformChangeOperation(
fChange); // RefactoringUI.createUIAwareChangeOperation(fChange);
fPerformChangeOperation.setUndoManager(
RefactoringCore.getUndoManager(), fRefactoring.getName());
if (fRefactoring instanceof IScheduledRefactoring)
fPerformChangeOperation.setSchedulingRule(
((IScheduledRefactoring) fRefactoring).getSchedulingRule());
if (!fForked || fForkChangeExecution)
fPerformChangeOperation.run(
new SubProgressMonitor(pm, 4, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK));
} finally {
pm.done();
}
}