Class ScriptingWindow


  • public class ScriptingWindow
    extends java.lang.Object
    Scripting window
    • Field Detail

      • DEFAULT_SCRIPTS_DIR

        public static final java.lang.String DEFAULT_SCRIPTS_DIR
        See Also:
        Constant Field Values
    • Constructor Detail

      • ScriptingWindow

        public ScriptingWindow()
    • Method Detail

      • loadPlugins

        public static void loadPlugins()
      • unloadPlugins

        public static void unloadPlugins()
      • executeScript

        public void executeScript​(ScriptItem scriptItem)
      • executeScript

        public void executeScript​(ScriptItem scriptItem,
                                  java.util.Map<java.lang.String,​java.lang.Object> bindings)
      • executeScript

        public void executeScript​(ScriptItem scriptItem,
                                  java.util.Map<java.lang.String,​java.lang.Object> bindings,
                                  boolean cancelQueue)
      • executeScripts

        public void executeScripts​(java.util.List<ScriptItem> scriptItems,
                                   java.util.Map<java.lang.String,​java.lang.Object> bindings,
                                   boolean cancelQueue)
        Execute scripts sequentially to make sure they don't interrupt each other.
        Parameters:
        scriptItems - List of script to execute.
        bindings - Additional bindings to pass to the executed script.
        cancelQueue - If true, the run queue is cleared before running the scripts.
      • executeScripts

        public void executeScripts​(java.util.List<ScriptItem> scriptItems)
      • executeScripts

        public void executeScripts​(java.util.List<ScriptItem> scriptItems,
                                   java.util.Map<java.lang.String,​java.lang.Object> bindings)
      • createScriptWorker

        public org.omegat.gui.scripting.ScriptingWindow.ScriptWorker createScriptWorker​(java.lang.String scriptString,
                                                                                        ScriptItem scriptItem,
                                                                                        java.util.Map<java.lang.String,​java.lang.Object> additionalBindings)
      • cancelCurrentScript

        public void cancelCurrentScript()
        Cancel the currently running script, if any.

        Note! Canceling the worker does not do anything in and of itself. The running script must poll for interruption with e.g. Thread.interrupted().

        See Also:
        StackOverflow answer about interrupting scripts
      • cancelScriptQueue

        public void cancelScriptQueue()
      • getSelectedText

        public java.lang.String getSelectedText()