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


Java DialogBuilder.showModal方法代码示例

本文整理汇总了Java中com.intellij.openapi.ui.DialogBuilder.showModal方法的典型用法代码示例。如果您正苦于以下问题:Java DialogBuilder.showModal方法的具体用法?Java DialogBuilder.showModal怎么用?Java DialogBuilder.showModal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.ui.DialogBuilder的用法示例。


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

示例1: show

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
/**
 * Show the search dialog
 * @param searchTerm
 */
public void show(@Nullable final String searchTerm) {

    final JTextField searchTextField = new JTextField(searchTerm);

    JPanel panel = new JPanel(new BorderLayout());
    panel.add(new JLabel(UI5Bundle.getString("api.searchterm")), BorderLayout.WEST);
    panel.add(searchTextField, BorderLayout.CENTER);

    final DialogBuilder dialogBuilder = new DialogBuilder(project);
    dialogBuilder.setTitle(UI5Bundle.getString("api.search"));
    dialogBuilder.setCenterPanel(panel);
    dialogBuilder.addAction(getSearchAction(dialogBuilder, searchTextField.getText()));
    dialogBuilder.addCancelAction();
    dialogBuilder.showModal(true);
}
 
开发者ID:asebak,项目名称:ui5-intellij-plugin,代码行数:20,代码来源:UI5ApiSearchDialog.java

示例2: showDiffDialog

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
static void showDiffDialog(DialogBuilder builder, Collection hints) {
  builder.showModal(!hints.contains(DiffTool.HINT_SHOW_NOT_MODAL_DIALOG));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:FrameDiffTool.java

示例3: editPattern

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
private void editPattern(@Nullable final String item) {
  final FileType type = myRecognizedFileType.getSelectedFileType();
  if (type == null) return;

  final String title =
    item == null
    ? FileTypesBundle.message("filetype.edit.add.pattern.title")
    : FileTypesBundle.message("filetype.edit.edit.pattern.title");

  final Language oldLanguage = item == null ? null : myTempTemplateDataLanguages.findAssociatedFileType(item);
  final FileTypePatternDialog dialog = new FileTypePatternDialog(item, type, oldLanguage);
  final DialogBuilder builder = new DialogBuilder(myPatterns);
  builder.setPreferredFocusComponent(dialog.getPatternField());
  builder.setCenterPanel(dialog.getMainPanel());
  builder.setTitle(title);
  builder.showModal(true);
  if (builder.getDialogWrapper().isOK()) {
    final String pattern = dialog.getPatternField().getText();
    if (StringUtil.isEmpty(pattern)) return;

    final FileNameMatcher matcher = FileTypeManager.parseFromString(pattern);
    FileType registeredFileType = findExistingFileType(matcher);
    if (registeredFileType != null && registeredFileType != type) {
      if (registeredFileType.isReadOnly()) {
        Messages.showMessageDialog(myPatterns.myPatternsList,
                                   FileTypesBundle.message("filetype.edit.add.pattern.exists.error", registeredFileType.getDescription()),
                                   title, Messages.getErrorIcon());
        return;
      }
      else {
        if (Messages.OK == Messages.showOkCancelDialog(myPatterns.myPatternsList, FileTypesBundle.message("filetype.edit.add.pattern.exists.message",
                                                                                             registeredFileType.getDescription()),
                                             FileTypesBundle.message("filetype.edit.add.pattern.exists.title"),
                                             FileTypesBundle.message("filetype.edit.add.pattern.reassign.button"),
                                             CommonBundle.getCancelButtonText(), Messages.getQuestionIcon())) {
          myTempPatternsTable.removeAssociation(matcher, registeredFileType);
          if (oldLanguage != null) {
            myTempTemplateDataLanguages.removeAssociation(matcher, oldLanguage);
          }
          myReassigned.put(matcher, registeredFileType);
        }
        else {
          return;
        }
      }
    }

    if (item != null) {
      final FileNameMatcher oldMatcher = FileTypeManager.parseFromString(item);
      myTempPatternsTable.removeAssociation(oldMatcher, type);
      if (oldLanguage != null) {
        myTempTemplateDataLanguages.removeAssociation(oldMatcher, oldLanguage);
      }
    }
    myTempPatternsTable.addAssociation(matcher, type);
    myTempTemplateDataLanguages.addAssociation(matcher, dialog.getTemplateDataLanguage());

    updateExtensionList();
    final int index = myPatterns.getListModel().indexOf(matcher.getPresentableString());
    if (index >= 0) {
      ScrollingUtil.selectItem(myPatterns.myPatternsList, index);
    }
    myPatterns.myPatternsList.requestFocus();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:66,代码来源:FileTypeConfigurable.java

示例4: editPattern

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
private void editPattern(@Nullable final String item) {
  final FileType type = myRecognizedFileType.getSelectedFileType();
  if (type == null) return;

  final String title =
    item == null
    ? FileTypesBundle.message("filetype.edit.add.pattern.title")
    : FileTypesBundle.message("filetype.edit.edit.pattern.title");

  final Language oldLanguage = item == null ? null : myTempTemplateDataLanguages.findAssociatedFileType(item);
  final FileTypePatternDialog dialog = new FileTypePatternDialog(item, type, oldLanguage);
  final DialogBuilder builder = new DialogBuilder(myPatterns);
  builder.setPreferredFocusComponent(dialog.getPatternField());
  builder.setCenterPanel(dialog.getMainPanel());
  builder.setTitle(title);
  builder.showModal(true);
  if (builder.getDialogWrapper().isOK()) {
    final String pattern = dialog.getPatternField().getText();
    if (StringUtil.isEmpty(pattern)) return;

    final FileNameMatcher matcher = FileTypeManager.parseFromString(pattern);
    FileType registeredFileType = findExistingFileType(matcher);
    if (registeredFileType != null && registeredFileType != type) {
      if (registeredFileType.isReadOnly()) {
        Messages.showMessageDialog(myPatterns.myPatternsList,
                                   FileTypesBundle.message("filetype.edit.add.pattern.exists.error", registeredFileType.getDescription()),
                                   title, Messages.getErrorIcon());
        return;
      }
      else {
        if (Messages.OK == Messages.showOkCancelDialog(myPatterns.myPatternsList, FileTypesBundle.message("filetype.edit.add.pattern.exists.message",
                                                                                             registeredFileType.getDescription()),
                                             FileTypesBundle.message("filetype.edit.add.pattern.exists.title"),
                                             FileTypesBundle.message("filetype.edit.add.pattern.reassign.button"),
                                             CommonBundle.getCancelButtonText(), Messages.getQuestionIcon())) {
          myTempPatternsTable.removeAssociation(matcher, registeredFileType);
          myTempTemplateDataLanguages.removeAssociation(matcher, oldLanguage);
          myReassigned.put(matcher, registeredFileType);
        }
        else {
          return;
        }
      }
    }

    if (item != null) {
      final FileNameMatcher oldMatcher = FileTypeManager.parseFromString(item);
      myTempPatternsTable.removeAssociation(oldMatcher, type);
      myTempTemplateDataLanguages.removeAssociation(oldMatcher, oldLanguage);
    }
    myTempPatternsTable.addAssociation(matcher, type);
    myTempTemplateDataLanguages.addAssociation(matcher, dialog.getTemplateDataLanguage());

    updateExtensionList();
    final int index = myPatterns.getListModel().indexOf(matcher.getPresentableString());
    if (index >= 0) {
      ListScrollingUtil.selectItem(myPatterns.myPatternsList, index);
    }
    myPatterns.myPatternsList.requestFocus();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:62,代码来源:FileTypeConfigurable.java

示例5: editPattern

import com.intellij.openapi.ui.DialogBuilder; //导入方法依赖的package包/类
private void editPattern(@Nullable final String item) {
  final FileType type = myRecognizedFileType.getSelectedFileType();
  if (type == null) return;

  final String title = item == null
                       ? FileTypesBundle.message("filetype.edit.add.pattern.title")
                       : FileTypesBundle.message("filetype.edit.edit.pattern.title");

  final Language oldLanguage = item == null ? null : myTempTemplateDataLanguages.findAssociatedFileType(item);
  final FileTypePatternDialog dialog = new FileTypePatternDialog(item, type, oldLanguage);
  final DialogBuilder builder = new DialogBuilder(myPatterns);
  builder.setPreferredFocusComponent(dialog.getPatternField());
  builder.setCenterPanel(dialog.getMainPanel());
  builder.setTitle(title);
  builder.showModal(true);
  if (builder.getDialogWrapper().isOK()) {
    final String pattern = dialog.getPatternField().getText();
    if (StringUtil.isEmpty(pattern)) return;

    final FileNameMatcher matcher = FileTypeManager.parseFromString(pattern);
    FileType registeredFileType = findExistingFileType(matcher);
    if (registeredFileType != null && registeredFileType != type) {
      if (registeredFileType.isReadOnly()) {
        Messages.showMessageDialog(myPatterns.myPatternsList, FileTypesBundle
                .message("filetype.edit.add.pattern.exists.error", registeredFileType.getDescription()), title,
                                   Messages.getErrorIcon());
        return;
      }
      else {
        if (Messages.OK ==
            Messages.showOkCancelDialog(myPatterns.myPatternsList, FileTypesBundle
                    .message("filetype.edit.add.pattern.exists.message", registeredFileType.getDescription()),
                                        FileTypesBundle.message("filetype.edit.add.pattern.exists.title"),
                                        FileTypesBundle.message("filetype.edit.add.pattern.reassign.button"),
                                        CommonBundle.getCancelButtonText(), Messages.getQuestionIcon())) {
          myTempPatternsTable.removeAssociation(matcher, registeredFileType);
          myTempTemplateDataLanguages.removeAssociation(matcher, oldLanguage);
          myReassigned.put(matcher, registeredFileType);
        }
        else {
          return;
        }
      }
    }

    if (item != null) {
      final FileNameMatcher oldMatcher = FileTypeManager.parseFromString(item);
      myTempPatternsTable.removeAssociation(oldMatcher, type);
      myTempTemplateDataLanguages.removeAssociation(oldMatcher, oldLanguage);
    }
    myTempPatternsTable.addAssociation(matcher, type);
    myTempTemplateDataLanguages.addAssociation(matcher, dialog.getTemplateDataLanguage());

    updateExtensionList();
    final int index = myPatterns.getListModel().indexOf(matcher.getPresentableString());
    if (index >= 0) {
      ScrollingUtil.selectItem(myPatterns.myPatternsList, index);
    }
    IdeFocusManager.getGlobalInstance().doForceFocusWhenFocusSettlesDown(myPatterns.myPatternsList);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:62,代码来源:FileTypeConfigurable.java


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