background-repeat: no-repeat;
background-position: top right;\r
}
-#itmtk-ajax-window {
+#itmill-ajax-window {
background-color: transparent;
}\r
#header {\r
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
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
/** 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
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
--- /dev/null
+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);
+ }
+}
+++ /dev/null
-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);
- }
-}
makeUidlRequest("repaintAll=1");
// TODO remove hardcoded id name
- view = new IView("itmtk-ajax-window");
+ view = new IView("itmill-ajax-window");
}
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;
private native String getPathInfo()
/*-{
- return $wnd.itmtk.pathInfo;
+ return $wnd.itmill.pathInfo;
}-*/;
private void makeUidlRequest(String requestData) {
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) {
-#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;
}
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 = "";
+ "/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();