• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java OptionsEditor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createHyperLink

import com.intellij.openapi.options.newEditor.OptionsEditor; //导入依赖的package包/类
@NotNull
    private HyperlinkLabel createHyperLink() {
//        List path = ContainerUtil.newArrayList(JSBundle.message("settings.javascript.root.configurable.name"), JSBundle.message("settings.javascript.linters.configurable.name"), getDisplayName());
        List path = ContainerUtil.newArrayList("JavaScript", SassLintBundle.message("sasslint.inspection.group.name"), getDisplayName());

        String title = Joiner.on(" / ").join(path);
        final HyperlinkLabel settingsLink = new HyperlinkLabel(title);
        settingsLink.addHyperlinkListener(new HyperlinkAdapter() {
            public void hyperlinkActivated(HyperlinkEvent e) {
                DataContext dataContext = DataManager.getInstance().getDataContext(settingsLink);
                OptionsEditor optionsEditor = OptionsEditor.KEY.getData(dataContext);
                if (optionsEditor == null) {
                    Project project = CommonDataKeys.PROJECT.getData(dataContext);
                    if (project != null) {
                        showSettings(project);
                    }
                    return;
                }
                Configurable configurable = optionsEditor.findConfigurableById(SassLintInspection.this.getId());
                if (configurable != null) {
                    optionsEditor.clearSearchAndSelect(configurable);
                }
            }
        });
        return settingsLink;
    }
 
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:27,代码来源:SassLintInspection.java


示例2: showSettingsDialog

import com.intellij.openapi.options.newEditor.OptionsEditor; //导入依赖的package包/类
public static void showSettingsDialog(@Nullable Project project, final String id2Select, final String filter) {
  ConfigurableGroup[] group = getConfigurableGroups(project, true);

  group = filterEmptyGroups(group);
  final Configurable configurable2Select = id2Select == null ? null : new ConfigurableVisitor.ByID(id2Select).find(group);

  if (Registry.is("ide.new.settings.view")) {
    new SettingsDialog(getProject(project), group, configurable2Select, filter).show();
    return;
  }
  final DialogWrapper dialog = getDialog(project, group, configurable2Select);

  new UiNotifyConnector.Once(dialog.getContentPane(), new Activatable.Adapter() {
    @Override
    public void showNotify() {
      final OptionsEditor editor = (OptionsEditor)((DataProvider)dialog).getData(OptionsEditor.KEY.getName());
      LOG.assertTrue(editor != null);
      editor.select(configurable2Select, filter);
    }
  });
  dialog.show();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ShowSettingsUtilImpl.java


示例3: createHyperLink

import com.intellij.openapi.options.newEditor.OptionsEditor; //导入依赖的package包/类
@NotNull
    private HyperlinkLabel createHyperLink() {
//        List path = ContainerUtil.newArrayList(JSBundle.message("settings.javascript.root.configurable.name"), JSBundle.message("settings.javascript.linters.configurable.name"), getDisplayName());
        List path = ContainerUtil.newArrayList("JavaScript", CoffeeLintBundle.message("coffeelint.inspection.group.name"), getDisplayName());

        String title = Joiner.on(" / ").join(path);
        final HyperlinkLabel settingsLink = new HyperlinkLabel(title);
        settingsLink.addHyperlinkListener(new HyperlinkAdapter() {
            public void hyperlinkActivated(HyperlinkEvent e) {
                DataContext dataContext = DataManager.getInstance().getDataContext(settingsLink);
                OptionsEditor optionsEditor = OptionsEditor.KEY.getData(dataContext);
                if (optionsEditor == null) {
                    Project project = CommonDataKeys.PROJECT.getData(dataContext);
                    if (project != null) {
                        showSettings(project);
                    }
                    return;
                }
                Configurable configurable = optionsEditor.findConfigurableById(CoffeeLintInspection.this.getId());
                if (configurable != null) {
                    optionsEditor.clearSearchAndSelect(configurable);
                }
            }
        });
        return settingsLink;
    }
 
开发者ID:idok,项目名称:coffee-lint-plugin,代码行数:27,代码来源:CoffeeLintInspection.java


示例4: createHyperLink

import com.intellij.openapi.options.newEditor.OptionsEditor; //导入依赖的package包/类
@NotNull
private HyperlinkLabel createHyperLink() {
    List path = ContainerUtil.newArrayList(JSBundle.message("settings.javascript.root.configurable.name"), JSBundle.message("settings.javascript.linters.configurable.name"), getDisplayName());

    String title = Joiner.on(" / ").join(path);
    final HyperlinkLabel settingsLink = new HyperlinkLabel(title);
    settingsLink.addHyperlinkListener(new HyperlinkAdapter() {
        public void hyperlinkActivated(HyperlinkEvent e) {
            DataContext dataContext = DataManager.getInstance().getDataContext(settingsLink);
            OptionsEditor optionsEditor = OptionsEditor.KEY.getData(dataContext);
            if (optionsEditor == null) {
                Project project = CommonDataKeys.PROJECT.getData(dataContext);
                if (project != null) {
                    showSettings(project);
                }
                return;
            }
            Configurable configurable = optionsEditor.findConfigurableById(ESLintInspection.this.getId());
            if (configurable != null) {
                optionsEditor.clearSearchAndSelect(configurable);
            }
        }
    });
    return settingsLink;
}
 
开发者ID:idok,项目名称:eslint-plugin,代码行数:26,代码来源:ESLintInspection.java


示例5: createComponent

import com.intellij.openapi.options.newEditor.OptionsEditor; //导入依赖的package包/类
@Nullable
@Override
public JComponent createComponent() {
  final JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
  panel.add(myCheckbox);
  panel.add(myComboBox);
  panel.add(Box.createHorizontalStrut(UIUtil.DEFAULT_HGAP));
  panel.add(new LinkLabel("Edit scopes", null, new LinkListener() {
    @Override
    public void linkSelected(LinkLabel aSource, Object aLinkData) {
      final OptionsEditor optionsEditor = OptionsEditor.KEY.getData(DataManager.getInstance().getDataContext(panel));
      if (optionsEditor != null) {
        SearchableConfigurable configurable = optionsEditor.findConfigurableById(new ScopeChooserConfigurable(myProject).getId());
        if (configurable != null) {
          optionsEditor.select(configurable);
        }
      }
    }
  }));
  return panel;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:VcsUpdateInfoScopeFilterConfigurable.java


示例6: createComponent

import com.intellij.openapi.options.newEditor.OptionsEditor; //导入依赖的package包/类
@Nullable
@Override
public JComponent createComponent() {
  final JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
  panel.add(myCheckbox);
  panel.add(myComboBox);
  panel.add(Box.createHorizontalStrut(UIUtil.DEFAULT_HGAP));
  panel.add(new LinkLabel("Edit scopes", null, new LinkListener() {
    @Override
    public void linkSelected(LinkLabel aSource, Object aLinkData) {
      final OptionsEditor optionsEditor = DataManager.getInstance().getDataContext(panel).getData(OptionsEditor.KEY);
      if (optionsEditor != null) {
        SearchableConfigurable configurable = optionsEditor.findConfigurableById(new ScopeChooserConfigurable(myProject).getId());
        if (configurable != null) {
          optionsEditor.select(configurable);
        }
      }
    }
  }));
  return panel;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:VcsUpdateInfoScopeFilterConfigurable.java


示例7: createChooseScopePanel

import com.intellij.openapi.options.newEditor.OptionsEditor; //导入依赖的package包/类
private static JPanel createChooseScopePanel() {
  Project[] projects = ProjectManager.getInstance().getOpenProjects();
  JPanel panel = new JPanel(new GridBagLayout());
  //panel.setBorder(new LineBorder(Color.red));
  if (projects.length == 0) return panel;
  GridBagConstraints gc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                                                 new Insets(0, 0, 0, 0), 0, 0);
  final Project contextProject = PlatformDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext());
  final Project project = contextProject != null ? contextProject : projects[0];

  JButton button = new JButton(ApplicationBundle.message("button.edit.scopes"));
  button.setPreferredSize(new Dimension(230, button.getPreferredSize().height));
  panel.add(button, gc);
  gc.gridx = GridBagConstraints.REMAINDER;
  gc.weightx = 1;
  panel.add(new JPanel(), gc);

  gc.gridy++;
  gc.gridx=0;
  gc.weighty = 1;
  panel.add(new JPanel(), gc);
  button.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      final OptionsEditor optionsEditor = OptionsEditor.KEY.getData(DataManager.getInstance().getDataContext());
      if (optionsEditor != null) {
        try {
          Configurable configurable = optionsEditor.findConfigurableById(ScopeChooserConfigurable.PROJECT_SCOPES);
          if (configurable == null || optionsEditor.clearSearchAndSelect(configurable).isRejected()) {
            EditScopesDialog.showDialog(project, null);
          }
        } catch (IllegalStateException ex) {
          EditScopesDialog.showDialog(project, null);
        }
      }
    }
  });
  return panel;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:40,代码来源:ScopeColorsPageFactory.java


示例8: createChooseScopePanel

import com.intellij.openapi.options.newEditor.OptionsEditor; //导入依赖的package包/类
private static JPanel createChooseScopePanel() {
  Project[] projects = ProjectManager.getInstance().getOpenProjects();
  JPanel panel = new JPanel(new GridBagLayout());
  //panel.setBorder(new LineBorder(Color.red));
  if (projects.length == 0) return panel;
  GridBagConstraints gc = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
                                                 new Insets(0, 0, 0, 0), 0, 0);
  final Project contextProject = DataManager.getInstance().getDataContext().getData(CommonDataKeys.PROJECT);
  final Project project = contextProject != null ? contextProject : projects[0];

  JButton button = new JButton(ApplicationBundle.message("button.edit.scopes"));
  button.setPreferredSize(new Dimension(230, button.getPreferredSize().height));
  panel.add(button, gc);
  gc.gridx = GridBagConstraints.REMAINDER;
  gc.weightx = 1;
  panel.add(new JPanel(), gc);

  gc.gridy++;
  gc.gridx=0;
  gc.weighty = 1;
  panel.add(new JPanel(), gc);
  button.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      final OptionsEditor optionsEditor = DataManager.getInstance().getDataContext().getData(OptionsEditor.KEY);
      if (optionsEditor != null) {
        try {
          Configurable configurable = optionsEditor.findConfigurableById(ScopeChooserConfigurable.PROJECT_SCOPES);
          if (configurable == null || optionsEditor.clearSearchAndSelect(configurable).isRejected()) {
            EditScopesDialog.showDialog(project, null);
          }
        } catch (IllegalStateException ex) {
          EditScopesDialog.showDialog(project, null);
        }
      }
    }
  });
  return panel;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:40,代码来源:ScopeColorsPageFactory.java


示例9: select

import com.intellij.openapi.options.newEditor.OptionsEditor; //导入依赖的package包/类
private static boolean select(DataContext context, String search, Function<ColorAndFontOptions, SearchableConfigurable> function) {
  OptionsEditor settings = context.getData(OptionsEditor.KEY);
  if (settings == null) return false;

  ColorAndFontOptions options = settings.findConfigurable(ColorAndFontOptions.class);
  if (options == null) return false;

  SearchableConfigurable page = function.apply(options);
  if (page == null) return false;

  settings.select(page, search);
  return true;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:ColorAndFontOptions.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Exceptions类代码示例发布时间:2022-05-22
下一篇:
Java SerializerWrite类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap