[isidorus-cvs] r475 - in branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example: . .settings src src/gdl src/gdl/isidor src/gdl/isidor/us src/gdl/isidor/us/client src/gdl/isidor/us/server src/gdl/isidor/us/shared test test-classes test-classes/gdl test-classes/gdl/isidor test-classes/gdl/isidor/us test/gdl test/gdl/isidor test/gdl/isidor/us war war/WEB-INF war/WEB-INF/classes war/WEB-INF/classes/gdl war/WEB-INF/classes/gdl/isidor war/WEB-INF/classes/gdl/isidor/us war/WEB-INF/classes/gdl/isidor/us/client war/WEB-INF/classes/gdl/isidor/us/server war/WEB-INF/classes/gdl/isidor/us/shared war/WEB-INF/lib

lgiessmann at common-lisp.net lgiessmann at common-lisp.net
Tue Jun 14 12:31:00 UTC 2011


Author: lgiessmann
Date: Tue Jun 14 05:31:00 2011
New Revision: 475

Log:
added a project skeleton tp GWT-JSNI

Added:
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.classpath
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.project
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.settings/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.settings/com.google.gdt.eclipse.core.prefs
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.settings/com.google.gwt.eclipse.core.prefs
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/GWT_JSNI_example.gwt.xml
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/client/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/client/GWT_JSNI_example.java
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/client/GreetingService.java
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/client/GreetingServiceAsync.java
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/server/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/server/GreetingServiceImpl.java
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/shared/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/shared/FieldVerifier.java
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/test/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/test-classes/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/test-classes/gdl/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/test-classes/gdl/isidor/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/test-classes/gdl/isidor/us/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/test/gdl/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/test/gdl/isidor/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/test/gdl/isidor/us/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/GWT_JSNI_example.css
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/GWT_JSNI_example.html
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/GWT_JSNI_example.gwt.xml
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GWT_JSNI_example$1.class   (contents, props changed)
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GWT_JSNI_example$1MyHandler$1.class   (contents, props changed)
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GWT_JSNI_example$1MyHandler.class   (contents, props changed)
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GWT_JSNI_example.class   (contents, props changed)
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GreetingService.class   (contents, props changed)
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GreetingServiceAsync.class   (contents, props changed)
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/server/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/server/GreetingServiceImpl.class   (contents, props changed)
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/shared/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/shared/FieldVerifier.class   (contents, props changed)
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/lib/
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/lib/gwt-servlet.jar   (contents, props changed)
   branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/web.xml

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.classpath
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.classpath	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" output="test-classes" path="test"/>
+	<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="war/WEB-INF/classes"/>
+</classpath>

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.project
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.project	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>GWT-JSNI-example</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>com.google.gwt.eclipse.core.gwtNature</nature>
+	</natures>
+</projectDescription>

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.settings/com.google.gdt.eclipse.core.prefs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.settings/com.google.gdt.eclipse.core.prefs	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,4 @@
+#Tue Jun 14 14:28:36 CEST 2011
+eclipse.preferences.version=1
+warSrcDir=war
+warSrcDirIsOutput=true

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.settings/com.google.gwt.eclipse.core.prefs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/.settings/com.google.gwt.eclipse.core.prefs	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,3 @@
+#Tue Jun 14 14:28:36 CEST 2011
+eclipse.preferences.version=1
+filesCopiedToWebInfLib=gwt-servlet.jar

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/GWT_JSNI_example.gwt.xml
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/GWT_JSNI_example.gwt.xml	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module rename-to='gwt_jsni_example'>
+  <!-- Inherit the core Web Toolkit stuff.                        -->
+  <inherits name='com.google.gwt.user.User'/>
+
+  <!-- Inherit the default GWT style sheet.  You can change       -->
+  <!-- the theme of your GWT application by uncommenting          -->
+  <!-- any one of the following lines.                            -->
+  <inherits name='com.google.gwt.user.theme.clean.Clean'/>
+  <!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
+  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
+  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->
+
+  <!-- Other module inherits                                      -->
+
+  <!-- Specify the app entry point class.                         -->
+  <entry-point class='gdl.isidor.us.client.GWT_JSNI_example'/>
+
+  <!-- Specify the paths for translatable code                    -->
+  <source path='client'/>
+  <source path='shared'/>
+
+</module>

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/client/GWT_JSNI_example.java
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/client/GWT_JSNI_example.java	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,152 @@
+package gdl.isidor.us.client;
+
+import gdl.isidor.us.shared.FieldVerifier;
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.KeyCodes;
+import com.google.gwt.event.dom.client.KeyUpEvent;
+import com.google.gwt.event.dom.client.KeyUpHandler;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.DialogBox;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+/**
+ * Entry point classes define <code>onModuleLoad()</code>.
+ */
+public class GWT_JSNI_example implements EntryPoint {
+	/**
+	 * The message displayed to the user when the server cannot be reached or
+	 * returns an error.
+	 */
+	private static final String SERVER_ERROR = "An error occurred while "
+			+ "attempting to contact the server. Please check your network "
+			+ "connection and try again.";
+
+	/**
+	 * Create a remote service proxy to talk to the server-side Greeting service.
+	 */
+	private final GreetingServiceAsync greetingService = GWT
+			.create(GreetingService.class);
+
+	/**
+	 * This is the entry point method.
+	 */
+	public void onModuleLoad() {
+		final Button sendButton = new Button("Send");
+		final TextBox nameField = new TextBox();
+		nameField.setText("GWT User");
+		final Label errorLabel = new Label();
+
+		// We can add style names to widgets
+		sendButton.addStyleName("sendButton");
+
+		// Add the nameField and sendButton to the RootPanel
+		// Use RootPanel.get() to get the entire body element
+		RootPanel.get("nameFieldContainer").add(nameField);
+		RootPanel.get("sendButtonContainer").add(sendButton);
+		RootPanel.get("errorLabelContainer").add(errorLabel);
+
+		// Focus the cursor on the name field when the app loads
+		nameField.setFocus(true);
+		nameField.selectAll();
+
+		// Create the popup dialog box
+		final DialogBox dialogBox = new DialogBox();
+		dialogBox.setText("Remote Procedure Call");
+		dialogBox.setAnimationEnabled(true);
+		final Button closeButton = new Button("Close");
+		// We can set the id of a widget by accessing its Element
+		closeButton.getElement().setId("closeButton");
+		final Label textToServerLabel = new Label();
+		final HTML serverResponseLabel = new HTML();
+		VerticalPanel dialogVPanel = new VerticalPanel();
+		dialogVPanel.addStyleName("dialogVPanel");
+		dialogVPanel.add(new HTML("<b>Sending name to the server:</b>"));
+		dialogVPanel.add(textToServerLabel);
+		dialogVPanel.add(new HTML("<br><b>Server replies:</b>"));
+		dialogVPanel.add(serverResponseLabel);
+		dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT);
+		dialogVPanel.add(closeButton);
+		dialogBox.setWidget(dialogVPanel);
+
+		// Add a handler to close the DialogBox
+		closeButton.addClickHandler(new ClickHandler() {
+			public void onClick(ClickEvent event) {
+				dialogBox.hide();
+				sendButton.setEnabled(true);
+				sendButton.setFocus(true);
+			}
+		});
+
+		// Create a handler for the sendButton and nameField
+		class MyHandler implements ClickHandler, KeyUpHandler {
+			/**
+			 * Fired when the user clicks on the sendButton.
+			 */
+			public void onClick(ClickEvent event) {
+				sendNameToServer();
+			}
+
+			/**
+			 * Fired when the user types in the nameField.
+			 */
+			public void onKeyUp(KeyUpEvent event) {
+				if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
+					sendNameToServer();
+				}
+			}
+
+			/**
+			 * Send the name from the nameField to the server and wait for a response.
+			 */
+			private void sendNameToServer() {
+				// First, we validate the input.
+				errorLabel.setText("");
+				String textToServer = nameField.getText();
+				if (!FieldVerifier.isValidName(textToServer)) {
+					errorLabel.setText("Please enter at least four characters");
+					return;
+				}
+
+				// Then, we send the input to the server.
+				sendButton.setEnabled(false);
+				textToServerLabel.setText(textToServer);
+				serverResponseLabel.setText("");
+				greetingService.greetServer(textToServer,
+						new AsyncCallback<String>() {
+							public void onFailure(Throwable caught) {
+								// Show the RPC error message to the user
+								dialogBox
+										.setText("Remote Procedure Call - Failure");
+								serverResponseLabel
+										.addStyleName("serverResponseLabelError");
+								serverResponseLabel.setHTML(SERVER_ERROR);
+								dialogBox.center();
+								closeButton.setFocus(true);
+							}
+
+							public void onSuccess(String result) {
+								dialogBox.setText("Remote Procedure Call");
+								serverResponseLabel
+										.removeStyleName("serverResponseLabelError");
+								serverResponseLabel.setHTML(result);
+								dialogBox.center();
+								closeButton.setFocus(true);
+							}
+						});
+			}
+		}
+
+		// Add a handler to send the name to the server
+		MyHandler handler = new MyHandler();
+		sendButton.addClickHandler(handler);
+		nameField.addKeyUpHandler(handler);
+	}
+}

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/client/GreetingService.java
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/client/GreetingService.java	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,12 @@
+package gdl.isidor.us.client;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+
+/**
+ * The client side stub for the RPC service.
+ */
+ at RemoteServiceRelativePath("greet")
+public interface GreetingService extends RemoteService {
+	String greetServer(String name) throws IllegalArgumentException;
+}

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/client/GreetingServiceAsync.java
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/client/GreetingServiceAsync.java	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,11 @@
+package gdl.isidor.us.client;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+/**
+ * The async counterpart of <code>GreetingService</code>.
+ */
+public interface GreetingServiceAsync {
+	void greetServer(String input, AsyncCallback<String> callback)
+			throws IllegalArgumentException;
+}

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/server/GreetingServiceImpl.java
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/server/GreetingServiceImpl.java	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,48 @@
+package gdl.isidor.us.server;
+
+import gdl.isidor.us.client.GreetingService;
+import gdl.isidor.us.shared.FieldVerifier;
+import com.google.gwt.user.server.rpc.RemoteServiceServlet;
+
+/**
+ * The server side implementation of the RPC service.
+ */
+ at SuppressWarnings("serial")
+public class GreetingServiceImpl extends RemoteServiceServlet implements
+		GreetingService {
+
+	public String greetServer(String input) throws IllegalArgumentException {
+		// Verify that the input is valid. 
+		if (!FieldVerifier.isValidName(input)) {
+			// If the input is not valid, throw an IllegalArgumentException back to
+			// the client.
+			throw new IllegalArgumentException(
+					"Name must be at least 4 characters long");
+		}
+
+		String serverInfo = getServletContext().getServerInfo();
+		String userAgent = getThreadLocalRequest().getHeader("User-Agent");
+
+		// Escape data from the client to avoid cross-site script vulnerabilities.
+		input = escapeHtml(input);
+		userAgent = escapeHtml(userAgent);
+
+		return "Hello, " + input + "!<br><br>I am running " + serverInfo
+				+ ".<br><br>It looks like you are using:<br>" + userAgent;
+	}
+
+	/**
+	 * Escape an html string. Escaping data received from the client helps to
+	 * prevent cross-site script vulnerabilities.
+	 * 
+	 * @param html the html string to escape
+	 * @return the escaped string
+	 */
+	private String escapeHtml(String html) {
+		if (html == null) {
+			return null;
+		}
+		return html.replaceAll("&", "&").replaceAll("<", "<")
+				.replaceAll(">", ">");
+	}
+}

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/shared/FieldVerifier.java
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/src/gdl/isidor/us/shared/FieldVerifier.java	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,42 @@
+package gdl.isidor.us.shared;
+
+/**
+ * <p>
+ * FieldVerifier validates that the name the user enters is valid.
+ * </p>
+ * <p>
+ * This class is in the <code>shared</code> package because we use it in both
+ * the client code and on the server. On the client, we verify that the name is
+ * valid before sending an RPC request so the user doesn't have to wait for a
+ * network round trip to get feedback. On the server, we verify that the name is
+ * correct to ensure that the input is correct regardless of where the RPC
+ * originates.
+ * </p>
+ * <p>
+ * When creating a class that is used on both the client and the server, be sure
+ * that all code is translatable and does not use native JavaScript. Code that
+ * is not translatable (such as code that interacts with a database or the file
+ * system) cannot be compiled into client side JavaScript. Code that uses native
+ * JavaScript (such as Widgets) cannot be run on the server.
+ * </p>
+ */
+public class FieldVerifier {
+
+	/**
+	 * Verifies that the specified name is valid for our service.
+	 * 
+	 * In this example, we only require that the name is at least four
+	 * characters. In your application, you can use more complex checks to ensure
+	 * that usernames, passwords, email addresses, URLs, and other fields have the
+	 * proper syntax.
+	 * 
+	 * @param name the name to validate
+	 * @return true if valid, false if invalid
+	 */
+	public static boolean isValidName(String name) {
+		if (name == null) {
+			return false;
+		}
+		return name.length() > 3;
+	}
+}

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/GWT_JSNI_example.css
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/GWT_JSNI_example.css	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,34 @@
+/** Add css rules here for your application. */
+
+
+/** Example rules used by the template application (remove for your app) */
+h1 {
+  font-size: 2em;
+  font-weight: bold;
+  color: #777777;
+  margin: 40px 0px 70px;
+  text-align: center;
+}
+
+.sendButton {
+  display: block;
+  font-size: 16pt;
+}
+
+/** Most GWT widgets already have a style name defined */
+.gwt-DialogBox {
+  width: 400px;
+}
+
+.dialogVPanel {
+  margin: 5px;
+}
+
+.serverResponseLabelError {
+  color: red;
+}
+
+/** Set ids using widget.getElement().setId("idOfElement") */
+#closeButton {
+  margin: 15px 6px 6px;
+}

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/GWT_JSNI_example.html
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/GWT_JSNI_example.html	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,63 @@
+<!doctype html>
+<!-- The DOCTYPE declaration above will set the    -->
+<!-- browser's rendering engine into               -->
+<!-- "Standards Mode". Replacing this declaration  -->
+<!-- with a "Quirks Mode" doctype may lead to some -->
+<!-- differences in layout.                        -->
+
+<html>
+  <head>
+    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+
+    <!--                                                               -->
+    <!-- Consider inlining CSS to reduce the number of requested files -->
+    <!--                                                               -->
+    <link type="text/css" rel="stylesheet" href="GWT_JSNI_example.css">
+
+    <!--                                           -->
+    <!-- Any title is fine                         -->
+    <!--                                           -->
+    <title>Web Application Starter Project</title>
+    
+    <!--                                           -->
+    <!-- This script loads your compiled module.   -->
+    <!-- If you add any GWT meta tags, they must   -->
+    <!-- be added before this line.                -->
+    <!--                                           -->
+    <script type="text/javascript" language="javascript" src="gwt_jsni_example/gwt_jsni_example.nocache.js"></script>
+  </head>
+
+  <!--                                           -->
+  <!-- The body can have arbitrary html, or      -->
+  <!-- you can leave the body empty if you want  -->
+  <!-- to create a completely dynamic UI.        -->
+  <!--                                           -->
+  <body>
+
+    <!-- OPTIONAL: include this if you want history support -->
+    <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
+    
+    <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
+    <noscript>
+      <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
+        Your web browser must have JavaScript enabled
+        in order for this application to display correctly.
+      </div>
+    </noscript>
+
+    <h1>Web Application Starter Project</h1>
+
+    <table align="center">
+      <tr>
+        <td colspan="2" style="font-weight:bold;">Please enter your name:</td>        
+      </tr>
+      <tr>
+        <td id="nameFieldContainer"></td>
+        <td id="sendButtonContainer"></td>
+      </tr>
+      <tr>
+        <td colspan="2" style="color:red;" id="errorLabelContainer"></td>
+      </tr>
+    </table>
+  </body>
+</html>

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/GWT_JSNI_example.gwt.xml
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/GWT_JSNI_example.gwt.xml	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module rename-to='gwt_jsni_example'>
+  <!-- Inherit the core Web Toolkit stuff.                        -->
+  <inherits name='com.google.gwt.user.User'/>
+
+  <!-- Inherit the default GWT style sheet.  You can change       -->
+  <!-- the theme of your GWT application by uncommenting          -->
+  <!-- any one of the following lines.                            -->
+  <inherits name='com.google.gwt.user.theme.clean.Clean'/>
+  <!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
+  <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
+  <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/>     -->
+
+  <!-- Other module inherits                                      -->
+
+  <!-- Specify the app entry point class.                         -->
+  <entry-point class='gdl.isidor.us.client.GWT_JSNI_example'/>
+
+  <!-- Specify the paths for translatable code                    -->
+  <source path='client'/>
+  <source path='shared'/>
+
+</module>

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GWT_JSNI_example$1.class
==============================================================================
Binary file. No diff available.

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GWT_JSNI_example$1MyHandler$1.class
==============================================================================
Binary file. No diff available.

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GWT_JSNI_example$1MyHandler.class
==============================================================================
Binary file. No diff available.

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GWT_JSNI_example.class
==============================================================================
Binary file. No diff available.

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GreetingService.class
==============================================================================
Binary file. No diff available.

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/client/GreetingServiceAsync.class
==============================================================================
Binary file. No diff available.

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/server/GreetingServiceImpl.class
==============================================================================
Binary file. No diff available.

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/classes/gdl/isidor/us/shared/FieldVerifier.class
==============================================================================
Binary file. No diff available.

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/lib/gwt-servlet.jar
==============================================================================
Binary file. No diff available.

Added: branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/web.xml
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/gdl-frontend/playground/GWT-JSNI/GWT-JSNI-example/war/WEB-INF/web.xml	Tue Jun 14 05:31:00 2011	(r475)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE web-app
+    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+    "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+  
+  <!-- Servlets -->
+  <servlet>
+    <servlet-name>greetServlet</servlet-name>
+    <servlet-class>gdl.isidor.us.server.GreetingServiceImpl</servlet-class>
+  </servlet>
+  
+  <servlet-mapping>
+    <servlet-name>greetServlet</servlet-name>
+    <url-pattern>/gwt_jsni_example/greet</url-pattern>
+  </servlet-mapping>
+  
+  <!-- Default page to serve -->
+  <welcome-file-list>
+    <welcome-file>GWT_JSNI_example.html</welcome-file>
+  </welcome-file-list>
+
+</web-app>




More information about the Isidorus-cvs mailing list