Пример #1
0
  private int extractRobot() {
    repositoryManager.refresh();
    int rv = 0;

    output = new StringWriter();
    PrintWriter out = new PrintWriter(output);

    out.println("Robot Extract");
    List<IRobotSpecItem> selectedRobots = getRobotSelectionPanel().getSelectedRobots();
    IRobotSpecItem spec = selectedRobots.get(0);

    try {
      WindowUtil.setStatusWriter(out);

      rv = repositoryManager.extractJar(spec);
      WindowUtil.setStatusWriter(null);
      WindowUtil.setStatus("");
      if (rv == 0) {
        out.println("Robot extracted successfully.");
      } else if (rv == -1) {
        out.println("Cancelled.");
      }
    } catch (Exception e) {
      out.println(e);
      rv = 8;
    }
    return rv;
  }
Пример #2
0
  public void finishButtonActionPerformed() {
    int rc = extractRobot();
    ConsoleDialog d;

    d = new ConsoleDialog(windowManager.getRobocodeFrame(), "Extract results", false);
    d.setText(output.toString());
    d.pack();
    d.pack();
    WindowUtil.packCenterShow(this, d);
    if (rc < 8) {
      this.dispose();
    }
  }