本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
});
}
示例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;
}
示例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);
}
});
}
示例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;
}
示例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);
}
});
}