当前位置: 首页>>代码示例>>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;未经允许,请勿转载。