aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/vaadin/ui/Root.java
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-06-14 17:29:49 +0300
committerLeif Åstrand <leif@vaadin.com>2012-06-14 17:29:49 +0300
commitd44e06fc50415d3dcdc93ad8c711a2c4f2664e6e (patch)
treef87b0664fc3d6ccd3cf604b73b4bdcd1164a4658 /src/com/vaadin/ui/Root.java
parent0c06e5ac6e854ff428290db0697c11ebde97adb0 (diff)
downloadvaadin-framework-d44e06fc50415d3dcdc93ad8c711a2c4f2664e6e.tar.gz
vaadin-framework-d44e06fc50415d3dcdc93ad8c711a2c4f2664e6e.zip
JavascriptManager -> JavaScript and changes based on review (#6730)
Diffstat (limited to 'src/com/vaadin/ui/Root.java')
-rw-r--r--src/com/vaadin/ui/Root.java39
1 files changed, 10 insertions, 29 deletions
diff --git a/src/com/vaadin/ui/Root.java b/src/com/vaadin/ui/Root.java
index 9814084cbc..60408fe1dc 100644
--- a/src/com/vaadin/ui/Root.java
+++ b/src/com/vaadin/ui/Root.java
@@ -357,12 +357,6 @@ public abstract class Root extends AbstractComponentContainer implements
private List<Notification> notifications;
/**
- * A list of javascript commands that are waiting to be sent to the client.
- * Cleared (set to null) when the commands have been sent.
- */
- private List<String> jsExecQueue = null;
-
- /**
* List of windows in this root.
*/
private final LinkedHashSet<Window> windows = new LinkedHashSet<Window>();
@@ -408,7 +402,7 @@ public abstract class Root extends AbstractComponentContainer implements
private DirtyConnectorTracker dirtyConnectorTracker = new DirtyConnectorTracker(
this);
- private JavascriptManager javascriptManager;
+ private JavaScript javaScript;
private RootServerRpc rpc = new RootServerRpc() {
public void click(MouseEventDetails mouseDetails) {
@@ -557,16 +551,6 @@ public abstract class Root extends AbstractComponentContainer implements
notifications = null;
}
- // Add executable javascripts if needed
- if (jsExecQueue != null) {
- for (String script : jsExecQueue) {
- target.startTag("execJS");
- target.addAttribute("script", script);
- target.endTag("execJS");
- }
- jsExecQueue = null;
- }
-
if (scrollIntoView != null) {
target.addAttribute("scrollTo", scrollIntoView);
scrollIntoView = null;
@@ -1000,15 +984,12 @@ public abstract class Root extends AbstractComponentContainer implements
*
* @param script
* JavaScript snippet that will be executed.
+ *
+ * @deprecated as of 7.0, use getJavaScript().execute(String) instead
*/
+ @Deprecated
public void executeJavaScript(String script) {
- if (jsExecQueue == null) {
- jsExecQueue = new ArrayList<String>();
- }
-
- jsExecQueue.add(script);
-
- requestRepaint();
+ getJavaScript().execute(script);
}
/**
@@ -1592,14 +1573,14 @@ public abstract class Root extends AbstractComponentContainer implements
return dirtyConnectorTracker;
}
- public JavascriptManager getJavascriptManager() {
- if (javascriptManager == null) {
+ public JavaScript getJavaScript() {
+ if (javaScript == null) {
// Create and attach on first use
- javascriptManager = new JavascriptManager();
- addExtension(javascriptManager);
+ javaScript = new JavaScript();
+ addExtension(javaScript);
}
- return javascriptManager;
+ return javaScript;
}
}