コード例 #1
0
  public void loadProperties() {
    for (XBreakpointPropertiesSubPanel<B> panel : mySubPanels) {
      panel.loadProperties();
    }

    if (myConditionComboBox != null) {
      String condition = myBreakpoint.getCondition();
      myConditionComboBox.setText(condition != null ? condition : "");
    }

    for (XBreakpointCustomPropertiesPanel<B> customPanel : myCustomPanels) {
      customPanel.loadFrom(myBreakpoint);
    }
    myEnabledCheckbox.setSelected(myBreakpoint.isEnabled());
    myEnabledCheckbox.setText(XBreakpointUtil.getShortText(myBreakpoint));
  }
コード例 #2
0
  public void saveProperties() {
    for (XBreakpointPropertiesSubPanel<B> panel : mySubPanels) {
      panel.saveProperties();
    }

    if (myConditionComboBox != null) {
      final String text = myConditionComboBox.getText();
      final String condition = StringUtil.isEmptyOrSpaces(text) ? null : text;
      myBreakpoint.setCondition(condition);
      if (condition != null) {
        myConditionComboBox.saveTextInHistory();
      }
    }

    for (XBreakpointCustomPropertiesPanel<B> customPanel : myCustomPanels) {
      customPanel.saveTo(myBreakpoint);
    }
    if (!myCustomPanels.isEmpty()) {
      ((XBreakpointBase) myBreakpoint).fireBreakpointChanged();
    }
    myBreakpoint.setEnabled(myEnabledCheckbox.isSelected());
  }
コード例 #3
0
  public XLightBreakpointPropertiesPanel(
      Project project, XBreakpointManager breakpointManager, B breakpoint, boolean showAllOptions) {
    myBreakpoint = breakpoint;
    XBreakpointType<B, ?> breakpointType = XBreakpointUtil.getType(breakpoint);

    mySuspendPolicyPanel.init(project, breakpointManager, breakpoint);
    mySuspendPolicyPanel.setDelegate(this);

    mySubPanels.add(mySuspendPolicyPanel);
    myMasterBreakpointPanel.init(project, breakpointManager, breakpoint);
    mySubPanels.add(myMasterBreakpointPanel);
    XDebuggerEditorsProvider debuggerEditorsProvider =
        breakpointType.getEditorsProvider(breakpoint, project);

    myActionsPanel.init(project, breakpointManager, breakpoint, debuggerEditorsProvider);
    mySubPanels.add(myActionsPanel);

    if (debuggerEditorsProvider != null) {
      myConditionComboBox =
          new XDebuggerExpressionComboBox(
              project,
              debuggerEditorsProvider,
              "breakpointCondition",
              myBreakpoint.getSourcePosition());
      JComponent conditionComponent = myConditionComboBox.getComponent();
      myConditionExpressionPanel.add(conditionComponent, BorderLayout.CENTER);
    } else {
      myConditionPanel.setVisible(false);
    }

    myShowMoreOptions = false;
    for (XBreakpointPropertiesSubPanel<B> panel : mySubPanels) {
      if (panel.lightVariant(showAllOptions)) {
        myShowMoreOptions = true;
      }
    }

    myCustomPanels = new ArrayList<XBreakpointCustomPropertiesPanel<B>>();
    XBreakpointCustomPropertiesPanel<B> customPropertiesPanel =
        breakpointType.createCustomPropertiesPanel();
    if (customPropertiesPanel != null) {
      myCustomPropertiesPanelWrapper.add(customPropertiesPanel.getComponent(), BorderLayout.CENTER);
      myCustomPanels.add(customPropertiesPanel);
    }

    XBreakpointCustomPropertiesPanel<B> customConditionPanel =
        breakpointType.createCustomConditionsPanel();
    if (customConditionPanel != null) {
      myCustomConditionsPanelWrapper.add(customConditionPanel.getComponent(), BorderLayout.CENTER);
      myCustomPanels.add(customConditionPanel);
    }

    myMainPanel.addFocusListener(
        new FocusAdapter() {
          @Override
          public void focusGained(FocusEvent event) {
            if (myConditionComboBox != null) {
              IdeFocusManager.findInstance()
                  .requestFocus(myConditionComboBox.getComponent(), false);
            }
          }
        });
    myEnabledCheckbox.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent event) {
            myBreakpoint.setEnabled(myEnabledCheckbox.isSelected());
          }
        });
  }