Examples of ScriptHandler


Examples of org.ngrinder.script.handler.ScriptHandler

        checkNotEmpty(scriptEntry.getContent(), "scriptEntity content should be provided");
      }
      checkNotNull(user, "user should be provided");
      // String result = checkSyntaxErrors(scriptEntry.getContent());

      ScriptHandler handler = scriptHandlerFactory.getHandler(scriptEntry);
      if (config.getControllerProperties().getPropertyBoolean(PROP_CONTROLLER_VALIDATION_SYNTAX_CHECK)) {
        String result = handler.checkSyntaxErrors(scriptEntry.getPath(), scriptEntry.getContent());
        LOGGER.info("Perform Syntax Check by {} for {}", user.getUserId(), scriptEntry.getPath());
        if (result != null) {
          return result;
        }
      }
      File scriptDirectory = config.getHome().getScriptDirectory(user);
      FileUtils.deleteDirectory(scriptDirectory);
      Preconditions.checkTrue(scriptDirectory.mkdirs(), "Script directory {} creation is failed.");

      ProcessingResultPrintStream processingResult = new ProcessingResultPrintStream(new ByteArrayOutputStream());
      handler.prepareDist(0L, user, scriptEntry, scriptDirectory, config.getControllerProperties(), processingResult);
      if (!processingResult.isSuccess()) {
        return new String(processingResult.getLogByteArray());
      }
      File scriptFile = new File(scriptDirectory, FilenameUtils.getName(scriptEntry.getPath()));
View Full Code Here

Examples of org.rsbot.script.internal.ScriptHandler

          methods.menu.setupListener();
        } catch (final Exception ignored) {
        }
      }
    });
    sh = new ScriptHandler(this);
    backBuffer = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
    image = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
    paintEvent = new PaintEvent();
    textPaintEvent = new TextPaintEvent();
    eventManager = new EventManager();
View Full Code Here

Examples of org.rsbot.script.internal.ScriptHandler

      new ScriptSelector(this, bot).showGUI();
    }
  }

  private void showStopScript(final Bot bot) {
    final ScriptHandler sh = bot.getScriptHandler();
    final Map<Integer, LoopTask> running = sh.getRunningScripts();
    if (running.size() > 0) {
      final int result = JOptionPane.showConfirmDialog(this, "Would you like to stop the script?", "Script", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
      if (result == JOptionPane.OK_OPTION) {
        sh.stopAllScripts();
        bot.getMethodContext().web.unloadWebScripts();
        updateScriptControls();
      }
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.