public void tearDown() {
   // hack - enable org.netbeans.modules.debugger.jpda.projects.ToolTipAnnotation
   //        System.clearProperty("org.netbeans.modules.debugger.jpda.doNotShowTooltips"); //
   // NOI18N
   debugger.removePropertyChangeListener(this);
   //        debugger.getThreadsCollector().removePropertyChangeListener(this);
   clearAnnotations();
 }
 public void tearUp(MethodChooser selector) {
   // hack - disable org.netbeans.modules.debugger.jpda.projects.ToolTipAnnotation
   //        System.setProperty("org.netbeans.modules.debugger.jpda.doNotShowTooltips", "true"); //
   // NOI18N
   this.chooser = selector;
   debugger.addPropertyChangeListener(this);
   //        debugger.getThreadsCollector().addPropertyChangeListener(this);
   annotateLines();
 }
  public boolean init() {
    refs = new CsmReference[0];
    FunctionCallsProvider fcProvider = Lookup.getDefault().lookup(FunctionCallsProvider.class);

    if (fcProvider == null) {
      // System.out.println("No function calls provider - just step into");
      debugger.stepInto();
      return true;
    }
    GdbCallStackFrame currentCallStackFrame = debugger.getCurrentCallStackFrame();

    if (currentCallStackFrame == null) {
      debugger.stepInto();
      return true;
    }

    List<CsmReference> functionCallsList =
        fcProvider.getFunctionCalls(
            currentCallStackFrame.getDocument(), currentCallStackFrame.getLineNumber() - 1);

    refs = functionCallsList.toArray(new CsmReference[functionCallsList.size()]);
    selectedIndex = 0;

    if (refs.length == 0) {
      debugger.stepInto();
      return true;
    } else if (refs.length == 1) {
      // do not show UI, continue directly using the selection
      // String name = functionCalls[selectedIndex].name;

      debugger.stepInto();
      // RunIntoMethodActionProvider.doAction(debugger, name, locations[selectedIndex], true);
      return true;
    }
    return false;
  }
 public void doStepInto() {
   final CsmReference ref = refs[chooser.getSelectedIndex()];
   debugger
       .getRequestProcessor()
       .post(
           new Runnable() {
             @Override
             public void run() {
               final CsmObject referencedObject = ref.getReferencedObject();
               if (CsmKindUtilities.isFunction(referencedObject)) {
                 debugger.until((CsmFunction) referencedObject);
               }
             }
           });
   //        debugger.getRequestProcessor().post(new Runnable() {
   //            public void run() {
   //                RunIntoMethodActionProvider.doAction(debugger, name, locations[index], true);
   //            }
   //        });
 }
 @Override
 public void propertyChange(PropertyChangeEvent evt) {
   if (debugger.getState() == GdbDebugger.State.EXITED) {
     chooser.releaseUI(false);
   }
 }