當前位置: 首頁>>代碼示例>>Java>>正文


Java Corext類代碼示例

本文整理匯總了Java中org.eclipse.jdt.internal.corext.Corext的典型用法代碼示例。如果您正苦於以下問題:Java Corext類的具體用法?Java Corext怎麽用?Java Corext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Corext類屬於org.eclipse.jdt.internal.corext包,在下文中一共展示了Corext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: checkIfOverridesAnother

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:23,代碼來源:MethodChecks.java

示例2: checkIfComesFromInterface

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:25,代碼來源:MethodChecks.java

示例3: checkExpressionFragmentIsRValue

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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;
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:27,代碼來源:ExtractTempRefactoring.java

示例4: checkInitializer

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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();
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:18,代碼來源:InlineConstantRefactoring.java

示例5: checkStaticFinalConstantNameSelected

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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();
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:13,代碼來源:InlineConstantRefactoring.java

示例6: checkInitialConditions

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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();
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:36,代碼來源:InlineConstantRefactoring.java

示例7: findField

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:14,代碼來源:InlineConstantRefactoring.java

示例8: addEntry

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的package包/類
private void addEntry(RefactoringStatus result, String message, int code, int severity) {
  result.addEntry(
      new RefactoringStatusEntry(
          severity,
          message,
          JavaStatusContext.create(fCUnit, fInvocation),
          Corext.getPluginId(),
          code,
          null));
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:11,代碼來源:CallInliner.java

示例9: checkExpressionFragmentIsRValue

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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;
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:30,代碼來源:ExtractConstantRefactoring.java

示例10: checkIfOverridesAnother

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:11,代碼來源:MethodChecks.java

示例11: checkIfComesFromInterface

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:12,代碼來源:MethodChecks.java

示例12: checkExpressionFragmentIsRValue

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的package包/類
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;
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:14,代碼來源:IntroduceParameterRefactoring.java

示例13: checkExpressionFragmentIsRValue

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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;
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:15,代碼來源:ExtractTempRefactoring.java

示例14: checkInitialConditions

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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();
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:34,代碼來源:InlineConstantRefactoring.java

示例15: findField

import org.eclipse.jdt.internal.corext.Corext; //導入依賴的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;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:8,代碼來源:InlineConstantRefactoring.java


注:本文中的org.eclipse.jdt.internal.corext.Corext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。