From: Jani Laakso Date: Thu, 18 Oct 2007 11:16:31 +0000 (+0000) Subject: Fixed #933 X-Git-Tag: 6.7.0.beta1~5822 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=09d0f5071efeed61ad85c6cb3b3d4c2513d87e62;p=vaadin-framework.git Fixed #933 svn changeset:2548/svn branch:trunk --- diff --git a/WebContent/ITMILL/themes/reservr/styles.css b/WebContent/ITMILL/themes/reservr/styles.css index 6bf615f486..c4e2ac9188 100644 --- a/WebContent/ITMILL/themes/reservr/styles.css +++ b/WebContent/ITMILL/themes/reservr/styles.css @@ -5,7 +5,7 @@ body { background-repeat: no-repeat; background-position: top right; } -#itmtk-ajax-window { +#itmill-ajax-window { background-color: transparent; } #header { @@ -64,7 +64,7 @@ textarea.i-textfield { background: none; font-weight: bold; } -#itmtk-ajax-window .i-button-selected-link { +#itmill-ajax-window .i-button-selected-link { border: 0px; text-align: left; text-decoration: none; diff --git a/src/com/itmill/toolkit/demo/colorpicker/gwt/client/WidgetSet.java b/src/com/itmill/toolkit/demo/colorpicker/gwt/client/WidgetSet.java index 58457aa571..8cddcdf206 100644 --- a/src/com/itmill/toolkit/demo/colorpicker/gwt/client/WidgetSet.java +++ b/src/com/itmill/toolkit/demo/colorpicker/gwt/client/WidgetSet.java @@ -1,7 +1,7 @@ package com.itmill.toolkit.demo.colorpicker.gwt.client; import com.google.gwt.user.client.ui.Widget; -import com.itmill.toolkit.demo.colorpicker.gwt.client.ui.ItkColorPicker; +import com.itmill.toolkit.demo.colorpicker.gwt.client.ui.IColorPicker; import com.itmill.toolkit.terminal.gwt.client.DefaultWidgetSet; import com.itmill.toolkit.terminal.gwt.client.UIDL; @@ -9,9 +9,9 @@ public class WidgetSet extends DefaultWidgetSet { /** Creates a widget according to its class name. */ public Widget createWidget(UIDL uidl) { String className = resolveWidgetTypeName(uidl); - if ("com.itmill.toolkit.demo.colorpicker.gwt.client.ui.ItkColorPicker" + if ("com.itmill.toolkit.demo.colorpicker.gwt.client.ui.IColorPicker" .equals(className)) - return new ItkColorPicker(); + return new IColorPicker(); // Let the DefaultWidgetSet handle creation of default widgets return super.createWidget(uidl); @@ -21,7 +21,7 @@ public class WidgetSet extends DefaultWidgetSet { protected String resolveWidgetTypeName(UIDL uidl) { String tag = uidl.getTag(); if ("colorpicker".equals(tag)) - return "com.itmill.toolkit.demo.colorpicker.gwt.client.ui.ItkColorPicker"; + return "com.itmill.toolkit.demo.colorpicker.gwt.client.ui.IColorPicker"; // Let the DefaultWidgetSet handle resolution of default widgets return super.resolveWidgetTypeName(uidl); 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 index 0000000000..e7738caead --- /dev/null +++ b/src/com/itmill/toolkit/demo/colorpicker/gwt/client/ui/IColorPicker.java @@ -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 index 2b7f4a806b..0000000000 --- a/src/com/itmill/toolkit/demo/colorpicker/gwt/client/ui/ItkColorPicker.java +++ /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); - } -} diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java index cea4565cef..f9b1dfcc99 100755 --- a/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java @@ -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) { diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/IUnknownComponent.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/IUnknownComponent.java index cbe7698372..5785489a3a 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/IUnknownComponent.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/IUnknownComponent.java @@ -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) { diff --git a/src/com/itmill/toolkit/terminal/gwt/public/default/common/common.css b/src/com/itmill/toolkit/terminal/gwt/public/default/common/common.css index 6b71089bd7..57fad722a8 100644 --- a/src/com/itmill/toolkit/terminal/gwt/public/default/common/common.css +++ b/src/com/itmill/toolkit/terminal/gwt/public/default/common/common.css @@ -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; @@ -11,15 +11,15 @@ 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; } diff --git a/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java b/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java index 488b92e61a..7e20440be2 100644 --- a/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java +++ b/src/com/itmill/toolkit/terminal/gwt/server/ApplicationServlet.java @@ -440,7 +440,7 @@ public class ApplicationServlet extends HttpServlet { page .write("\n\nIT Mill Toolkit 5\n" + "