Пример #1
0
  /** Creates new form LineBreakpointPanel */
  public ActionsPanel(CndBreakpoint b) {
    breakpoint = b;
    initComponents();

    cbSuspend.addItem(
        NbBundle.getMessage(ActionsPanel.class, "LBL_CB_Actions_Panel_Suspend_None")); // NOI18N
    cbSuspend.addItem(
        NbBundle.getMessage(ActionsPanel.class, "LBL_CB_Actions_Panel_Suspend_Current")); // NOI18N
    cbSuspend.addItem(
        NbBundle.getMessage(ActionsPanel.class, "LBL_CB_Actions_Panel_Suspend_All")); // NOI18N
    tfThreadID.setText(b.getThreadID());

    switch (b.getSuspend()) {
      case CndBreakpoint.SUSPEND_NONE:
        cbSuspend.setSelectedIndex(0);
        tfThreadID.setEnabled(false);
        lThreadID.setEnabled(false);
        break;
      case CndBreakpoint.SUSPEND_THREAD:
        cbSuspend.setSelectedIndex(1);
        tfThreadID.setEnabled(true);
        lThreadID.setEnabled(true);
        break;
      case CndBreakpoint.SUSPEND_ALL:
      default:
        cbSuspend.setSelectedIndex(2);
        tfThreadID.setEnabled(false);
        lThreadID.setEnabled(false);
        break;
    }
    if (b.getPrintText() != null) {
      tfPrintText.setText(b.getPrintText());
    }
  }
Пример #2
0
  /** Called when "Ok" button is pressed. */
  public void ok() {
    String printText = tfPrintText.getText();
    if (printText.trim().length() > 0) {
      breakpoint.setPrintText(printText.trim());
    } else {
      breakpoint.setPrintText(null);
    }

    switch (cbSuspend.getSelectedIndex()) {
      case 0:
        breakpoint.setSuspend(CndBreakpoint.SUSPEND_NONE);
        break;
      case 1:
        breakpoint.setSuspend(CndBreakpoint.SUSPEND_THREAD, tfThreadID.getText());
        break;
      case 2:
        breakpoint.setSuspend(CndBreakpoint.SUSPEND_ALL);
        break;
    }
  }