Search in sources :

Example 1 with ClassRenderer

use of com.intellij.debugger.ui.tree.render.ClassRenderer in project intellij-community by JetBrains.

the class DebuggerDataViewsConfigurable method apply.

@Override
public void apply() {
    final ViewsGeneralSettings generalSettings = ViewsGeneralSettings.getInstance();
    final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance();
    generalSettings.AUTOSCROLL_TO_NEW_LOCALS = myCbAutoscroll.isSelected();
    rendererSettings.setAlternateCollectionViewsEnabled(myCbEnableAlternateViews.isSelected());
    generalSettings.HIDE_NULL_ARRAY_ELEMENTS = myCbHideNullArrayElements.isSelected();
    final ClassRenderer classRenderer = rendererSettings.getClassRenderer();
    classRenderer.SHOW_STATIC = myCbShowStatic.isSelected();
    classRenderer.SHOW_STATIC_FINAL = myCbShowStaticFinalFields.isSelectedWhenSelectable();
    classRenderer.SHOW_SYNTHETICS = myCbShowSyntheticFields.isSelected();
    classRenderer.SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES = myCbShowValFieldsAsLocalVariables.isSelectedWhenSelectable();
    classRenderer.SHOW_DECLARED_TYPE = myCbShowDeclaredType.isSelected();
    classRenderer.SHOW_FQ_TYPE_NAMES = myCbShowFQNames.isSelected();
    classRenderer.SHOW_OBJECT_ID = myCbShowObjectId.isSelected();
    classRenderer.SHOW_STRINGS_TYPE = myCbShowStringsType.isSelected();
    final ToStringRenderer toStringRenderer = rendererSettings.getToStringRenderer();
    toStringRenderer.setEnabled(myCbEnableToString.isSelected());
    toStringRenderer.setUseClassFilters(myRbFromList.isSelected());
    toStringRenderer.setClassFilters(myToStringFilterEditor.getFilters());
    PrimitiveRenderer primitiveRenderer = rendererSettings.getPrimitiveRenderer();
    primitiveRenderer.setShowHexValue(myCbHexValue.isSelected());
    rendererSettings.fireRenderersChanged();
}
Also used : ClassRenderer(com.intellij.debugger.ui.tree.render.ClassRenderer) ToStringRenderer(com.intellij.debugger.ui.tree.render.ToStringRenderer) PrimitiveRenderer(com.intellij.debugger.ui.tree.render.PrimitiveRenderer)

Example 2 with ClassRenderer

use of com.intellij.debugger.ui.tree.render.ClassRenderer in project intellij-community by JetBrains.

the class DebuggerDataViewsConfigurable method areDefaultRenderersModified.

private boolean areDefaultRenderersModified() {
    //if (myArrayRendererConfigurable.isModified()) {
    //  return true;
    //}
    final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance();
    final ClassRenderer classRenderer = rendererSettings.getClassRenderer();
    final boolean isClassRendererModified = (classRenderer.SHOW_STATIC != myCbShowStatic.isSelected()) || (classRenderer.SHOW_STATIC_FINAL != myCbShowStaticFinalFields.isSelectedWhenSelectable()) || (classRenderer.SHOW_SYNTHETICS != myCbShowSyntheticFields.isSelected()) || (classRenderer.SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES != myCbShowValFieldsAsLocalVariables.isSelectedWhenSelectable()) || (classRenderer.SHOW_DECLARED_TYPE != myCbShowDeclaredType.isSelected()) || (classRenderer.SHOW_FQ_TYPE_NAMES != myCbShowFQNames.isSelected()) || (classRenderer.SHOW_OBJECT_ID != myCbShowObjectId.isSelected()) || (classRenderer.SHOW_STRINGS_TYPE != myCbShowStringsType.isSelected());
    if (isClassRendererModified) {
        return true;
    }
    final ToStringRenderer toStringRenderer = rendererSettings.getToStringRenderer();
    final boolean isToStringRendererModified = (toStringRenderer.isEnabled() != myCbEnableToString.isSelected()) || (toStringRenderer.isUseClassFilters() != myRbFromList.isSelected()) || (!DebuggerUtilsEx.filterEquals(toStringRenderer.getClassFilters(), myToStringFilterEditor.getFilters()));
    if (isToStringRendererModified) {
        return true;
    }
    if (rendererSettings.areAlternateCollectionViewsEnabled() != myCbEnableAlternateViews.isSelected()) {
        return true;
    }
    PrimitiveRenderer primitiveRenderer = rendererSettings.getPrimitiveRenderer();
    if (primitiveRenderer.isShowHexValue() != myCbHexValue.isSelected()) {
        return true;
    }
    return false;
}
Also used : ClassRenderer(com.intellij.debugger.ui.tree.render.ClassRenderer) ToStringRenderer(com.intellij.debugger.ui.tree.render.ToStringRenderer) PrimitiveRenderer(com.intellij.debugger.ui.tree.render.PrimitiveRenderer)

Example 3 with ClassRenderer

use of com.intellij.debugger.ui.tree.render.ClassRenderer 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;
}
Also used : ClassRenderer(com.intellij.debugger.ui.tree.render.ClassRenderer) ArrayRenderer(com.intellij.debugger.ui.tree.render.ArrayRenderer) NodeRendererSettings(com.intellij.debugger.settings.NodeRendererSettings) PrimitiveRenderer(com.intellij.debugger.ui.tree.render.PrimitiveRenderer) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with ClassRenderer

use of com.intellij.debugger.ui.tree.render.ClassRenderer in project intellij-community by JetBrains.

the class StaticDescriptorImpl method calcRepresentation.

protected String calcRepresentation(EvaluationContextImpl context, DescriptorLabelListener descriptorLabelListener) throws EvaluateException {
    DebuggerManagerThreadImpl.assertIsManagerThread();
    final ClassRenderer classRenderer = NodeRendererSettings.getInstance().getClassRenderer();
    return getName() + " = " + classRenderer.renderTypeName(myType.name());
}
Also used : ClassRenderer(com.intellij.debugger.ui.tree.render.ClassRenderer)

Example 5 with ClassRenderer

use of com.intellij.debugger.ui.tree.render.ClassRenderer in project intellij-community by JetBrains.

the class DebuggerDataViewsConfigurable method reset.

@Override
public void reset() {
    final ViewsGeneralSettings generalSettings = ViewsGeneralSettings.getInstance();
    final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance();
    myCbAutoscroll.setSelected(generalSettings.AUTOSCROLL_TO_NEW_LOCALS);
    myCbHideNullArrayElements.setSelected(generalSettings.HIDE_NULL_ARRAY_ELEMENTS);
    myCbEnableAlternateViews.setSelected(rendererSettings.areAlternateCollectionViewsEnabled());
    ClassRenderer classRenderer = rendererSettings.getClassRenderer();
    myCbShowSyntheticFields.setSelected(classRenderer.SHOW_SYNTHETICS);
    myCbShowValFieldsAsLocalVariables.setSelected(classRenderer.SHOW_VAL_FIELDS_AS_LOCAL_VARIABLES);
    if (!classRenderer.SHOW_SYNTHETICS) {
        myCbShowValFieldsAsLocalVariables.makeUnselectable(false);
    }
    myCbShowStatic.setSelected(classRenderer.SHOW_STATIC);
    myCbShowStaticFinalFields.setSelected(classRenderer.SHOW_STATIC_FINAL);
    if (!classRenderer.SHOW_STATIC) {
        myCbShowStaticFinalFields.makeUnselectable(false);
    }
    myCbShowDeclaredType.setSelected(classRenderer.SHOW_DECLARED_TYPE);
    myCbShowFQNames.setSelected(classRenderer.SHOW_FQ_TYPE_NAMES);
    myCbShowObjectId.setSelected(classRenderer.SHOW_OBJECT_ID);
    myCbShowStringsType.setSelected(classRenderer.SHOW_STRINGS_TYPE);
    final ToStringRenderer toStringRenderer = rendererSettings.getToStringRenderer();
    final boolean toStringEnabled = toStringRenderer.isEnabled();
    final boolean useClassFilters = toStringRenderer.isUseClassFilters();
    myCbEnableToString.setSelected(toStringEnabled);
    myRbAllThatOverride.setSelected(!useClassFilters);
    myRbFromList.setSelected(useClassFilters);
    myToStringFilterEditor.setFilters(toStringRenderer.getClassFilters());
    myToStringFilterEditor.setEnabled(toStringEnabled && useClassFilters);
    myRbFromList.setEnabled(toStringEnabled);
    myRbAllThatOverride.setEnabled(toStringEnabled);
    PrimitiveRenderer primitiveRenderer = rendererSettings.getPrimitiveRenderer();
    myCbHexValue.setSelected(primitiveRenderer.isShowHexValue());
}
Also used : ClassRenderer(com.intellij.debugger.ui.tree.render.ClassRenderer) ToStringRenderer(com.intellij.debugger.ui.tree.render.ToStringRenderer) PrimitiveRenderer(com.intellij.debugger.ui.tree.render.PrimitiveRenderer)

Aggregations

ClassRenderer (com.intellij.debugger.ui.tree.render.ClassRenderer)5 PrimitiveRenderer (com.intellij.debugger.ui.tree.render.PrimitiveRenderer)4 ToStringRenderer (com.intellij.debugger.ui.tree.render.ToStringRenderer)3 NodeRendererSettings (com.intellij.debugger.settings.NodeRendererSettings)1 ArrayRenderer (com.intellij.debugger.ui.tree.render.ArrayRenderer)1 NotNull (org.jetbrains.annotations.NotNull)1