You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@labs.apache.org by no...@apache.org on 2009/06/26 22:43:14 UTC
svn commit: r788864 [1/3] - in /labs/hupa: ./ .settings/ src/ src/main/
src/main/java/ src/main/java/org/ src/main/java/org/apache/
src/main/java/org/apache/hupa/ src/main/java/org/apache/hupa/client/
src/main/java/org/apache/hupa/client/bundles/ src/m...
Author: norman
Date: Fri Jun 26 20:43:11 2009
New Revision: 788864
URL: http://svn.apache.org/viewvc?rev=788864&view=rev
Log:
import to labs
Added:
labs/hupa/.classpath
labs/hupa/.project
labs/hupa/.settings/
labs/hupa/.settings/com.google.gwt.eclipse.core.prefs
labs/hupa/.settings/org.eclipse.jdt.core.prefs
labs/hupa/.settings/org.eclipse.jdt.ui.prefs
labs/hupa/.settings/org.maven.ide.eclipse.prefs
labs/hupa/doap.rdf
labs/hupa/pom.xml
labs/hupa/src/
labs/hupa/src/main/
labs/hupa/src/main/java/
labs/hupa/src/main/java/org/
labs/hupa/src/main/java/org/apache/
labs/hupa/src/main/java/org/apache/hupa/
labs/hupa/src/main/java/org/apache/hupa/Hupa.gwt.xml
labs/hupa/src/main/java/org/apache/hupa/client/
labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java
labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.java
labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.properties
labs/hupa/src/main/java/org/apache/hupa/client/bundles/
labs/hupa/src/main/java/org/apache/hupa/client/bundles/IMAPTreeImages.java
labs/hupa/src/main/java/org/apache/hupa/client/bundles/folder.png (with props)
labs/hupa/src/main/java/org/apache/hupa/client/bundles/folder_add.png (with props)
labs/hupa/src/main/java/org/apache/hupa/client/controller/
labs/hupa/src/main/java/org/apache/hupa/client/controller/HupaController.java
labs/hupa/src/main/java/org/apache/hupa/client/model/
labs/hupa/src/main/java/org/apache/hupa/client/model/FolderModel.java
labs/hupa/src/main/java/org/apache/hupa/client/model/MessageListModel.java
labs/hupa/src/main/java/org/apache/hupa/client/model/MessageModel.java
labs/hupa/src/main/java/org/apache/hupa/client/model/SessionModel.java
labs/hupa/src/main/java/org/apache/hupa/client/services/
labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPService.java
labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPServiceAsync.java
labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPServiceException.java
labs/hupa/src/main/java/org/apache/hupa/client/view/
labs/hupa/src/main/java/org/apache/hupa/client/view/LoadingMasker.java
labs/hupa/src/main/java/org/apache/hupa/client/view/LoginView.java
labs/hupa/src/main/java/org/apache/hupa/client/view/MainView.java
labs/hupa/src/main/java/org/apache/hupa/client/widgets/
labs/hupa/src/main/java/org/apache/hupa/client/widgets/IMAPMessageWidget.java
labs/hupa/src/main/java/org/apache/hupa/common/
labs/hupa/src/main/java/org/apache/hupa/common/data/
labs/hupa/src/main/java/org/apache/hupa/common/data/IMAPFolder.java
labs/hupa/src/main/java/org/apache/hupa/common/data/IMAPHeader.java
labs/hupa/src/main/java/org/apache/hupa/common/data/IMAPMessage.java
labs/hupa/src/main/java/org/apache/hupa/common/data/IMAPMessageAttachment.java
labs/hupa/src/main/java/org/apache/hupa/common/data/IMAPMessageContent.java
labs/hupa/src/main/java/org/apache/hupa/common/data/IMAPUser.java
labs/hupa/src/main/java/org/apache/hupa/common/data/ResultList.java
labs/hupa/src/main/java/org/apache/hupa/common/data/Session.java
labs/hupa/src/main/java/org/apache/hupa/server/
labs/hupa/src/main/java/org/apache/hupa/server/IMAPServiceImpl.java
labs/hupa/war/
labs/hupa/war/Hupa.css
labs/hupa/war/Hupa.html
labs/hupa/war/WEB-INF/
labs/hupa/war/WEB-INF/classes/
labs/hupa/war/WEB-INF/lib/
labs/hupa/war/WEB-INF/lib/gwt-servlet.jar (with props)
labs/hupa/war/WEB-INF/web.xml
labs/hupa/war/hupa/
labs/hupa/war/hupa/3B185B9ADE10EE20F5A5913D7AAD27A0.gwt.rpc
labs/hupa/war/hupa/7060248520A1B3E97C76CABA13154B94.gwt.rpc
labs/hupa/war/hupa/E559B6073B872D90039FC7E6F45571E6.cache.png (with props)
labs/hupa/war/hupa/cbg-star.png (with props)
labs/hupa/war/hupa/cbg-stardeselected.png (with props)
labs/hupa/war/hupa/cbg-starhover.png (with props)
labs/hupa/war/hupa/cbg_button.css
labs/hupa/war/hupa/clear.cache.gif (with props)
labs/hupa/war/hupa/gwt/
labs/hupa/war/hupa/gwt/standard/
labs/hupa/war/hupa/gwt/standard/images/
labs/hupa/war/hupa/gwt/standard/images/corner.png (with props)
labs/hupa/war/hupa/gwt/standard/images/corner_ie6.png (with props)
labs/hupa/war/hupa/gwt/standard/images/hborder.png (with props)
labs/hupa/war/hupa/gwt/standard/images/hborder_ie6.png (with props)
labs/hupa/war/hupa/gwt/standard/images/ie6/
labs/hupa/war/hupa/gwt/standard/images/ie6/corner_dialog_topleft.png (with props)
labs/hupa/war/hupa/gwt/standard/images/ie6/corner_dialog_topright.png (with props)
labs/hupa/war/hupa/gwt/standard/images/ie6/hborder_blue_shadow.png (with props)
labs/hupa/war/hupa/gwt/standard/images/ie6/hborder_gray_shadow.png (with props)
labs/hupa/war/hupa/gwt/standard/images/ie6/vborder_blue_shadow.png (with props)
labs/hupa/war/hupa/gwt/standard/images/ie6/vborder_gray_shadow.png (with props)
labs/hupa/war/hupa/gwt/standard/images/vborder.png (with props)
labs/hupa/war/hupa/gwt/standard/images/vborder_ie6.png (with props)
labs/hupa/war/hupa/gwt/standard/standard.css
labs/hupa/war/hupa/gwt/standard/standard_rtl.css
labs/hupa/war/hupa/hosted.html
labs/hupa/war/hupa/hupa.nocache.js
labs/hupa/war/hupa/images/
labs/hupa/war/hupa/images/asc.gif (with props)
labs/hupa/war/hupa/images/desc.gif (with props)
labs/hupa/war/hupa/images/lightbox.png (with props)
labs/hupa/war/hupa/style/
labs/hupa/war/hupa/style/gwl-calcPanel.css
labs/hupa/war/hupa/style/gwl-editableLabel.css
labs/hupa/war/hupa/style/gwl-progressBar.css
labs/hupa/war/hupa/style/gwl-simplecalendar-blue.css
labs/hupa/war/hupa/style/gwl-simplecalendar-green.css
labs/hupa/war/hupa/style/gwl-simplecalendar-orange.css
labs/hupa/war/images/
labs/hupa/war/images/ajax-loader.gif (with props)
Modified:
labs/hupa/ (props changed)
Propchange: labs/hupa/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jun 26 20:43:11 2009
@@ -0,0 +1 @@
+target
Added: labs/hupa/.classpath
URL: http://svn.apache.org/viewvc/labs/hupa/.classpath?rev=788864&view=auto
==============================================================================
--- labs/hupa/.classpath (added)
+++ labs/hupa/.classpath Fri Jun 26 20:43:11 2009
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: labs/hupa/.project
URL: http://svn.apache.org/viewvc/labs/hupa/.project?rev=788864&view=auto
==============================================================================
--- labs/hupa/.project (added)
+++ labs/hupa/.project Fri Jun 26 20:43:11 2009
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>Hupa</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>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>com.google.gwt.eclipse.core.gwtNature</nature>
+ <nature>com.google.gdt.eclipse.core.webAppNature</nature>
+ </natures>
+</projectDescription>
Added: labs/hupa/.settings/com.google.gwt.eclipse.core.prefs
URL: http://svn.apache.org/viewvc/labs/hupa/.settings/com.google.gwt.eclipse.core.prefs?rev=788864&view=auto
==============================================================================
--- labs/hupa/.settings/com.google.gwt.eclipse.core.prefs (added)
+++ labs/hupa/.settings/com.google.gwt.eclipse.core.prefs Fri Jun 26 20:43:11 2009
@@ -0,0 +1,3 @@
+#Sat Jun 06 15:54:29 CEST 2009
+eclipse.preferences.version=1
+filesCopiedToWebInfLib=gwt-servlet.jar
Added: labs/hupa/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/labs/hupa/.settings/org.eclipse.jdt.core.prefs?rev=788864&view=auto
==============================================================================
--- labs/hupa/.settings/org.eclipse.jdt.core.prefs (added)
+++ labs/hupa/.settings/org.eclipse.jdt.core.prefs Fri Jun 26 20:43:11 2009
@@ -0,0 +1,5 @@
+#Sat Jun 06 15:58:35 CEST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.source=1.5
Added: labs/hupa/.settings/org.eclipse.jdt.ui.prefs
URL: http://svn.apache.org/viewvc/labs/hupa/.settings/org.eclipse.jdt.ui.prefs?rev=788864&view=auto
==============================================================================
--- labs/hupa/.settings/org.eclipse.jdt.ui.prefs (added)
+++ labs/hupa/.settings/org.eclipse.jdt.ui.prefs Fri Jun 26 20:43:11 2009
@@ -0,0 +1,57 @@
+#Mon Jun 15 20:33:03 CEST 2009
+cleanup.add_default_serial_version_id=true
+cleanup.add_generated_serial_version_id=false
+cleanup.add_missing_annotations=true
+cleanup.add_missing_deprecated_annotations=true
+cleanup.add_missing_methods=false
+cleanup.add_missing_nls_tags=false
+cleanup.add_missing_override_annotations=true
+cleanup.add_serial_version_id=false
+cleanup.always_use_blocks=true
+cleanup.always_use_parentheses_in_expressions=false
+cleanup.always_use_this_for_non_static_field_access=false
+cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_to_enhanced_for_loop=false
+cleanup.correct_indentation=false
+cleanup.format_source_code=true
+cleanup.format_source_code_changes_only=false
+cleanup.make_local_variable_final=true
+cleanup.make_parameters_final=false
+cleanup.make_private_fields_final=true
+cleanup.make_type_abstract_if_missing_method=false
+cleanup.make_variable_declarations_final=false
+cleanup.never_use_blocks=false
+cleanup.never_use_parentheses_in_expressions=true
+cleanup.organize_imports=false
+cleanup.qualify_static_field_accesses_with_declaring_class=false
+cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+cleanup.qualify_static_member_accesses_with_declaring_class=true
+cleanup.qualify_static_method_accesses_with_declaring_class=false
+cleanup.remove_private_constructors=true
+cleanup.remove_trailing_whitespaces=true
+cleanup.remove_trailing_whitespaces_all=true
+cleanup.remove_trailing_whitespaces_ignore_empty=false
+cleanup.remove_unnecessary_casts=true
+cleanup.remove_unnecessary_nls_tags=true
+cleanup.remove_unused_imports=true
+cleanup.remove_unused_local_variables=false
+cleanup.remove_unused_private_fields=true
+cleanup.remove_unused_private_members=false
+cleanup.remove_unused_private_methods=true
+cleanup.remove_unused_private_types=true
+cleanup.sort_members=false
+cleanup.sort_members_all=false
+cleanup.use_blocks=false
+cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_parentheses_in_expressions=false
+cleanup.use_this_for_non_static_field_access=false
+cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+cleanup.use_this_for_non_static_method_access=false
+cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup_profile=_ASF
+cleanup_settings_version=2
+eclipse.preferences.version=1
+formatter_profile=_ASF
+formatter_settings_version=11
+org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
Added: labs/hupa/.settings/org.maven.ide.eclipse.prefs
URL: http://svn.apache.org/viewvc/labs/hupa/.settings/org.maven.ide.eclipse.prefs?rev=788864&view=auto
==============================================================================
--- labs/hupa/.settings/org.maven.ide.eclipse.prefs (added)
+++ labs/hupa/.settings/org.maven.ide.eclipse.prefs Fri Jun 26 20:43:11 2009
@@ -0,0 +1,9 @@
+#Sat Jun 06 15:58:29 CEST 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Added: labs/hupa/doap.rdf
URL: http://svn.apache.org/viewvc/labs/hupa/doap.rdf?rev=788864&view=auto
==============================================================================
--- labs/hupa/doap.rdf (added)
+++ labs/hupa/doap.rdf Fri Jun 26 20:43:11 2009
@@ -0,0 +1,23 @@
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+xmlns="http://usefulinc.com/ns/doap#"
+xmlns:foaf="http://xmlns.com/foaf/0.1/"
+xmlns:labs="http://labs.apache.org/doap-ext/1.0#"
+xmlns:projects="http://projects.apache.org/ns/asfext#"> <Project
+rdf:about="http://labs.apache.org/labs#hupa"> <name>Hupa</name>
+<shortname>hupa</shortname> <shortdesc xml:lang="en">GWT based Webmail
+for IMAP-Servers</shortdesc> <description xml:lang="en">Hupa is a GWT
+based Webmail which can be used to retrieve email from IMAP-Servers.
+</description> <homepage rdf:resource="http://labs.apache.org/hupa/"/>
+<license rdf:resource="http://usefulinc.com/doap/licenses/asl20"/>
+<created>2009-6-15</created> <labs:status>active</labs:status>
+<maintainer> <foaf:Person
+rdf:about="http://people.apache.org/~norman/#me"> <foaf:name>Norman
+Maurer</foaf:name> <foaf:homepage
+rdf:resource="http://people.apache.org/~norman/"/>
+<foaf:mbox_sha1sum>08f730c4f151e19c63631fd8ed6fd7d8d0c2c425</foaf:mbox_sha1sum>
+</foaf:Person> </maintainer> <repository> <SVNRepository> <location
+rdf:resource="http://svn.apache.org/repos/asf/labs/hupa/"/> <browse
+rdf:resource="http://svn.apache.org/viewvc/labs/hupa/"/>
+</SVNRepository> </repository>
+<programming-language>Java</programming-language> </Project>
+</rdf:RDF>
\ No newline at end of file
Added: labs/hupa/pom.xml
URL: http://svn.apache.org/viewvc/labs/hupa/pom.xml?rev=788864&view=auto
==============================================================================
--- labs/hupa/pom.xml (added)
+++ labs/hupa/pom.xml Fri Jun 26 20:43:11 2009
@@ -0,0 +1,287 @@
+<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>org.apache.hupa</groupId>
+ <artifactId>hupa</artifactId>
+ <name>Hupa</name>
+ <version>0.0.1-SNAPSHOT</version>
+ <description>
+ Hupa is a GWT based Webmail
+ </description>
+ <url>http://labs.apache.org</url>
+ <inceptionYear>2009</inceptionYear>
+
+ <licenses>
+ <license>
+ <name>Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <developers>
+ <developer>
+ <id>norman</id>
+ <name>Norman Maurer</name>
+ <email>norman at apache.org</email>
+ <timezone>2</timezone>
+ <roles>
+ <role>Developer</role>
+ </roles>
+ </developer>
+ </developers>
+
+ <issueManagement>
+ <system>JIRA</system>
+ <url>http://issues.apache.org/jira/browse/LABS</url>
+ </issueManagement>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/james/jspf/trunk</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/james/jspf/trunk</developerConnection>
+ <url>http://svn.apache.org/viewvc/james/jspf/trunk/</url>
+ </scm>
+
+ <repositories>
+ <repository>
+ <id>gwt-maven</id>
+ <url>
+ http://gwt-maven.googlecode.com/svn/trunk/mavenrepo/
+ </url>
+ </repository>
+ <repository>
+ <id>gwt-mvc</id>
+ <name>GWT MVC repository at googlecode</name>
+ <url>http://gwt-mvc.googlecode.com/svn/repository</url>
+ </repository>
+ <repository>
+ <id>columba</id>
+ <name>columba</name>
+ <url>https://columba.hora-obscura.de/dav_columba</url>
+ </repository>
+ </repositories>
+
+
+ <!-- include the GWT-Maven repo as plugin, and as standard -->
+ <pluginRepositories>
+ <pluginRepository>
+ <id>gwt-maven</id>
+ <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <!-- convenience to define GWT version in one place -->
+ <properties>
+ <gwtVersion>1.6.4</gwtVersion>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>2.0-beta-5</version>
+ </plugin>
+
+ <!-- configure the GWT-Maven plugin -->
+ <plugin>
+ <groupId>com.totsp.gwt</groupId>
+ <artifactId>maven-googlewebtoolkit2-plugin</artifactId>
+ <version>2.0-RC1</version>
+ <configuration>
+ <logLevel>INFO</logLevel>
+ <compileTargets>
+ <value>org.apache.hupa.Hupa</value>
+ </compileTargets>
+ <runTarget>org.apache.hupa.Hupa/Hupa.html</runTarget>
+ <style>DETAILED</style>
+ <noServer>false</noServer>
+ <extraJvmArgs>-Xmx512m</extraJvmArgs>
+
+ <!-- this parameter is VERY important with automatic mode - has to match the version in your declared deps -->
+ <!-- if this does not match (default if left out is 1.5.3) you will have mysterious errors -->
+ <gwtVersion>${gwtVersion}</gwtVersion>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <!--
+ <goal>mergewebxml</goal>
+ <goal>i18n</goal>
+ -->
+ <goal>compile</goal>
+ <!--
+ <goal>test</goal>
+ -->
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- Use the dependency plugin to unpack gwt-dev-PLATFORM-libs.zip -->
+ <!--
+ (this is a replacement for the old "automatic" mode - useful if you
+ don't have GWT installed already, or you just want a maven way to
+ handle gwt deps)
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwtVersion}</version>
+ <classifier>${platform}-libs</classifier>
+ <type>zip</type>
+ <overWrite>false</overWrite>
+ <outputDirectory>${settings.localRepository}/com/google/gwt/gwt-dev/${gwtVersion}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!--
+ If you want to use the target/web.xml file mergewebxml produces,
+ tell the war plugin to use it.
+ Also, exclude what you want from the final artifact here.
+ -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webXml>target/web.xml</webXml>
+ <warSourceExcludes>.gwt-tmp/**</warSourceExcludes>
+ </configuration>
+ </plugin>
+ <!-- tell the compiler we can use 1.5 -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <!-- profiles (with activation per platform) -->
+ <profiles>
+ <profile>
+ <id>gwt-dev-windows</id>
+ <properties>
+ <platform>windows</platform>
+ </properties>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ <os>
+ <family>windows</family>
+ </os>
+ </activation>
+ </profile>
+ <profile>
+ <id>gwt-dev-mac</id>
+ <properties>
+ <platform>mac</platform>
+ </properties>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ <os>
+ <family>mac</family>
+ </os>
+ </activation>
+ </profile>
+ <profile>
+ <id>gwt-dev-linux</id>
+ <properties>
+ <platform>linux</platform>
+ </properties>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ <os>
+ <name>linux</name>
+ </os>
+ </activation>
+ </profile>
+ </profiles>
+
+ <dependencies>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.4</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.columba</groupId>
+ <artifactId>ristretto-common</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.columba</groupId>
+ <artifactId>ristretto-imap</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.columba</groupId>
+ <artifactId>ristretto-smtp</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.cobogw </groupId>
+ <artifactId>gwt</artifactId>
+ <version>1.2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>net.sf.gwt-widget</groupId>
+ <artifactId>gwt-widgets</artifactId>
+ <version>0.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>gwt-mvc</groupId>
+ <artifactId>gwt-mvc</artifactId>
+ <version>0.2.1-gwt-1.6</version>
+ </dependency>
+ <!-- GWT deps (from central repo) -->
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-servlet</artifactId>
+ <version>${gwtVersion}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${gwtVersion}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwtVersion}</version>
+ <classifier>${platform}-libs</classifier>
+ <type>zip</type>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev</artifactId>
+ <version>${gwtVersion}</version>
+ <classifier>${platform}</classifier>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.1</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: labs/hupa/src/main/java/org/apache/hupa/Hupa.gwt.xml
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/Hupa.gwt.xml?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/Hupa.gwt.xml (added)
+++ labs/hupa/src/main/java/org/apache/hupa/Hupa.gwt.xml Fri Jun 26 20:43:11 2009
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.6.4//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.6.4/distro-source/core/src/gwt-module.dtd">
+<module rename-to='hupa'>
+ <!-- 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.standard.Standard'/>
+ <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
+ <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
+
+ <!-- Other module inherits -->
+ <inherits name='org.cobogw.gwt.user.User' />
+ <inherits name='org.gwtwidgets.WidgetLibrary' />
+
+ <!-- GWT MVC -->
+ <inherits name="com.googlecode.gwtmvc.GwtMvc" />
+
+ <source path="client"/>
+ <source path="common"/>
+
+ <!-- Specify the app entry point class. -->
+ <entry-point class='org.apache.hupa.client.Hupa'/>
+</module>
Added: labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/Hupa.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,32 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client;
+
+import org.apache.hupa.client.controller.HupaController;
+
+import com.googlecode.gwtmvc.client.MvcEntryPoint;
+
+public class Hupa extends MvcEntryPoint {
+
+ public Hupa() {
+ super(new HupaController());
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,62 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client;
+
+import com.google.gwt.i18n.client.Constants;
+
+public interface HupaConstants extends Constants {
+
+ public String usernameLabel();
+
+ public String passwordLabel();
+
+ public String saveLoginLabel();
+
+ public String loginButton();
+
+ public String resetButton();
+
+ public String logoutButton();
+
+ public String deleteMailButton();
+
+ public String newMailButton();
+
+ public String replyMailButton();
+
+ public String replyAllMailButton();
+
+ public String headerTo();
+
+ public String headerCc();
+
+ public String headerSubject();
+
+ public String headerReceivedDate();
+
+ public String productName();
+
+ public String headerFrom();
+ public String mailTableFrom();
+ public String mailTableSubject();
+ public String mailTableDate();
+
+ public String loading();
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.properties
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.properties?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.properties (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/HupaConstants.properties Fri Jun 26 20:43:11 2009
@@ -0,0 +1,20 @@
+usernameLabel=Username:
+passwordLabel=Password:
+saveLoginLabel=Save login data
+loginButton=Login
+resetButton=Reset
+logoutButton=Logout
+deleteMailButton=Delete
+newMailButton=New
+replyMailButton=Reply
+replyAllMailButton=Reply All
+headerTo=To
+headerCc=Cc
+headerFrom=From
+headerSubject=Subject
+headerReceivedDate=Received
+productName=Hupa
+mailTableFrom=From
+mailTableSubject=Subject
+mailTableDate=Date
+loading=Loading....
\ No newline at end of file
Added: labs/hupa/src/main/java/org/apache/hupa/client/bundles/IMAPTreeImages.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/bundles/IMAPTreeImages.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/bundles/IMAPTreeImages.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/bundles/IMAPTreeImages.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,48 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client.bundles;
+
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.TreeImages;
+
+public interface IMAPTreeImages extends TreeImages {
+
+ /*
+ * (non-Javadoc)
+ * @see com.google.gwt.user.client.ui.TreeImages#treeOpen()
+ */
+ @Resource("folder_add.png")
+ AbstractImagePrototype treeOpen();
+
+ /*
+ * (non-Javadoc)
+ * @see com.google.gwt.user.client.ui.TreeImages#treeClosed()
+ */
+ @Resource("folder_add.png")
+ AbstractImagePrototype treeClosed();
+
+ /*
+ * (non-Javadoc)
+ * @see com.google.gwt.user.client.ui.TreeImages#treeLeaf()
+ */
+ @Resource("folder.png")
+ AbstractImagePrototype treeLeaf();
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/bundles/folder.png
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/bundles/folder.png?rev=788864&view=auto
==============================================================================
Binary file - no diff available.
Propchange: labs/hupa/src/main/java/org/apache/hupa/client/bundles/folder.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: labs/hupa/src/main/java/org/apache/hupa/client/bundles/folder_add.png
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/bundles/folder_add.png?rev=788864&view=auto
==============================================================================
Binary file - no diff available.
Propchange: labs/hupa/src/main/java/org/apache/hupa/client/bundles/folder_add.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: labs/hupa/src/main/java/org/apache/hupa/client/controller/HupaController.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/controller/HupaController.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/controller/HupaController.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/controller/HupaController.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,118 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+
+package org.apache.hupa.client.controller;
+
+import org.apache.hupa.client.model.FolderModel;
+import org.apache.hupa.client.model.MessageListModel;
+import org.apache.hupa.client.model.MessageModel;
+import org.apache.hupa.client.model.SessionModel;
+import org.apache.hupa.client.view.LoginView;
+import org.apache.hupa.client.view.MainView;
+import org.apache.hupa.common.data.Session;
+
+import com.google.gwt.user.client.ui.RootPanel;
+import com.googlecode.gwtmvc.client.Controller;
+import com.googlecode.gwtmvc.client.Event;
+import com.googlecode.gwtmvc.client.IView;
+import com.googlecode.gwtmvc.client.View;
+
+public class HupaController extends Controller {
+
+ public enum HupaAction {
+ LOGIN, LOGIN_SUCCESSFULL, LOGIN_ERROR, LOGOUT, FETCH_FOLDERS, FETCH_MESSAGES, EXPOSE_MESSAGE
+ }
+
+ protected IView<Session> loginView;
+
+ private SessionModel model;
+ private FolderModel fModel;
+ private MessageListModel mModel;
+
+ private IView mailboxView;
+
+ private MessageModel messageModel;
+
+
+ public HupaController() {
+ super(HupaAction.values());
+ model = new SessionModel();
+ fModel = new FolderModel();
+ mModel = new MessageListModel();
+ messageModel = new MessageModel();
+ }
+
+ protected void handleEvent(Event ev) {
+ Event<Session,HupaAction> event = ev;
+ HupaAction action = event.getAction();
+ switch (action) {
+ case LOGIN:
+ model.login(event.getValue(),ev);
+ break;
+ case LOGOUT:
+ model.logout(event.getValue(),ev);
+ renderView(loginView);
+ break;
+ case LOGIN_SUCCESSFULL:
+ fModel.fetchFolders((Session) event.getValue(),ev);
+ renderView(mailboxView);
+ break;
+ case FETCH_MESSAGES:
+ mModel.fetchMessages((Session) event.getValue() , 0, 20,ev);
+ break;
+ case EXPOSE_MESSAGE:
+ messageModel.exposeMessage(event.getValue(),ev);
+ break;
+ default:
+ break;
+ }
+ }
+
+ @Override
+ public void init() {
+ if (loginView == null) {
+ loginView = new LoginView(this, model);
+
+ }
+ if (mailboxView == null) {
+ mailboxView = new MainView(this, model, fModel,mModel,messageModel);
+ }
+ initModel(model);
+ initModel(fModel);
+ initModel(messageModel);
+ initModel(mModel);
+ }
+
+ @Override
+ protected void renderView(IView view) {
+ if (view instanceof View) {
+ RootPanel.get().clear();
+ RootPanel.get().add((View) view);
+ }
+
+ view.render();
+ }
+
+ @Override
+ public void showHomeView() {
+ renderView(loginView);
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/model/FolderModel.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/model/FolderModel.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/model/FolderModel.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/model/FolderModel.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,60 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.hupa.client.services.IMAPService;
+import org.apache.hupa.client.services.IMAPServiceAsync;
+import org.apache.hupa.common.data.IMAPFolder;
+import org.apache.hupa.common.data.Session;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.googlecode.gwtmvc.client.Event;
+import com.googlecode.gwtmvc.client.Model;
+
+public class FolderModel extends Model<List<IMAPFolder>> {
+
+ private IMAPServiceAsync imapService = GWT.create(IMAPService.class);
+
+ @Override
+ protected void init() {
+ // no folders as default
+ update(new ArrayList<IMAPFolder>());
+ }
+
+ public void fetchFolders(Session session,final Event event) {
+ imapService.getFolders(session, new AsyncCallback<List<IMAPFolder>>() {
+
+ public void onFailure(Throwable caught) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onSuccess(List<IMAPFolder> result) {
+ update(result,event);
+ }
+
+ });
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/model/MessageListModel.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/model/MessageListModel.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/model/MessageListModel.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/model/MessageListModel.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,59 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client.model;
+
+import org.apache.hupa.client.services.IMAPService;
+import org.apache.hupa.client.services.IMAPServiceAsync;
+import org.apache.hupa.common.data.IMAPMessage;
+import org.apache.hupa.common.data.ResultList;
+import org.apache.hupa.common.data.Session;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.googlecode.gwtmvc.client.Event;
+import com.googlecode.gwtmvc.client.Model;
+
+public class MessageListModel extends Model<ResultList<IMAPMessage>> {
+
+ private IMAPServiceAsync service = GWT.create(IMAPService.class);
+
+ @Override
+ protected void init() {
+ // do nothing
+ }
+
+ public void fetchMessages(Session session, int start,
+ int end,final Event event) {
+ service.getMessages(session, start, end,
+ new AsyncCallback<ResultList<IMAPMessage>>() {
+
+ public void onFailure(Throwable caught) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onSuccess(ResultList<IMAPMessage> result) {
+ update(result,event);
+ }
+
+ });
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/model/MessageModel.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/model/MessageModel.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/model/MessageModel.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/model/MessageModel.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,57 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+
+package org.apache.hupa.client.model;
+
+import org.apache.hupa.client.services.IMAPService;
+import org.apache.hupa.client.services.IMAPServiceAsync;
+import org.apache.hupa.common.data.IMAPMessage;
+import org.apache.hupa.common.data.Session;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.googlecode.gwtmvc.client.Event;
+import com.googlecode.gwtmvc.client.Model;
+
+public class MessageModel extends Model<IMAPMessage>{
+
+ private IMAPServiceAsync service = GWT.create(IMAPService.class);
+ @Override
+ protected void init() {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void exposeMessage(Session session,final Event event) {
+ service.exposeMessage(session, new AsyncCallback<IMAPMessage>() {
+
+ public void onFailure(Throwable caught) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void onSuccess(IMAPMessage result) {
+ update(result,event);
+ }
+
+ });
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/model/SessionModel.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/model/SessionModel.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/model/SessionModel.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/model/SessionModel.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,61 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client.model;
+
+import org.apache.hupa.client.services.IMAPService;
+import org.apache.hupa.client.services.IMAPServiceAsync;
+import org.apache.hupa.common.data.IMAPUser;
+import org.apache.hupa.common.data.Session;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.googlecode.gwtmvc.client.Event;
+import com.googlecode.gwtmvc.client.Model;
+
+public class SessionModel extends Model<Session> {
+
+ private IMAPServiceAsync imapService = GWT.create(IMAPService.class);
+
+ @Override
+ protected void init() {
+
+ }
+
+ public void login(Session session,final Event event) {
+ IMAPUser user = session.getIMAPUser();
+ imapService.login(user.getName(), user.getPassword(),
+ new AsyncCallback<Session>() {
+
+ public void onFailure(Throwable caught) {
+
+ }
+
+ public void onSuccess(Session result) {
+ update(result,event);
+ }
+
+ });
+ }
+
+ public void logout(Session session,Event ev) {
+ update(null,ev);
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPService.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPService.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPService.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPService.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,50 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client.services;
+
+import java.util.List;
+
+import org.apache.hupa.common.data.IMAPFolder;
+import org.apache.hupa.common.data.IMAPMessage;
+import org.apache.hupa.common.data.ResultList;
+import org.apache.hupa.common.data.Session;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
+
+@RemoteServiceRelativePath("imap")
+public interface IMAPService extends RemoteService {
+
+ public Session login(String username, String password)
+ throws IMAPServiceException;
+
+ public List<IMAPFolder> getFolders(Session session)
+ throws IMAPServiceException;
+
+ public ResultList<IMAPMessage> getMessages(Session session, int start, int end) throws IMAPServiceException;
+
+ public IMAPMessage exposeMessage(Session session) throws IMAPServiceException;
+
+ public void addFolder(Session session, IMAPFolder folder)
+ throws IMAPServiceException;
+
+ public void removeFolder(Session session, IMAPFolder folder)
+ throws IMAPServiceException;
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPServiceAsync.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPServiceAsync.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPServiceAsync.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPServiceAsync.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,50 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client.services;
+
+import java.util.List;
+
+import org.apache.hupa.common.data.IMAPFolder;
+import org.apache.hupa.common.data.IMAPMessage;
+import org.apache.hupa.common.data.IMAPUser;
+import org.apache.hupa.common.data.ResultList;
+import org.apache.hupa.common.data.Session;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public interface IMAPServiceAsync {
+
+ public void login(String username, String password,
+ AsyncCallback<Session> callback);
+
+ public void getFolders(Session session,
+ AsyncCallback<List<IMAPFolder>> callback);
+
+ public void getMessages(Session session, int start,
+ int end, AsyncCallback<ResultList<IMAPMessage>> callback);
+
+ public void exposeMessage(Session session, AsyncCallback<IMAPMessage> callback);
+
+ public void addFolder(Session session, IMAPFolder folder,
+ AsyncCallback<Void> callBack);
+
+ public void removeFolder(Session session, IMAPFolder folder,
+ AsyncCallback<Void> callBack);
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPServiceException.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPServiceException.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPServiceException.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/services/IMAPServiceException.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,44 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client.services;
+
+public class IMAPServiceException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7662655924554353719L;
+
+ public IMAPServiceException(String msg, Throwable e) {
+ super(msg, e);
+ }
+
+ public IMAPServiceException(Throwable e) {
+ super(e);
+ }
+
+ public IMAPServiceException() {
+ }
+
+ public IMAPServiceException(String message) {
+ super(message);
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/view/LoadingMasker.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/view/LoadingMasker.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/view/LoadingMasker.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/view/LoadingMasker.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,70 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+
+package org.apache.hupa.client.view;
+
+import org.apache.hupa.client.HupaConstants;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.PopupPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.googlecode.gwtmvc.client.Maskable;
+
+public class LoadingMasker implements Maskable {
+ private HupaConstants constants = GWT.create(HupaConstants.class);
+
+ private PopupPanel pPanel= new PopupPanel();
+
+ public LoadingMasker() {
+
+ pPanel.setModal(true);
+ VerticalPanel vP = new VerticalPanel();
+ vP.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
+ Image loadingImage = new Image();
+ loadingImage.setUrl(GWT.getModuleBaseURL()
+ + "../images/ajax-loader.gif");
+ vP.add(loadingImage);
+ vP.add(new Label(constants.loading()));
+ pPanel.add(vP);
+
+ pPanel.center();
+
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.googlecode.gwtmvc.client.Maskable#mask()
+ */
+ public void mask() {
+ pPanel.show();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see com.googlecode.gwtmvc.client.Maskable#unmask()
+ */
+ public void unmask() {
+ pPanel.hide();
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/view/LoginView.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/view/LoginView.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/view/LoginView.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/view/LoginView.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,166 @@
+package org.apache.hupa.client.view;
+
+import org.apache.hupa.client.HupaConstants;
+import org.apache.hupa.client.controller.HupaController;
+import org.apache.hupa.client.controller.HupaController.HupaAction;
+import org.apache.hupa.client.model.SessionModel;
+import org.apache.hupa.common.data.IMAPUser;
+import org.apache.hupa.common.data.Session;
+import org.cobogw.gwt.user.client.ui.Button;
+import org.cobogw.gwt.user.client.ui.ButtonBar;
+
+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.KeyUpEvent;
+import com.google.gwt.event.dom.client.KeyUpHandler;
+import com.google.gwt.user.client.Cookies;
+import com.google.gwt.user.client.ui.CheckBox;
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.PasswordTextBox;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.googlecode.gwtmvc.client.Event;
+import com.googlecode.gwtmvc.client.ModelForView;
+import com.googlecode.gwtmvc.client.View;
+
+public class LoginView extends View<Session, VerticalPanel> implements
+ ClickHandler, KeyUpHandler {
+
+ public LoginView(HupaController controller, SessionModel sModel) {
+ super("loginView", controller, sModel);
+ }
+
+ public final static int LOGIN = 0;
+ public final static int RESET = 1;
+ private HupaConstants constants = GWT.create(HupaConstants.class);
+ private Button loginButton = new Button(constants.loginButton());
+ private Button resetButton = new Button(constants.resetButton());
+ private TextBox usernameTextBox = new TextBox();
+ private PasswordTextBox passwordTextBox = new PasswordTextBox();
+ private CheckBox saveBox = new CheckBox(constants.saveLoginLabel());
+ private LoadingMasker masker = new LoadingMasker();
+
+ private int minUsernameLength = 1;
+ private int minPasswordLength = 1;
+
+ @Override
+ public VerticalPanel createWidget() {
+ VerticalPanel vPanel = new VerticalPanel();
+ vPanel.setSpacing(5);
+ vPanel.setWidth("100%");
+ vPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
+ vPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+
+ Label header = new Label(constants.productName());
+
+ header.setHeight("25px");
+ header.setStyleName("hupa-LoginWidgetHeader");
+ vPanel.add(header);
+ vPanel.setCellHorizontalAlignment(header, VerticalPanel.ALIGN_LEFT);
+
+ Grid grid = new Grid(3, 2);
+
+ grid.setText(0, 0, constants.usernameLabel());
+ grid.setWidget(0, 1, usernameTextBox);
+
+ grid.setText(1, 0, constants.passwordLabel());
+ grid.setWidget(1, 1, passwordTextBox);
+ grid.setWidget(2, 1, saveBox);
+ usernameTextBox.addKeyUpHandler(this);
+ usernameTextBox.setText(Cookies.getCookie("username"));
+ passwordTextBox.addKeyUpHandler(this);
+ passwordTextBox.setText(Cookies.getCookie("password"));
+ vPanel.add(grid);
+ ButtonBar buttonBar = new ButtonBar();
+
+ buttonBar.add(loginButton);
+ buttonBar.add(resetButton);
+
+ loginButton.setEnabled(false);
+ loginButton.addClickHandler(this);
+ resetButton.addClickHandler(this);
+
+ vPanel.add(buttonBar);
+
+ return vPanel;
+ }
+
+ @Override
+ public void onModelChange(ModelForView<Session> model) {
+
+ if (model.getValue() == null) {
+ reset();
+ } else {
+ controller.call(new Event<Session, HupaAction>(HupaAction.LOGIN_SUCCESSFULL, model.getValue()));
+ }
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event
+ * .dom.client.ClickEvent)
+ */
+ public void onClick(ClickEvent event) {
+ if (resetButton.equals(event.getSource())) {
+ reset();
+ } else if (loginButton.equals(event.getSource())) {
+ IMAPUser user = new IMAPUser();
+ user.setName(getUsername());
+ user.setPassword(getPassword());
+ Session session = new Session();
+ session.setIMAPUser(user);
+ controller.call(new Event<Session, HupaAction>(HupaAction.LOGIN,
+ session,masker));
+ }
+ }
+
+ public void reset() {
+ loginButton.setEnabled(false);
+ usernameTextBox.setText("");
+ passwordTextBox.setText("");
+ }
+
+ public void error() {
+ reset();
+ if (saveBox.getValue()) {
+ Cookies.removeCookie("username");
+ Cookies.removeCookie("password");
+ }
+ }
+
+ public void success() {
+ if (saveBox.getValue()) {
+ Cookies.setCookie("username", getUsername());
+ Cookies.setCookie("password", getPassword());
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.google.gwt.event.dom.client.KeyUpHandler#onKeyUp(com.google.gwt.event
+ * .dom.client.KeyUpEvent)
+ */
+ public void onKeyUp(KeyUpEvent event) {
+ if (usernameTextBox.getText().length() >= minUsernameLength
+ && passwordTextBox.getText().length() >= minPasswordLength) {
+ loginButton.setEnabled(true);
+ } else {
+ loginButton.setEnabled(false);
+ }
+ }
+
+ public String getUsername() {
+ return usernameTextBox.getText();
+ }
+
+ public String getPassword() {
+ return passwordTextBox.getText();
+ }
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/view/MainView.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/view/MainView.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/view/MainView.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/view/MainView.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,385 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client.view;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.hupa.client.HupaConstants;
+import org.apache.hupa.client.bundles.IMAPTreeImages;
+import org.apache.hupa.client.controller.HupaController;
+import org.apache.hupa.client.controller.HupaController.HupaAction;
+import org.apache.hupa.client.model.FolderModel;
+import org.apache.hupa.client.model.MessageListModel;
+import org.apache.hupa.client.model.MessageModel;
+import org.apache.hupa.client.model.SessionModel;
+import org.apache.hupa.client.widgets.IMAPMessageWidget;
+import org.apache.hupa.common.data.IMAPFolder;
+import org.apache.hupa.common.data.IMAPMessage;
+import org.apache.hupa.common.data.ResultList;
+import org.apache.hupa.common.data.Session;
+import org.apache.hupa.common.data.IMAPMessage.IMAPFlag;
+import org.cobogw.gwt.user.client.ui.Button;
+import org.cobogw.gwt.user.client.ui.ButtonBar;
+import org.cobogw.gwt.user.client.ui.RoundedPanel;
+
+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.logical.shared.SelectionEvent;
+import com.google.gwt.event.logical.shared.SelectionHandler;
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.user.client.ui.CheckBox;
+import com.google.gwt.user.client.ui.DockPanel;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Tree;
+import com.google.gwt.user.client.ui.TreeItem;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.HTMLTable.Cell;
+import com.googlecode.gwtmvc.client.Event;
+import com.googlecode.gwtmvc.client.Maskable;
+import com.googlecode.gwtmvc.client.ModelForView;
+import com.googlecode.gwtmvc.client.View;
+
+public class MainView extends View {
+
+ private IMAPTreeImages tImages = GWT.create(IMAPTreeImages.class);
+ private Tree folderTree = new Tree(tImages, true);
+ private HupaConstants constants = GWT.create(HupaConstants.class);
+ private RoundedPanel west;
+ private HorizontalPanel north;
+ private RoundedPanel center;
+ private DateTimeFormat dFormat = DateTimeFormat.getShortDateTimeFormat();
+ private int rowsPerPage = 20;
+
+ private Label usernameLabel = new Label();
+ private FlexTable mailTable = new FlexTable();
+ private int selectedRow = -1;
+ private DockPanel dockPanel = new DockPanel();
+ private Map<Integer, IMAPMessage> mMap = new HashMap<Integer, IMAPMessage>();
+ private IMAPFolder folder;
+ private IMAPMessageWidget msgWidget = new IMAPMessageWidget();
+ private VerticalPanel centerVP = new VerticalPanel();
+ private Maskable masker = new LoadingMasker();
+ private Cell cell;
+ private Session session;
+
+ public MainView(HupaController hupaController, SessionModel sModel,
+ FolderModel folderModel,MessageListModel mModel,MessageModel messageModel) {
+ super("mainView", hupaController, sModel, folderModel,mModel,messageModel);
+
+ }
+
+ private void createWest() {
+ west = new RoundedPanel(RoundedPanel.ALL);
+ west.add(folderTree);
+ west.setWidth("30%");
+
+ folderTree.addSelectionHandler(new SelectionHandler<TreeItem>() {
+
+ public void onSelection(SelectionEvent<TreeItem> event) {
+ folder = (IMAPFolder) event.getSelectedItem().getUserObject();
+ session.setSelectedIMAPFolder(folder);
+ controller.call(new Event<Session, HupaAction>(HupaAction.FETCH_MESSAGES, session, masker));
+ }
+
+ });
+ }
+
+ private void createCenter() {
+
+ centerVP.setSpacing(10);
+
+ HorizontalPanel navPanel = new HorizontalPanel();
+ navPanel.setSpacing(10);
+ ButtonBar navigatorBar = new ButtonBar();
+ Button newMailButton = new Button(constants.newMailButton());
+ navigatorBar.add(newMailButton);
+ Button deleteMailButton = new Button(constants.deleteMailButton());
+ navigatorBar.add(deleteMailButton);
+
+ navPanel.add(navigatorBar);
+
+ centerVP.add(navPanel);
+ mailTable.getRowFormatter().setStyleName(0, "hupa-Mailtable-Header");
+
+ final CheckBox headerCheckbox = new CheckBox();
+ headerCheckbox.addClickHandler(new ClickHandler() {
+
+ public void onClick(ClickEvent event) {
+ for (int i = 1; i < mailTable.getRowCount(); i++) {
+ ((CheckBox) mailTable.getWidget(i, 0))
+ .setValue(headerCheckbox.getValue());
+ }
+ }
+
+ });
+ mailTable.setCellSpacing(0);
+ mailTable.setWidget(0, 0, headerCheckbox);
+ mailTable.getFlexCellFormatter().setWidth(0, 0, "15px");
+ mailTable.setText(0, 1, constants.mailTableFrom());
+ mailTable.getFlexCellFormatter().setWidth(0, 1, "200px");
+ mailTable.setText(0, 2, constants.mailTableSubject());
+ mailTable.getFlexCellFormatter().setWidth(0, 2, "500px");
+ mailTable.setText(0, 3, constants.mailTableDate());
+ mailTable.getFlexCellFormatter().setWidth(0, 3, "200px");
+
+ mailTable.addClickHandler(new ClickHandler() {
+
+ public void onClick(ClickEvent event) {
+
+ cell = mailTable.getCellForEvent(event);
+ if (cell.getRowIndex() > 0) {
+ if (selectedRow != -1) {
+ if ((selectedRow + 1) % 2 == 0) {
+ mailTable.getRowFormatter().setStyleName(
+ selectedRow, "hupa-Mailtable-row1");
+ } else {
+ mailTable.getRowFormatter().setStyleName(
+ selectedRow, "hupa-Mailtable-row2");
+ }
+ }
+ if (cell.getCellIndex() == 0) {
+
+ mailTable.getRowFormatter().setStyleName(
+ cell.getRowIndex(),
+ "hupa-Mailtable-row-selected");
+ } else {
+ session.setSelectedIMAPMessage(getSelectedMessage());
+ controller.call(new Event<Session, HupaAction>(HupaAction.EXPOSE_MESSAGE,session,masker));
+ }
+ selectedRow = cell.getRowIndex();
+ }
+
+ }
+
+ });
+ centerVP.add(mailTable);
+ center = new RoundedPanel();
+ center.add(centerVP);
+ center.setWidth("100%");
+ }
+
+ private void createNorth() {
+ north = new HorizontalPanel();
+ north.setSpacing(5);
+ north.setStyleName("hupa-Northpanel");
+ north.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
+
+ north.setWidth("100%");
+ north.add(new Label(constants.productName()));
+
+ Button logoutButton = new Button(constants.logoutButton());
+ logoutButton.addClickHandler(new ClickHandler() {
+
+ public void onClick(ClickEvent event) {
+ controller.call(new Event<Session, HupaAction>(HupaAction.LOGOUT,session,masker));
+ }
+
+ });
+ north.add(logoutButton);
+ north.setCellHorizontalAlignment(logoutButton,
+ VerticalPanel.ALIGN_RIGHT);
+ }
+
+ /**
+ * Load all needed data for the user
+ *
+ * @param user
+ */
+ public void load(Session session) {
+ if (session != null) {
+ this.session = session;
+ usernameLabel.setText(session.getIMAPUser().getName());
+ }
+ }
+
+ private void loadMails(ResultList<IMAPMessage> result) {
+ int pages = 0;
+
+ while (result.getRealSize()
+ - (rowsPerPage * (pages + 1)) >= 0) {
+ pages++;
+ }
+
+ // clear table
+ int a = 0;
+ while ((a = mailTable.getRowCount()) != 1) {
+ mailTable.removeRow(a - 1);
+ }
+
+ mMap.clear();
+
+ int rows = 1;
+ for (int i = 0; i < result.size(); i++) {
+ CheckBox mCheckbox = new CheckBox();
+ mCheckbox.addClickHandler(new ClickHandler() {
+
+ public void onClick(ClickEvent event) {
+ }
+
+ });
+ IMAPMessage message = result.get(i);
+ mMap.put(rows, message);
+ mailTable.setWidget(rows, 0, mCheckbox);
+ mailTable.setText(rows, 1, truncate(message.getIMAPHeader()
+ .getFrom()));
+ mailTable.setText(rows, 2, truncate(message.getIMAPHeader()
+ .getSubject()));
+ mailTable.setText(rows, 3, dFormat.format(message
+ .getIMAPHeader().getReceivedDate()));
+ if (rows % 2 == 0) {
+ mailTable.getRowFormatter().setStyleName(rows,
+ "hupa-Mailtable-row1");
+ } else {
+ mailTable.getRowFormatter().setStyleName(rows,
+ "hupa-Mailtable-row2");
+ }
+ if (message.getIMAPFlags().contains(IMAPFlag.SEEN) == false) {
+ mailTable.getRowFormatter().addStyleName(rows,
+ "hupa-Mailtable-row-notseen");
+ }
+ mailTable.getCellFormatter().setWordWrap(rows, 1,
+ false);
+ mailTable.getCellFormatter().setWordWrap(rows, 2,
+ false);
+ mailTable.getCellFormatter().setWordWrap(rows, 3,
+ false);
+
+ rows++;
+ }
+
+ if (center.getWidget().equals(msgWidget)) {
+ center.remove(msgWidget);
+ center.add(centerVP);
+ }
+
+ }
+
+ /**
+ * Create recursive the TreeNodes with all childs
+ *
+ * @param list
+ * @return
+ */
+ private List<TreeItem> createTreeNodes(List<IMAPFolder> list) {
+ List<TreeItem> tList = new ArrayList<TreeItem>();
+
+ for (int i = 0; i < list.size(); i++) {
+ IMAPFolder iFolder = list.get(i);
+ TreeItem record = new TreeItem(iFolder.getName() + " ("
+ + iFolder.getUnseeMessageCount() + ")");
+ record.setUserObject(iFolder);
+
+ List<IMAPFolder> childFolders = iFolder.getChildIMAPFolders();
+ if (childFolders != null && childFolders.isEmpty() == false) {
+ List<TreeItem> items = createTreeNodes(childFolders);
+ for (int a = 0; a < items.size(); a++) {
+ record.addItem(items.get(a));
+ }
+ }
+
+ tList.add(record);
+ }
+
+ // Sort tree
+ Collections.sort(tList, new Comparator<TreeItem>() {
+
+ public int compare(TreeItem o1, TreeItem o2) {
+ return o1.getText().compareTo(o2.getText());
+ }
+
+ });
+ return tList;
+ }
+
+ @Override
+ public Widget createWidget() {
+
+ dockPanel.setSpacing(10);
+ dockPanel.setWidth("100%");
+
+ createNorth();
+ createWest();
+ createCenter();
+
+ createNorth();
+ dockPanel.add(north, DockPanel.NORTH);
+ dockPanel.add(west, DockPanel.WEST);
+ dockPanel.add(center, DockPanel.CENTER);
+ dockPanel.setCellHorizontalAlignment(north, DockPanel.ALIGN_RIGHT);
+ dockPanel.setCellHorizontalAlignment(center, DockPanel.ALIGN_LEFT);
+
+ return dockPanel;
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public void onModelChange(ModelForView model) {
+
+ if (model instanceof SessionModel) {
+ if (model.getValue() == null) {
+ reset();
+ } else {
+ load((Session) model.getValue());
+ }
+ } else if (model instanceof FolderModel) {
+ List<TreeItem> tList = createTreeNodes((List<IMAPFolder>) model
+ .getValue());
+ for (int i = 0; i < tList.size(); i++) {
+ folderTree.addItem(tList.get(i));
+ }
+ } else if (model instanceof MessageListModel) {
+ loadMails((ResultList<IMAPMessage>)model.getValue());
+ } else if (model instanceof MessageModel) {
+ msgWidget.setIMAPMessage((IMAPMessage)model.getValue());
+ center.clear();
+ center.add(msgWidget);
+ }
+
+ }
+
+ private String truncate(String rawString) {
+ if (rawString.length() > 50) {
+ return rawString.substring(0, 50);
+ } else {
+ return rawString;
+ }
+ }
+ private void reset() {
+ session = null;
+ folderTree.clear();
+ mailTable.clear();
+ center.clear();
+ center.add(centerVP);
+ }
+
+ public IMAPMessage getSelectedMessage() {
+ return mMap.get(cell.getRowIndex());
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/client/widgets/IMAPMessageWidget.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/client/widgets/IMAPMessageWidget.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/client/widgets/IMAPMessageWidget.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/client/widgets/IMAPMessageWidget.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,105 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.client.widgets;
+
+import org.cobogw.gwt.user.client.ui.Button;
+import org.cobogw.gwt.user.client.ui.ButtonBar;
+
+import org.apache.hupa.client.HupaConstants;
+import org.apache.hupa.common.data.IMAPMessage;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Grid;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class IMAPMessageWidget extends Composite {
+ private Grid detailGrid = new Grid(3, 2);
+ private HTML msgArea = new HTML();
+ private Button deleteMsgButton = new Button();
+ private Button replyMsgButton = new Button();
+ private Button replyAllMsgButton = new Button();
+ private HupaConstants constants = GWT.create(HupaConstants.class);
+ public final static int DELETE_BUTTON = 0;
+ public final static int REPLY_BUTTON = 1;
+ public final static int REPLY_ALL_BUTTON = 2;
+
+ public IMAPMessageWidget() {
+ VerticalPanel mPanel = new VerticalPanel();
+ mPanel.setWidth("100%");
+ mPanel.setSpacing(5);
+
+ detailGrid.setWidth("100%");
+ detailGrid.setStyleName("hupa-IMAPMessageWidget-Header");
+ detailGrid.setText(0, 0, constants.headerFrom() + ":");
+
+ detailGrid.setText(1, 0, constants.headerCc() + ":");
+ detailGrid.setText(2, 0, constants.headerSubject() + ":");
+
+ mPanel.add(detailGrid);
+
+ deleteMsgButton.setText(constants.deleteMailButton());
+ replyMsgButton.setText(constants.replyMailButton());
+ replyAllMsgButton.setText(constants.replyAllMailButton());
+ ButtonBar buttonBar = new ButtonBar();
+ buttonBar.addStyleName("hupa-IMAPMessageWidget-ButtonBar");
+ buttonBar.add(replyMsgButton);
+ buttonBar.add(replyAllMsgButton);
+ buttonBar.add(deleteMsgButton);
+
+ buttonBar.setWidth("100%");
+
+ mPanel.add(buttonBar);
+ msgArea.setWidth("100%");
+ ScrollPanel sPanel = new ScrollPanel();
+ sPanel.setAlwaysShowScrollBars(false);
+
+ sPanel.add(msgArea);
+ mPanel.add(sPanel);
+
+ initWidget(mPanel);
+ }
+
+ public void setIMAPMessage(IMAPMessage msg) {
+ detailGrid.setText(0, 1, msg.getIMAPHeader().getFrom());
+ detailGrid.setText(1, 1, msg.getIMAPHeader().getCc());
+ detailGrid.setText(2, 1, msg.getIMAPHeader().getSubject());
+ msgArea.setHTML(msg.getIMAPMessageContent().getText());
+
+ }
+
+ public HandlerRegistration addClickHandler(int buttonId,
+ ClickHandler handler) {
+ switch (buttonId) {
+ case DELETE_BUTTON:
+ return deleteMsgButton.addClickHandler(handler);
+ case REPLY_BUTTON:
+ return replyMsgButton.addClickHandler(handler);
+ case REPLY_ALL_BUTTON:
+ return replyAllMsgButton.addClickHandler(handler);
+ default:
+ throw new IllegalArgumentException("Unknown Button id " + buttonId);
+ }
+ }
+
+}
Added: labs/hupa/src/main/java/org/apache/hupa/common/data/IMAPFolder.java
URL: http://svn.apache.org/viewvc/labs/hupa/src/main/java/org/apache/hupa/common/data/IMAPFolder.java?rev=788864&view=auto
==============================================================================
--- labs/hupa/src/main/java/org/apache/hupa/common/data/IMAPFolder.java (added)
+++ labs/hupa/src/main/java/org/apache/hupa/common/data/IMAPFolder.java Fri Jun 26 20:43:11 2009
@@ -0,0 +1,110 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.common.data;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+public class IMAPFolder implements Serializable {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 2084188092060266479L;
+ private List<IMAPFolder> childs = new ArrayList<IMAPFolder>();
+ private String fullName;
+ private String delimiter;
+ private int msgCount;
+ private int unseenMsgCount;
+
+ public IMAPFolder() {
+ }
+
+ public IMAPFolder(String fullName) {
+ setFullName(fullName);
+ }
+
+ public String getName() {
+ if (delimiter != null) {
+ String fParts[] = getFullName().split("\\" + delimiter);
+ if (fParts != null && fParts.length > 0) {
+ return fParts[fParts.length - 1];
+ }
+ }
+ return fullName;
+ }
+
+ public void setChildIMAPFolders(List<IMAPFolder> childs) {
+ this.childs = childs;
+ }
+
+ public List<IMAPFolder> getChildIMAPFolders() {
+ return childs;
+ }
+
+ public String getFullName() {
+ return fullName;
+ }
+
+ public void setFullName(String fullName) {
+ this.fullName = fullName;
+ }
+
+ public void setDelimiter(String delimiter) {
+ this.delimiter = delimiter;
+ }
+
+ public String getDelimiter() {
+ return delimiter;
+ }
+
+ public int getMessageCount() {
+ return msgCount;
+ }
+
+ public void setMessageCount(int msgCount) {
+ this.msgCount = msgCount;
+ }
+
+ public void setUnseenMessageCount(int unseenMsgCount) {
+ this.unseenMsgCount = unseenMsgCount;
+ }
+
+ public int getUnseeMessageCount() {
+ return unseenMsgCount;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (o instanceof IMAPFolder) {
+ if (((IMAPFolder) o).getFullName().equals(getFullName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ return getFullName().hashCode();
+ }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org