Class CmsCodeMirrorScriptLoader
- java.lang.Object
-
- org.opencms.acacia.client.widgets.code.CmsCodeMirrorScriptLoader
-
public class CmsCodeMirrorScriptLoader extends java.lang.Object
Helper class that asynchronously loads all the necessary scripts and stylesheets for the CodeMirror editor widget, and executes a callback at the end.Scripts are loaded (unless they've already been loaded before) with the async=false option, which causes them to be executed in order, and a special dummy script is loaded at the end to execute the callback.
-
-
Constructor Summary
Constructors Constructor Description CmsCodeMirrorScriptLoader()
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
load(java.lang.Runnable callback)
Asynchronously loads all scripts / stylesheets and calls the given callback at the end.void
load(java.lang.String path)
Loads the script from the given path (which is treated as relative to the CodeMirror base URI.
-
-
-
Constructor Detail
-
CmsCodeMirrorScriptLoader
public CmsCodeMirrorScriptLoader()
Creates a new instance.
-
-
Method Detail
-
load
public void load(java.lang.Runnable callback)
Asynchronously loads all scripts / stylesheets and calls the given callback at the end.- Parameters:
callback
- the callback to execute after script loading
-
load
public void load(java.lang.String path)
Loads the script from the given path (which is treated as relative to the CodeMirror base URI.- Parameters:
path
- the path to load the script from
-
-