Search in sources :

Example 1 with XBreakpointCustomPropertiesPanel

use of com.intellij.xdebugger.breakpoints.ui.XBreakpointCustomPropertiesPanel in project intellij-community by JetBrains.

the class XLightBreakpointPropertiesPanel method loadProperties.

public void loadProperties() {
    mySubPanels.forEach(XBreakpointPropertiesSubPanel::loadProperties);
    if (myConditionComboBox != null) {
        XExpression condition = myBreakpoint.getConditionExpressionInt();
        myConditionComboBox.setExpression(condition);
        boolean hideCheckbox = !myShowAllOptions && condition == null;
        myConditionEnabledCheckbox.setSelected(hideCheckbox || (myBreakpoint.isConditionEnabled() && condition != null));
        myConditionEnabledPanel.removeAll();
        if (hideCheckbox) {
            JBLabel label = new JBLabel(XDebuggerBundle.message("xbreakpoints.condition.checkbox"));
            label.setBorder(JBUI.Borders.empty(0, 4));
            label.setLabelFor(myConditionComboBox.getComboBox());
            myConditionEnabledPanel.add(label);
        } else {
            myConditionEnabledPanel.add(myConditionEnabledCheckbox);
        }
        onCheckboxChanged();
    }
    for (XBreakpointCustomPropertiesPanel customPanel : myCustomPanels) {
        customPanel.loadFrom(myBreakpoint);
    }
    myEnabledCheckbox.setSelected(myBreakpoint.isEnabled());
    myBreakpointNameLabel.setText(XBreakpointUtil.getShortText(myBreakpoint));
}
Also used : JBLabel(com.intellij.ui.components.JBLabel) XBreakpointCustomPropertiesPanel(com.intellij.xdebugger.breakpoints.ui.XBreakpointCustomPropertiesPanel) XExpression(com.intellij.xdebugger.XExpression)

Example 2 with XBreakpointCustomPropertiesPanel

use of com.intellij.xdebugger.breakpoints.ui.XBreakpointCustomPropertiesPanel in project intellij-community by JetBrains.

the class XLightBreakpointPropertiesPanel method saveProperties.

public void saveProperties() {
    mySubPanels.forEach(XBreakpointPropertiesSubPanel::saveProperties);
    if (myConditionComboBox != null) {
        XExpression expression = myConditionComboBox.getExpression();
        XExpression condition = !XDebuggerUtilImpl.isEmptyExpression(expression) ? expression : null;
        myBreakpoint.setConditionEnabled(condition == null || myConditionEnabledCheckbox.isSelected());
        myBreakpoint.setConditionExpression(condition);
        myConditionComboBox.saveTextInHistory();
    }
    for (XBreakpointCustomPropertiesPanel customPanel : myCustomPanels) {
        customPanel.saveTo(myBreakpoint);
    }
    myBreakpoint.setEnabled(myEnabledCheckbox.isSelected());
}
Also used : XBreakpointCustomPropertiesPanel(com.intellij.xdebugger.breakpoints.ui.XBreakpointCustomPropertiesPanel) XExpression(com.intellij.xdebugger.XExpression)

Aggregations

XExpression (com.intellij.xdebugger.XExpression)2 XBreakpointCustomPropertiesPanel (com.intellij.xdebugger.breakpoints.ui.XBreakpointCustomPropertiesPanel)2 JBLabel (com.intellij.ui.components.JBLabel)1