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


Java RefactorJBundle.message方法代碼示例

本文整理匯總了Java中com.intellij.refactoring.RefactorJBundle.message方法的典型用法代碼示例。如果您正苦於以下問題:Java RefactorJBundle.message方法的具體用法?Java RefactorJBundle.message怎麽用?Java RefactorJBundle.message使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.refactoring.RefactorJBundle的用法示例。


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

示例1: invoke

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
private static void invoke(final PsiField field, Editor editor) {
  final Project project = field.getProject();
  final Set<PsiMethod> delegating = DelegationUtils.getDelegatingMethodsForField(field);
  if (delegating.isEmpty()) {
    final String message =
      RefactorJBundle.message("cannot.perform.the.refactoring") + RefactorJBundle.message("field.selected.is.not.used.as.a.delegate");
    CommonRefactoringUtil.showErrorHint(project, editor, message, null, getHelpID());
    return;
  }

  MemberInfo[] infos = new MemberInfo[delegating.size()];
  int i = 0;
  for (PsiMethod method : delegating) {
    final MemberInfo memberInfo = new MemberInfo(method);
    memberInfo.setChecked(true);
    memberInfo.setToAbstract(method.findDeepestSuperMethods().length == 0);
    infos[i++] = memberInfo;
  }
  new RemoveMiddlemanDialog(field, infos).show();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:RemoveMiddlemanHandler.java

示例2: getCannotRefactorMessage

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
private static String getCannotRefactorMessage(PsiClass containingClass) {
  if (containingClass == null) {
    return RefactorJBundle.message("the.caret.should.be.positioned.within.a.class.to.be.refactored");
  }
  if (containingClass.isInterface()) {
    return RefactorJBundle.message("the.selected.class.is.an.interface");
  }
  if (containingClass.isEnum()) {
    return RefactorJBundle.message("the.selected.class.is.an.enumeration");
  }
  if (containingClass.isAnnotationType()) {
    return RefactorJBundle.message("the.selected.class.is.an.annotation.type");
  }
  if (classIsInner(containingClass) && !containingClass.hasModifierProperty(PsiModifier.STATIC)) {
    return RefactorJBundle.message("the.refactoring.is.not.supported.on.non.static.inner.classes");
  }
  if (classIsTrivial(containingClass)) {
    return RefactorJBundle.message("the.selected.class.has.no.members.to.extract");
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:22,代碼來源:ExtractClassHandler.java

示例3: invoke

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
public void invoke(@NotNull Project project, Editor editor, PsiFile file, DataContext dataContext) {
  final ScrollingModel scrollingModel = editor.getScrollingModel();
  scrollingModel.scrollToCaret(ScrollType.MAKE_VISIBLE);
  PsiMethod selectedMethod = getSelectedMethod(editor, file, dataContext);
  if (selectedMethod == null) {
    final String message = RefactorJBundle.message("cannot.perform.the.refactoring") +
                           RefactorJBundle.message("the.caret.should.be.positioned.at.the.name.of.the.method.to.be.refactored");
    CommonRefactoringUtil.showErrorHint(project, editor, message, REFACTORING_NAME, HelpID.IntroduceParameterObject);
    return;
  }
  invoke(project, selectedMethod, editor);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:IntroduceParameterObjectHandler.java

示例4: getErrorMessage

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
private static String getErrorMessage(PsiMethod newMethod) {
  final PsiParameter[] parameters = newMethod.getParameterList().getParameters();
  if (parameters.length == 0) {
   return RefactorJBundle.message("cannot.perform.the.refactoring") +
          RefactorJBundle.message("method.selected.has.no.parameters");
  }
  if (newMethod instanceof PsiCompiledElement) {
    return RefactorJBundle.message("cannot.perform.the.refactoring") +
           RefactorJBundle.message("the.selected.method.cannot.be.wrapped.because.it.is.defined.in.a.non.project.class");
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:13,代碼來源:IntroduceParameterObjectHandler.java

示例5: getConflictMessage

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
@Override
public String getConflictMessage() {
  if (!myGenerateAccessors && (!paramsNeedingSetters.isEmpty() || !paramsNeedingGetters.isEmpty())) {
    final StringBuffer buf = new StringBuffer();
    appendConflicts(buf, paramsNeedingGetters);
    appendConflicts(buf, paramsNeedingSetters);
    return RefactorJBundle.message("cannot.perform.the.refactoring") + buf.toString();
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:AppendAccessorsUsageInfo.java

示例6: invoke

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
public void invoke(@NotNull Project project, Editor editor, PsiFile file, DataContext dataContext) {
  final ScrollingModel scrollingModel = editor.getScrollingModel();
  scrollingModel.scrollToCaret(ScrollType.MAKE_VISIBLE);
  final PsiElement element = LangDataKeys.PSI_ELEMENT.getData(dataContext);
  PsiMethod selectedMethod = null;
  if (element instanceof PsiMethod) {
    selectedMethod = (PsiMethod)element;
  }
  else if (element instanceof PsiParameter && ((PsiParameter)element).getDeclarationScope() instanceof PsiMethod){
    selectedMethod = (PsiMethod)((PsiParameter)element).getDeclarationScope();
  }
  else {
    final CaretModel caretModel = editor.getCaretModel();
    final int position = caretModel.getOffset();
    final PsiElement elementAt = file.findElementAt(position);
    final PsiMethodCallExpression methodCallExpression =
     PsiTreeUtil.getParentOfType(elementAt, PsiMethodCallExpression.class);
    if (methodCallExpression != null) {
      selectedMethod = methodCallExpression.resolveMethod();
    } else {
      final PsiParameterList parameterList = PsiTreeUtil.getParentOfType(elementAt, PsiParameterList.class);
      if (parameterList != null && parameterList.getParent() instanceof PsiMethod) {
        selectedMethod = (PsiMethod)parameterList.getParent();
      }
    }
  }
  if (selectedMethod == null) {
    final String message = RefactorJBundle.message("cannot.perform.the.refactoring") +
                           RefactorJBundle.message("the.caret.should.be.positioned.at.the.name.of.the.method.to.be.refactored");
    CommonRefactoringUtil.showErrorHint(project, editor, message, REFACTORING_NAME, HelpID.IntroduceParameterObject);
    return;
  }
  invoke(project, selectedMethod, editor);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:35,代碼來源:IntroduceParameterObjectHandler.java

示例7: invoke

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
public void invoke(@NotNull Project project, Editor editor, PsiFile file, DataContext dataContext) {
  final ScrollingModel scrollingModel = editor.getScrollingModel();
  scrollingModel.scrollToCaret(ScrollType.MAKE_VISIBLE);
  final PsiElement element = dataContext.getData(LangDataKeys.PSI_ELEMENT);
  PsiMethod selectedMethod = null;
  if (element instanceof PsiMethod) {
    selectedMethod = (PsiMethod)element;
  }
  else if (element instanceof PsiParameter && ((PsiParameter)element).getDeclarationScope() instanceof PsiMethod){
    selectedMethod = (PsiMethod)((PsiParameter)element).getDeclarationScope();
  }
  else {
    final CaretModel caretModel = editor.getCaretModel();
    final int position = caretModel.getOffset();
    final PsiElement elementAt = file.findElementAt(position);
    final PsiMethodCallExpression methodCallExpression =
     PsiTreeUtil.getParentOfType(elementAt, PsiMethodCallExpression.class);
    if (methodCallExpression != null) {
      selectedMethod = methodCallExpression.resolveMethod();
    } else {
      final PsiParameterList parameterList = PsiTreeUtil.getParentOfType(elementAt, PsiParameterList.class);
      if (parameterList != null && parameterList.getParent() instanceof PsiMethod) {
        selectedMethod = (PsiMethod)parameterList.getParent();
      }
    }
  }
  if (selectedMethod == null) {
    final String message = RefactorJBundle.message("cannot.perform.the.refactoring") +
                           RefactorJBundle.message("the.caret.should.be.positioned.at.the.name.of.the.method.to.be.refactored");
    CommonRefactoringUtil.showErrorHint(project, editor, message, REFACTORING_NAME, HelpID.IntroduceParameterObject);
    return;
  }
  invoke(project, selectedMethod, editor);
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:35,代碼來源:IntroduceParameterObjectHandler.java

示例8: getCommandName

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
protected String getCommandName() {
  final PsiClass containingClass = myMethod.getContainingClass();
  return RefactorJBundle.message("wrapped.return.command.name", myClassName, containingClass.getName(), '.', myMethod.getName());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:WrapReturnValueProcessor.java

示例9: getProcessedElementsHeader

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
public String getProcessedElementsHeader(){
    return RefactorJBundle.message("method.whose.return.are.to.wrapped");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:WrapReturnValueUsageViewDescriptor.java

示例10: getCodeReferencesText

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
public String getCodeReferencesText(int usagesCount, int filesCount){
    return RefactorJBundle.message("references.to.be.modified.usage.view",
            MyUsageViewUtil.getUsageCountInfo(usagesCount, filesCount, RefactorJBundle.message("reference")));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:WrapReturnValueUsageViewDescriptor.java

示例11: getProcessedElementsHeader

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
public String getProcessedElementsHeader() {
    return RefactorJBundle.message("method.whose.parameters.are.to.wrapped");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:IntroduceParameterObjectUsageViewDescriptor.java

示例12: getCodeReferencesText

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
public String getCodeReferencesText(int usagesCount, int filesCount) {
    return RefactorJBundle.message("references.to.be.modified") + MyUsageViewUtil.getUsageCountInfo(usagesCount, filesCount, "reference");
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:IntroduceParameterObjectUsageViewDescriptor.java

示例13: getCommandName

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
protected String getCommandName() {
  final PsiClass containingClass = method.getContainingClass();
  return RefactorJBundle.message("introduced.parameter.class.command.name", className, containingClass.getName(), method.getName());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:IntroduceParameterObjectProcessor.java

示例14: getCommandName

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
protected String getCommandName() {
  return RefactorJBundle.message("exposed.delegation.command.name", containingClass.getName(), '.', field.getName());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:RemoveMiddlemanProcessor.java

示例15: getCodeReferencesText

import com.intellij.refactoring.RefactorJBundle; //導入方法依賴的package包/類
public String getCodeReferencesText(int usagesCount, int filesCount) {
  return RefactorJBundle
    .message("references.to.expose.usage.view", MyUsageViewUtil.getUsageCountInfo(usagesCount, filesCount, "reference"));
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:5,代碼來源:RemoveMiddlemanUsageViewDescriptor.java


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