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

Java SingleConfigurableEditor类代码示例

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

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



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

示例1: perform

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
@Override
protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
  final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
  Disposable disposable = Disposer.newDisposable();
  final MyTabbedConfigurable configurable = new MyTabbedConfigurable(disposable);
  SingleConfigurableEditor editor = new SingleConfigurableEditor(project, configurable) {
    @Override
    protected void doOKAction() {
      //noinspection AssignmentToStaticFieldFromInstanceMethod
      ourLastSelectedTabIndex = configurable.getSelectedIndex();
      super.doOKAction();
    }

    @Override
    public void doCancelAction() {
      //noinspection AssignmentToStaticFieldFromInstanceMethod
      ourLastSelectedTabIndex = configurable.getSelectedIndex();
      super.doCancelAction();
    }
  };
  Disposer.register(editor.getDisposable(), disposable);
  editor.show();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:CustomizeContextViewAction.java


示例2: actionPerformed

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
  final PluginManagerConfigurable configurable = createAvailableConfigurable(myVendor);
  final SingleConfigurableEditor configurableEditor =
    new SingleConfigurableEditor(myActionsPanel, configurable, ShowSettingsUtilImpl.createDimensionKey(configurable), false) {
      {
        setOKButtonText(CommonBundle.message("close.action.name"));
        setOKButtonMnemonic('C');
        final String filter = myFilter.getFilter();
        if (!StringUtil.isEmptyOrSpaces(filter)) {
          final Runnable searchRunnable = configurable.enableSearch(filter);
          LOG.assertTrue(searchRunnable != null);
          searchRunnable.run();
        }
      }

      @NotNull
      @Override
      protected Action[] createActions() {
        return new Action[]{getOKAction()};
      }
    };
  configurableEditor.show();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:InstalledPluginsManagerMain.java


示例3: showDialog

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
static void showDialog(Project project) {
  if (Registry.is("ide.new.project.settings")) {
    new SingleConfigurableEditor(project, ProjectStructureConfigurable.getInstance(project), OptionsEditorDialog.DIMENSION_KEY) {
      @NotNull
      @Override
      protected DialogStyle getStyle() {
        return DialogStyle.COMPACT;
      }
    }.show();
  }
  else {
    ShowSettingsUtil
      .getInstance().editConfigurable(project, OptionsEditorDialog.DIMENSION_KEY, ProjectStructureConfigurable.getInstance(project));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ShowStructureSettingsAction.java


示例4: createAccount

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
private void createAccount(ServerType<?> cloudType) {
  RemoteServer<?> newAccount = RemoteServersManager.getInstance().createServer(cloudType, generateServerName(cloudType));

  final Ref<Consumer<String>> errorConsumerRef = new Ref<Consumer<String>>();

  SingleRemoteServerConfigurable configurable = new SingleRemoteServerConfigurable(newAccount, null, true) {

    @Override
    protected void setConnectionStatusText(boolean error, String text) {
      super.setConnectionStatusText(error, error ? "" : text);
      errorConsumerRef.get().consume(error ? text : null);
    }
  };

  if (!new SingleConfigurableEditor(myMainPanel, configurable, ShowSettingsUtilImpl.createDimensionKey(configurable), false) {
    {
      errorConsumerRef.set(new Consumer<String>() {
        @Override
        public void consume(String s) {
          setErrorText(s);
        }
      });
    }
  }.showAndGet()) {
    return;
  }

  newAccount.setName(configurable.getDisplayName());

  RemoteServersManager.getInstance().addServer(newAccount);
  AccountItem newAccountItem = new AccountItem(newAccount);
  myAccountComboBox.addItem(newAccountItem);
  myAccountComboBox.setSelectedItem(newAccountItem);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:CloudAccountSelectionEditor.java


示例5: resizeDialogToFitTextFor

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public static void resizeDialogToFitTextFor(@NotNull final JComponent... components) {
  if (components.length == 0) return;
  doWithDialogWrapper(components[0], new Consumer<DialogWrapper>() {
    @Override
    public void consume(final DialogWrapper dialogWrapper) {
      if (dialogWrapper instanceof SettingsDialog || dialogWrapper instanceof SingleConfigurableEditor) {
        for (Component component : components) {
          if (component instanceof TextFieldWithHistoryWithBrowseButton) {
            setPreferredWidthToFitText((TextFieldWithHistoryWithBrowseButton)component);
          }
          else if (component instanceof TextFieldWithBrowseButton) {
            setPreferredWidthToFitText((TextFieldWithBrowseButton)component);
          }
          else if (component instanceof JTextField) {
            setPreferredWidthToFitText((JTextField)component);
          }
        }
        ApplicationManager.getApplication().invokeLater(new Runnable() {
          @Override
          public void run() {
            adjustDialogSizeToFitPreferredSize(dialogWrapper);
          }
        }, ModalityState.any());
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:SwingHelper.java


示例6: editConfiguration

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public static boolean editConfiguration(final Project project, final RunnerAndConfigurationSettings configuration, final String title, @Nullable final Executor executor) {
  final SingleConfigurationConfigurable<RunConfiguration> configurable =
    SingleConfigurationConfigurable.editSettings(configuration, executor);
  final SingleConfigurableEditor dialog = new SingleConfigurableEditor(project, configurable, IdeModalityType.PROJECT) {
    {
      if (executor != null) setOKButtonText(executor.getActionName());
      if (executor != null) setOKButtonIcon(executor.getIcon());
    }
  };

  dialog.setTitle(title);
  return dialog.showAndGet();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:RunDialog.java


示例7: actionPerformed

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());

  Disposable disposable = Disposer.newDisposable();
  final CompositeConfigurable configurable = new TabbedConfigurable(disposable) {
    protected List<Configurable> createConfigurables() {
      ArrayList<Configurable> array = new ArrayList<Configurable>();
      array.add(new DebuggerDataViewsConfigurable(project));
      array.add(new UserRenderersConfigurable(project));
      return array;
    }

    public void apply() throws ConfigurationException {
      super.apply();
      NodeRendererSettings.getInstance().fireRenderersChanged();
    }

    public String getDisplayName() {
      return DebuggerBundle.message("title.customize.data.views");
    }

    public String getHelpTopic() {
      return null;
    }
  };

  SingleConfigurableEditor editor = new SingleConfigurableEditor(project, configurable);
  Disposer.register(editor.getDisposable(), disposable);
  editor.show();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:CustomizeContextViewAction.java


示例8: showMacrosConfigurationDialog

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public static boolean showMacrosConfigurationDialog(Project project, final Collection<String> undefinedMacros) {
  final String text = ProjectBundle.message("project.load.undefined.path.variables.message");
  final Application application = ApplicationManager.getApplication();
  if (application.isHeadlessEnvironment() || application.isUnitTestMode()) {
    throw new RuntimeException(text + ": " + StringUtil.join(undefinedMacros, ", "));
  }
  final UndefinedMacrosConfigurable configurable =
    new UndefinedMacrosConfigurable(text, undefinedMacros);
  final SingleConfigurableEditor editor = new SingleConfigurableEditor(project, configurable);
  editor.show();
  return editor.isOK();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:ProjectMacrosUtil.java


示例9: editConfiguration

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public static boolean editConfiguration(final Project project, final RunnerAndConfigurationSettings configuration, final String title, @Nullable final Executor executor) {
  final SingleConfigurationConfigurable<RunConfiguration> configurable = SingleConfigurationConfigurable.editSettings(configuration, executor);
  final SingleConfigurableEditor dialog = new SingleConfigurableEditor(project, configurable) {
    {
      if (executor != null) setOKButtonText(executor.getActionName());
      if (executor != null) setOKButtonIcon(executor.getIcon());
    }
  };

  dialog.setTitle(title);
  dialog.show();
  return dialog.isOK();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:RunDialog.java


示例10: editConfiguration

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public static boolean editConfiguration(final Project project, final RunnerAndConfigurationSettings configuration, final String title, @Nullable final Executor executor) {
  final SingleConfigurationConfigurable<RunConfiguration> configurable = SingleConfigurationConfigurable.editSettings(configuration, executor);
  final SingleConfigurableEditor dialog = new SingleConfigurableEditor(project, configurable, IdeModalityType.PROJECT) {
    {
      if (executor != null) setOKButtonText(executor.getActionName());
      if (executor != null) setOKButtonIcon(executor.getIcon());
    }
  };

  dialog.setTitle(title);
  dialog.show();
  return dialog.isOK();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:14,代码来源:RunDialog.java


示例11: showSettings

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public void showSettings() {
    String dimensionKey = ShowSettingsUtilImpl.createDimensionKey(this);
    SingleConfigurableEditor singleConfigurableEditor = new SingleConfigurableEditor(project, this, dimensionKey, false);
    singleConfigurableEditor.show();
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:6,代码来源:StylintSettingsPage.java


示例12: showSettings

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public static void showSettings(Project project) {
    SassLintSettingsPage configurable = new SassLintSettingsPage(project);
    String dimensionKey = ShowSettingsUtilImpl.createDimensionKey(configurable);
    SingleConfigurableEditor singleConfigurableEditor = new SingleConfigurableEditor(project, configurable, dimensionKey, false);
    singleConfigurableEditor.show();
}
 
开发者ID:idok,项目名称:sass-lint-plugin,代码行数:7,代码来源:SassLintInspection.java


示例13: actionPerformed

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public void actionPerformed(@NotNull final AnActionEvent event) {
  final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(event.getDataContext());
  final List<JavaValue> values = ViewAsGroup.getSelectedValues(event);
  if (values.size() != 1) {
    return;
  }

  final JavaValue javaValue = values.get(0);

  final DebugProcessImpl process = debuggerContext.getDebugProcess();
  if (process == null) {
    return;
  }

  final Project project = event.getProject();

  process.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext) {
    public void threadAction() {
      Type type = javaValue.getDescriptor().getType();
      final String name = type != null ? type.name() :null;
      DebuggerUIUtil.invokeLater(new Runnable() {
        @Override
        public void run() {
          final UserRenderersConfigurable ui = new UserRenderersConfigurable();
          ConfigurableBase<UserRenderersConfigurable, NodeRendererSettings> configurable =
            new ConfigurableBase<UserRenderersConfigurable, NodeRendererSettings>(
                                                                    "reference.idesettings.debugger.typerenderers",
                                                                    DebuggerBundle.message("user.renderers.configurable.display.name"),
                                                                    "reference.idesettings.debugger.typerenderers") {
              @NotNull
              @Override
              protected NodeRendererSettings getSettings() {
                return NodeRendererSettings.getInstance();
              }

              @Override
              protected UserRenderersConfigurable createUi() {
                return ui;
              }
            };
          SingleConfigurableEditor editor = new SingleConfigurableEditor(project, configurable);
          if (name != null) {
            CompoundReferenceRenderer renderer =
              NodeRendererSettings.getInstance().createCompoundReferenceRenderer(name, name, null, null);
            renderer.setEnabled(true);
            ui.addRenderer(renderer);
          }
          editor.show();
        }
      });
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:54,代码来源:CreateRendererAction.java


示例14: showSettings

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public static void showSettings(Project project) {
    RTSettingsPage configurable = new RTSettingsPage(project);
    String dimensionKey = ShowSettingsUtilImpl.createDimensionKey(configurable);
    SingleConfigurableEditor singleConfigurableEditor = new SingleConfigurableEditor(project, configurable, dimensionKey, false);
    singleConfigurableEditor.show();
}
 
开发者ID:idok,项目名称:react-templates-plugin,代码行数:7,代码来源:RTInspection.java


示例15: showSettings

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public static void showSettings(Project project) {
    CoffeeLintSettingsPage configurable = new CoffeeLintSettingsPage(project);
    String dimensionKey = ShowSettingsUtilImpl.createDimensionKey(configurable);
    SingleConfigurableEditor singleConfigurableEditor = new SingleConfigurableEditor(project, configurable, dimensionKey, false);
    singleConfigurableEditor.show();
}
 
开发者ID:idok,项目名称:coffee-lint-plugin,代码行数:7,代码来源:CoffeeLintInspection.java


示例16: showSettings

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public static void showSettings(Project project) {
    ESLintSettingsPage configurable = new ESLintSettingsPage(project);
    String dimensionKey = ShowSettingsUtilImpl.createDimensionKey(configurable);
    SingleConfigurableEditor singleConfigurableEditor = new SingleConfigurableEditor(project, configurable, dimensionKey, false);
    singleConfigurableEditor.show();
}
 
开发者ID:idok,项目名称:eslint-plugin,代码行数:7,代码来源:ESLintInspection.java


示例17: actionPerformed

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
  if(debuggerContext == null) {
    return;
  }

  DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
  if(debugProcess == null) {
    return;
  }

  final Project project = debuggerContext.getProject();

  final DebuggerTreeNodeImpl selectedNode = getSelectedNode(e.getDataContext());
  if (selectedNode == null) {
    return;
  }
  NodeDescriptorImpl descriptor = selectedNode.getDescriptor();
  if(!(descriptor instanceof ValueDescriptorImpl /*&& ((ValueDescriptorImpl)descriptor).isArray()*/)) {
    return;
  }

  final ArrayRenderer renderer = getArrayRenderer((ValueDescriptorImpl)descriptor)/*(ArrayRenderer)((ValueDescriptorImpl)selectedNode.getDescriptor()).getLastRenderer()*/;
  if (renderer == null) {
    return;
  }

  String title = createNodeTitle("", selectedNode);
  String label = selectedNode.toString();
  int index = label.indexOf('=');
  if (index > 0) {
    title = title + " " + label.substring(index);
  }
  final ArrayRenderer clonedRenderer = renderer.clone();
  final NamedArrayConfigurable configurable = new NamedArrayConfigurable(title, clonedRenderer);
  SingleConfigurableEditor editor = new SingleConfigurableEditor(project, configurable,
                                                                 ShowSettingsUtilImpl.createDimensionKey(configurable), false);
  editor.show();

  if(editor.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
    debugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(debuggerContext.getSuspendContext()) {
        public void contextAction() throws Exception {
          final ValueDescriptorImpl nodeDescriptor = (ValueDescriptorImpl)selectedNode.getDescriptor();
          final Renderer lastRenderer = nodeDescriptor.getLastRenderer();
          if (lastRenderer instanceof ArrayRenderer) {
            selectedNode.setRenderer(clonedRenderer);
          }
          else if (lastRenderer instanceof CompoundNodeRenderer) {
            final CompoundNodeRenderer compoundRenderer = (CompoundNodeRenderer)lastRenderer;
            final ChildrenRenderer childrenRenderer = compoundRenderer.getChildrenRenderer();
            if (childrenRenderer instanceof ExpressionChildrenRenderer) {
              ExpressionChildrenRenderer.setPreferableChildrenRenderer(nodeDescriptor, clonedRenderer);
              selectedNode.calcRepresentation();
            }
          }
        }
      });
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:60,代码来源:AdjustArrayRangeAction.java


示例18: actionPerformed

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
  final SingleConfigurableEditor editor = new SingleConfigurableEditor(project, new ThreadsViewConfigurable(ThreadsViewSettings.getInstance()));
  editor.show();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:CustomizeThreadsViewAction.java


示例19: actionPerformed

import com.intellij.openapi.options.ex.SingleConfigurableEditor; //导入依赖的package包/类
public void actionPerformed(@NotNull final AnActionEvent event)
{
	final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(event.getDataContext());
	final List<JavaValue> values = ViewAsGroup.getSelectedValues(event);
	if(values.size() != 1)
	{
		return;
	}

	final JavaValue javaValue = values.get(0);

	final DebugProcessImpl process = debuggerContext.getDebugProcess();
	if(process == null)
	{
		return;
	}

	final Project project = event.getProject();

	process.getManagerThread().schedule(new DebuggerContextCommandImpl(debuggerContext)
	{
		public void threadAction()
		{
			Type type = javaValue.getDescriptor().getType();
			final String name = type != null ? type.name() : null;
			DebuggerUIUtil.invokeLater(() ->
			{
				final UserRenderersConfigurable ui = new UserRenderersConfigurable();
				ConfigurableBase<UserRenderersConfigurable, NodeRendererSettings> configurable = new ConfigurableBase<UserRenderersConfigurable, NodeRendererSettings>("reference.idesettings" +
						".debugger.typerenderers", DebuggerBundle.message("user.renderers.configurable.display.name"), "reference.idesettings.debugger.typerenderers")
				{
					@NotNull
					@Override
					protected NodeRendererSettings getSettings()
					{
						return NodeRendererSettings.getInstance();
					}

					@Override
					protected UserRenderersConfigurable createUi()
					{
						return ui;
					}
				};
				SingleConfigurableEditor editor = new SingleConfigurableEditor(project, configurable);
				if(name != null)
				{
					NodeRenderer renderer = NodeRendererSettings.getInstance().createCompoundTypeRenderer(StringUtil.getShortName(name), name, null, null);
					renderer.setEnabled(true);
					ui.addRenderer(renderer);
				}
				editor.show();
			});
		}
	});
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:57,代码来源:CreateRendererAction.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java SettableListenableFuture类代码示例发布时间:2022-05-22
下一篇:
Java TIllegalArgument类代码示例发布时间: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