public String getTargetLabel(DebugTargetImpl debugTarget) {
   String name = debugTarget.getName();
   String status = debugTarget.getVmStatus();
   if (status == null) {
     return name;
   } else {
     return NLS.bind(Messages.DebugTargetImpl_TARGET_NAME_PATTERN, name, status);
   }
 }
  private void fireTerminateEvent() {
    // TODO(peter.rybin): from Alexander Pavlov: I think you need to fire a terminate event after
    // this line, for consolePseudoProcess if one is not null.

    // Do not report on threads -- the children are gone when terminated.
    DebugTargetImpl.fireDebugEvent(
        new DebugEvent(debugTargetImpl, DebugEvent.TERMINATE, DebugEvent.UNSPECIFIED));
    DebugTargetImpl.fireDebugEvent(
        new DebugEvent(debugTargetImpl.getLaunch(), DebugEvent.TERMINATE, DebugEvent.UNSPECIFIED));
  }
 private void fireEventForThread(int kind, int detail) {
   try {
     IThread[] threads = debugTargetState.getThreads();
     if (threads.length > 0) {
       DebugTargetImpl.fireDebugEvent(new DebugEvent(threads[0], kind, detail));
     }
   } catch (DebugException e) {
     // Actually, this is not thrown in our getThreads()
     return;
   }
 }
  private void initWorkspaceRelations() {
    ConnectedTargetData.this.workspaceRelations =
        debugTargetImpl
            .getWorkspaceBridgeFactory()
            .attachedToVm(ConnectedTargetData.this, vmEmbedder.getJavascriptVm());

    // We'd like to know when launch is removed to remove our project.
    DebugPlugin.getDefault()
        .getLaunchManager()
        .addLaunchListener(
            new ILaunchListener() {
              public void launchAdded(ILaunch launch) {}

              public void launchChanged(ILaunch launch) {}
              // TODO(peter.rybin): maybe have one instance of listener for all targets?
              public void launchRemoved(ILaunch launch) {
                if (launch != debugTargetImpl.getLaunch()) {
                  return;
                }
                DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
                workspaceRelations.launchRemoved();
              }
            });
  }
 public void reset() {
   listenerBlock.waitUntilReady();
   workspaceRelations.handleVmResetEvent();
   DebugTargetImpl.fireDebugEvent(
       new DebugEvent(debugTargetImpl, DebugEvent.CHANGE, DebugEvent.CONTENT));
 }
 void fireSuspendEvent(int detail) {
   fireEventForThread(DebugEvent.SUSPEND, detail);
   DebugTargetImpl.fireDebugEvent(new DebugEvent(debugTargetImpl, DebugEvent.SUSPEND, detail));
 }
 public SourceWrapSupport getSourceWrapSupport() {
   return debugTargetImpl.getSourceWrapSupport();
 }
 public synchronized void busyStatusChanged(String currentRequest, int numberOfEnqueued) {
   this.currentRequest = currentRequest;
   this.numberOfEnqueued = numberOfEnqueued;
   DebugTargetImpl.fireDebugEvent(new DebugEvent(debugTargetImpl, DebugEvent.CHANGE));
 }
 void fireResumeEvent(int detail) {
   fireEventForThread(DebugEvent.RESUME, detail);
   DebugTargetImpl.fireDebugEvent(new DebugEvent(debugTargetImpl, DebugEvent.RESUME, detail));
 }
 void fireBecameConnectedEvents() {
   setDisconnected(false);
   DebugTargetImpl.fireDebugEvent(new DebugEvent(debugTargetImpl, DebugEvent.CHANGE));
   fireEventForThread(DebugEvent.CREATE, DebugEvent.UNSPECIFIED);
 }