]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed #933
authorJani Laakso <jani.laakso@itmill.com>
Thu, 18 Oct 2007 11:16:31 +0000 (11:16 +0000)
committerJani Laakso <jani.laakso@itmill.com>
Thu, 18 Oct 2007 11:16:31 +0000 (11:16 +0000)
svn changeset:2548/svn branch:trunk

WebContent/ITMILL/themes/reservr/styles.css
src/com/itmill/toolkit/demo/colorpicker/gwt/client/WidgetSet.java
src/com/itmill/toolkit/demo/colorpicker/gwt/client/ui/IColorPicker.java [new file with mode: 0644]
src/com/itmill/toolkit/demo/colorpicker/gwt/client/ui/ItkColorPicker.java [deleted file]
src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java
src/com/itmill/toolkit/terminal/gwt/client/ui/IUnknownComponent.java
src/com/itmill/toolkit/terminal/gwt/public/default/common/common.css
src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java

index 6bf615f486395dae87ec54270014e7abb6cf68b3..c4e2ac9188af399421ae14753836d9de406cd5d1 100644 (file)
@@ -5,7 +5,7 @@ body {
        background-repeat: no-repeat;
        background-position: top right;\r
 }
-#itmtk-ajax-window {
+#itmill-ajax-window {
        background-color: transparent;  
 }\r
 #header {\r
@@ -64,7 +64,7 @@ textarea.i-textfield {
        background: none;\r
        font-weight: bold;\r
 }\r
-#itmtk-ajax-window .i-button-selected-link {\r
+#itmill-ajax-window .i-button-selected-link {\r
        border: 0px;\r
        text-align: left;\r
        text-decoration: none;\r
index 58457aa57169a6293b78463984932023236d7386..8cddcdf206d365e794b3aff953e516a115fbcfb9 100644 (file)
@@ -1,7 +1,7 @@
 package com.itmill.toolkit.demo.colorpicker.gwt.client;\r
 \r
 import com.google.gwt.user.client.ui.Widget;\r
-import com.itmill.toolkit.demo.colorpicker.gwt.client.ui.ItkColorPicker;\r
+import com.itmill.toolkit.demo.colorpicker.gwt.client.ui.IColorPicker;\r
 import com.itmill.toolkit.terminal.gwt.client.DefaultWidgetSet;\r
 import com.itmill.toolkit.terminal.gwt.client.UIDL;\r
 \r
@@ -9,9 +9,9 @@ public class WidgetSet extends DefaultWidgetSet {
        /** Creates a widget according to its class name. */\r
     public Widget createWidget(UIDL uidl) {\r
        String className = resolveWidgetTypeName(uidl);\r
-       if ("com.itmill.toolkit.demo.colorpicker.gwt.client.ui.ItkColorPicker"\r
+       if ("com.itmill.toolkit.demo.colorpicker.gwt.client.ui.IColorPicker"\r
                        .equals(className))\r
-               return new ItkColorPicker();\r
+               return new IColorPicker();\r
 \r
        // Let the DefaultWidgetSet handle creation of default widgets\r
        return super.createWidget(uidl);\r
@@ -21,7 +21,7 @@ public class WidgetSet extends DefaultWidgetSet {
     protected String resolveWidgetTypeName(UIDL uidl) {\r
        String tag = uidl.getTag();\r
        if ("colorpicker".equals(tag))\r
-               return "com.itmill.toolkit.demo.colorpicker.gwt.client.ui.ItkColorPicker";\r
+               return "com.itmill.toolkit.demo.colorpicker.gwt.client.ui.IColorPicker";\r
 \r
        // Let the DefaultWidgetSet handle resolution of default widgets\r
        return super.resolveWidgetTypeName(uidl);\r
diff --git a/src/com/itmill/toolkit/demo/colorpicker/gwt/client/ui/IColorPicker.java b/src/com/itmill/toolkit/demo/colorpicker/gwt/client/ui/IColorPicker.java
new file mode 100644 (file)
index 0000000..e7738ca
--- /dev/null
@@ -0,0 +1,74 @@
+package com.itmill.toolkit.demo.colorpicker.gwt.client.ui;
+
+import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection;
+import com.itmill.toolkit.terminal.gwt.client.Paintable;
+import com.itmill.toolkit.terminal.gwt.client.UIDL;
+
+public class IColorPicker extends GwtColorPicker implements Paintable {
+
+       /** Set the CSS class name to allow styling. */
+       public static final String CLASSNAME = "example-colorpicker";
+
+       /** Component identifier in UIDL communications. */
+       String uidlId;
+
+       /** Reference to the server connection object. */
+       ApplicationConnection client;
+
+       /**
+        * The constructor should first call super() to initialize the component and
+        * then handle any initialization relevant to IT Mill Toolkit.
+        */
+       public IColorPicker() {
+               // The superclass has a lot of relevant initialization
+               super();
+
+               // This method call of the Paintable interface sets the component
+               // style name in DOM tree
+               setStyleName(CLASSNAME);
+       }
+
+       /**
+        * This method must be implemented to update the client-side component from
+        * UIDL data received from server.
+        * 
+        * This method is called when the page is loaded for the first time, and
+        * every time UI changes in the component are received from the server.
+        */
+       public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
+               // This call should be made first. Ensure correct implementation,
+               // and let the containing layout manage caption, etc.
+               if (client.updateComponent(this, uidl, true))
+                       return;
+
+               // Save reference to server connection object to be able to send
+               // user interaction later
+               this.client = client;
+
+               // Save the UIDL identifier for the component
+               uidlId = uidl.getId();
+
+               // Get value received from server and actualize it in the GWT component
+               setColor(uidl.getStringVariable("colorname"));
+       }
+
+       /** Override the method to communicate the new value to server. */
+       public void setColor(String newcolor) {
+               // Ignore if no change
+               if (newcolor.equals(currentcolor.getText()))
+                       return;
+
+               // Let the original implementation to do whatever it needs to do
+               super.setColor(newcolor);
+
+               // Updating the state to the server can not be done before
+               // the server connection is known, i.e., before updateFromUIDL()
+               // has been called.
+               if (uidlId == null || client == null)
+                       return;
+
+               // Communicate the user interaction parameters to server. This call will
+               // initiate an AJAX request to the server.
+               client.updateVariable(uidlId, "colorname", newcolor, true);
+       }
+}
diff --git a/src/com/itmill/toolkit/demo/colorpicker/gwt/client/ui/ItkColorPicker.java b/src/com/itmill/toolkit/demo/colorpicker/gwt/client/ui/ItkColorPicker.java
deleted file mode 100644 (file)
index 2b7f4a8..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.itmill.toolkit.demo.colorpicker.gwt.client.ui;
-
-import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection;
-import com.itmill.toolkit.terminal.gwt.client.Paintable;
-import com.itmill.toolkit.terminal.gwt.client.UIDL;
-
-public class ItkColorPicker extends GwtColorPicker implements Paintable {
-
-       /** Set the CSS class name to allow styling. */
-       public static final String CLASSNAME = "example-colorpicker";
-
-       /** Component identifier in UIDL communications. */
-       String uidlId;
-
-       /** Reference to the server connection object. */
-       ApplicationConnection client;
-
-       /**
-        * The constructor should first call super() to initialize the component and
-        * then handle any initialization relevant to IT Mill Toolkit.
-        */
-       public ItkColorPicker() {
-               // The superclass has a lot of relevant initialization
-               super();
-
-               // This method call of the Paintable interface sets the component
-               // style name in DOM tree
-               setStyleName(CLASSNAME);
-       }
-
-       /**
-        * This method must be implemented to update the client-side component from
-        * UIDL data received from server.
-        * 
-        * This method is called when the page is loaded for the first time, and
-        * every time UI changes in the component are received from the server.
-        */
-       public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
-               // This call should be made first. Ensure correct implementation,
-               // and let the containing layout manage caption, etc.
-               if (client.updateComponent(this, uidl, true))
-                       return;
-
-               // Save reference to server connection object to be able to send
-               // user interaction later
-               this.client = client;
-
-               // Save the UIDL identifier for the component
-               uidlId = uidl.getId();
-
-               // Get value received from server and actualize it in the GWT component
-               setColor(uidl.getStringVariable("colorname"));
-       }
-
-       /** Override the method to communicate the new value to server. */
-       public void setColor(String newcolor) {
-               // Ignore if no change
-               if (newcolor.equals(currentcolor.getText()))
-                       return;
-
-               // Let the original implementation to do whatever it needs to do
-               super.setColor(newcolor);
-
-               // Updating the state to the server can not be done before
-               // the server connection is known, i.e., before updateFromUIDL()
-               // has been called.
-               if (uidlId == null || client == null)
-                       return;
-
-               // Communicate the user interaction parameters to server. This call will
-               // initiate an AJAX request to the server.
-               client.updateVariable(uidlId, "colorname", newcolor, true);
-       }
-}
index cea4565cef70fb3640be3eaeecb38f139169b2da..f9b1dfcc993f43b795aeaa1c6ca4f04df125c8a4 100755 (executable)
@@ -59,7 +59,7 @@ public class ApplicationConnection implements FocusListener {
                makeUidlRequest("repaintAll=1");
 
                // TODO remove hardcoded id name
-               view = new IView("itmtk-ajax-window");
+               view = new IView("itmill-ajax-window");
 
        }
 
@@ -76,7 +76,7 @@ public class ApplicationConnection implements FocusListener {
 
        public native String getAppUri()
        /*-{
-        var u = $wnd.itmtk.appUri;
+        var u = $wnd.itmill.appUri;
         if (u.indexOf("/") != 0 && u.indexOf("http") != 0) {
         var b = $wnd.location.href;
         var i = b.length-1;
@@ -89,7 +89,7 @@ public class ApplicationConnection implements FocusListener {
 
        private native String getPathInfo()
        /*-{
-        return $wnd.itmtk.pathInfo;
+        return $wnd.itmill.pathInfo;
         }-*/;
 
        private void makeUidlRequest(String requestData) {
index cbe7698372c300d232f8f943f570e611356c5578..5785489a3a3da7b183748a2aa2f66b03054126e6 100644 (file)
@@ -17,8 +17,8 @@ public class IUnknownComponent extends Composite implements Paintable {
                panel.add(caption);
                panel.add(uidlTree);
                initWidget(panel);
-               setStyleName("itmtk-unknown");
-               caption.setStyleName("itmtk-unknown-caption");
+               setStyleName("itmill-unknown");
+               caption.setStyleName("itmill-unknown-caption");
        }
 
        public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
index 6b71089bd74cc1eda06862d3b74d819c9ec61ca1..57fad722a8d1a2dc295599b5d85932b4de670147 100644 (file)
@@ -1,4 +1,4 @@
-#itmtk-ajax-window {
+#itmill-ajax-window {
        background: #e9eced;
        font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif;
        color: #464f52;
        height: 100%;   
 }
 
-#itmtk-ajax-window input, 
-#itmtk-ajax-window select, 
-#itmtk-ajax-window textarea, 
-#itmtk-ajax-window button {
+#itmill-ajax-window input, 
+#itmill-ajax-window select, 
+#itmill-ajax-window textarea, 
+#itmill-ajax-window button {
        font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif;
        color: #464f52;
 }
 
-#itmtk-ajax-window select {
+#itmill-ajax-window select {
        padding: 0;
        margin: 0;
 }
index 488b92e61a31800449964393b3d95da3f438bce4..7e20440be248fc37ce7a20c65bec645b825f31cc 100644 (file)
@@ -440,7 +440,7 @@ public class ApplicationServlet extends HttpServlet {
                page
                                .write("<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<title>IT Mill Toolkit 5</title>\n"
                                                + "<script type=\"text/javascript\">\n"
-                                               + "     var itmtk = {\n" + "            appUri:'");
+                                               + "     var itmill = {\n" + "           appUri:'");
 
                String[] urlParts = getApplicationUrl(request).toString().split("\\/");
                String appUrl = "";
@@ -481,7 +481,7 @@ public class ApplicationServlet extends HttpServlet {
                                                + "/styles.css\">"
                                                + "</head>\n<body>\n"
                                                + "     <iframe id=\"__gwt_historyFrame\" style=\"width:0;height:0;border:0\"></iframe>\n"
-                                               + "     <div id=\"itmtk-ajax-window\"></div>"
+                                               + "     <div id=\"itmill-ajax-window\"></div>"
                                                + "     </body>\n" + "</html>\n");
 
                page.close();