private void unmarkBreakpoint(RemoteScreenshot screenshot, ComponentBreakpoint b) {
   ComponentBreakpoint.ComponentDescription cd = ((ComponentBreakpoint) b).getComponent();
   if (cd != null) {
     ObjectReference oc = cd.getComponent(debugger);
     if (oc != null) {
       ComponentInfo ci = findComponentInfo(screenshot.getComponentInfo(), oc);
       if (ci != null) {
         screenshot.getScreenshotUIManager().unmarkBreakpoint(ci);
       }
     }
   }
 }
  @Override
  public void doAction(Object action) {
    String msg = null;
    setEnabled(ScreenshotUIManager.ACTION_TAKE_SCREENSHOT, false);
    try {
      ProgressHandle ph = createProgress();

      RemoteScreenshot[] screenshots = null;
      try {
        screenshots = RemoteAWTScreenshot.takeCurrent(debugger);
        for (int i = 0; i < screenshots.length; i++) {
          final RemoteScreenshot screenshot = screenshots[i];
          screenshot.getScreenshotUIManager().open();
          bpListener.addScreenshot(screenshot);
          /*
          SwingUtilities.invokeLater(new Runnable() {
          @Override
          public void run() {
          ScreenshotComponent sc = new ScreenshotComponent(screenshot);
          sc.open();
          sc.requestActive();
          }
          });*/
        }
        if (screenshots != null && screenshots.length != 0) {
          GestureSubmitter.logSnapshotTaken("Swing", debugger);
          return;
        }
      } finally {
        ph.finish();
      }

      ph = createProgress();
      try {
        screenshots = RemoteFXScreenshot.takeCurrent(debugger);
        for (int i = 0; i < screenshots.length; i++) {
          final RemoteScreenshot screenshot = screenshots[i];
          screenshot.getScreenshotUIManager().open();
          bpListener.addScreenshot(screenshot);
        }

        if (screenshots != null && screenshots.length != 0) {
          GestureSubmitter.logSnapshotTaken("JavaFX", debugger);
          return;
        }
      } finally {
        ph.finish();
      }
      msg = NbBundle.getMessage(TakeScreenshotActionProvider.class, "MSG_NoScreenshots");
    } catch (RetrievalException ex) {
      msg = ex.getLocalizedMessage();
      if (ex.getCause() != null) {
        Exceptions.printStackTrace(ex);
      }
    } finally {
      setEnabled(ScreenshotUIManager.ACTION_TAKE_SCREENSHOT, true);
    }
    if (msg != null) {
      NotifyDescriptor nd = new NotifyDescriptor.Message(msg);
      DialogDisplayer.getDefault().notify(nd);
    }
  }