mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-124119 [regression] Breakpoints dialog: checkbox for "condition" field is gone
This commit is contained in:
+7
-7
@@ -23,20 +23,20 @@
|
||||
<children>
|
||||
<grid id="5482b" binding="myConditionExpressionPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="1" use-parent-layout="false"/>
|
||||
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="3" indent="1" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children/>
|
||||
</grid>
|
||||
<component id="fbbb7" class="com.intellij.ui.components.JBCheckBox" binding="myConditionEnabledCheckbox">
|
||||
<grid id="5547c" binding="myConditionEnabledPanel" layout-manager="CardLayout" hgap="0" vgap="0">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="1" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text resource-bundle="messages/XDebuggerBundle" key="xbreakpoints.condition.checkbox"/>
|
||||
</properties>
|
||||
</component>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children/>
|
||||
</grid>
|
||||
</children>
|
||||
</grid>
|
||||
<nested-form id="11152" form-file="com/intellij/xdebugger/impl/breakpoints/ui/XSuspendPolicyPanel.form" binding="mySuspendPolicyPanel">
|
||||
|
||||
+28
-6
@@ -18,7 +18,10 @@ package com.intellij.xdebugger.impl.breakpoints.ui;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.ui.components.JBCheckBox;
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.ui.popup.util.DetailView;
|
||||
import com.intellij.xdebugger.XDebuggerBundle;
|
||||
import com.intellij.xdebugger.XExpression;
|
||||
import com.intellij.xdebugger.breakpoints.XBreakpointManager;
|
||||
import com.intellij.xdebugger.breakpoints.XBreakpointType;
|
||||
import com.intellij.xdebugger.breakpoints.ui.XBreakpointCustomPropertiesPanel;
|
||||
@@ -29,6 +32,8 @@ import com.intellij.xdebugger.impl.ui.DebuggerUIUtil;
|
||||
import com.intellij.xdebugger.impl.ui.XDebuggerExpressionComboBox;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.swing.plaf.basic.BasicRadioButtonUI;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@@ -83,6 +88,7 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
private JPanel myCustomRightPropertiesPanelWrapper;
|
||||
private JBCheckBox myConditionEnabledCheckbox;
|
||||
private JPanel myCustomTopPropertiesPanelWrapper;
|
||||
private JPanel myConditionEnabledPanel;
|
||||
private final List<XBreakpointCustomPropertiesPanel<B>> myCustomPanels;
|
||||
|
||||
private List<XBreakpointPropertiesSubPanel<B>> mySubPanels = new ArrayList<XBreakpointPropertiesSubPanel<B>>();
|
||||
@@ -91,12 +97,17 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
|
||||
private B myBreakpoint;
|
||||
|
||||
private final boolean myShowAllOptions;
|
||||
private static final String CONDITION_ENABLED_LABEL = "label";
|
||||
private static final String CONDITION_ENABLED_CHECKBOX = "checkbox";
|
||||
|
||||
public void setDetailView(DetailView detailView) {
|
||||
myMasterBreakpointPanel.setDetailView(detailView);
|
||||
}
|
||||
|
||||
public XLightBreakpointPropertiesPanel(Project project, XBreakpointManager breakpointManager, B breakpoint, boolean showAllOptions) {
|
||||
myBreakpoint = breakpoint;
|
||||
myShowAllOptions = showAllOptions;
|
||||
XBreakpointType<B, ?> breakpointType = XBreakpointUtil.getType(breakpoint);
|
||||
|
||||
mySuspendPolicyPanel.init(project, breakpointManager, breakpoint);
|
||||
@@ -112,6 +123,13 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
|
||||
myCustomPanels = new ArrayList<XBreakpointCustomPropertiesPanel<B>>();
|
||||
if (debuggerEditorsProvider != null) {
|
||||
myConditionEnabledCheckbox = new JBCheckBox(XDebuggerBundle.message("xbreakpoints.condition.checkbox"));
|
||||
JBLabel conditionEnabledLabel = new JBLabel(XDebuggerBundle.message("xbreakpoints.condition.checkbox"));
|
||||
conditionEnabledLabel.setBorder(new EmptyBorder(0, ((BasicRadioButtonUI)myConditionEnabledCheckbox.getUI()).getDefaultIcon().getIconWidth() +
|
||||
myConditionEnabledCheckbox.getIconTextGap() +
|
||||
myConditionEnabledCheckbox.getBorder().getBorderInsets(myConditionEnabledCheckbox).left, 0, 0));
|
||||
myConditionEnabledPanel.add(myConditionEnabledCheckbox, CONDITION_ENABLED_CHECKBOX);
|
||||
myConditionEnabledPanel.add(conditionEnabledLabel, CONDITION_ENABLED_LABEL);
|
||||
myConditionComboBox = new XDebuggerExpressionComboBox(project, debuggerEditorsProvider, CONDITION_HISTORY_ID, myBreakpoint.getSourcePosition());
|
||||
JComponent conditionComponent = myConditionComboBox.getComponent();
|
||||
myConditionExpressionPanel.add(conditionComponent, BorderLayout.CENTER);
|
||||
@@ -161,7 +179,7 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
@Override
|
||||
public void focusGained(FocusEvent event) {
|
||||
if (myConditionComboBox != null) {
|
||||
IdeFocusManager.findInstance().requestFocus(myConditionComboBox.getComponent(), false);
|
||||
IdeFocusManager.findInstance().requestFocus(myConditionComboBox.getEditorComponent(), false);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -187,7 +205,8 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
|
||||
if (myConditionComboBox != null) {
|
||||
myBreakpoint.setConditionEnabled(myConditionEnabledCheckbox.isSelected());
|
||||
myBreakpoint.setConditionExpression(myConditionComboBox.getExpression());
|
||||
XExpression expression = myConditionComboBox.getExpression();
|
||||
myBreakpoint.setConditionExpression(expression != null && !expression.getExpression().isEmpty() ? expression : null);
|
||||
myConditionComboBox.saveTextInHistory();
|
||||
}
|
||||
|
||||
@@ -203,8 +222,13 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
}
|
||||
|
||||
if (myConditionComboBox != null) {
|
||||
myConditionEnabledCheckbox.setSelected(myBreakpoint.isConditionEnabled());
|
||||
myConditionComboBox.setExpression(myBreakpoint.getConditionExpressionInt());
|
||||
XExpression condition = myBreakpoint.getConditionExpressionInt();
|
||||
myConditionComboBox.setExpression(condition);
|
||||
boolean hideCheckbox = !myShowAllOptions && condition == null;
|
||||
myConditionEnabledCheckbox.setSelected(hideCheckbox || (myBreakpoint.isConditionEnabled() && condition != null));
|
||||
((CardLayout)myConditionEnabledPanel.getLayout()).show(myConditionEnabledPanel, hideCheckbox ? CONDITION_ENABLED_LABEL : CONDITION_ENABLED_CHECKBOX);
|
||||
|
||||
onCheckboxChanged();
|
||||
}
|
||||
|
||||
for (XBreakpointCustomPropertiesPanel<B> customPanel : myCustomPanels) {
|
||||
@@ -212,8 +236,6 @@ public class XLightBreakpointPropertiesPanel<B extends XBreakpointBase<?,?,?>> i
|
||||
}
|
||||
myEnabledCheckbox.setSelected(myBreakpoint.isEnabled());
|
||||
myEnabledCheckbox.setText(XBreakpointUtil.getShortText(myBreakpoint) + " enabled");
|
||||
|
||||
onCheckboxChanged();
|
||||
}
|
||||
|
||||
public JPanel getMainPanel() {
|
||||
|
||||
Reference in New Issue
Block a user