org.eclipse.ltk.core.refactoring.RefactoringStatus.createStatus()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(11.1k)|赞(0)|评价(0)|浏览(66)

本文整理了Java中org.eclipse.ltk.core.refactoring.RefactoringStatus.createStatus方法的一些代码示例,展示了RefactoringStatus.createStatus的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RefactoringStatus.createStatus方法的具体详情如下:
包路径:org.eclipse.ltk.core.refactoring.RefactoringStatus
类名称:RefactoringStatus
方法名:createStatus

RefactoringStatus.createStatus介绍

[英]Creates a new RefactoringStatus with one entry filled with the given arguments.
[中]创建一个新的RefactoringStatus,其中一个条目填充了给定的参数。

代码示例

代码示例来源:origin: org.eclipse/org.eclipse.ltk.core.refactoring

/**
 * Creates a new <code>RefactoringStatus</code> with one <code>INFO</code> entry
 * filled with the given message. 
 * 
 * @param msg the message of the info entry
 * @return the refactoring status
 * 
 * @see RefactoringStatusEntry
 */
public static RefactoringStatus createInfoStatus(String msg) {
  return createStatus(INFO, msg, null, null, RefactoringStatusEntry.NO_CODE, null);
}

代码示例来源:origin: org.eclipse/org.eclipse.ltk.core.refactoring

/**
 * Creates a new <code>RefactoringStatus</code> with one <code>FATAL</code> entry
 * filled with the given message.
 * 
 * @param msg the message of the fatal entry
 * @return the refactoring status
 * 
 * @see RefactoringStatusEntry
 */
public static RefactoringStatus createFatalErrorStatus(String msg) {
  return createStatus(FATAL, msg, null, null, RefactoringStatusEntry.NO_CODE, null);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ltk.core.refactoring

/**
 * Creates a new <code>RefactoringStatus</code> with one <code>FATAL</code> entry
 * filled with the given message.
 *
 * @param msg the message of the fatal entry
 * @return the refactoring status
 *
 * @see RefactoringStatusEntry
 */
public static RefactoringStatus createFatalErrorStatus(String msg) {
  return createStatus(FATAL, msg, null, null, RefactoringStatusEntry.NO_CODE, null);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ltk.core.refactoring

/**
 * Creates a new <code>RefactoringStatus</code> with one <code>WARNING</code> entry
 * filled with the given message.
 *
 * @param msg the message of the warning entry
 * @return the refactoring status
 *
 * @see RefactoringStatusEntry
 */
public static RefactoringStatus createWarningStatus(String msg) {
  return createStatus(WARNING, msg, null, null, RefactoringStatusEntry.NO_CODE, null);
}

代码示例来源:origin: org.eclipse/org.eclipse.ltk.core.refactoring

/**
 * Creates a new <code>RefactoringStatus</code> with one <code>WARNING</code> entry
 * filled with the given message.
 * 
 * @param msg the message of the warning entry
 * @return the refactoring status
 * 
 * @see RefactoringStatusEntry
 */
public static RefactoringStatus createWarningStatus(String msg) {
  return createStatus(WARNING, msg, null, null, RefactoringStatusEntry.NO_CODE, null);
}

代码示例来源:origin: org.eclipse/org.eclipse.ltk.core.refactoring

/**
 * Creates a new <code>RefactoringStatus</code> with one <code>ERROR</code> entry
 * filled with the given message.
 * 
 * @param msg the message of the error entry
 * @return the refactoring status
 * 
 * @see RefactoringStatusEntry
 */
public static RefactoringStatus createErrorStatus(String msg) {
  return createStatus(ERROR, msg, null, null, RefactoringStatusEntry.NO_CODE, null);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ltk.core.refactoring

/**
 * Creates a new <code>RefactoringStatus</code> with one <code>ERROR</code> entry
 * filled with the given message.
 *
 * @param msg the message of the error entry
 * @return the refactoring status
 *
 * @see RefactoringStatusEntry
 */
public static RefactoringStatus createErrorStatus(String msg) {
  return createStatus(ERROR, msg, null, null, RefactoringStatusEntry.NO_CODE, null);
}

代码示例来源:origin: org.eclipse/org.eclipse.ltk.core.refactoring

/**
 * Creates a <code>RefactoringStatus</code> with one <code>FATAL</code> entry
 * fill with the given message and context.
 * 
 * @param msg the message of the fatal entry
 * @param context the context of the fatal entry
 * @return the refactoring status
 * 
 * @see RefactoringStatusEntry
 */
public static RefactoringStatus createFatalErrorStatus(String msg, RefactoringStatusContext context) {
  return createStatus(FATAL, msg, context, null, RefactoringStatusEntry.NO_CODE, null);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ltk.core.refactoring

/**
 * Creates a <code>RefactoringStatus</code> with one <code>WARNING</code> entry
 * fill with the given message and context.
 *
 * @param msg the message of the warning entry
 * @param context the context of the warning entry
 * @return the refactoring status
 *
 * @see RefactoringStatusEntry
 */
public static RefactoringStatus createWarningStatus(String msg, RefactoringStatusContext context) {
  return createStatus(WARNING, msg, context, null, RefactoringStatusEntry.NO_CODE, null);
}

代码示例来源:origin: org.eclipse/org.eclipse.ltk.core.refactoring

/**
 * Creates a new <code>RefactoringStatus</code> with one <code>INFO</code> entry
 * filled with the given message and context.
 * 
 * @param msg the message of the info entry
 * @param context the context of the info entry
 * @return the refactoring status
 * 
 * @see RefactoringStatusEntry
 */
public static RefactoringStatus createInfoStatus(String msg, RefactoringStatusContext context) {
  return createStatus(INFO, msg, context, null, RefactoringStatusEntry.NO_CODE, null);
}

代码示例来源:origin: org.eclipse/org.eclipse.ltk.core.refactoring

/**
 * Creates a <code>RefactoringStatus</code> with one <code>WARNING</code> entry
 * fill with the given message and context.
 * 
 * @param msg the message of the warning entry
 * @param context the context of the warning entry
 * @return the refactoring status
 * 
 * @see RefactoringStatusEntry
 */
public static RefactoringStatus createWarningStatus(String msg, RefactoringStatusContext context) {
  return createStatus(WARNING, msg, context, null, RefactoringStatusEntry.NO_CODE, null);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

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();
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private RefactoringStatus checkExpressionFragmentIsRValue() {
  switch(Checks.checkExpressionIsRValue(fSelectedExpression)) {
    case Checks.NOT_RVALUE_MISC:
      return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_select, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE, null); 
    case Checks.NOT_RVALUE_VOID:
      return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_no_void, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE_VOID, null); 
    case Checks.IS_RVALUE:
      return new RefactoringStatus();
    default:
      Assert.isTrue(false); return null;
  }        
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private RefactoringStatus checkExpressionFragmentIsRValue() {
  switch(Checks.checkExpressionIsRValue(fSelectedExpression)) {
    case Checks.IS_RVALUE_GUESSED:
    case Checks.NOT_RVALUE_MISC:
      return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_select, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE, null);
    case Checks.NOT_RVALUE_VOID:
      return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_no_void, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE_VOID, null);
    case Checks.IS_RVALUE:
      return new RefactoringStatus();
    default:
      Assert.isTrue(false); return null;
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private RefactoringStatus checkExpressionFragmentIsRValue() {
  switch(Checks.checkExpressionIsRValue(fSelectedExpression)) {
    case Checks.IS_RVALUE_GUESSED:
    case Checks.NOT_RVALUE_MISC:
      return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_select, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE, null);
    case Checks.NOT_RVALUE_VOID:
      return RefactoringStatus.createStatus(RefactoringStatus.FATAL, RefactoringCoreMessages.IntroduceParameterRefactoring_no_void, null, Corext.getPluginId(), RefactoringStatusCodes.EXPRESSION_NOT_RVALUE_VOID, null);
    case Checks.IS_RVALUE:
      return new RefactoringStatus();
    default:
      Assert.isTrue(false); return null;
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

private RefactoringStatus findField() throws JavaModelException {
  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;
}
private RefactoringStatus findDeclaration() throws JavaModelException {

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

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();
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

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();
}

代码示例来源:origin: eclipse/eclipse.jdt.ls

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, "", RefactoringStatusCodes.OVERRIDES_ANOTHER_METHOD, overrides);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

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);
}

相关文章