use of com.intellij.debugger.settings.NodeRendererSettings in project intellij-community by JetBrains.
the class DebugProcessImpl method getDefaultRenderer.
@NotNull
public static NodeRenderer getDefaultRenderer(Type type) {
final NodeRendererSettings settings = NodeRendererSettings.getInstance();
final PrimitiveRenderer primitiveRenderer = settings.getPrimitiveRenderer();
if (primitiveRenderer.isApplicable(type)) {
return primitiveRenderer;
}
final ArrayRenderer arrayRenderer = settings.getArrayRenderer();
if (arrayRenderer.isApplicable(type)) {
return arrayRenderer;
}
final ClassRenderer classRenderer = settings.getClassRenderer();
LOG.assertTrue(classRenderer.isApplicable(type), type.name());
return classRenderer;
}
use of com.intellij.debugger.settings.NodeRendererSettings 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