Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Initial commit to the public repository.

  • Loading branch information...
commit 9bf5680495de81df16166e04d317a2f0486179ca 1 parent f2130b3
Laurent Eschenauer eschnou authored
Showing with 13,063 additions and 0 deletions.
  1. +8 −0 .gitignore
  2. +7 −0 BUILD
  3. +202 −0 LICENSE
  4. +7 −0 README
  5. BIN  lib/gwt-html5-storage.jar
  6. BIN  lib/gwt-image-loader-1.1.1.jar
  7. BIN  lib/gwt-log-2.6.2.jar
  8. BIN  lib/gwt-validation-0.9a-without-hibernate.jar
  9. +43 −0 src/eu/maydu/gwt/validation/client/i18n/StandardValidationMessagesImpl_nl.properties
  10. +7 −0 src/org/appfuse/client/Appfuse.gwt.xml
  11. +19 −0 src/org/appfuse/client/widget/BulletList.java
  12. +66 −0 src/org/appfuse/client/widget/ListItem.java
  13. +76 −0 src/org/appfuse/client/widget/MultipleTextBox.java
  14. +30 −0 src/org/appfuse/client/widget/Paragraph.java
  15. +20 −0 src/org/appfuse/client/widget/Span.java
  16. +29 −0 src/org/onesocialweb/gwt/OswClient.gwt.xml
  17. +323 −0 src/org/onesocialweb/gwt/client/OswClient.java
  18. +53 −0 src/org/onesocialweb/gwt/client/OswEntryPoint.java
  19. +22 −0 src/org/onesocialweb/gwt/client/exception/MissingWindowFactoryException.java
  20. +27 −0 src/org/onesocialweb/gwt/client/handler/ActivityButtonHandler.java
  21. +27 −0 src/org/onesocialweb/gwt/client/handler/ContactButtonHandler.java
  22. +22 −0 src/org/onesocialweb/gwt/client/handler/LoginHandler.java
  23. +22 −0 src/org/onesocialweb/gwt/client/handler/PictureHandler.java
  24. +22 −0 src/org/onesocialweb/gwt/client/handler/VideoHandler.java
  25. +28 −0 src/org/onesocialweb/gwt/client/i18n/CustomValidation.java
  26. +234 −0 src/org/onesocialweb/gwt/client/i18n/CustomValidationMessages.java
  27. +25 −0 src/org/onesocialweb/gwt/client/i18n/CustomValidationMessagesImpl.java
  28. +1 −0  src/org/onesocialweb/gwt/client/i18n/CustomValidationMessagesImpl.properties
  29. +1 −0  src/org/onesocialweb/gwt/client/i18n/CustomValidationMessagesImpl_en.properties
  30. +1 −0  src/org/onesocialweb/gwt/client/i18n/CustomValidationMessagesImpl_nl.properties
  31. +63 −0 src/org/onesocialweb/gwt/client/i18n/UserInterfaceText.java
  32. +21 −0 src/org/onesocialweb/gwt/client/i18n/UserInterfaceText.properties
  33. +21 −0 src/org/onesocialweb/gwt/client/i18n/UserInterfaceText_en.properties
  34. +21 −0 src/org/onesocialweb/gwt/client/i18n/UserInterfaceText_nl.properties
  35. +40 −0 src/org/onesocialweb/gwt/client/task/DefaultTaskEvent.java
  36. +86 −0 src/org/onesocialweb/gwt/client/task/DefaultTaskInfo.java
  37. +31 −0 src/org/onesocialweb/gwt/client/task/TaskEvent.java
  38. +35 −0 src/org/onesocialweb/gwt/client/task/TaskInfo.java
  39. +83 −0 src/org/onesocialweb/gwt/client/task/TaskMonitor.java
  40. +182 −0 src/org/onesocialweb/gwt/client/ui/application/AbstractApplication.java
  41. +37 −0 src/org/onesocialweb/gwt/client/ui/application/ActivityApplication.java
  42. +38 −0 src/org/onesocialweb/gwt/client/ui/application/ContactsApplication.java
  43. +36 −0 src/org/onesocialweb/gwt/client/ui/application/PreferencesApplication.java
  44. +56 −0 src/org/onesocialweb/gwt/client/ui/dialog/AbstractDialog.java
  45. +90 −0 src/org/onesocialweb/gwt/client/ui/dialog/AlertDialog.java
  46. +303 −0 src/org/onesocialweb/gwt/client/ui/dialog/LoginDialog.java
  47. +175 −0 src/org/onesocialweb/gwt/client/ui/dialog/PictureChooserDialog.java
  48. +131 −0 src/org/onesocialweb/gwt/client/ui/dialog/PicturePreviewDialog.java
  49. +157 −0 src/org/onesocialweb/gwt/client/ui/dialog/VideoChooserDialog.java
  50. +41 −0 src/org/onesocialweb/gwt/client/ui/event/ComponentAdapter.java
  51. +30 −0 src/org/onesocialweb/gwt/client/ui/event/ComponentEvent.java
  52. +77 −0 src/org/onesocialweb/gwt/client/ui/event/ComponentHelper.java
  53. +29 −0 src/org/onesocialweb/gwt/client/ui/event/ComponentListener.java
  54. +21 −0 src/org/onesocialweb/gwt/client/ui/menu/Command.java
  55. +129 −0 src/org/onesocialweb/gwt/client/ui/menu/MainMenu.java
  56. +25 −0 src/org/onesocialweb/gwt/client/ui/menu/MenuCommand.java
  57. +65 −0 src/org/onesocialweb/gwt/client/ui/widget/ConfirmLabel.java
  58. +70 −0 src/org/onesocialweb/gwt/client/ui/widget/DateField.java
  59. +55 −0 src/org/onesocialweb/gwt/client/ui/widget/DeletableLabel.java
  60. +88 −0 src/org/onesocialweb/gwt/client/ui/widget/DropdownList.java
  61. +64 −0 src/org/onesocialweb/gwt/client/ui/widget/EditableFollowingList.java
  62. +242 −0 src/org/onesocialweb/gwt/client/ui/widget/EditableRelationsList.java
  63. +27 −0 src/org/onesocialweb/gwt/client/ui/widget/ErrorLabel.java
  64. +27 −0 src/org/onesocialweb/gwt/client/ui/widget/FieldLabel.java
  65. +191 −0 src/org/onesocialweb/gwt/client/ui/widget/ListSelector.java
  66. +54 −0 src/org/onesocialweb/gwt/client/ui/widget/NameField.java
  67. +87 −0 src/org/onesocialweb/gwt/client/ui/widget/PictureThumbnail.java
  68. +78 −0 src/org/onesocialweb/gwt/client/ui/widget/PrivacySelector.java
  69. +50 −0 src/org/onesocialweb/gwt/client/ui/widget/PrivacySelectorHeader.java
  70. +59 −0 src/org/onesocialweb/gwt/client/ui/widget/ProgressBar.java
  71. +223 −0 src/org/onesocialweb/gwt/client/ui/widget/SingleUploader.java
  72. +28 −0 src/org/onesocialweb/gwt/client/ui/widget/StyledButton.java
  73. +26 −0 src/org/onesocialweb/gwt/client/ui/widget/StyledFlowPanel.java
  74. +26 −0 src/org/onesocialweb/gwt/client/ui/widget/StyledHorizontalPanel.java
  75. +28 −0 src/org/onesocialweb/gwt/client/ui/widget/StyledLabel.java
  76. +29 −0 src/org/onesocialweb/gwt/client/ui/widget/StyledTextBox.java
  77. +28 −0 src/org/onesocialweb/gwt/client/ui/widget/StyledTooltipImage.java
  78. +29 −0 src/org/onesocialweb/gwt/client/ui/widget/TooltipPushButton.java
  79. +65 −0 src/org/onesocialweb/gwt/client/ui/widget/VideoThumbnail.java
  80. +103 −0 src/org/onesocialweb/gwt/client/ui/widget/activity/AbstractActivityPanel.java
  81. +94 −0 src/org/onesocialweb/gwt/client/ui/widget/activity/ActivityButtons.java
  82. +499 −0 src/org/onesocialweb/gwt/client/ui/widget/activity/ActivityItemView.java
  83. +79 −0 src/org/onesocialweb/gwt/client/ui/widget/activity/FeedPanel.java
  84. +79 −0 src/org/onesocialweb/gwt/client/ui/widget/activity/InboxPanel.java
  85. +205 −0 src/org/onesocialweb/gwt/client/ui/widget/compose/AbstractAttachmentPanel.java
  86. +37 −0 src/org/onesocialweb/gwt/client/ui/widget/compose/Attachment.java
  87. +308 −0 src/org/onesocialweb/gwt/client/ui/widget/compose/NewActivityPanel.java
  88. +51 −0 src/org/onesocialweb/gwt/client/ui/widget/compose/PictureAttachmentPanel.java
  89. +95 −0 src/org/onesocialweb/gwt/client/ui/widget/compose/PrivacyAttachmentPanel.java
  90. +237 −0 src/org/onesocialweb/gwt/client/ui/widget/compose/RecipientList.java
  91. +101 −0 src/org/onesocialweb/gwt/client/ui/widget/compose/RecipientOracle.java
  92. +58 −0 src/org/onesocialweb/gwt/client/ui/widget/compose/ShoutAttachmentPanel.java
  93. +66 −0 src/org/onesocialweb/gwt/client/ui/widget/compose/TextareaUpdate.java
  94. +23 −0 src/org/onesocialweb/gwt/client/ui/widget/contact/AbstractContactPanel.java
  95. +83 −0 src/org/onesocialweb/gwt/client/ui/widget/contact/ContactButtons.java
  96. +322 −0 src/org/onesocialweb/gwt/client/ui/widget/contact/ContactItemView.java
  97. +144 −0 src/org/onesocialweb/gwt/client/ui/widget/contact/ContactPanel.java
  98. +139 −0 src/org/onesocialweb/gwt/client/ui/widget/contact/SearchPanel.java
  99. +367 −0 src/org/onesocialweb/gwt/client/ui/window/AbstractWindow.java
  100. +25 −0 src/org/onesocialweb/gwt/client/ui/window/AbstractWindowFactory.java
  101. +128 −0 src/org/onesocialweb/gwt/client/ui/window/ContactsWindow.java
  102. +31 −0 src/org/onesocialweb/gwt/client/ui/window/ContactsWindowFactory.java
  103. +145 −0 src/org/onesocialweb/gwt/client/ui/window/FeedWindow.java
  104. +31 −0 src/org/onesocialweb/gwt/client/ui/window/FeedWindowFactory.java
  105. +495 −0 src/org/onesocialweb/gwt/client/ui/window/PreferencesWindow.java
  106. +31 −0 src/org/onesocialweb/gwt/client/ui/window/PreferencesWindowFactory.java
  107. +752 −0 src/org/onesocialweb/gwt/client/ui/window/ProfileWindow.java
  108. +31 −0 src/org/onesocialweb/gwt/client/ui/window/ProfileWindowFactory.java
  109. +60 −0 src/org/onesocialweb/gwt/client/ui/window/WindowFactory.java
  110. +126 −0 src/org/onesocialweb/gwt/client/util/FormLayoutHelper.java
  111. +47 −0 src/org/onesocialweb/gwt/client/util/FormatHelper.java
  112. +57 −0 src/org/onesocialweb/gwt/client/validation/CustomLabelTextAction.java
  113. +55 −0 war/OswClient.html
  114. BIN  war/WEB-INF/lib/emite-0.4.7-proxies.jar
  115. BIN  war/WEB-INF/lib/gwt-servlet.jar
  116. +28 −0 war/WEB-INF/logging.properties
  117. +57 −0 war/WEB-INF/web.xml.sample
  118. +1,056 −0 war/standard.css
  119. +1,558 −0 war/themes/osw/OswClient.css
  120. BIN  war/themes/osw/assets/08-chat.png
  121. BIN  war/themes/osw/assets/MISO.OTF
  122. BIN  war/themes/osw/assets/ajax-loader.gif
  123. BIN  war/themes/osw/assets/alert-overlay.png
  124. BIN  war/themes/osw/assets/avatar-loader.gif
  125. BIN  war/themes/osw/assets/bg2.gif
  126. BIN  war/themes/osw/assets/button-bg-hi.png
  127. BIN  war/themes/osw/assets/button-bg.gif
  128. BIN  war/themes/osw/assets/button-bg.png
  129. BIN  war/themes/osw/assets/default-avatar-big.png
  130. BIN  war/themes/osw/assets/default-avatar.png
  131. BIN  war/themes/osw/assets/i-arrowdown.png
  132. BIN  war/themes/osw/assets/i-attachment.png
  133. BIN  war/themes/osw/assets/i-available.png
  134. BIN  war/themes/osw/assets/i-away.png
  135. BIN  war/themes/osw/assets/i-block.png
  136. BIN  war/themes/osw/assets/i-camera.png
  137. BIN  war/themes/osw/assets/i-camera2.png
  138. BIN  war/themes/osw/assets/i-chat.png
  139. BIN  war/themes/osw/assets/i-chat2.png
  140. BIN  war/themes/osw/assets/i-chatty.png
  141. BIN  war/themes/osw/assets/i-close.png
  142. BIN  war/themes/osw/assets/i-close2.png
  143. BIN  war/themes/osw/assets/i-comment.png
  144. BIN  war/themes/osw/assets/i-connected.png
  145. BIN  war/themes/osw/assets/i-deny.png
  146. BIN  war/themes/osw/assets/i-dnd.png
  147. BIN  war/themes/osw/assets/i-edit.png
  148. BIN  war/themes/osw/assets/i-event.png
  149. BIN  war/themes/osw/assets/i-event2.png
  150. BIN  war/themes/osw/assets/i-following.png
  151. BIN  war/themes/osw/assets/i-info.png
  152. BIN  war/themes/osw/assets/i-key.png
  153. BIN  war/themes/osw/assets/i-like.png
  154. BIN  war/themes/osw/assets/i-link.png
  155. BIN  war/themes/osw/assets/i-link2.png
  156. BIN  war/themes/osw/assets/i-link3.png
  157. BIN  war/themes/osw/assets/i-location.png
  158. BIN  war/themes/osw/assets/i-message.png
  159. BIN  war/themes/osw/assets/i-more.png
  160. BIN  war/themes/osw/assets/i-movie.png
  161. BIN  war/themes/osw/assets/i-movie2.png
  162. BIN  war/themes/osw/assets/i-msg.png
  163. BIN  war/themes/osw/assets/i-new.png
  164. BIN  war/themes/osw/assets/i-notavailable.png
  165. BIN  war/themes/osw/assets/i-notconnected.png
  166. BIN  war/themes/osw/assets/i-ok.png
  167. BIN  war/themes/osw/assets/i-ok2.png
  168. BIN  war/themes/osw/assets/i-private-r.png
  169. BIN  war/themes/osw/assets/i-private.png
  170. BIN  war/themes/osw/assets/i-profile.png
  171. BIN  war/themes/osw/assets/i-relation-oneway-from.png
  172. BIN  war/themes/osw/assets/i-relation-oneway-to.png
  173. BIN  war/themes/osw/assets/i-relation-twoway.png
  174. BIN  war/themes/osw/assets/i-relation.png
  175. BIN  war/themes/osw/assets/i-reply.png
  176. BIN  war/themes/osw/assets/i-share.png
  177. BIN  war/themes/osw/assets/i-shout-r.png
  178. BIN  war/themes/osw/assets/i-shout.png
  179. BIN  war/themes/osw/assets/i-tags-r.png
  180. BIN  war/themes/osw/assets/i-tags.png
  181. BIN  war/themes/osw/assets/i-unfollowing.png
  182. BIN  war/themes/osw/assets/i-unknown.png
  183. BIN  war/themes/osw/assets/i-visibility.png
  184. BIN  war/themes/osw/assets/i-xaway.png
  185. BIN  war/themes/osw/assets/logo.gif
  186. BIN  war/themes/osw/assets/logo.png
  187. BIN  war/themes/osw/assets/plus.png
  188. BIN  war/themes/osw/assets/search.png
  189. BIN  war/themes/osw/assets/tab-shadow.png
  190. BIN  war/themes/osw/assets/tabbar-shadow.png
  191. BIN  war/themes/osw/assets/toolButton.png
  192. BIN  war/themes/osw/assets/warning_icon_small.gif
  193. +91 −0 war/themes/osw/fonts/SIL Open Font License 1.1.txt
  194. BIN  war/themes/osw/fonts/TitilliumText1.eot
  195. BIN  war/themes/osw/fonts/TitilliumText1.ttf
  196. BIN  war/themes/osw/fonts/TitilliumText250wt.eot
  197. BIN  war/themes/osw/fonts/TitilliumText250wt.ttf
  198. BIN  war/themes/osw/fonts/TitilliumText400wt.eot
  199. BIN  war/themes/osw/fonts/TitilliumText400wt.ttf
  200. BIN  war/themes/osw/fonts/TitilliumText600wt.eot
  201. BIN  war/themes/osw/fonts/TitilliumText600wt.ttf
  202. BIN  war/themes/osw/fonts/TitilliumText800wt.eot
  203. BIN  war/themes/osw/fonts/TitilliumText800wt.ttf
  204. BIN  war/themes/osw/fonts/TitilliumText999wt.eot
  205. BIN  war/themes/osw/fonts/TitilliumText999wt.ttf
  206. BIN  war/themes/osw/fonts/Titillium_title03.eot
  207. BIN  war/themes/osw/fonts/Titillium_title03.ttf
  208. +59 −0 war/themes/osw/fonts/stylesheet.css
  209. +138 −0 war/themes/osw/global-forms.css
  210. +53 −0 war/themes/osw/reset.css
8 .gitignore
View
@@ -0,0 +1,8 @@
+.classpath
+.project
+.settings
+war/OswClient
+war/WEB-INF/classes
+war/WEB-INF/web.xml
+.DS_Store
+*.orig
7 BUILD
View
@@ -0,0 +1,7 @@
+1- Compiling the Onesocialweb GWT library
+
+- Create a new project in eclipse based on these source files
+- Make it a GWT project and add the GWT libs
+- Add JUnit 4 on the build path
+- Copy the file /war/WEB-INF/web.xml.sample to web.xml and edit it if required
+- Compile the GWT project using "GWT Compile" in the Google contextual menu
202 LICENSE
View
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
7 README
View
@@ -0,0 +1,7 @@
+Onesocialweb web client, built using Google Web Toolkit.
+Released under an Apache 2.0 License (see LICENSE).
+Copyright 2010 Vodafone Group Services Limited.
+
+All documentation and tutorials available on http://onesocialweb.org
+
+Version 0.6 - Released April 23rd 2010
BIN  lib/gwt-html5-storage.jar
View
Binary file not shown
BIN  lib/gwt-image-loader-1.1.1.jar
View
Binary file not shown
BIN  lib/gwt-log-2.6.2.jar
View
Binary file not shown
BIN  lib/gwt-validation-0.9a-without-hibernate.jar
View
Binary file not shown
43 src/eu/maydu/gwt/validation/client/i18n/StandardValidationMessagesImpl_nl.properties
View
@@ -0,0 +1,43 @@
+notNull = Must be given
+isNull = Should not be given
+equal = Should be equal
+notEqual = Should not be equal
+notEmpty = Mustn''t be empty
+min = Minimum value for this field is ''{0}''. You entered ''{1}''
+max = Maximum value for this field is ''{0}''. You entered ''{1}''
+notInRange = Value ''{2}'' lies beyond the boundaries [{0},{1}]
+notAnInteger = Number is not an integer
+notExactly = Mustn't be ''{0}''
+exactly = Value must be ''{0}''
+notAnInteger = Not a whole number
+notALong = Not a whole number
+notAFloat = Not a floating point number
+notADouble = Not a floating point number
+length = Needs a length between ''{0}'' and ''{1}''. Was ''{2}''
+stringsNotEqual = Strings must be equal
+mustSelectValue = Please select a value
+validator_assertFalse=Assertion failed
+validator_assertTrue=Assertion failed
+validator_future=Must be a future date
+validator_length=Length not correct
+validator_max=Too big
+validator_min=Too small
+validator_notNull=Must be given
+validator_past=Must be a past date
+validator_pattern=Incorrect pattern
+validator_range=Not in range
+validator_size=Incorrect number of elements
+validator_email=Not a well-formed email address
+validator_notEmpty=May not be null or empty
+validator_digits=Numeric value out of bounds
+validator_creditCard=Invalid credit card number
+validator_ean=Invalid EAN
+noDateGiven = No date entered
+unparsableDate = Wrong date format
+notARegEx = No valid regular expression given
+regexNotFulfilled = The text does not fulfill the given regular expression
+notAValidCharacter = Not a valid character: ''{0}''
+notAValidEmail = ''{0}'' is not a valid email address
+notAValidTimeWithoutSeconds = ''{0}'' is not a valid time (seconds must not be given)
+notAValidTimeWithSecondsOptionally = ''{0}'' is not a valid time (seconds may be given)
+notAValidTimeWithSecondsRequired = ''{0}'' is not a valid time (seconds must be given)
7 src/org/appfuse/client/Appfuse.gwt.xml
View
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.1/distro-source/core/src/gwt-module.dtd">
+<module>
+ <!-- Inherit the core Web Toolkit stuff. -->
+ <inherits name='com.google.gwt.user.User'/>
+ <source path="widget/" />
+</module>
19 src/org/appfuse/client/widget/BulletList.java
View
@@ -0,0 +1,19 @@
+package org.appfuse.client.widget;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.ComplexPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class BulletList extends ComplexPanel {
+ public BulletList() {
+ setElement(DOM.createElement("UL"));
+ }
+
+ public void add(Widget w) {
+ super.add(w, getElement());
+ }
+
+ public void insert(Widget w, int beforeIndex) {
+ super.insert(w, getElement(), beforeIndex, true);
+ }
+}
66 src/org/appfuse/client/widget/ListItem.java
View
@@ -0,0 +1,66 @@
+package org.appfuse.client.widget;
+
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.HasBlurHandlers;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.dom.client.HasKeyDownHandlers;
+import com.google.gwt.event.dom.client.KeyDownEvent;
+import com.google.gwt.event.dom.client.KeyDownHandler;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.ComplexPanel;
+import com.google.gwt.user.client.ui.HasHTML;
+import com.google.gwt.user.client.ui.HasText;
+import com.google.gwt.user.client.ui.Widget;
+
+public class ListItem extends ComplexPanel implements HasText, HasHTML,
+ HasClickHandlers, HasKeyDownHandlers, HasBlurHandlers {
+ HandlerRegistration clickHandler;
+
+ public ListItem() {
+ setElement(DOM.createElement("LI"));
+ }
+
+ public void add(Widget w) {
+ super.add(w, getElement());
+ }
+
+ public void insert(Widget w, int beforeIndex) {
+ super.insert(w, getElement(), beforeIndex, true);
+ }
+
+ public String getText() {
+ return DOM.getInnerText(getElement());
+ }
+
+ public void setText(String text) {
+ DOM.setInnerText(getElement(), (text == null) ? "" : text);
+ }
+
+ public void setId(String id) {
+ DOM.setElementAttribute(getElement(), "id", id);
+ }
+
+ public String getHTML() {
+ return DOM.getInnerHTML(getElement());
+ }
+
+ public void setHTML(String html) {
+ DOM.setInnerHTML(getElement(), (html == null) ? "" : html);
+ }
+
+ public HandlerRegistration addClickHandler(ClickHandler handler) {
+ return addDomHandler(handler, ClickEvent.getType());
+ }
+
+ public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) {
+ return addDomHandler(handler, KeyDownEvent.getType());
+ }
+
+ public HandlerRegistration addBlurHandler(BlurHandler handler) {
+ return addDomHandler(handler, BlurEvent.getType());
+ }
+}
76 src/org/appfuse/client/widget/MultipleTextBox.java
View
@@ -0,0 +1,76 @@
+package org.appfuse.client.widget;
+
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.InputElement;
+import com.google.gwt.user.client.ui.TextBoxBase;
+
+public class MultipleTextBox extends TextBoxBase {
+ /**
+ * Creates an empty multiple text box.
+ */
+ public MultipleTextBox() {
+ this(Document.get().createTextInputElement(), "gwt-TextBox");
+ }
+
+ /**
+ * This constructor may be used by subclasses to explicitly use an existing
+ * element. This element must be an <input> element whose type is 'text'.
+ *
+ * @param element
+ * the element to be used
+ */
+ protected MultipleTextBox(Element element) {
+ super(element);
+ assert InputElement.as(element).getType().equalsIgnoreCase("text");
+ }
+
+ MultipleTextBox(Element element, String styleName) {
+ super(element);
+ if (styleName != null) {
+ setStyleName(styleName);
+ }
+ }
+
+ @Override
+ public String getText() {
+ String wholeString = super.getText();
+ String lastString = wholeString;
+ if (wholeString != null && !wholeString.trim().equals("")) {
+ int lastComma = wholeString.trim().lastIndexOf(",");
+ if (lastComma > 0) {
+ lastString = wholeString.trim().substring(lastComma + 1);
+ }
+ }
+ return lastString;
+ }
+
+ @Override
+ public void setText(String text) {
+ String wholeString = super.getText();
+ if (text != null && text.equals("")) {
+ super.setText(text);
+ } else {
+ // Clean last text, to replace with new value, for example, if new
+ // text is v.zaprudnevd@gmail.com:
+ // "manuel@we-r-you.com, v" need to be replaced with:
+ // "manuel@we-r-you.com, v.zaprudnevd@gmail.com, "
+ if (wholeString != null) {
+ int lastComma = wholeString.trim().lastIndexOf(",");
+ if (lastComma > 0) {
+ wholeString = wholeString.trim().substring(0, lastComma);
+ } else {
+ wholeString = "";
+ }
+
+ if (!wholeString.trim().endsWith(",")
+ && !wholeString.trim().equals("")) {
+ wholeString = wholeString + ", ";
+ }
+
+ wholeString = wholeString + text + ", ";
+ super.setText(wholeString);
+ }
+ }
+ }
+}
30 src/org/appfuse/client/widget/Paragraph.java
View
@@ -0,0 +1,30 @@
+package org.appfuse.client.widget;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.HasText;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * This widget is to create
+ * <p>
+ * elements in a page.
+ */
+public class Paragraph extends Widget implements HasText {
+
+ public Paragraph() {
+ setElement(DOM.createElement("p"));
+ }
+
+ public Paragraph(String text) {
+ this();
+ setText(text);
+ }
+
+ public String getText() {
+ return getElement().getInnerText();
+ }
+
+ public void setText(String text) {
+ getElement().setInnerText(text);
+ }
+}
20 src/org/appfuse/client/widget/Span.java
View
@@ -0,0 +1,20 @@
+package org.appfuse.client.widget;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HasText;
+
+/**
+ * This widget is to create <span> elements in a page.
+ */
+public class Span extends HTML implements HasText {
+
+ public Span() {
+ super(DOM.createElement("span"));
+ }
+
+ public Span(String text) {
+ this();
+ setText(text);
+ }
+}
29 src/org/onesocialweb/gwt/OswClient.gwt.xml
View
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/1.7.1/distro-source/core/src/gwt-module.dtd">
+<module rename-to='OswClient'>
+ <!-- Inherit the core Web Toolkit stuff. -->
+ <inherits name='com.google.gwt.user.User'/>
+
+ <!-- User Agent -->
+ <!-- <set-property name="user.agent" value="safari" />-->
+
+ <!-- Inherits components -->
+ <inherits name='com.reveregroup.gwt.imagepreloader.ImagePreloader' />
+ <inherits name='eu.maydu.gwt.validation.ValidationLibrary' />
+ <inherits name='com.google.gwt.i18n.I18N'/>
+ <inherits name='com.google.code.gwt.storage.Html5Storage' />
+
+ <extend-property name="locale" values="en"/>
+ <!-- <extend-property name="locale" values="nl"/> -->
+
+ <inherits name="com.allen_sauer.gwt.log.gwt-log" />
+
+ <inherits name="org.appfuse.client.Appfuse"/>
+
+ <inherits name="org.onesocialweb.OswCore" />
+ <set-property name="log_DivLogger" value="ENABLED" />
+
+ <!-- Specify the app entry point class. -->
+ <entry-point class='org.onesocialweb.gwt.client.OswEntryPoint'/>
+
+</module>
323 src/org/onesocialweb/gwt/client/OswClient.java
View
@@ -0,0 +1,323 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.onesocialweb.gwt.client.handler.LoginHandler;
+import org.onesocialweb.gwt.client.ui.application.AbstractApplication;
+import org.onesocialweb.gwt.client.ui.application.ActivityApplication;
+import org.onesocialweb.gwt.client.ui.application.ContactsApplication;
+import org.onesocialweb.gwt.client.ui.application.PreferencesApplication;
+import org.onesocialweb.gwt.client.ui.dialog.LoginDialog;
+import org.onesocialweb.gwt.client.ui.menu.MainMenu;
+import org.onesocialweb.gwt.client.ui.menu.MenuCommand;
+import org.onesocialweb.gwt.service.OswService;
+import org.onesocialweb.gwt.service.OswServiceFactory;
+import org.onesocialweb.gwt.service.RequestCallback;
+
+import com.google.code.gwt.storage.client.Storage;
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.i18n.client.Dictionary;
+import com.google.gwt.user.client.History;
+
+public class OswClient {
+
+ private static OswClient instance;
+
+ private Map<String, String> preferences = new HashMap<String, String>();
+
+ private OswService service;
+ private MainMenu mainMenu;
+ private AbstractApplication currentApplication;
+ private HashMap<String, MenuCommand> applicationCommands = new HashMap<String, MenuCommand>();
+ private boolean sessionActive;
+
+ public static OswClient getInstance() {
+ if (instance == null) {
+ instance = new OswClient();
+ }
+ return instance;
+ }
+
+ public void start() {
+ // Prepare the environment
+ this.service = OswServiceFactory.getService();
+ loadPreferences();
+
+ // Start the XMPP connection
+ service.setup(getPreference("bosh_path"), getPreference("bosh_host"),
+ getPreference("xmpp_domain"));
+
+ // Prepare the history manager (for browser history support)
+ History.addValueChangeHandler(new HistoryEventHandler());
+ History.fireCurrentHistoryState();
+
+ // Check local storage for username & password
+ if (Storage.isSupported()) {
+ Storage localStorage = Storage.getLocalStorage();
+ String username = localStorage.getItem("username");
+ String password = localStorage.getItem("password");
+ if (username != null && password != null) {
+ // if present automatically login
+ login(username, password);
+ return;
+ }
+ }
+
+ // Could not login based on stored credentials,
+ // so we show the login dialog
+ if (!sessionActive) {
+ showLogin();
+ }
+ }
+
+ public OswService getService() {
+ return service;
+ }
+
+ public String getPreference(String key) {
+ return preferences.get(key);
+ }
+
+ public String getPreference(String key, String defaultValue) {
+ String result = getPreference(key);
+ if (result != null) {
+ return result;
+ } else {
+ return defaultValue;
+ }
+ }
+
+ public void showApplication(String application) {
+
+ // remove the current application
+ if (currentApplication != null) {
+ currentApplication.destroy();
+ currentApplication = null;
+ }
+
+ // show the application
+ // TODO Will be refactored with a factory or other form of dependency
+ // injection
+ if (application.equals("ActivityApplication")) {
+ ActivityApplication activityApplication = new ActivityApplication();
+ currentApplication = activityApplication;
+ } else if (application.equals("PreferencesApplication")) {
+ PreferencesApplication preferencesApplication = new PreferencesApplication();
+ currentApplication = preferencesApplication;
+ } else if (application.equals("ContactsApplication")) {
+ ContactsApplication contactsApplication = new ContactsApplication();
+ currentApplication = contactsApplication;
+ }
+
+ // Initialized and show the application
+ currentApplication.init();
+ currentApplication.show();
+
+ // Inform the menu that we changed
+ if (applicationCommands.containsKey(application)) {
+ mainMenu.highlight(applicationCommands.get(application));
+ }
+
+ // set the application history
+ History.newItem(application, false);
+
+ }
+
+ public AbstractApplication getCurrentApplication() {
+ return currentApplication;
+ }
+
+ public void logout() {
+ service.logout(new RequestCallback<Object>() {
+ @Override
+ public void onFailure() {
+ destroySession();
+ }
+
+ @Override
+ public void onSuccess(Object result) {
+ destroySession();
+ }
+ });
+ }
+
+ private void showLogin() {
+ // show login box and add a handler for success
+ LoginDialog.getInstance().showDialog(new LoginHandler() {
+ public void handleLogin(boolean success) {
+ if (success) {
+ LoginDialog.getInstance().hide();
+ createSession();
+ }
+ }
+ });
+ }
+
+ private void login(String username, String password) {
+ OswServiceFactory.getService().login(username, password,
+ new RequestCallback<Object>() {
+ @Override
+ public void onFailure() {
+ showLogin();
+ }
+
+ @Override
+ public void onSuccess(Object result) {
+ createSession();
+ }
+ });
+ }
+
+ private void createSession() {
+ sessionActive = true;
+
+ // create a new mainmenu
+ initMenu();
+
+ // fire the first application
+ showApplication("ActivityApplication");
+ }
+
+ private void destroySession() {
+ sessionActive = false;
+ // make sure to kill all apps
+ killApplications();
+
+ // hide the menu
+ mainMenu.hideMenu();
+
+ // clear the local storage
+ Storage.getLocalStorage().clear();
+
+ // show login dialog
+ showLogin();
+ }
+
+ private void killApplications() {
+ currentApplication.destroy();
+ currentApplication = null;
+ }
+
+ private void initMenu() {
+
+ List<MenuCommand> commands = new ArrayList<MenuCommand>();
+
+ MenuCommand command = new ActivityAppCommand();
+ applicationCommands.put("ActivityApplication", command);
+ commands.add(command);
+
+ command = new ContactsAppCommand();
+ applicationCommands.put("ContactsApplication", command);
+ commands.add(command);
+
+ command = new PreferencesAppCommand();
+ applicationCommands.put("PreferencesApplication", command);
+ commands.add(command);
+
+ command = new SignOutCommand();
+ commands.add(command);
+
+ mainMenu = new MainMenu(commands);
+ mainMenu.showMenu();
+ }
+
+ private void loadPreferences() {
+ Dictionary prefs = Dictionary.getDictionary("preferences");
+ for (String key : prefs.keySet()) {
+ preferences.put(key, prefs.get(key));
+ }
+ }
+
+ // Private constructor to enforce the singleton
+ private OswClient() {
+ //
+ }
+
+ private class HistoryEventHandler implements ValueChangeHandler<String> {
+
+ @Override
+ public void onValueChange(ValueChangeEvent<String> event) {
+ if (sessionActive) {
+ showApplication(event.getValue());
+ }
+ }
+
+ }
+
+ private class ActivityAppCommand implements MenuCommand {
+
+ @Override
+ public String getLabel() {
+ return "What's up";
+ }
+
+ @Override
+ public void execute() {
+ showApplication("ActivityApplication");
+ }
+
+ }
+
+ private class ContactsAppCommand implements MenuCommand {
+
+ @Override
+ public String getLabel() {
+ return "Contacts";
+ }
+
+ @Override
+ public void execute() {
+ showApplication("ContactsApplication");
+ }
+
+ }
+
+ private class PreferencesAppCommand implements MenuCommand {
+
+ @Override
+ public String getLabel() {
+ return "Preferences";
+ }
+
+ @Override
+ public void execute() {
+ showApplication("PreferencesApplication");
+ }
+
+ }
+
+ private class SignOutCommand implements MenuCommand {
+
+ @Override
+ public String getLabel() {
+ return "Sign out";
+ }
+
+ @Override
+ public void execute() {
+ logout();
+ }
+
+ }
+
+}
53 src/org/onesocialweb/gwt/client/OswEntryPoint.java
View
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client;
+
+import org.onesocialweb.gwt.client.ui.window.ContactsWindowFactory;
+import org.onesocialweb.gwt.client.ui.window.FeedWindowFactory;
+import org.onesocialweb.gwt.client.ui.window.PreferencesWindowFactory;
+import org.onesocialweb.gwt.client.ui.window.ProfileWindowFactory;
+import org.onesocialweb.gwt.client.ui.window.WindowFactory;
+
+import com.allen_sauer.gwt.log.client.DivLogger;
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class OswEntryPoint implements EntryPoint {
+
+ public void onModuleLoad() {
+
+ // Prepare a few things to get our pattern right
+ WindowFactory.getInstance().registerFactory(new ProfileWindowFactory());
+ WindowFactory.getInstance().registerFactory(new FeedWindowFactory());
+ WindowFactory.getInstance().registerFactory(
+ new PreferencesWindowFactory());
+ WindowFactory.getInstance()
+ .registerFactory(new ContactsWindowFactory());
+
+ // Hide logger before login
+ FlowPanel hideLogger = new FlowPanel();
+ hideLogger.addStyleName("hidelogger");
+ Widget divLogger = Log.getLogger(DivLogger.class).getWidget();
+ hideLogger.add(divLogger);
+
+ // Start the application
+ OswClient.getInstance().start();
+ }
+
+}
22 src/org/onesocialweb/gwt/client/exception/MissingWindowFactoryException.java
View
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.exception;
+
+@SuppressWarnings("serial")
+public class MissingWindowFactoryException extends Exception {
+
+}
27 src/org/onesocialweb/gwt/client/handler/ActivityButtonHandler.java
View
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.handler;
+
+import org.onesocialweb.gwt.client.ui.widget.activity.ActivityItemView;
+
+public interface ActivityButtonHandler {
+
+ public void handleShow(int top, ActivityItemView sa);
+
+ public void handleHide();
+
+}
27 src/org/onesocialweb/gwt/client/handler/ContactButtonHandler.java
View
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.handler;
+
+import org.onesocialweb.gwt.client.ui.widget.contact.ContactItemView;
+
+public interface ContactButtonHandler {
+
+ public void handleShow(int top, ContactItemView contact);
+
+ public void handleHide();
+
+}
22 src/org/onesocialweb/gwt/client/handler/LoginHandler.java
View
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.handler;
+
+public interface LoginHandler {
+
+ public void handleLogin(boolean success);
+}
22 src/org/onesocialweb/gwt/client/handler/PictureHandler.java
View
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.handler;
+
+public interface PictureHandler {
+
+ public void handlePicture(String pictureUrl);
+}
22 src/org/onesocialweb/gwt/client/handler/VideoHandler.java
View
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.handler;
+
+public interface VideoHandler {
+
+ public void handleEmbeddedVideo(String source);
+}
28 src/org/onesocialweb/gwt/client/i18n/CustomValidation.java
View
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.i18n;
+
+import eu.maydu.gwt.validation.client.i18n.StandardValidationMessages;
+import eu.maydu.gwt.validation.client.i18n.ValidationMessages;
+
+public class CustomValidation extends ValidationMessages {
+
+ public CustomValidation(StandardValidationMessages messages) {
+ super(messages);
+ }
+
+}
234 src/org/onesocialweb/gwt/client/i18n/CustomValidationMessages.java
View
@@ -0,0 +1,234 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.i18n;
+
+import com.google.gwt.core.client.GWT;
+
+import eu.maydu.gwt.validation.client.i18n.StandardValidationMessages;
+import eu.maydu.gwt.validation.client.i18n.StandardValidationMessagesImpl;
+
+public class CustomValidationMessages implements StandardValidationMessages {
+
+ private StandardValidationMessages defaultMessages;
+
+ private CustomValidationMessagesImpl customMessages;
+
+ public CustomValidationMessages() {
+ defaultMessages = GWT.create(StandardValidationMessagesImpl.class);
+ customMessages = GWT.create(CustomValidationMessagesImpl.class);
+ }
+
+ // Custom messages
+ public String length(int minLength, int maxLength, int actualLength) {
+ return customMessages.length(minLength, maxLength);
+ }
+
+ // Default messages from Validator component
+ public String equal() {
+ return defaultMessages.equal();
+ }
+
+ public String isNull() {
+ return defaultMessages.isNull();
+ }
+
+ // Standard messages
+ public String max(int maxValue, int actualValue) {
+ return defaultMessages.max(maxValue, actualValue);
+ }
+
+ public String max(long maxValue, long actualValue) {
+ return defaultMessages.max(maxValue, actualValue);
+ }
+
+ public String max(float maxValue, float actualValue) {
+ return defaultMessages.max(maxValue, actualValue);
+ }
+
+ public String max(double maxValue, double actualValue) {
+ return defaultMessages.max(maxValue, actualValue);
+ }
+
+ public String min(int minValue, int actualValue) {
+ return defaultMessages.min(minValue, actualValue);
+ }
+
+ public String min(long minValue, long actualValue) {
+ return defaultMessages.min(minValue, actualValue);
+ }
+
+ public String min(float minValue, float actualValue) {
+ return defaultMessages.min(minValue, actualValue);
+ }
+
+ public String min(double minValue, double actualValue) {
+ return defaultMessages.min(minValue, actualValue);
+ }
+
+ public String mustSelectValue() {
+ return defaultMessages.mustSelectValue();
+ }
+
+ public String noDateGiven() {
+ return defaultMessages.noDateGiven();
+ }
+
+ public String notADouble() {
+ return defaultMessages.notADouble();
+ }
+
+ public String notAFloat() {
+ return defaultMessages.notAFloat();
+ }
+
+ public String notALong() {
+ return defaultMessages.notALong();
+ }
+
+ public String notARegEx() {
+ return defaultMessages.notARegEx();
+ }
+
+ public String notAValidCharacter(char c) {
+ return defaultMessages.notAValidCharacter(c);
+ }
+
+ public String notAValidEmail(String givenEmailInput) {
+ return defaultMessages.notAValidEmail(givenEmailInput);
+ }
+
+ public String notAValidTimeWithSecondsOptionally(String parameter) {
+ return defaultMessages.notAValidTimeWithSecondsOptionally(parameter);
+ }
+
+ public String notAValidTimeWithSecondsRequired(String parameter) {
+ return defaultMessages.notAValidTimeWithSecondsRequired(parameter);
+ }
+
+ public String notAValidTimeWithoutSeconds(String parameter) {
+ return defaultMessages.notAValidTimeWithoutSeconds(parameter);
+ }
+
+ public String notAnInteger() {
+ return defaultMessages.notAnInteger();
+ }
+
+ public String notEmpty() {
+ return defaultMessages.notEmpty();
+ }
+
+ public String notEqual() {
+ return defaultMessages.notEqual();
+ }
+
+ public String notInRange(int min, int max, int value) {
+ return defaultMessages.notInRange(min, max, value);
+ }
+
+ public String notInRange(long min, long max, long value) {
+ return defaultMessages.notInRange(min, max, value);
+ }
+
+ public String notInRange(float min, float max, float value) {
+ return defaultMessages.notInRange(min, max, value);
+ }
+
+ public String notInRange(double min, double max, double value) {
+ return defaultMessages.notInRange(min, max, value);
+ }
+
+ public String notNull() {
+ return defaultMessages.notNull();
+ }
+
+ public String regexNotFulfilled() {
+ return defaultMessages.regexNotFulfilled();
+ }
+
+ public String stringsNotEqual() {
+ return defaultMessages.stringsNotEqual();
+ }
+
+ public String unparsableDate() {
+ return defaultMessages.unparsableDate();
+ }
+
+ public String validator_assertFalse() {
+ return defaultMessages.validator_assertFalse();
+ }
+
+ public String validator_assertTrue() {
+ return defaultMessages.validator_assertTrue();
+ }
+
+ public String validator_creditCard() {
+ return defaultMessages.validator_creditCard();
+ }
+
+ public String validator_digits() {
+ return defaultMessages.validator_digits();
+ }
+
+ public String validator_ean() {
+ return defaultMessages.validator_ean();
+ }
+
+ public String validator_email() {
+ return defaultMessages.validator_email();
+ }
+
+ public String validator_future() {
+ return defaultMessages.validator_future();
+ }
+
+ public String validator_length() {
+ return defaultMessages.validator_length();
+ }
+
+ public String validator_max() {
+ return defaultMessages.validator_max();
+ }
+
+ public String validator_min() {
+ return defaultMessages.validator_min();
+ }
+
+ public String validator_notEmpty() {
+ return defaultMessages.validator_notEmpty();
+ }
+
+ public String validator_notNull() {
+ return defaultMessages.validator_notNull();
+ }
+
+ public String validator_past() {
+ return defaultMessages.validator_past();
+ }
+
+ public String validator_pattern() {
+ return defaultMessages.validator_pattern();
+ }
+
+ public String validator_range() {
+ return defaultMessages.validator_range();
+ }
+
+ public String validator_size() {
+ return defaultMessages.validator_size();
+ }
+
+}
25 src/org/onesocialweb/gwt/client/i18n/CustomValidationMessagesImpl.java
View
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.i18n;
+
+import com.google.gwt.i18n.client.Messages;
+
+public interface CustomValidationMessagesImpl extends Messages {
+
+ public String length(int minLength, int maxLength);
+
+}
1  src/org/onesocialweb/gwt/client/i18n/CustomValidationMessagesImpl.properties
View
@@ -0,0 +1 @@
+length = Needs a length between ''{0}'' and ''{1}''.
1  src/org/onesocialweb/gwt/client/i18n/CustomValidationMessagesImpl_en.properties
View
@@ -0,0 +1 @@
+length = Needs a length between ''{0}'' and ''{1}''.
1  src/org/onesocialweb/gwt/client/i18n/CustomValidationMessagesImpl_nl.properties
View
@@ -0,0 +1 @@
+length = Gebruik meer dan ''{0}'' en minder dan ''{1}'' karakters.
63 src/org/onesocialweb/gwt/client/i18n/UserInterfaceText.java
View
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.i18n;
+
+import com.google.gwt.i18n.client.Constants;
+
+public interface UserInterfaceText extends Constants {
+ String Welcome();
+
+ String OK();
+
+ String Cancel();
+
+ String Login();
+
+ String Logout();
+
+ String Register();
+
+ String YourUsername();
+
+ String YourPassword();
+
+ String ChooseUsername();
+
+ String ChoosePassword();
+
+ String EnterYourEmail();
+
+ String Activities();
+
+ String Photos();
+
+ String Videos();
+
+ String Albums();
+
+ String Bookmarks();
+
+ String Inbox();
+
+ String Messages();
+
+ String Chat();
+
+ String Preferences();
+
+ String Contacts();
+}
21 src/org/onesocialweb/gwt/client/i18n/UserInterfaceText.properties
View
@@ -0,0 +1,21 @@
+Welcome = Welcome to onesocial.me
+OK = OK
+Cancel = Cancel
+Login = Sign in
+Logout = Sign out
+Register = Register
+YourUsername = Your username
+YourPassword = Your password
+ChooseUsername = Pick a username
+ChoosePassword = Pick a password
+EnterYourEmail = Enter your email address
+Activities = What's up
+Photos = Photos
+Videos = Videos
+Albums = Albums
+Bookmarks = Bookmarks
+Inbox = Inbox
+Messages = Messages
+Chat = Chat
+Preferences = Preferences
+Contacts = Contacts
21 src/org/onesocialweb/gwt/client/i18n/UserInterfaceText_en.properties
View
@@ -0,0 +1,21 @@
+Welcome = Welcome to onesocial.me
+OK = OK
+Cancel = Cancel
+Login = Sign in
+Logout = Sign out
+Register = Register
+YourUsername = Your username
+YourPassword = Your password
+ChooseUsername = Pick a username
+ChoosePassword = Pick a password
+EnterYourEmail = Enter your email address
+Activities = What's up
+Photos = Photos
+Videos = Videos
+Albums = Albums
+Bookmarks = Bookmarks
+Inbox = Inbox
+Messages = Messages
+Chat = Chat
+Preferences = Preferences
+Contacts = Contacts
21 src/org/onesocialweb/gwt/client/i18n/UserInterfaceText_nl.properties
View
@@ -0,0 +1,21 @@
+Welcome = Welkom bij onesocial.me
+OK = OK
+Cancel = Annuleren
+Login = Inloggen
+Logout = Uitloggen
+Register = Registreren
+YourUsername = Je gebruikersnaam
+YourPassword = Je wachtwoord
+ChooseUsername = Kies een gebruikersnaam
+ChoosePassword = Kies een wachtwoord
+EnterYourEmail = Vul je email adres in
+Activities = Nieuwsfeed
+Photos = Foto's
+Videos = Video's
+Albums = Albums
+Bookmarks = Bookmarks
+Inbox = Inbox
+Messages = Berichten
+Chat = Chat
+Preferences = Voorkeuren
+Contacts = Contacten
40 src/org/onesocialweb/gwt/client/task/DefaultTaskEvent.java
View
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.task;
+
+public class DefaultTaskEvent implements TaskEvent {
+
+ private final Type type;
+
+ private final TaskInfo task;
+
+ public DefaultTaskEvent(Type type, TaskInfo task) {
+ this.type = type;
+ this.task = task;
+ }
+
+ @Override
+ public TaskInfo getTask() {
+ return task;
+ }
+
+ @Override
+ public Type getType() {
+ return type;
+ }
+
+}
86 src/org/onesocialweb/gwt/client/task/DefaultTaskInfo.java
View
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.task;
+
+import org.onesocialweb.gwt.client.task.TaskEvent.Type;
+import org.onesocialweb.gwt.util.ObservableHelper;
+import org.onesocialweb.gwt.util.Observer;
+
+public class DefaultTaskInfo implements TaskInfo {
+
+ private final ObservableHelper<TaskEvent> observableHelper = new ObservableHelper<TaskEvent>();
+
+ private final boolean hasProgress;
+
+ private float progress = 0;
+
+ private String message;
+
+ private Status status = Status.running;
+
+ public DefaultTaskInfo(String message, boolean hasProgress) {
+ this.message = message;
+ this.hasProgress = hasProgress;
+ }
+
+ @Override
+ public String getMessage() {
+ return message;
+ }
+
+ @Override
+ public float getProgress() {
+ return progress;
+ }
+
+ @Override
+ public Status getStatus() {
+ return status;
+ }
+
+ @Override
+ public boolean hasProgress() {
+ return hasProgress;
+ }
+
+ @Override
+ public void registerEventHandler(Observer<TaskEvent> handler) {
+ observableHelper.registerEventHandler(handler);
+ }
+
+ @Override
+ public void unregisterEventHandler(Observer<TaskEvent> handler) {
+ observableHelper.unregisterEventHandler(handler);
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ observableHelper.fireEvent(new DefaultTaskEvent(Type.updated, this));
+ }
+
+ public void setProgress(float progress) {
+ this.progress = progress;
+ observableHelper.fireEvent(new DefaultTaskEvent(Type.updated, this));
+ }
+
+ public void complete(String message, Status status) {
+ this.status = status;
+ this.message = message;
+ observableHelper.fireEvent(new DefaultTaskEvent(Type.completed, this));
+ }
+
+}
31 src/org/onesocialweb/gwt/client/task/TaskEvent.java
View
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.task;
+
+import org.onesocialweb.gwt.util.Event;
+
+public interface TaskEvent extends Event {
+
+ public enum Type {
+ added, updated, completed
+ };
+
+ public Type getType();
+
+ public TaskInfo getTask();
+
+}
35 src/org/onesocialweb/gwt/client/task/TaskInfo.java
View
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.task;
+
+import org.onesocialweb.gwt.util.Observable;
+
+public interface TaskInfo extends Observable<TaskEvent> {
+
+ public enum Status {
+ running, succes, failure
+ };
+
+ public Status getStatus();
+
+ public String getMessage();
+
+ public boolean hasProgress();
+
+ public float getProgress();
+
+}
83 src/org/onesocialweb/gwt/client/task/TaskMonitor.java
View
@@ -0,0 +1,83 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.task;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.onesocialweb.gwt.client.task.TaskEvent.Type;
+import org.onesocialweb.gwt.util.Observable;
+import org.onesocialweb.gwt.util.ObservableHelper;
+import org.onesocialweb.gwt.util.Observer;
+
+public class TaskMonitor implements Observable<TaskEvent> {
+
+ private static TaskMonitor instance;
+
+ private final ObservableHelper<TaskEvent> observableHelper = new ObservableHelper<TaskEvent>();
+
+ private final List<TaskInfo> tasks = new ArrayList<TaskInfo>();
+
+ private final TaskHandler handler = new TaskHandler();
+
+ public static TaskMonitor getInstance() {
+ if (instance == null) {
+ instance = new TaskMonitor();
+ }
+ return instance;
+ }
+
+ @Override
+ public void registerEventHandler(Observer<TaskEvent> handler) {
+ observableHelper.registerEventHandler(handler);
+ }
+
+ @Override
+ public void unregisterEventHandler(Observer<TaskEvent> handler) {
+ observableHelper.unregisterEventHandler(handler);
+ }
+
+ public void addTask(TaskInfo task) {
+ tasks.add(task);
+ task.registerEventHandler(handler);
+ observableHelper.fireEvent(new DefaultTaskEvent(TaskEvent.Type.added,
+ task));
+ }
+
+ public List<TaskInfo> getTasks() {
+ return Collections.unmodifiableList(tasks);
+ }
+
+ private class TaskHandler implements Observer<TaskEvent> {
+
+ @Override
+ public void handleEvent(TaskEvent event) {
+ if (event.getType().equals(Type.completed)) {
+ tasks.remove(event.getTask());
+ observableHelper.fireEvent(event);
+ }
+ }
+
+ }
+
+ // private constructor to maintain singleton
+ private TaskMonitor() {
+ //
+ }
+
+}
182 src/org/onesocialweb/gwt/client/ui/application/AbstractApplication.java
View
@@ -0,0 +1,182 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.ui.application;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.onesocialweb.gwt.client.exception.MissingWindowFactoryException;
+import org.onesocialweb.gwt.client.ui.window.AbstractWindow;
+import org.onesocialweb.gwt.client.ui.window.WindowFactory;
+
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.RootPanel;
+
+public abstract class AbstractApplication extends FlowPanel {
+
+ private FlowPanel appContainer = new FlowPanel();
+
+ private final HashMap<Slot, AbstractWindow> windows; // keeps track of the
+ // actual windows
+ private final List<Slot> slots; // keeps track of the slot dimensions
+
+ public AbstractApplication(int slotsCount) {
+ setVisible(false);
+ slots = new ArrayList<Slot>(slotsCount);
+ windows = new HashMap<Slot, AbstractWindow>(slotsCount);
+
+ for (int i = 0; i < slotsCount; i++) {
+ slots.add(new Slot());
+ }
+ }
+
+ public void init() {
+ // Let the implementing class know we are initializing
+ onInit();
+ }
+
+ public void show() {
+ // Let the implementing class know we are going to show
+ onShow();
+
+ // Check if application is already attached to DOM
+ if (!isAttached()) {
+ // attach application to page
+ RootPanel.get("applicationwrapper").add(appContainer);
+ appContainer.setHeight("100%");
+ appContainer.setStyleName("application");
+ }
+
+ // Check if application is already showing
+ setVisible(true);
+
+ // Show the windows
+ for (AbstractWindow w : windows.values()) {
+ w.show();
+ }
+ }
+
+ public void hide() {
+ // Let the implementor know we are going to hide
+ onHide();
+
+ // Hide the content
+ setVisible(false);
+
+ // Cycle through the windows and inform of hide
+ for (AbstractWindow w : windows.values()) {
+ w.hide();
+ }
+ }
+
+ public void destroy() {
+ // Let the implementor know we are going to destroy
+ onDestroy();
+
+ // Get out of the view of the user to do our dirty stuff
+ setVisible(false);
+
+ // Destroy the windows
+ for (AbstractWindow w : windows.values()) {
+ w.destroy();
+ }
+
+ // Remove the container
+ RootPanel.get("applicationwrapper").remove(appContainer);
+ }
+
+ public AbstractWindow addWindow(String className, int slotId) {
+ try {
+ // Get the slot
+ final Slot slot = slots.get(slotId);
+
+ // Clean up current slot
+ if (windows.containsKey(slot)) {
+ windows.get(slot).destroy();
+ windows.remove(slot);
+ }
+
+ // Build a new window in the factory of the right type
+ final AbstractWindow window = WindowFactory.getInstance()
+ .newWindow(className);
+ window.setSlot(slot);
+ window.setParent(this);
+
+ // Allocate it to the slot
+ windows.put(slot, window);
+
+ // Attach window
+ appContainer.add(window);
+
+ // Return the new window to the caller
+ return window;
+
+ } catch (MissingWindowFactoryException e) {
+ return null;
+ }
+ }
+
+ public void removeWindow(int slotId) {
+ windows.remove(slotId);
+ }
+
+ public void removeWindow(AbstractWindow window) {
+ for (Slot s : slots) {
+ AbstractWindow w = windows.get(s);
+ if (w != null && w.equals(window)) {
+ windows.remove(s);
+ break;
+ }
+ }
+ }
+
+ protected AbstractWindow getWindow(int slotId) {
+ return windows.get(slotId);
+ }
+
+ protected Slot getSlot(int slotId) {
+ return slots.get(slotId);
+ }
+
+ protected void onInit() {
+ }
+
+ protected void onShow() {
+ }
+
+ protected void onHide() {
+ }
+
+ protected void onDestroy() {
+ }
+
+ // class to keep track of the slot dimensions
+ public class Slot {
+
+ public int width, height, left, top;
+
+ public void setSlotDimensions(int top, int left, int width, int height) {
+ this.top = top;
+ this.left = left;
+ this.width = width;
+ this.height = height;
+ }
+
+ }
+
+}
37 src/org/onesocialweb/gwt/client/ui/application/ActivityApplication.java
View
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.ui.application;
+
+import org.onesocialweb.gwt.client.ui.window.FeedWindow;
+
+public class ActivityApplication extends AbstractApplication {
+
+ public ActivityApplication() {
+ super(2);
+ }
+
+ @Override
+ protected void onInit() {
+ // Initialize the slots
+ getSlot(0).setSlotDimensions(0, 0, 50, 100);
+ getSlot(1).setSlotDimensions(0, 50, 50, 100);
+
+ // Add default window to specific slots
+ addWindow(FeedWindow.class.toString(), 0);
+ }
+
+}
38 src/org/onesocialweb/gwt/client/ui/application/ContactsApplication.java
View
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.ui.application;
+
+import org.onesocialweb.gwt.client.ui.window.ContactsWindow;
+
+public class ContactsApplication extends AbstractApplication {
+
+ public ContactsApplication() {
+ super(2);
+ }
+
+ @Override
+ protected void onInit() {
+
+ // Init the application slots
+ getSlot(0).setSlotDimensions(0, 0, 50, 100);
+ getSlot(1).setSlotDimensions(0, 50, 50, 100);
+
+ // add default window to specific slots
+ addWindow(ContactsWindow.class.toString(), 0);
+ }
+
+}
36 src/org/onesocialweb/gwt/client/ui/application/PreferencesApplication.java
View
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.ui.application;
+
+import org.onesocialweb.gwt.client.ui.window.PreferencesWindow;
+
+public class PreferencesApplication extends AbstractApplication {
+
+ public PreferencesApplication() {
+ super(1);
+ }
+
+ @Override
+ protected void onInit() {
+ // Set the application slot dimensions
+ getSlot(0).setSlotDimensions(0, 0, 100, 100);
+
+ // Add default window to specific slots
+ addWindow(PreferencesWindow.class.toString(), 0);
+ }
+
+}
56 src/org/onesocialweb/gwt/client/ui/dialog/AbstractDialog.java
View
@@ -0,0 +1,56 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.ui.dialog;
+
+import com.google.gwt.event.logical.shared.ResizeEvent;
+import com.google.gwt.event.logical.shared.ResizeHandler;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.DialogBox;
+
+public abstract class AbstractDialog extends DialogBox {
+
+ public AbstractDialog() {
+ // set styles
+ this.setStylePrimaryName("dialog");
+
+ this.setModal(true);
+
+ Window.addResizeHandler(new ResizeHandler() {
+ public void onResize(ResizeEvent event) {
+ // make sure dialog is always centered
+ if (isShowing())
+ center();
+ }
+ });
+
+ }
+
+ public void hide() {
+ super.hide();
+ onHide();
+ }
+
+ public void show() {
+ super.show();
+ onShow();
+ }
+
+ protected abstract void onShow();
+
+ protected abstract void onHide();
+
+}
90 src/org/onesocialweb/gwt/client/ui/dialog/AlertDialog.java
View
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed 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.onesocialweb.gwt.client.ui.dialog;
+
+import org.onesocialweb.gwt.client.i18n.UserInterfaceText;
+
+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.user.client.ui.Button;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class AlertDialog extends AbstractDialog {
+
+ // internationalization
+ private UserInterfaceText uiText = (UserInterfaceText) GWT
+ .create(UserInterfaceText.class);
+
+ // private final LoginHandler loginHandler;
+ private static AlertDialog instance;
+ private Button buttonOK = new Button(uiText.OK());
+ private Label message = new Label();
+
+ public static AlertDialog getInstance() {
+ if (instance == null) {
+ instance = new AlertDialog();
+ }
+ return instance;
+ }
+
+ public void showDialog(String message, String title) {
+ setText(title);
+ this.message.setText(message);
+ center();
+ buttonOK.setFocus(true);
+ }
+
+ private AlertDialog() {
+
+ // Create dialog
+ VerticalPanel vpanel1 = new VerticalPanel();
+ HorizontalPanel buttoncontainer = new HorizontalPanel();
+
+ vpanel1.add(message);
+ vpanel1.add(buttoncontainer);
+
+ buttoncontainer.add(buttonOK);
+ buttoncontainer.setStyleName("dialogButtons");
+
+ setWidth("300px");
+ setWidget(vpanel1);
+
+ buttonOK.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent event) {
+
+ AlertDialog.getInstance().hide();
+ }
+ });
+
+ }
+
+ @Override
+ protected void onHide() {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ protected void onShow() {
+ // TODO Auto-generated method stub
+
+ }
+
+}
303 src/org/onesocialweb/gwt/client/ui/dialog/LoginDialog.java
View
@@ -0,0 +1,303 @@
+/*
+ * Copyright 2010 Vodafone Group Services Ltd.
+ *
+ * Licensed under the Apache License