当前位置: 首页>>代码示例>>Java>>正文


Java FindBundle类代码示例

本文整理汇总了Java中com.intellij.find.FindBundle的典型用法代码示例。如果您正苦于以下问题:Java FindBundle类的具体用法?Java FindBundle怎么用?Java FindBundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


FindBundle类属于com.intellij.find包,在下文中一共展示了FindBundle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createFindWhatPanel

import com.intellij.find.FindBundle; //导入依赖的package包/类
@Override
protected JPanel createFindWhatPanel() {
  JPanel findWhatPanel = new JPanel();

  findWhatPanel.setBorder(IdeBorderFactory.createTitledBorder(FindBundle.message("find.what.group"), true));
  findWhatPanel.setLayout(new BoxLayout(findWhatPanel, BoxLayout.Y_AXIS));

  myCbUsages = addCheckboxToPanel(FindBundle.message("find.what.usages.checkbox"), getFindUsagesOptions().isUsages, findWhatPanel, true);

  PsiClass psiClass = (PsiClass)getPsiElement();
  myCbMethodsUsages = addCheckboxToPanel(FindBundle.message("find.what.methods.usages.checkbox"), getFindUsagesOptions().isMethodsUsages, findWhatPanel, true);

  if (!psiClass.isAnnotationType()) {
    myCbFieldsUsages = addCheckboxToPanel(FindBundle.message("find.what.fields.usages.checkbox"), getFindUsagesOptions().isFieldsUsages, findWhatPanel, true);
    if (psiClass.isInterface()){
      myCbImplementingClasses = addCheckboxToPanel(FindBundle.message("find.what.implementing.classes.checkbox"), getFindUsagesOptions().isImplementingClasses, findWhatPanel, true);
      myCbDerivedInterfaces = addCheckboxToPanel(FindBundle.message("find.what.derived.interfaces.checkbox"), getFindUsagesOptions().isDerivedInterfaces, findWhatPanel, true);
    }
    else if (!psiClass.hasModifierProperty(PsiModifier.FINAL)){
      myCbDerivedClasses = addCheckboxToPanel(FindBundle.message("find.what.derived.classes.checkbox"), getFindUsagesOptions().isDerivedClasses, findWhatPanel, true);
    }
  }
  return findWhatPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:FindClassUsagesDialog.java

示例2: createFindWhatPanel

import com.intellij.find.FindBundle; //导入依赖的package包/类
@Override
protected JPanel createFindWhatPanel() {
  final JPanel findWhatPanel = new JPanel();
  findWhatPanel.setBorder(IdeBorderFactory.createTitledBorder(FindBundle.message("find.what.group"), true));
  findWhatPanel.setLayout(new BoxLayout(findWhatPanel, BoxLayout.Y_AXIS));

  myCbUsages = addCheckboxToPanel(FindBundle.message("find.what.usages.checkbox")       , myFindUsagesOptions.isUsages,            findWhatPanel,  true);
  //final ThrowSearchUtil.Root[] searchRoots = ThrowSearchUtil.getSearchRoots(getPsiElement ());

  //final PsiThrowStatement throwStatement = (PsiThrowStatement)getPsiElement();
  //final boolean exactExnType = ThrowSearchUtil.isExactExnType(throwStatement.getException ());
  //if (exactExnType) {
  //  myCbStrict.setEnabled(false);
  //}
  myHasFindWhatPanel = true;
  return findWhatPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:FindThrowUsagesDialog.java

示例3: SearchDialog

import com.intellij.find.FindBundle; //导入依赖的package包/类
public SearchDialog(SearchContext searchContext, boolean showScope, boolean runFindActionOnClose) {
  super(searchContext.getProject(), true);

  if (showScope) setModal(false);
  myShowScopePanel = showScope;
  myRunFindActionOnClose = runFindActionOnClose;
  this.searchContext = searchContext;
  setTitle(getDefaultTitle());

  if (runFindActionOnClose) {
    setOKButtonText(FindBundle.message("find.dialog.find.button"));
  }

  existingTemplatesComponent = ExistingTemplatesComponent.getInstance(this.searchContext.getProject());
  model = new SearchModel(createConfiguration());

  init();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:SearchDialog.java

示例4: chooseAmbiguousTargetAndPerform

import com.intellij.find.FindBundle; //导入依赖的package包/类
static void chooseAmbiguousTargetAndPerform(@NotNull final Project project,
                                            final Editor editor,
                                            @NotNull PsiElementProcessor<PsiElement> processor) {
  if (editor == null) {
    Messages.showMessageDialog(project, FindBundle.message("find.no.usages.at.cursor.error"), CommonBundle.getErrorTitle(),
                               Messages.getErrorIcon());
  }
  else {
    int offset = editor.getCaretModel().getOffset();
    boolean chosen = GotoDeclarationAction.chooseAmbiguousTarget(editor, offset, processor, FindBundle.message("find.usages.ambiguous.title"), null);
    if (!chosen) {
      ApplicationManager.getApplication().invokeLater(new Runnable() {
        @Override
        public void run() {
          if (editor.isDisposed() || !editor.getComponent().isShowing()) return;
          HintManager.getInstance().showErrorHint(editor, FindBundle.message("find.no.usages.at.cursor.error"));
        }
      }, project.getDisposed());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:FindUsagesAction.java

示例5: createCenterPanel

import com.intellij.find.FindBundle; //导入依赖的package包/类
@Override
protected JComponent createCenterPanel() {
  JPanel panel = new JPanel(new GridBagLayout());

  JPanel _panel = new JPanel(new BorderLayout());
  panel.add(_panel, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
                                           new Insets(0, 0, 0, 0), 0, 0));

  if (myIsShowInNewTabVisible) {
    myCbToOpenInNewTab = new JCheckBox(FindBundle.message("find.open.in.new.tab.checkbox"));
    myCbToOpenInNewTab.setSelected(myToShowInNewTab);
    myCbToOpenInNewTab.setEnabled(myIsShowInNewTabEnabled);
    _panel.add(myCbToOpenInNewTab, BorderLayout.EAST);
  }

  JPanel allOptionsPanel = createAllOptionsPanel();
  if (allOptionsPanel != null) {
    panel.add(allOptionsPanel, new GridBagConstraints(0, 0, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                                                      new Insets(0, 0, 0, 0), 0, 0));
  }
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:AbstractFindUsagesDialog.java

示例6: findUsageInFile

import com.intellij.find.FindBundle; //导入依赖的package包/类
private boolean findUsageInFile(@NotNull FileEditor editor, @NotNull FileSearchScope direction) {
  ApplicationManager.getApplication().assertIsDispatchThread();

  if (myLastSearchInFileData == null) return false;
  PsiElement[] primaryElements = myLastSearchInFileData.getPrimaryElements();
  PsiElement[] secondaryElements = myLastSearchInFileData.getSecondaryElements();
  if (primaryElements.length == 0) {//all elements have been invalidated
      Messages.showMessageDialog(myProject, FindBundle.message("find.searched.elements.have.been.changed.error"),
                                 FindBundle.message("cannot.search.for.usages.title"), Messages.getInformationIcon());
      // SCR #10022
      //clearFindingNextUsageInFile();
      return false;
  }

  //todo
  TextEditor textEditor = (TextEditor)editor;
  Document document = textEditor.getEditor().getDocument();
  PsiFile psiFile = PsiDocumentManager.getInstance(myProject).getPsiFile(document);
  if (psiFile == null) return false;

  final FindUsagesHandler handler = getFindUsagesHandler(primaryElements[0], false);
  if (handler == null) return false;
  findUsagesInEditor(primaryElements, secondaryElements, handler, psiFile, direction, myLastSearchInFileData.myOptions, textEditor);
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:FindUsagesManager.java

示例7: createPresentation

import com.intellij.find.FindBundle; //导入依赖的package包/类
@NotNull
private static UsageViewPresentation createPresentation(@NotNull PsiElement psiElement,
                                                        @NotNull FindUsagesOptions options,
                                                        boolean toOpenInNewTab) {
  UsageViewPresentation presentation = new UsageViewPresentation();
  String scopeString = options.searchScope.getDisplayName();
  presentation.setScopeText(scopeString);
  String usagesString = generateUsagesString(options);
  presentation.setUsagesString(usagesString);
  String title = FindBundle.message("find.usages.of.element.in.scope.panel.title", usagesString, UsageViewUtil.getLongName(psiElement),
                       scopeString);
  presentation.setTabText(title);
  presentation.setTabName(FindBundle.message("find.usages.of.element.tab.name", usagesString, UsageViewUtil.getShortName(psiElement)));
  presentation.setTargetsNodeText(StringUtil.capitalize(UsageViewUtil.getType(psiElement)));
  presentation.setOpenInNewTab(toOpenInNewTab);
  return presentation;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:FindUsagesManager.java

示例8: FindDialog

import com.intellij.find.FindBundle; //导入依赖的package包/类
public FindDialog(@NotNull Project project, @NotNull FindModel model, @NotNull Consumer<FindModel> myOkHandler){
  super(project, true);
  myProject = project;
  myModel = model;

  this.myOkHandler = myOkHandler;

  updateTitle();
  setOKButtonText(FindBundle.message("find.button"));
  init();
  initByModel();
  updateReplaceVisibility();

  if (haveResultsPreview()) {
    ApplicationManager.getApplication().invokeLater(new Runnable() {
      @Override
      public void run() {
        scheduleResultsUpdate();
      }
    }, ModalityState.any());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:FindDialog.java

示例9: updateTitle

import com.intellij.find.FindBundle; //导入依赖的package包/类
private void updateTitle() {
  if (myModel.isReplaceState()){
    if (myModel.isMultipleFiles()){
      setTitle(FindBundle.message("find.replace.in.project.dialog.title"));
    }
    else{
      setTitle(FindBundle.message("find.replace.text.dialog.title"));
    }
  }
  else{
    setButtonsMargin(null);
    if (myModel.isMultipleFiles()){
      setTitle(FindBundle.message("find.in.path.dialog.title"));
    }
    else{
      setTitle(FindBundle.message("find.text.dialog.title"));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:FindDialog.java

示例10: createFilterPanel

import com.intellij.find.FindBundle; //导入依赖的package包/类
@NotNull
private JComponent createFilterPanel() {
  JPanel filterPanel = new JPanel();
  filterPanel.setLayout(new BorderLayout());
  filterPanel.setBorder(IdeBorderFactory.createTitledBorder(FindBundle.message("find.filter.file.name.group"),
                                                            true));

  myFileFilter = new ComboBox(100);
  initCombobox(myFileFilter);
  filterPanel.add(myUseFileFilter = createCheckbox(FindBundle.message("find.filter.file.mask.checkbox")),BorderLayout.WEST);
  filterPanel.add(myFileFilter,BorderLayout.CENTER);
  initFileFilter(myFileFilter, myUseFileFilter);
  myUseFileFilter.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      scheduleResultsUpdate();
      validateFindButton();
    }
  });
  return filterPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:FindDialog.java

示例11: getPresentableName

import com.intellij.find.FindBundle; //导入依赖的package包/类
public static String getPresentableName(@NotNull FindModel.SearchContext searchContext) {
  @PropertyKey(resourceBundle = "messages.FindBundle") String messageKey = null;
  if (searchContext == FindModel.SearchContext.ANY) {
    messageKey = "find.context.anywhere.scope.label";
  } else if (searchContext == FindModel.SearchContext.EXCEPT_COMMENTS) {
    messageKey = "find.context.except.comments.scope.label";
  } else if (searchContext == FindModel.SearchContext.EXCEPT_STRING_LITERALS) {
    messageKey = "find.context.except.literals.scope.label";
  } else if (searchContext == FindModel.SearchContext.EXCEPT_COMMENTS_AND_STRING_LITERALS) {
    messageKey = "find.context.except.comments.and.literals.scope.label";
  } else if (searchContext == FindModel.SearchContext.IN_COMMENTS) {
    messageKey = "find.context.in.comments.scope.label";
  } else if (searchContext == FindModel.SearchContext.IN_STRING_LITERALS) {
    messageKey = "find.context.in.literals.scope.label";
  }
  return messageKey != null ? FindBundle.message(messageKey) : searchContext.toString();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:FindDialog.java

示例12: createDirectionPanel

import com.intellij.find.FindBundle; //导入依赖的package包/类
@NotNull
private JPanel createDirectionPanel() {
  JPanel directionPanel = new JPanel();
  directionPanel.setBorder(IdeBorderFactory.createTitledBorder(FindBundle.message("find.direction.group"), true));
  directionPanel.setLayout(new BoxLayout(directionPanel, BoxLayout.Y_AXIS));

  myRbForward = new JRadioButton(FindBundle.message("find.direction.forward.radio"), true);
  directionPanel.add(myRbForward);
  myRbBackward = new JRadioButton(FindBundle.message("find.direction.backward.radio"));
  directionPanel.add(myRbBackward);
  ButtonGroup bgDirection = new ButtonGroup();
  bgDirection.add(myRbForward);
  bgDirection.add(myRbBackward);

  return directionPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:FindDialog.java

示例13: createScopePanel

import com.intellij.find.FindBundle; //导入依赖的package包/类
@NotNull
private JPanel createScopePanel() {
  JPanel scopePanel = new JPanel();
  scopePanel.setBorder(IdeBorderFactory.createTitledBorder(FindBundle.message("find.scope.group"), true));
  scopePanel.setLayout(new BoxLayout(scopePanel, BoxLayout.Y_AXIS));

  myRbGlobal = new JRadioButton(FindBundle.message("find.scope.global.radio"), true);
  scopePanel.add(myRbGlobal);
  myRbSelectedText = new JRadioButton(FindBundle.message("find.scope.selected.text.radio"));
  scopePanel.add(myRbSelectedText);
  ButtonGroup bgScope = new ButtonGroup();
  bgScope.add(myRbGlobal);
  bgScope.add(myRbSelectedText);

  ActionListener actionListener = new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      updateControls();
    }
  };
  myRbGlobal.addActionListener(actionListener);
  myRbSelectedText.addActionListener(actionListener);

  return scopePanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:FindDialog.java

示例14: createOriginPanel

import com.intellij.find.FindBundle; //导入依赖的package包/类
@NotNull
private JPanel createOriginPanel() {
  JPanel originPanel = new JPanel();
  originPanel.setBorder(IdeBorderFactory.createTitledBorder(FindBundle.message("find.origin.group"), true));
  originPanel.setLayout(new BoxLayout(originPanel, BoxLayout.Y_AXIS));

  myRbFromCursor = new JRadioButton(FindBundle.message("find.origin.from.cursor.radio"), true);
  originPanel.add(myRbFromCursor);
  myRbEntireScope = new JRadioButton(FindBundle.message("find.origin.entire.scope.radio"));
  originPanel.add(myRbEntireScope);
  ButtonGroup bgOrigin = new ButtonGroup();
  bgOrigin.add(myRbFromCursor);
  bgOrigin.add(myRbEntireScope);

  return originPanel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:FindDialog.java

示例15: restorePsiElements

import com.intellij.find.FindBundle; //导入依赖的package包/类
@Nullable
private PsiElement[] restorePsiElements(SearchData searchData, final boolean showErrorMessage) {
  if (searchData == null) return null;
  SmartPsiElementPointer[] lastSearchElements = searchData.myElements;
  if (lastSearchElements == null) return null;
  List<PsiElement> elements = new ArrayList<PsiElement>();
  for (SmartPsiElementPointer pointer : lastSearchElements) {
    PsiElement element = pointer.getElement();
    if (element != null) elements.add(element);
  }
  if (elements.isEmpty() && showErrorMessage) {
    Messages.showMessageDialog(myProject, FindBundle.message("find.searched.elements.have.been.changed.error"),
                               FindBundle.message("cannot.search.for.usages.title"), Messages.getInformationIcon());
    // SCR #10022
    //clearFindingNextUsageInFile();
    return PsiElement.EMPTY_ARRAY;
  }

  return PsiUtilCore.toPsiElementArray(elements);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:FindUsagesManager.java


注:本文中的com.intellij.find.FindBundle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。