use of com.intellij.openapi.options.ex.SingleConfigurableEditor in project intellij-community by JetBrains.
the class CreateRendererAction method actionPerformed.
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(name, name, null, null);
renderer.setEnabled(true);
ui.addRenderer(renderer);
}
editor.show();
});
}
});
}
use of com.intellij.openapi.options.ex.SingleConfigurableEditor in project intellij-community by JetBrains.
the class CloudAccountSelectionEditor method createAccount.
private void createAccount(ServerType<?> cloudType) {
RemoteServer<?> newAccount = RemoteServersManager.getInstance().createServer(cloudType, generateServerName(cloudType));
final Ref<Consumer<String>> errorConsumerRef = new Ref<>();
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(s -> setErrorText(s, myMainPanel));
}
}.showAndGet()) {
return;
}
newAccount.setName(configurable.getDisplayName());
RemoteServersManager.getInstance().addServer(newAccount);
AccountItem newAccountItem = new AccountItem(newAccount);
myAccountComboBox.addItem(newAccountItem);
myAccountComboBox.setSelectedItem(newAccountItem);
}
use of com.intellij.openapi.options.ex.SingleConfigurableEditor in project intellij-community by JetBrains.
the class CustomizeContextViewAction method perform.
@Override
protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
final Project project = e.getProject();
final MyTabbedConfigurable configurable = new MyTabbedConfigurable();
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();
}
};
editor.show();
}
use of com.intellij.openapi.options.ex.SingleConfigurableEditor in project intellij-community by JetBrains.
the class RunDialog method editConfiguration.
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.IDE) {
{
if (executor != null)
setOKButtonText(executor.getActionName());
if (executor != null)
setOKButtonIcon(executor.getIcon());
}
};
dialog.setTitle(title);
return dialog.showAndGet();
}
use of com.intellij.openapi.options.ex.SingleConfigurableEditor in project intellij-plugins by JetBrains.
the class KarmaRunConfigurationEditor method updatePreferredWidth.
private void updatePreferredWidth() {
DialogWrapper dialogWrapper = DialogWrapper.findInstance(myRootComponent);
if (dialogWrapper instanceof SingleConfigurableEditor) {
// dialog for single run configuration
myNodeInterpreterField.setPreferredWidthToFitText();
myKarmaPackageField.setPreferredWidthToFitText();
SwingHelper.setPreferredWidthToFitText(myConfigPathField);
ApplicationManager.getApplication().invokeLater(() -> SwingHelper.adjustDialogSizeToFitPreferredSize(dialogWrapper), ModalityState.any());
}
}
Aggregations