import com.intellij.psi.*;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.ui.*;
+import com.intellij.ui.components.JBCheckBox;
import com.intellij.ui.table.JBTable;
import com.intellij.util.Function;
import com.intellij.util.ui.AbstractTableCellEditor;
private final ClassNameEditorWithBrowseButton myClassNameField;
private final JRadioButton myRbDefaultLabel;
private final JRadioButton myRbExpressionLabel;
+ private final JBCheckBox myShowTypeCheckBox;
private final JRadioButton myRbDefaultChildrenRenderer;
private final JRadioButton myRbExpressionChildrenRenderer;
private final JRadioButton myRbListChildrenRenderer;
labelButtonsGroup.add(myRbDefaultLabel);
labelButtonsGroup.add(myRbExpressionLabel);
+ myShowTypeCheckBox = new JBCheckBox(DebuggerBundle.message("label.compound.renderer.configurable.show.type"));
+
myRbDefaultChildrenRenderer = new JRadioButton(DebuggerBundle.message("label.compound.renderer.configurable.use.default.renderer"));
myRbExpressionChildrenRenderer = new JRadioButton(DebuggerBundle.message("label.compound.renderer.configurable.use.expression"));
myRbListChildrenRenderer = new JRadioButton(DebuggerBundle.message("label.compound.renderer.configurable.use.expression.list"));
panel.add(new JLabel(DebuggerBundle.message("label.compound.renderer.configurable.when.rendering")),
new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
new Insets(20, 0, 0, 0), 0, 0));
+ panel.add(myShowTypeCheckBox,
+ new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
+ new Insets(0, 7, 0, 0), 0, 0));
panel.add(myRbDefaultLabel,
new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
new Insets(0, 10, 0, 0), 0, 0));
private void flushDataTo(final CompoundReferenceRenderer renderer) { // label
LabelRenderer labelRenderer = null;
+ renderer.setShowType(myShowTypeCheckBox.isSelected());
if (myRbExpressionLabel.isSelected()) {
labelRenderer = new LabelRenderer();
labelRenderer.setLabelExpression(myLabelEditor.getText());
final ChildrenRenderer childrenRenderer = myRenderer.getChildrenRenderer();
final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance();
+ myShowTypeCheckBox.setSelected(myRenderer.isShowType());
+
if (rendererSettings.isBase(labelRenderer)) {
myLabelEditor.setText(emptyExpressionFragment);
myRbDefaultLabel.setSelected(true);
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
-import java.util.Iterator;
-import java.util.List;
-
/**
* @author Eugene Zhuravlev
* Date: Feb 12, 2005
private static final @NonNls String CLASSNAME_OPTION = "QUALIFIED_NAME";
private String myClassName;
+ private static final @NonNls String SHOWTYPE_OPTION = "SHOW_TYPE";
+ private Boolean myShowType;
+
public String getName() {
return myName;
}
}
public boolean isEnabled() {
- return myEnabled != null? myEnabled.booleanValue() : false;
+ return myEnabled != null && myEnabled.booleanValue();
}
public void setEnabled(final boolean enabled) {
myClassName = className;
}
+ public boolean isShowType() {
+ return myShowType == null || myShowType.booleanValue();
+ }
+
+ public void setShowType(boolean showType) {
+ myShowType = showType;
+ }
+
@SuppressWarnings({"HardCodedStringLiteral"}) public void readExternal(Element element) throws InvalidDataException {
- final List options = element.getChildren("option");
myName = null;
myEnabled = null;
myClassName = null;
- for (Iterator it = options.iterator(); it.hasNext();) {
- final Element option = (Element)it.next();
+ for (Element option : element.getChildren("option")) {
final String optionName = option.getAttributeValue("name");
if (NAME_OPTION.equals(optionName)) {
myName = option.getAttributeValue("value");
}
else if (ENABLED_OPTION.equals(optionName)) {
- final String val = option.getAttributeValue("value");
- myEnabled = "true".equalsIgnoreCase(val);
+ myEnabled = Boolean.parseBoolean(option.getAttributeValue("value"));
}
else if (CLASSNAME_OPTION.equals(optionName)) {
myClassName = option.getAttributeValue("value");
}
+ else if (SHOWTYPE_OPTION.equals(optionName)) {
+ myShowType = Boolean.parseBoolean(option.getAttributeValue("value"));
+ }
}
}
addOption(element, NAME_OPTION, myName);
}
if (myEnabled != null) {
- addOption(element, ENABLED_OPTION, myEnabled.booleanValue()? "true" : "false");
+ addOption(element, ENABLED_OPTION, myEnabled.toString());
}
if (myClassName != null) {
addOption(element, CLASSNAME_OPTION, myClassName);
}
+ if (myShowType != null) {
+ addOption(element, SHOWTYPE_OPTION, myShowType.toString());
+ }
}
@SuppressWarnings({"HardCodedStringLiteral"})
/*
- * Copyright 2000-2009 JetBrains s.r.o.
+ * Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
myProperties.setEnabled(enabled);
}
+ public boolean isShowType() {
+ return myProperties.isShowType();
+ }
+
+ public void setShowType(boolean showType) {
+ myProperties.setShowType(showType);
+ }
+
public Icon calcValueIcon(ValueDescriptor descriptor, EvaluationContext evaluationContext, DescriptorLabelListener listener) throws EvaluateException {
return null;
}
@Nullable
public String getIdLabel(Value value, DebugProcess process) {
- return value instanceof ObjectReference ? ValueDescriptorImpl.getIdLabel((ObjectReference)value) : null;
+ return value instanceof ObjectReference && isShowType() ? ValueDescriptorImpl.getIdLabel((ObjectReference)value) : null;
}
}
label.base.renderer.configurable.enable.toString=Enable 't&oString()' object view:
label.base.renderer.configurable.all.overriding=For all classes that override 'toString()' method
label.base.renderer.configurable.classes.from.list=For classes from the list:
+label.compound.renderer.configurable.show.type=Show type and object id
label.compound.renderer.configurable.use.default.renderer=Use default renderer
label.compound.renderer.configurable.use.expression=Use following expression:
label.compound.renderer.configurable.use.expression.list=Use list of expressions: