本文整理汇总了Java中org.eclipse.ltk.core.refactoring.RefactoringStatus.createStatus方法的典型用法代码示例。如果您正苦于以下问题:Java RefactoringStatus.createStatus方法的具体用法?Java RefactoringStatus.createStatus怎么用?Java RefactoringStatus.createStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.ltk.core.refactoring.RefactoringStatus
的用法示例。
在下文中一共展示了RefactoringStatus.createStatus方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkIfOverridesAnother
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
public static RefactoringStatus checkIfOverridesAnother(IMethod method, ITypeHierarchy hierarchy)
throws JavaModelException {
IMethod overrides = MethodChecks.overridesAnotherMethod(method, hierarchy);
if (overrides == null) return null;
RefactoringStatusContext context = JavaStatusContext.create(overrides);
String message =
Messages.format(
RefactoringCoreMessages.MethodChecks_overrides,
new String[] {
JavaElementUtil.createMethodSignature(overrides),
JavaElementLabels.getElementLabel(
overrides.getDeclaringType(), JavaElementLabels.ALL_FULLY_QUALIFIED)
});
return RefactoringStatus.createStatus(
RefactoringStatus.FATAL,
message,
context,
Corext.getPluginId(),
RefactoringStatusCodes.OVERRIDES_ANOTHER_METHOD,
overrides);
}
示例2: checkIfComesFromInterface
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
public static RefactoringStatus checkIfComesFromInterface(
IMethod method, ITypeHierarchy hierarchy, IProgressMonitor monitor)
throws JavaModelException {
IMethod inInterface = MethodChecks.isDeclaredInInterface(method, hierarchy, monitor);
if (inInterface == null) return null;
RefactoringStatusContext context = JavaStatusContext.create(inInterface);
String message =
Messages.format(
RefactoringCoreMessages.MethodChecks_implements,
new String[] {
JavaElementUtil.createMethodSignature(inInterface),
JavaElementLabels.getElementLabel(
inInterface.getDeclaringType(), JavaElementLabels.ALL_FULLY_QUALIFIED)
});
return RefactoringStatus.createStatus(
RefactoringStatus.FATAL,
message,
context,
Corext.getPluginId(),
RefactoringStatusCodes.METHOD_DECLARED_IN_INTERFACE,
inInterface);
}
示例3: checkExpressionFragmentIsRValue
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
private RefactoringStatus checkExpressionFragmentIsRValue() throws JavaModelException {
switch (Checks.checkExpressionIsRValue(getSelectedExpression().getAssociatedExpression())) {
case Checks.NOT_RVALUE_MISC:
return RefactoringStatus.createStatus(
RefactoringStatus.FATAL,
RefactoringCoreMessages.ExtractTempRefactoring_select_expression,
null,
Corext.getPluginId(),
RefactoringStatusCodes.EXPRESSION_NOT_RVALUE,
null);
case Checks.NOT_RVALUE_VOID:
return RefactoringStatus.createStatus(
RefactoringStatus.FATAL,
RefactoringCoreMessages.ExtractTempRefactoring_no_void,
null,
Corext.getPluginId(),
RefactoringStatusCodes.EXPRESSION_NOT_RVALUE_VOID,
null);
case Checks.IS_RVALUE_GUESSED:
case Checks.IS_RVALUE:
return new RefactoringStatus();
default:
Assert.isTrue(false);
return null;
}
}
示例4: checkInitializer
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
private RefactoringStatus checkInitializer() {
Expression initializer = getInitializer();
if (initializer == null)
return RefactoringStatus.createStatus(
RefactoringStatus.FATAL,
RefactoringCoreMessages.InlineConstantRefactoring_blank_finals,
null,
Corext.getPluginId(),
RefactoringStatusCodes.CANNOT_INLINE_BLANK_FINAL,
null);
fInitializerAllStaticFinal =
ConstantChecks.isStaticFinalConstant(
(IExpressionFragment) ASTFragmentFactory.createFragmentForFullSubtree(initializer));
fInitializerChecked = true;
return new RefactoringStatus();
}
示例5: checkStaticFinalConstantNameSelected
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
public RefactoringStatus checkStaticFinalConstantNameSelected() {
if (fSelectedConstantName == null)
return RefactoringStatus.createStatus(
RefactoringStatus.FATAL,
RefactoringCoreMessages.InlineConstantRefactoring_static_final_field,
null,
Corext.getPluginId(),
RefactoringStatusCodes.NOT_STATIC_FINAL_SELECTED,
null);
return new RefactoringStatus();
}
示例6: checkInitialConditions
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException {
try {
pm.beginTask("", 3); // $NON-NLS-1$
if (!fSelectionCu.isStructureKnown())
return RefactoringStatus.createStatus(
RefactoringStatus.FATAL,
RefactoringCoreMessages.InlineConstantRefactoring_syntax_errors,
null,
Corext.getPluginId(),
RefactoringStatusCodes.SYNTAX_ERRORS,
null);
RefactoringStatus result = checkStaticFinalConstantNameSelected();
if (result.hasFatalError()) return result;
result.merge(findField());
if (result.hasFatalError()) return result;
pm.worked(1);
result.merge(findDeclaration());
if (result.hasFatalError()) return result;
pm.worked(1);
result.merge(checkInitializer());
if (result.hasFatalError()) return result;
pm.worked(1);
return result;
} finally {
pm.done();
}
}
示例7: findField
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
private RefactoringStatus findField() {
fField = (IField) ((IVariableBinding) fSelectedConstantName.resolveBinding()).getJavaElement();
if (fField != null && !fField.exists())
return RefactoringStatus.createStatus(
RefactoringStatus.FATAL,
RefactoringCoreMessages.InlineConstantRefactoring_local_anonymous_unsupported,
null,
Corext.getPluginId(),
RefactoringStatusCodes.LOCAL_AND_ANONYMOUS_NOT_SUPPORTED,
null);
return null;
}
示例8: checkExpressionFragmentIsRValue
import org.eclipse.ltk.core.refactoring.RefactoringStatus; //导入方法依赖的package包/类
private RefactoringStatus checkExpressionFragmentIsRValue() throws JavaModelException {
/* Moved this functionality to Checks, to allow sharing with
ExtractTempRefactoring, others */
switch (Checks.checkExpressionIsRValue(getSelectedExpression().getAssociatedExpression())) {
case Checks.NOT_RVALUE_MISC:
return RefactoringStatus.createStatus(
RefactoringStatus.FATAL,
RefactoringCoreMessages.ExtractConstantRefactoring_select_expression,
null,
Corext.getPluginId(),
RefactoringStatusCodes.EXPRESSION_NOT_RVALUE,
null);
case Checks.NOT_RVALUE_VOID:
return RefactoringStatus.createStatus(
RefactoringStatus.FATAL,
RefactoringCoreMessages.ExtractConstantRefactoring_no_void,
null,
Corext.getPluginId(),
RefactoringStatusCodes.EXPRESSION_NOT_RVALUE_VOID,
null);
case Checks.IS_RVALUE_GUESSED:
case Checks.IS_RVALUE:
return new RefactoringStatus();
default:
Assert.isTrue(false);
return null;
}
}