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


Java ScopeChooserConfigurable类代码示例

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


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

示例1: createComponent

import com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable; //导入依赖的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("Manage Scopes", null, new LinkListener() {
    @Override
    public void linkSelected(LinkLabel aSource, Object aLinkData) {
      Settings settings = Settings.KEY.getData(DataManager.getInstance().getDataContext(panel));
      if (settings != null) {
        settings.select(settings.find(ScopeChooserConfigurable.PROJECT_SCOPES));
      }
    }
  }));
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:VcsUpdateInfoScopeFilterConfigurable.java

示例2: createComponent

import com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable; //导入依赖的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

示例3: createComponent

import com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable; //导入依赖的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

示例4: createChooseScopePanel

import com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable; //导入依赖的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 = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext());
  final Project project = contextProject != null ? contextProject : projects[0];

  JButton button = new JButton("Manage 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(@NotNull ActionEvent e) {
      Settings settings = Settings.KEY.getData(DataManager.getInstance().getDataContext());
      if (settings != null) {
        try {
          if (settings.select(settings.find(ScopeChooserConfigurable.PROJECT_SCOPES)).isRejected()) {
            EditScopesDialog.showDialog(project, null);
          }
        } catch (IllegalStateException ex) {
          EditScopesDialog.showDialog(project, null);
        }
      }
    }
  });
  return panel;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:39,代码来源:ScopeColorsPageFactory.java

示例5: actionPerformed

import com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final DataContext dataContext = e.getDataContext();
  final Project project = CommonDataKeys.PROJECT.getData(dataContext);
  LOG.assertTrue(project != null);
  final String scopeName = ProjectView.getInstance(project).getCurrentProjectViewPane().getSubId();
  LOG.assertTrue(scopeName != null);
  final ScopeChooserConfigurable scopeChooserConfigurable = new ScopeChooserConfigurable(project);
  ShowSettingsUtil.getInstance().editConfigurable(project, scopeChooserConfigurable, new Runnable(){
    @Override
    public void run() {
      scopeChooserConfigurable.selectNodeInTree(scopeName);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:EditScopesAction.java

示例6: createChooseScopePanel

import com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable; //导入依赖的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

示例7: actionPerformed

import com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final DataContext dataContext = e.getDataContext();
  final Project project = PlatformDataKeys.PROJECT.getData(dataContext);
  LOG.assertTrue(project != null);
  final String scopeName = ProjectView.getInstance(project).getCurrentProjectViewPane().getSubId();
  LOG.assertTrue(scopeName != null);
  final ScopeChooserConfigurable scopeChooserConfigurable = new ScopeChooserConfigurable(project);
  ShowSettingsUtil.getInstance().editConfigurable(project, scopeChooserConfigurable, new Runnable(){
    @Override
    public void run() {
      scopeChooserConfigurable.selectNodeInTree(scopeName);
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:EditScopesAction.java

示例8: createChooseScopePanel

import com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable; //导入依赖的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: actionPerformed

import com.intellij.ide.util.scopeChooser.ScopeChooserConfigurable; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final DataContext dataContext = e.getDataContext();
  final Project project = dataContext.getData(CommonDataKeys.PROJECT);
  LOG.assertTrue(project != null);
  final String scopeName = ProjectView.getInstance(project).getCurrentProjectViewPane().getSubId();
  LOG.assertTrue(scopeName != null);
  final ScopeChooserConfigurable scopeChooserConfigurable = new ScopeChooserConfigurable(project);
  ShowSettingsUtil.getInstance().editConfigurable(project, scopeChooserConfigurable, new Runnable(){
    @Override
    public void run() {
      scopeChooserConfigurable.selectNodeInTree(scopeName);
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:16,代码来源:EditScopesAction.java


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