Permalink
Browse files

Completed most basic components

1 parent 716e1c3 commit 70b0ca80f60c627c37978fe363fdd2928a76e616 @bradseefeld committed Mar 30, 2011
Showing with 1,898 additions and 0 deletions.
  1. +12 −0 .gitignore
  2. +10 −0 README
  3. +149 −0 pom.xml
  4. +18 −0 src/main/java/com/bradley/gwt/demo/server/DemoServiceLocator.java
  5. +78 −0 src/main/java/com/bradley/gwt/demo/server/EmployeeLocator.java
  6. +70 −0 src/main/java/com/bradley/gwt/demo/server/domain/Employee.java
  7. +75 −0 src/main/java/com/bradley/gwt/demo/user/client/TestApp.java
  8. +12 −0 src/main/java/com/bradley/gwt/demo/user/client/entity/EmployeeProxy.java
  9. +32 −0 src/main/java/com/bradley/gwt/demo/user/client/request/EmployeeRequest.java
  10. +7 −0 src/main/java/com/bradley/gwt/demo/user/client/request/EmployeeRequestFactory.java
  11. +26 −0 src/main/java/com/bradley/gwt/user/client/request/PagingRequest.java
  12. +90 −0 src/main/java/com/bradley/gwt/user/client/ui/Button.java
  13. +11 −0 src/main/java/com/bradley/gwt/user/client/ui/CellTableResources.java
  14. +59 −0 src/main/java/com/bradley/gwt/user/client/ui/ClosableDialogBox.java
  15. +188 −0 src/main/java/com/bradley/gwt/user/client/ui/PagingCellTablePanel.java
  16. +202 −0 src/main/java/com/bradley/gwt/user/client/ui/ScrollableDialogBox.java
  17. +16 −0 src/main/java/com/bradley/gwt/user/client/ui/SimplePager.java
  18. +31 −0 src/main/java/com/bradley/gwt/user/client/ui/TextTitleCell.java
  19. +19 −0 src/main/java/com/bradley/gwt/user/client/ui/TextTitleColumn.java
  20. +25 −0 src/main/java/com/bradley/gwt/user/client/ui/ToolBar.java
  21. +13 −0 src/main/java/com/bradley/gwt/user/client/ui/UIClientBundle.java
  22. +18 −0 src/main/java/com/bradley/gwt/user/client/ui/UICssResource.java
  23. +1 −0 src/main/resources/applicationContext.xml
  24. +7 −0 src/main/resources/com/bradley/gwt/demo/user/DemoGwtUI.gwt.xml
  25. +16 −0 src/main/resources/com/bradley/gwt/user/GwtUI.gwt.xml
  26. +18 −0 src/main/resources/com/bradley/gwt/user/client/ui/Button.ui.xml
  27. +18 −0 src/main/resources/com/bradley/gwt/user/client/ui/PagingCellTablePanel.ui.xml
  28. +15 −0 src/main/resources/com/bradley/gwt/user/client/ui/ToolBar.ui.xml
  29. +107 −0 src/main/resources/com/bradley/gwt/user/client/ui/cell-table.css
  30. +63 −0 src/main/resources/com/bradley/gwt/user/client/ui/styles.css
  31. +1 −0 src/main/resources/spring-security.xml
  32. +8 −0 src/main/site.xml
  33. +24 −0 src/main/webapp/WEB-INF/web.xml
  34. +12 −0 src/main/webapp/demo.html
  35. +49 −0 src/test/java/com/bradley/gwt/user/client/ui/TextTitleCellTest.java
  36. +30 −0 src/test/java/com/bradley/gwt/user/client/ui/TextTitleColumnTest.java
  37. +2 −0 war/WEB-INF/deploy/com.bradley.gwt.user.GwtUI.JUnit/rpcPolicyManifest/manifest.txt
  38. +16 −0 war/com.bradley.gwt.user.GwtUI.JUnit/com.bradley.gwt.user.GwtUI.JUnit.nocache.js
  39. +350 −0 war/com.bradley.gwt.user.GwtUI.JUnit/hosted.html
View
@@ -0,0 +1,12 @@
+.classpath
+.project
+.settings
+*.launch
+war/WEB-INF/classes/
+war/WEB-INF/lib/
+target/*
+*~
+
+*.cmd
+tomcat/
+
View
10 README
@@ -0,0 +1,10 @@
+This project is intended to create production ready UI components on the GWT
+framework. It aims to use no dependencies other than the GWT itself and to be
+as fast as possible. It also aims to follow the GWT architecture as closely
+as possible. For example, using tools provided such as UIBinder, ClientBundle, etc.
+
+Goals:
+
+* Speed. As fast as possible!
+* Download size. Few dependencies. Few/none external resources such as images/css.
+* Follow the GWT design (UiBinder, ClientBundle, i18n, etc)
View
149 pom.xml
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.bradley.gwt</groupId>
+ <artifactId>gwt-ui</artifactId>
+ <packaging>jar</packaging>
+ <version>1.0-SNAPSHOT</version>
+ <name>GWT Maven Archetype</name>
+
+ <properties>
+ <gwt.version>2.2.0</gwt.version>
+ <slf4j.version>1.6.1</slf4j.version>
+ <maven.compiler.source>1.6</maven.compiler.source>
+ <maven.compiler.target>1.6</maven.compiler.target>
+ <downloadSources>true</downloadSources>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwt.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwt.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwt.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.7</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ <version>1.0.0.GA</version>
+ </dependency>
+ <dependency>
+ <groupId>org.json</groupId>
+ <artifactId>json</artifactId>
+ <version>20090211</version>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.0.2.GA</version>
+ <!-- <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ </exclusions>-->
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${slf4j.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <!-- Generate compiled stuff in the folder used for developing mode -->
+ <outputDirectory>${webappDirectory}/WEB-INF/classes</outputDirectory>
+
+ <plugins>
+
+ <!-- GWT Maven Plugin -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>gwt-maven-plugin</artifactId>
+ <version>${gwt.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>compile</goal>
+ <goal>test</goal>
+ <goal>resources</goal>
+ <!--<goal>i18n</goal> -->
+ </goals>
+ </execution>
+ </executions>
+ <!-- Plugin configuration. There are many available options, see gwt-maven-plugin
+ documentation at codehaus.org -->
+ <configuration>
+ <runTarget>demo.html</runTarget>
+ <hostedWebapp>${webappDirectory}</hostedWebapp>
+ </configuration>
+ </plugin>
+ <!-- Copy static web files before executing gwt:run -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <executions>
+ <execution>
+ <phase>compile</phase>
+ <goals>
+ <goal>exploded</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <webappDirectory>${webappDirectory}</webappDirectory>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.8</version>
+ <configuration>
+ <additionalBuildcommands>
+ <buildcommand>net.sf.eclipsecs.core.CheckstyleBuilder</buildcommand>
+ </additionalBuildcommands>
+ <classpathContainers>
+ <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
+ <classpathContainer>org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER</classpathContainer>
+ </classpathContainers>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
@@ -0,0 +1,18 @@
+package com.bradley.gwt.demo.server;
+
+import com.google.gwt.requestfactory.shared.ServiceLocator;
+
+public class DemoServiceLocator implements ServiceLocator {
+
+ @Override
+ public Object getInstance(Class<?> clazz) {
+ try {
+ return clazz.newInstance();
+ } catch (InstantiationException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+}
@@ -0,0 +1,78 @@
+package com.bradley.gwt.demo.server;
+
+import java.util.Date;
+import java.util.LinkedList;
+import java.util.List;
+
+import com.bradley.gwt.demo.server.domain.Employee;
+import com.google.gwt.requestfactory.shared.Locator;
+
+public class EmployeeLocator extends Locator<Employee, String> {
+
+ public List<Employee> paginate(int offset, int limit, String sortField,
+ boolean isAscending) {
+ List<Employee> list = new LinkedList<Employee>();
+
+ for (int i = 0; i < 100; i++) {
+ Employee e = new Employee();
+ e.setFirstName("brad " + i);
+ e.setLastName("last " + i);
+ e.setId(i + "");
+ list.add(e);
+ }
+
+ return list;
+ }
+
+ public Integer count() {
+ return 2312;
+ }
+
+ @Override
+ public Employee create(Class<? extends Employee> clazz) {
+ try {
+ return clazz.newInstance();
+ } catch (InstantiationException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+ @Override
+ public Employee find(Class<? extends Employee> clazz, String id) {
+ Employee e = new Employee();
+ e.setFirstName("existing");
+ return e;
+ }
+
+ @Override
+ public Class<Employee> getDomainType() {
+ return Employee.class;
+ }
+
+ @Override
+ public String getId(Employee e) {
+ return e.getId();
+ }
+
+ @Override
+ public Class<String> getIdType() {
+ return String.class;
+ }
+
+ @Override
+ public Object getVersion(Employee e) {
+ Date d = e.getDateUpdated();
+ if (d == null) {
+ return 0;
+ }
+
+ return d.getTime();
+ }
+
+}
@@ -0,0 +1,70 @@
+package com.bradley.gwt.demo.server.domain;
+
+import java.util.Date;
+
+public class Employee {
+
+ protected String id;
+
+ protected String firstName;
+
+ protected String lastName;
+
+ protected Date dateUpdated;
+
+ /**
+ * @return the dateUpdated
+ */
+ public Date getDateUpdated() {
+ return dateUpdated;
+ }
+
+ /**
+ * @param dateUpdated the dateUpdated to set
+ */
+ public void setDateUpdated(Date dateUpdated) {
+ this.dateUpdated = dateUpdated;
+ }
+
+ /**
+ * @return the id
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @param id the id to set
+ */
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ /**
+ * @return the firstName
+ */
+ public String getFirstName() {
+ return firstName;
+ }
+
+ /**
+ * @param firstName the firstName to set
+ */
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ /**
+ * @return the lastName
+ */
+ public String getLastName() {
+ return lastName;
+ }
+
+ /**
+ * @param lastName the lastName to set
+ */
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+}
Oops, something went wrong.

0 comments on commit 70b0ca8

Please sign in to comment.