use of com.intellij.openapi.options.ConfigurableBase 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();
});
}
});
}
Aggregations