Ejemplo n.º 1
0
 /** Performs stop action. */
 void stop(boolean stop, final AbstractThread thread) {
   final ResourceBundle bundle = NbBundle.getBundle(JPDADebugger.class);
   if (stop) {
     removeStepRequest();
     setLastAction(ACTION_BREAKPOINT_HIT);
     setDebuggerState(DEBUGGER_STOPPED);
     operator.stopRequest();
     SwingUtilities.invokeLater(
         new Runnable() {
           public void run() {
             thread.setCurrent(true);
             updateWatches();
             threadGroup.refresh();
           }
         });
   } else operator.resume();
 }
Ejemplo n.º 2
0
  /**
   * Sets curent line. It means: change debugger state to stopped, shows message, sets current
   * thread and updates watches.
   */
  private void makeCurrent(
      final String threadName,
      final String className,
      final String methodName,
      final String lineNumber,
      final boolean hasSource,
      final ThreadReference tr) {
    setDebuggerState(DEBUGGER_STOPPED);

    SwingUtilities.invokeLater(
        new Runnable() {
          public void run() {
            // show message
            if (isFollowedByEditor()) {
              if (hasSource) {
                println(
                    new MessageFormat(bundle.getString("CTL_Thread_stopped"))
                        .format(new Object[] {threadName, className, methodName, lineNumber}),
                    ERR_OUT + STL_OUT);
              } else {
                println(
                    new MessageFormat(bundle.getString("CTL_Thread_stopped_no_source"))
                        .format(new Object[] {threadName, className, methodName, lineNumber}),
                    ERR_OUT + STL_OUT);
              }
            } else
              println(
                  new MessageFormat(bundle.getString("CTL_Thread_stopped"))
                      .format(new Object[] {threadName, className, methodName, lineNumber}),
                  ERR_OUT + STL_OUT);

            // refresh all
            JPDAThread tt = threadManager.getThread(tr);
            tt.setCurrent(true);
            updateWatches();
          }
        });
  }