kune-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 1587 discussions
Author: vjrj
Date: 2008-08-05 03:32:52 +0200 (Tue, 05 Aug 2008)
New Revision: 829
Added:
trunk/img/emite-groups-logo.svg
trunk/img/emite-groups.png
Log:
emite groups images
Added: trunk/img/emite-groups-logo.svg
===================================================================
--- trunk/img/emite-groups-logo.svg 2008-08-05 01:29:31 UTC (rev 828)
+++ trunk/img/emite-groups-logo.svg 2008-08-05 01:32:52 UTC (rev 829)
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="42"
+ height="42"
+ id="svg2533"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ inkscape:export-filename="/Users/vjrj/Desktop/emite-groups.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ sodipodi:docbase="/Users/vjrj/Desktop"
+ sodipodi:docname="emite-groups-logo.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2535" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="9.45"
+ inkscape:cx="29.482892"
+ inkscape:cy="20"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ width="42px"
+ height="42px"
+ inkscape:window-width="756"
+ inkscape:window-height="581"
+ inkscape:window-x="354"
+ inkscape:window-y="104" />
+ <metadata
+ id="metadata2538">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <text
+ xml:space="preserve"
+ style="font-size:23.88686371px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;fill:#ff0000;fill-opacity:1;fill-rule:nonzero;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Emblem"
+ x="-0.14885554"
+ y="28.014141"
+ id="text2516"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan2518"
+ x="-0.14885554"
+ y="28.014141"
+ dy="0 0 -0.57697296"><tspan
+ style="fill:#ff6600"
+ id="tspan2520">((</tspan>e<tspan
+ style="fill:#ff6600"
+ id="tspan2522"
+ dy="0.57697296">))</tspan></tspan></text>
+ <g
+ id="g2551"
+ transform="matrix(0.126788,0,0,0.126788,107.24045,44.350445)">
+ <g
+ transform="matrix(1.7831728,0,0,1.7831728,-79.227654,-1724.5839)"
+ id="g2524">
+ <text
+ xml:space="preserve"
+ style="font-size:49.60492325px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:89.99999762%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#784421;fill-opacity:1;fill-rule:nonzero;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Emblem"
+ x="-219.35106"
+ y="817.05505"
+ id="text2526"
+ sodipodi:linespacing="89.999998%"
+ transform="scale(0.9684286,1.0326006)"><tspan
+ sodipodi:role="line"
+ x="-219.35106"
+ y="817.05505"
+ id="tspan2528">emite</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:23.32044411px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:89.99999762%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#784421;fill-opacity:1;fill-rule:nonzero;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Emblem"
+ x="-217.47432"
+ y="839.24841"
+ id="text2530"
+ sodipodi:linespacing="89.999998%"
+ transform="scale(0.9684286,1.0326006)"><tspan
+ sodipodi:role="line"
+ x="-217.47432"
+ y="839.24841"
+ id="tspan2532">xmpp & gwt</tspan></text>
+ </g>
+ <text
+ inkscape:export-ydpi="32.508678"
+ inkscape:export-xdpi="32.508678"
+ inkscape:export-filename="/home/vjrj/proyectos/ourproject.org/kune/dev/emite/emite/img/emite-ui.png"
+ transform="scale(0.9684286,1.0326006)"
+ sodipodi:linespacing="89.999998%"
+ id="text2534"
+ y="-133.38048"
+ x="-471.8595"
+ style="font-size:34.96242523px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:89.99999762%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;opacity:1;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Emblem"
+ xml:space="preserve"><tspan
+ id="tspan2536"
+ y="-133.38048"
+ x="-471.8595"
+ sodipodi:role="line">ui application</tspan></text>
+ </g>
+ </g>
+</svg>
Added: trunk/img/emite-groups.png
===================================================================
(Binary files differ)
Property changes on: trunk/img/emite-groups.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
Author: vjrj
Date: 2008-08-05 03:29:31 +0200 (Tue, 05 Aug 2008)
New Revision: 828
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java
trunk/src/test/java/org/ourproject/kune/workspace/client/tags/
trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java
Removed:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatComponents.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomListener.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextComponents.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocToolComponents.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentComponents.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentListener.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderListener.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextComponents.java
trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
trunk/src/main/java/org/ourproject/kune/platf/client/Component.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ui/
trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidget.java
trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetChild.java
trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetId.java
trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetsManager.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/BottomTrayIcon.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/
Modified:
trunk/TODO
trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfo.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/Document.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetLanguageAction.java
trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetPublishedOnAction.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControl.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlView.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
trunk/src/test/java/org/ourproject/kune/sitebar/client/msg/SiteMessagePresenterTest.java
Log:
Workspace refactorization
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/TODO 2008-08-05 01:29:31 UTC (rev 828)
@@ -38,6 +38,7 @@
- Remove pagination i18n's
- Chat rooms --> Chats
- Confirmation of chat close (see code)
+ - Participates as ... --> Participates in
MIND-TERM:
--------------------------------------------------------------------------------
Modified: trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-08-05 01:29:31 UTC (rev 828)
@@ -26,7 +26,7 @@
<iframe id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe>
<div id="kuneprogresspanel" class="kune-sitebar">
<table cellspacing="0" summary="Starting" cellpadding="0" border="0"
- style="height: 16px;">
+ style="height: 16px; margin-top: 5px; margin-left: 5px;">
<tbody>
<tr>
<td height="16" align="left" style="vertical-align: top;"
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,15 +1,31 @@
package org.ourproject.kune.chat.client;
+import org.ourproject.kune.chat.client.cnt.ChatContent;
+import org.ourproject.kune.chat.client.cnt.ChatContentPresenter;
+import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
+import org.ourproject.kune.chat.client.cnt.info.ui.ChatInfoPanel;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomControl;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPresenter;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomPresenter;
+import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomControlPanel;
+import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomPanel;
+import org.ourproject.kune.chat.client.ctx.ChatContext;
+import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
+import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
+import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdminPresenter;
import org.ourproject.kune.platf.client.KunePlatform;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
import com.calclab.suco.client.modules.AbstractModule;
@@ -24,12 +40,61 @@
@Override
public void onLoad() {
+
+ register(SingletonScope.class, new Factory<ChatInfo>(ChatInfo.class) {
+ public ChatInfo create() {
+ return new ChatInfoPanel();
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatContent>(ChatContent.class) {
+ public ChatContent create() {
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final ChatContentPresenter presenter = new ChatContentPresenter($(EmiteUIDialog.class), panel,
+ $p(ChatInfo.class), $p(ChatRoom.class));
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatContext>(ChatContext.class) {
+ public ChatContext create() {
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final ChatContextPresenter presenter = new ChatContextPresenter(panel, $p(RoomsAdmin.class));
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatRoomControl>(ChatRoomControl.class) {
+ public ChatRoomControl create() {
+ final ChatRoomControlPresenter presenter = new ChatRoomControlPresenter();
+ final ChatRoomControlPanel panel = new ChatRoomControlPanel($(I18nUITranslationService.class),
+ presenter);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ChatRoom>(ChatRoom.class) {
+ public ChatRoom create() {
+ final ChatRoomPanel panel = new ChatRoomPanel($(WorkspaceSkeleton.class));
+ final ChatRoomPresenter presenter = new ChatRoomPresenter(panel);
+ return presenter;
+ }
+ });
+ register(SingletonScope.class, new Factory<RoomsAdmin>(RoomsAdmin.class) {
+ public RoomsAdmin create() {
+ final RoomsAdminPresenter presenter = new RoomsAdminPresenter($(ContextItems.class),
+ $(I18nUITranslationService.class), $p(StateManager.class), $(Session.class),
+ $p(ContentServiceAsync.class));
+ return presenter;
+ }
+ });
+
register(SingletonScope.class, new Factory<ChatClientTool>(ChatClientTool.class) {
public ChatClientTool create() {
return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
$(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $p(GroupMembersSummary.class),
- $p(StateManager.class), $p(ContentServiceAsync.class), $(ToolSelector.class),
- $(WsThemePresenter.class));
+ $(ToolSelector.class), $(WsThemePresenter.class), $p(ChatContent.class), $p(ChatContext.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -20,22 +20,21 @@
package org.ourproject.kune.chat.client;
+import org.ourproject.kune.chat.client.cnt.ChatContent;
+import org.ourproject.kune.chat.client.ctx.ChatContext;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItem;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
+import org.ourproject.kune.platf.client.ui.MenuItem;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
import com.calclab.emite.client.xmpp.stanzas.XmppURI;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
@@ -48,24 +47,25 @@
public static final String TYPE_ROOT = "chat.root";
public static final String TYPE_ROOM = "chat.room";
public static final String TYPE_CHAT = "chat.chat";
- private final ChatToolComponents components;
private ChatEngine chat;
+ private final Provider<ChatContext> chatContextProvider;
+ private final Provider<ChatContent> chatContentProvider;
public ChatClientTool(final Session session, final Application application, final I18nTranslationService i18n,
final EmiteUIDialog emiteUIDialog, final WorkspaceSkeleton ws,
- final Provider<GroupMembersSummary> groupMembersSummaryProvider,
- final Provider<StateManager> stateManagerProvider,
- final Provider<ContentServiceAsync> contentServiceProvider, final ToolSelector toolSelector,
- final WsThemePresenter wsThemePresenter) {
+ final Provider<GroupMembersSummary> groupMembersSummaryProvider, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter, final Provider<ChatContent> chatContentProvider,
+ final Provider<ChatContext> chatContextProvider) {
super(NAME, i18n.t("chat rooms"), toolSelector, wsThemePresenter, ws);
- components = new ChatToolComponents(emiteUIDialog, i18n, stateManagerProvider, session, contentServiceProvider);
+ this.chatContentProvider = chatContentProvider;
+ this.chatContextProvider = chatContextProvider;
session.onInitDataReceived(new Slot<InitDataDTO>() {
public void onEvent(final InitDataDTO initData) {
final ChatOptions chatOptions = new ChatOptions(initData.getChatHttpBase(), initData.getChatDomain(),
initData.getChatRoomHost());
chat = new ChatEngineXmpp(emiteUIDialog, chatOptions, i18n, ws);
groupMembersSummaryProvider.get().addGroupOperation(
- new GridMenuItem<GroupDTO>("images/chat-basic.gif", i18n.t("Start a chat with this member"),
+ new MenuItem<GroupDTO>("images/chat-basic.gif", i18n.t("Start a chat with this member"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
emiteUIDialog.chat(XmppURI.jid(group.getShortName() + "@"
@@ -96,24 +96,16 @@
return chat;
}
- public WorkspaceComponent getContent() {
- return components.getContent();
- }
-
- public WorkspaceComponent getContext() {
- return components.getContext();
- }
-
public String getName() {
return NAME;
}
public void setContent(final StateDTO state) {
- components.getContent().setState(state);
+ chatContentProvider.get().setState(state);
}
public void setContext(final StateDTO state) {
- components.getContext().setState(state);
+ chatContextProvider.get().setState(state);
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,98 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.chat.client;
-
-import org.ourproject.kune.chat.client.cnt.ChatContent;
-import org.ourproject.kune.chat.client.cnt.ChatContentPresenter;
-import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
-import org.ourproject.kune.chat.client.cnt.info.ui.ChatInfoPanel;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControl;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPresenter;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomListener;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomPresenter;
-import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomControlPanel;
-import org.ourproject.kune.chat.client.cnt.room.ui.ChatRoomPanel;
-import org.ourproject.kune.chat.client.ctx.ChatContext;
-import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
-import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
-import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdminPresenter;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.WorkspaceFactory;
-import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
-
-import com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.suco.client.container.Provider;
-
-public class ChatFactory {
-
- private static I18nTranslationService i18n;
- private static Provider<StateManager> stateManagerProvider;
- private static Session session;
- private static Provider<ContentServiceAsync> contentServiceProvider;
-
- public static ChatContent createChatContent(final EmiteUIDialog emiteUIDialog, final I18nTranslationService i18n,
- final Provider<StateManager> stateManagerProvider, final Session session,
- final Provider<ContentServiceAsync> contentServiceProvider) {
- ChatFactory.i18n = i18n;
- ChatFactory.stateManagerProvider = stateManagerProvider;
- ChatFactory.session = session;
- ChatFactory.contentServiceProvider = contentServiceProvider;
- final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final ChatContentPresenter presenter = new ChatContentPresenter(emiteUIDialog, panel);
- return presenter;
- }
-
- public static ChatContext createChatContext() {
- final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final ChatContextPresenter presenter = new ChatContextPresenter(panel);
- return presenter;
- }
-
- public static ChatInfo createChatInfo(final ChatRoomListener listener) {
- final ChatInfoPanel panel = new ChatInfoPanel(listener);
- return panel;
- }
-
- public static ChatRoomControl createChatRoomControlViewer(final ChatRoomListener listener) {
- final ChatRoomControlPanel panel = new ChatRoomControlPanel(listener, i18n);
- final ChatRoomControlPresenter presenter = new ChatRoomControlPresenter(panel);
- return presenter;
- }
-
- public static ChatRoom createChatRoomViewer(final ChatRoomListener listener) {
- final ChatRoomPanel panel = new ChatRoomPanel();
- final ChatRoomPresenter presenter = new ChatRoomPresenter(panel);
- return presenter;
- }
-
- public static RoomsAdmin createRoomsAdmin() {
- final ContextItems contextItems = WorkspaceFactory.createContextItems();
- final RoomsAdminPresenter presenter = new RoomsAdminPresenter(contextItems, i18n, stateManagerProvider,
- session, contentServiceProvider);
- return presenter;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,67 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.chat.client;
-
-import org.ourproject.kune.chat.client.cnt.ChatContent;
-import org.ourproject.kune.chat.client.ctx.ChatContext;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-
-import com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.suco.client.container.Provider;
-
-class ChatToolComponents {
- private ChatContent content;
- private ChatContext context;
- private final EmiteUIDialog emiteUIDialog;
- private final I18nTranslationService i18n;
- private final Provider<StateManager> stateManagerProvider;
- private final Session session;
- private final Provider<ContentServiceAsync> contentServiceProvider;
-
- public ChatToolComponents(final EmiteUIDialog emiteUIDialog, final I18nTranslationService i18n,
- final Provider<StateManager> stateManagerProvider, final Session session,
- final Provider<ContentServiceAsync> contentServiceProvider) {
- this.emiteUIDialog = emiteUIDialog;
- this.i18n = i18n;
- this.stateManagerProvider = stateManagerProvider;
- this.session = session;
- this.contentServiceProvider = contentServiceProvider;
- }
-
- public ChatContent getContent() {
- if (content == null) {
- content = ChatFactory.createChatContent(emiteUIDialog, i18n, stateManagerProvider, session,
- contentServiceProvider);
- }
- return content;
- }
-
- public ChatContext getContext() {
- if (context == null) {
- context = ChatFactory.createChatContext();
- }
- return context;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,60 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.chat.client.cnt;
-
-import org.ourproject.kune.chat.client.ChatFactory;
-import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControl;
-
-class ChatComponents {
-
- private final ChatContentPresenter owner;
- private ChatRoom chatRoom;
- private ChatInfo chatInfo;
- private ChatRoomControl chatRoomControl;
-
- public ChatComponents(final ChatContentPresenter owner) {
- this.owner = owner;
- }
-
- public ChatRoom getChatRoom() {
- if (chatRoom == null) {
- chatRoom = ChatFactory.createChatRoomViewer(owner);
- }
- return chatRoom;
- }
-
- public ChatRoomControl getChatRoomControl() {
- if (chatRoomControl == null) {
- chatRoomControl = ChatFactory.createChatRoomControlViewer(owner);
- }
- return chatRoomControl;
- }
-
- public ChatInfo getChatInfo() {
- if (chatInfo == null) {
- chatInfo = ChatFactory.createChatInfo(owner);
- }
- return chatInfo;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,9 +21,9 @@
package org.ourproject.kune.chat.client.cnt;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-public interface ChatContent extends WorkspaceComponent {
+public interface ChatContent {
+
void setState(StateDTO state);
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -23,37 +23,31 @@
import org.ourproject.kune.chat.client.ChatClientTool;
import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomListener;
-import org.ourproject.kune.platf.client.PlatformEvents;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
-import org.ourproject.kune.platf.client.ui.UnknowComponent;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
+import com.allen_sauer.gwt.log.client.Log;
import com.calclab.emite.client.xmpp.stanzas.XmppURI;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
+import com.calclab.suco.client.container.Provider;
-public class ChatContentPresenter implements ChatContent, ChatRoomListener {
+public class ChatContentPresenter implements ChatContent {
private final WorkspaceDeckView view;
- private final ChatComponents components;
private StateDTO state;
private final EmiteUIDialog emiteUIDialog;
+ private final Provider<ChatInfo> chatInfoProvider;
+ private final Provider<ChatRoom> chatRoomProvider;
- public ChatContentPresenter(final EmiteUIDialog emiteUIDialog, final WorkspaceDeckView view) {
+ public ChatContentPresenter(final EmiteUIDialog emiteUIDialog, final WorkspaceDeckView view,
+ final Provider<ChatInfo> chatInfoProvider, final Provider<ChatRoom> chatRoomProvider) {
this.emiteUIDialog = emiteUIDialog;
this.view = view;
- this.components = new ChatComponents(this);
+ this.chatInfoProvider = chatInfoProvider;
+ this.chatRoomProvider = chatRoomProvider;
}
- public void attach() {
- }
-
- public void detach() {
- }
-
public View getView() {
return view;
}
@@ -67,20 +61,11 @@
this.state = state;
final String typeId = state.getTypeId();
if (typeId.equals(ChatClientTool.TYPE_ROOT)) {
- final ChatInfo info = components.getChatInfo();
- view.show(info.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ chatInfoProvider.get().show();
} else if (typeId.equals(ChatClientTool.TYPE_ROOM)) {
- final ChatRoom viewer = components.getChatRoom();
- view.show(viewer.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ chatRoomProvider.get().show();
} else {
- view.show(UnknowComponent.instance.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ Log.error("Programming error: unknown component!! please contact kune-devel(a)lists-ourproject.org");
}
}
-
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfo.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ChatInfo.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.chat.client.cnt.info;
-import org.ourproject.kune.platf.client.Component;
+public interface ChatInfo {
-public interface ChatInfo extends Component {
+ void show();
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/ChatInfoPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -20,23 +20,20 @@
package org.ourproject.kune.chat.client.cnt.info.ui;
import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomListener;
-import org.ourproject.kune.platf.client.View;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
-public class ChatInfoPanel extends VerticalPanel implements ChatInfo, View {
+public class ChatInfoPanel extends VerticalPanel implements ChatInfo {
private final VerticalPanel stateArea;
- public ChatInfoPanel(final ChatRoomListener listener) {
- FlowPanel flow = new FlowPanel();
+ public ChatInfoPanel() {
+ final FlowPanel flow = new FlowPanel();
add(flow);
stateArea = new VerticalPanel();
add(stateArea);
}
- public View getView() {
- return this;
+ public void show() {
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -19,7 +19,7 @@
*/
package org.ourproject.kune.chat.client.cnt.room;
-import org.ourproject.kune.platf.client.Component;
+public interface ChatRoom {
-public interface ChatRoom extends Component {
+ void show();
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -19,8 +19,6 @@
*/
package org.ourproject.kune.chat.client.cnt.room;
-import org.ourproject.kune.platf.client.Component;
+public interface ChatRoomControl {
-public interface ChatRoomControl extends Component {
-
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -23,14 +23,19 @@
public class ChatRoomControlPresenter implements ChatRoomControl {
- private final ChatRoomControlView view;
+ private ChatRoomControlView view;
- public ChatRoomControlPresenter(final ChatRoomControlView view) {
- this.view = view;
+ public View getView() {
+ return view;
}
- public View getView() {
- return view;
+ public void init(final ChatRoomControlView view) {
+ this.view = view;
}
+ public void onEnterRoom() {
+ // TODO Auto-generated method stub
+
+ }
+
}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomListener.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomListener.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.cnt.room;
-
-public interface ChatRoomListener {
- void onEnterRoom();
-}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -25,7 +25,7 @@
private final ChatRoomView view;
- public ChatRoomPresenter(ChatRoomView view) {
+ public ChatRoomPresenter(final ChatRoomView view) {
this.view = view;
}
@@ -33,4 +33,7 @@
return view;
}
+ public void show() {
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomControlPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -20,8 +20,8 @@
package org.ourproject.kune.chat.client.cnt.room.ui;
+import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPresenter;
import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlView;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomListener;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.CustomPushButton;
@@ -32,18 +32,18 @@
public class ChatRoomControlPanel extends HorizontalPanel implements ChatRoomControlView {
private final CustomPushButton enterRoomBtn;
- public ChatRoomControlPanel(final ChatRoomListener listener, final I18nTranslationService i18n) {
- enterRoomBtn = new CustomPushButton(i18n.t("Enter room"), new ClickListener() {
- public void onClick(final Widget sender) {
- listener.onEnterRoom();
- }
- });
- add(enterRoomBtn);
- setEnterRoomEnabled(true);
+ public ChatRoomControlPanel(final I18nTranslationService i18n, final ChatRoomControlPresenter presenter) {
+ enterRoomBtn = new CustomPushButton(i18n.t("Enter room"), new ClickListener() {
+ public void onClick(final Widget sender) {
+ presenter.onEnterRoom();
+ }
+ });
+ add(enterRoomBtn);
+ setEnterRoomEnabled(true);
}
public void setEnterRoomEnabled(final boolean isEnabled) {
- enterRoomBtn.setEnabled(isEnabled);
+ enterRoomBtn.setEnabled(isEnabled);
}
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/ChatRoomPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -22,12 +22,14 @@
import org.ourproject.kune.chat.client.cnt.room.ChatRoomView;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.ui.DefaultContentPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-public class ChatRoomPanel extends DefaultContentPanel implements ChatRoomView {
+import com.google.gwt.user.client.ui.Label;
- public ChatRoomPanel() {
- setContent("History of room conversations." + Site.IN_DEVELOPMENT);
+public class ChatRoomPanel implements ChatRoomView {
+
+ public ChatRoomPanel(final WorkspaceSkeleton ws) {
+ ws.getEntityWorkspace().setContent(new Label("History of room conversations." + Site.IN_DEVELOPMENT));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,9 +21,8 @@
package org.ourproject.kune.chat.client.ctx;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-public interface ChatContext extends WorkspaceComponent {
+public interface ChatContext {
void setState(StateDTO state);
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,40 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.chat.client.ctx;
-
-import org.ourproject.kune.chat.client.ChatFactory;
-import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
-
-class ChatContextComponents {
-
- private RoomsAdmin roomsAdmin;
-
- public ChatContextComponents(final ChatContextPresenter chatContextPresenter) {
- }
-
- public RoomsAdmin getRoomsAdmin() {
- if (roomsAdmin == null) {
- roomsAdmin = ChatFactory.createRoomsAdmin();
- }
- return roomsAdmin;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -25,30 +25,25 @@
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
+import com.calclab.suco.client.container.Provider;
+
public class ChatContextPresenter implements ChatContext {
private final WorkspaceDeckView view;
- private final ChatContextComponents components;
+ private final Provider<RoomsAdmin> roomAdminsProvider;
- public ChatContextPresenter(final WorkspaceDeckView view) {
+ public ChatContextPresenter(final WorkspaceDeckView view, final Provider<RoomsAdmin> roomAdminsProvider) {
this.view = view;
- this.components = new ChatContextComponents(this);
+ this.roomAdminsProvider = roomAdminsProvider;
}
- public void attach() {
- }
-
- public void detach() {
- }
-
public View getView() {
return view;
}
public void setState(final StateDTO state) {
- RoomsAdmin rooms = components.getRoomsAdmin();
+ final RoomsAdmin rooms = roomAdminsProvider.get();
rooms.showRoom(state.getStateToken(), state.getFolder(), state.getFolderRights());
view.show(rooms.getView());
}
-
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/DocToolComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocToolComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocToolComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,52 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.docs.client;
-
-import org.ourproject.kune.docs.client.cnt.DocumentContent;
-import org.ourproject.kune.docs.client.ctx.DocumentContext;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
-
-class DocToolComponents {
- private DocumentContent content;
- private DocumentContext context;
- private final DocumentClientTool documentClientTool;
- private final DocumentFactory documentFactory;
-
- public DocToolComponents(final DocumentFactory documentFactory, final DocumentClientTool documentClientTool) {
- this.documentFactory = documentFactory;
- this.documentClientTool = documentClientTool;
- }
-
- public DocumentContent getContent() {
- if (content == null) {
- content = documentFactory.createDocumentContent(documentClientTool);
- }
- return content;
- }
-
- public DocumentContext getContext() {
- if (context == null) {
- context = documentFactory.createDocumentContext();
- }
- return context;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -32,28 +32,21 @@
import org.ourproject.kune.docs.client.actions.GoParentFolderAction;
import org.ourproject.kune.docs.client.actions.RenameTokenAction;
import org.ourproject.kune.docs.client.actions.SaveDocumentAction;
-import org.ourproject.kune.docs.client.actions.WSSplitterStartResizingAction;
-import org.ourproject.kune.docs.client.actions.WSSplitterStopResizingAction;
import org.ourproject.kune.platf.client.extend.ClientModule;
import org.ourproject.kune.platf.client.extend.Register;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
public class DocsClientModule implements ClientModule {
private final Session session;
- private final Workspace workspace;
private final StateManager stateManager;
private final I18nTranslationService i18n;
- public DocsClientModule(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
+ public DocsClientModule(final Session session, final StateManager stateManager, final I18nTranslationService i18n) {
this.session = session;
this.stateManager = stateManager;
- this.workspace = workspace;
this.i18n = i18n;
}
@@ -64,12 +57,10 @@
register.addAction(DocsEvents.GO_PARENT_FOLDER, new GoParentFolderAction(stateManager, session));
register.addAction(DocsEvents.ADD_AUTHOR, new ContentAddAuthorAction(stateManager, session));
register.addAction(DocsEvents.REMOVE_AUTHOR, new ContentRemoveAuthorAction(stateManager, session));
- register.addAction(DocsEvents.SET_LANGUAGE, new ContentSetLanguageAction(session, workspace));
- register.addAction(DocsEvents.SET_PUBLISHED_ON, new ContentSetPublishedOnAction(session, workspace));
+ register.addAction(DocsEvents.SET_LANGUAGE, new ContentSetLanguageAction(session));
+ register.addAction(DocsEvents.SET_PUBLISHED_ON, new ContentSetPublishedOnAction(session));
register.addAction(DocsEvents.RENAME_CONTENT, new ContentRenameAction(session));
register.addAction(DocsEvents.DEL_CONTENT, new ContentDelContentAction(stateManager, session));
register.addAction(DocsEvents.RENAME_TOKEN, new RenameTokenAction(session, stateManager));
- register.addAction(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, new WSSplitterStartResizingAction());
- register.addAction(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, new WSSplitterStopResizingAction());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/Document.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/Document.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/Document.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -20,8 +20,7 @@
package org.ourproject.kune.docs.client;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-public interface Document extends WorkspaceComponent {
+public interface Document {
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,16 +1,42 @@
package org.ourproject.kune.docs.client;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
+import org.ourproject.kune.docs.client.cnt.DocumentContent;
+import org.ourproject.kune.docs.client.cnt.DocumentContentPresenter;
+import org.ourproject.kune.docs.client.cnt.folder.FolderEditor;
+import org.ourproject.kune.docs.client.cnt.folder.FolderEditorPresenter;
+import org.ourproject.kune.docs.client.cnt.folder.ui.FolderEditorPanel;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPresenter;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.ui.FolderViewerPanel;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControl;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlPresenter;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlView;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderPresenter;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderView;
+import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderControlPanel;
+import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderPanel;
+import org.ourproject.kune.docs.client.ctx.DocumentContext;
+import org.ourproject.kune.docs.client.ctx.DocumentContextPresenter;
+import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
+import org.ourproject.kune.docs.client.ctx.admin.AdminContextPresenter;
+import org.ourproject.kune.docs.client.ctx.admin.AdminContextView;
+import org.ourproject.kune.docs.client.ctx.admin.ui.AdminContextPanel;
+import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
+import org.ourproject.kune.docs.client.ctx.folder.FolderContextPresenter;
import org.ourproject.kune.platf.client.KunePlatform;
-import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
+import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
+import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.tags.TagsSummary;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
import com.calclab.suco.client.modules.AbstractModule;
import com.calclab.suco.client.provider.Factory;
@@ -24,30 +50,91 @@
@Override
public void onLoad() {
- register(SingletonScope.class, new Factory<DocumentFactory>(DocumentFactory.class) {
- public DocumentFactory create() {
- return new DocumentFactory($(I18nUITranslationService.class), $(Session.class), $p(TagsSummary.class),
- $(WorkspaceSkeleton.class), $(RateIt.class));
- }
- });
+ final I18nUITranslationService i18n = $(I18nUITranslationService.class);
+ final WorkspaceSkeleton ws = $(WorkspaceSkeleton.class);
register(SingletonScope.class, new Factory<DocumentClientTool>(DocumentClientTool.class) {
public DocumentClientTool create() {
- final DocumentFactory factory = $(DocumentFactory.class);
- return new DocumentClientTool(factory, $(I18nUITranslationService.class), $(ToolSelector.class),
- $(WsThemePresenter.class), $(WorkspaceSkeleton.class));
+ return new DocumentClientTool(i18n, $(ToolSelector.class), $(WsThemePresenter.class),
+ $(WorkspaceSkeleton.class), $p(DocumentContent.class), $p(DocumentContext.class));
}
});
+ register(SingletonScope.class, new Factory<AdminContext>(AdminContext.class) {
+ public AdminContext create() {
+ final AdminContextPresenter presenter = new AdminContextPresenter($(Session.class),
+ $p(TagsSummary.class));
+ final AdminContextView view = new AdminContextPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<DocumentContent>(DocumentContent.class) {
+ public DocumentContent create() {
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final DocumentContentPresenter presenter = new DocumentContentPresenter(panel, $(Session.class),
+ $(RateIt.class), $p(DocumentReader.class), $p(DocumentReaderControl.class),
+ $p(TextEditor.class), $p(FolderViewer.class), $p(FolderEditor.class));
+ return presenter;
+ }
+ });
+ register(SingletonScope.class, new Factory<DocumentContext>(DocumentContext.class) {
+ public DocumentContext create() {
+ final WorkspaceDeckPanel view = new WorkspaceDeckPanel();
+ final DocumentContextPresenter presenter = new DocumentContextPresenter(view, $p(FolderContext.class),
+ $p(AdminContext.class));
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<DocumentReader>(DocumentReader.class) {
+ public DocumentReader create() {
+ final DocumentReaderView view = new DocumentReaderPanel(ws);
+ final DocumentReaderPresenter presenter = new DocumentReaderPresenter(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<DocumentReaderControl>(DocumentReaderControl.class) {
+ public DocumentReaderControl create() {
+ final DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter();
+ final DocumentReaderControlView view = new DocumentReaderControlPanel(presenter, i18n, ws);
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<FolderContext>(FolderContext.class) {
+ public FolderContext create() {
+ final FolderContextPresenter presenter = new FolderContextPresenter($(ContextItems.class), i18n);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<FolderEditor>(FolderEditor.class) {
+ public FolderEditor create() {
+ final FolderEditorPanel view = new FolderEditorPanel();
+ final FolderEditorPresenter presenter = new FolderEditorPresenter(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<FolderViewer>(FolderViewer.class) {
+ public FolderViewer create() {
+ final FolderViewerView view = new FolderViewerPanel(ws);
+ final FolderViewerPresenter presenter = new FolderViewerPresenter(view);
+ return presenter;
+ }
+ });
+
final KunePlatform platform = $(KunePlatform.class);
final DocumentClientTool docClientTool = $(DocumentClientTool.class);
platform.addTool(docClientTool);
final Session session = $(Session.class);
final StateManager stateManager = $(StateManager.class);
- final Application application = $(Application.class);
- final I18nUITranslationService i18n = $(I18nUITranslationService.class);
- platform.install(new DocsClientModule(session, stateManager, application.getWorkspace(), i18n));
+ platform.install(new DocsClientModule(session, stateManager, i18n));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,61 +21,54 @@
package org.ourproject.kune.docs.client;
import org.ourproject.kune.docs.client.cnt.DocumentContent;
-import org.ourproject.kune.docs.client.cnt.DocumentContentListener;
import org.ourproject.kune.docs.client.ctx.DocumentContext;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-public class DocumentClientTool extends AbstractClientTool implements DocumentContentListener {
+import com.calclab.suco.client.container.Provider;
+
+public class DocumentClientTool extends AbstractClientTool {
public static final String TYPE_ROOT = "docs.root";
public static final String TYPE_FOLDER = "docs.folder";
public static final String TYPE_DOCUMENT = "docs.doc";
public static final String NAME = "docs";
- private final DocToolComponents components;
+ private final Provider<DocumentContext> documentContextProvider;
+ private final Provider<DocumentContent> documentContentProvider;
- public DocumentClientTool(final DocumentFactory documentFactory, final I18nUITranslationService i18n,
- final ToolSelector toolSelector, final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws) {
+ public DocumentClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws,
+ final Provider<DocumentContent> documentContentProvider,
+ final Provider<DocumentContext> documentContextProvider) {
super(NAME, i18n.t("documents"), toolSelector, wsThemePresenter, ws);
- components = new DocToolComponents(documentFactory, this);
+ this.documentContentProvider = documentContentProvider;
+ this.documentContextProvider = documentContextProvider;
}
- public WorkspaceComponent getContent() {
- return components.getContent();
- }
-
- public WorkspaceComponent getContext() {
- return components.getContext();
- }
-
public String getName() {
return NAME;
}
public void onCancel() {
- components.getContext().showFolders();
+ documentContextProvider.get().showFolders();
}
public void onEdit() {
- components.getContext().showAdmin();
+ documentContextProvider.get().showAdmin();
}
public void setContent(final StateDTO state) {
- final DocumentContent docContent = components.getContent();
- docContent.setContent(state);
+ documentContentProvider.get().setContent(state);
// TODO: check trigger interface (setState)
// trigger.setState(state.getStateToken().toString());
}
public void setContext(final StateDTO state) {
- final DocumentContext context = components.getContext();
- context.setContext(state);
+ documentContextProvider.get().setContext(state);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetLanguageAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetLanguageAction.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetLanguageAction.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -27,32 +27,30 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
public class ContentSetLanguageAction implements Action<String> {
private final Session session;
- private final Workspace workspace;
- public ContentSetLanguageAction(final Session session, final Workspace workspace) {
- this.session = session;
- this.workspace = workspace;
+ public ContentSetLanguageAction(final Session session) {
+ this.session = session;
}
public void execute(final String value) {
- onContentSetLanguage(value);
+ onContentSetLanguage(value);
}
private void onContentSetLanguage(final String languageCode) {
- Site.showProgressProcessing();
- ContentServiceAsync server = ContentService.App.getInstance();
- StateDTO currentState = session.getCurrentState();
- server.setLanguage(session.getUserHash(), currentState.getGroup().getShortName(), currentState.getDocumentId(),
- languageCode, new AsyncCallbackSimple<I18nLanguageDTO>() {
- public void onSuccess(final I18nLanguageDTO lang) {
- Site.hideProgress();
- workspace.getContentSubTitleComponent().setContentLanguage(lang.getEnglishName());
- }
- });
+ Site.showProgressProcessing();
+ final ContentServiceAsync server = ContentService.App.getInstance();
+ final StateDTO currentState = session.getCurrentState();
+ server.setLanguage(session.getUserHash(), currentState.getGroup().getShortName(), currentState.getDocumentId(),
+ languageCode, new AsyncCallbackSimple<I18nLanguageDTO>() {
+ public void onSuccess(final I18nLanguageDTO lang) {
+ Site.hideProgress();
+ // FIXME
+ // workspace.getContentSubTitleComponent().setContentLanguage(lang.getEnglishName());
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetPublishedOnAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetPublishedOnAction.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetPublishedOnAction.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -28,32 +28,30 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
public class ContentSetPublishedOnAction implements Action<Date> {
- private final Workspace workspace;
private final Session session;
- public ContentSetPublishedOnAction(final Session session, final Workspace workspace) {
- this.session = session;
- this.workspace = workspace;
+ public ContentSetPublishedOnAction(final Session session) {
+ this.session = session;
}
public void execute(final Date value) {
- onContentsetPublishedOn(value);
+ onContentsetPublishedOn(value);
}
private void onContentsetPublishedOn(final Date publishedOn) {
- Site.showProgressProcessing();
- ContentServiceAsync server = ContentService.App.getInstance();
- StateDTO currentState = session.getCurrentState();
- server.setPublishedOn(session.getUserHash(), currentState.getGroup().getShortName(), currentState
- .getDocumentId(), publishedOn, new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- Site.hideProgress();
- workspace.getContentTitleComponent().setContentDate(publishedOn);
- }
- });
+ Site.showProgressProcessing();
+ final ContentServiceAsync server = ContentService.App.getInstance();
+ final StateDTO currentState = session.getCurrentState();
+ server.setPublishedOn(session.getUserHash(), currentState.getGroup().getShortName(), currentState
+ .getDocumentId(), publishedOn, new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ Site.hideProgress();
+ // FIXME
+ // workspace.getContentTitleComponent().setContentDate(publishedOn);
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,14 +21,19 @@
package org.ourproject.kune.docs.client.cnt;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-public interface DocumentContent extends WorkspaceComponent {
+import com.calclab.suco.client.signal.Slot0;
- void setContent(StateDTO content);
+public interface DocumentContent {
+ void onCancel(Slot0 slot);
+
+ void onEdit(Slot0 slot);
+
void onSaved();
void onSaveFailed();
+ void setContent(StateDTO content);
+
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,81 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.docs.client.cnt;
-
-import org.ourproject.kune.docs.client.cnt.folder.FolderEditor;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControl;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
-import org.ourproject.kune.workspace.client.WorkspaceFactory;
-import org.ourproject.kune.workspace.client.editor.TextEditor;
-
-class DocumentContentComponents {
- private DocumentReader reader;
- private TextEditor editor;
- private final DocumentContentPresenter documentContentPresenter;
- private FolderViewer folderViewer;
- private FolderEditor folderEditor;
- private DocumentReaderControl readerControl;
- private final DocumentFactory documentFactory;
-
- public DocumentContentComponents(final DocumentFactory documentFactory,
- final DocumentContentPresenter documentContentPresenter) {
- this.documentFactory = documentFactory;
- this.documentContentPresenter = documentContentPresenter;
- }
-
- public TextEditor getDocumentEditor() {
- if (editor == null) {
- editor = WorkspaceFactory.createDocumentEditor(documentContentPresenter);
- }
- return editor;
- }
-
- public DocumentReader getDocumentReader() {
- if (reader == null) {
- reader = documentFactory.createDocumentReader(documentContentPresenter);
- }
- return reader;
- }
-
- public DocumentReaderControl getDocumentReaderControl() {
- if (readerControl == null) {
- readerControl = documentFactory.createDocumentReaderControl(documentContentPresenter);
- }
- return readerControl;
- }
-
- public FolderEditor getFolderEditor() {
- if (folderEditor == null) {
- folderEditor = documentFactory.createFolderEditor();
- }
- return folderEditor;
- }
-
- public FolderViewer getFolderViewer() {
- if (folderViewer == null) {
- folderViewer = documentFactory.createFolderViewer();
- }
- return folderViewer;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentListener.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentListener.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,27 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.docs.client.cnt;
-
-public interface DocumentContentListener {
- void onEdit();
-
- void onCancel();
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -25,61 +25,66 @@
import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControl;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderListener;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
-import org.ourproject.kune.platf.client.PlatformEvents;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.SaveDocumentActionParams;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.editor.TextEditorListener;
-public class DocumentContentPresenter implements DocumentContent, DocumentReaderListener, TextEditorListener {
+import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.signal.Signal0;
+import com.calclab.suco.client.signal.Slot0;
+
+public class DocumentContentPresenter implements DocumentContent, TextEditorListener {
private final WorkspaceDeckView view;
- private final DocumentContentComponents components;
private StateDTO content;
- private final DocumentContentListener listener;
- private final DocumentReader reader;
- private final DocumentReaderControl readerControl;
private final Session session;
private final RateIt rateIt;
+ private final Provider<DocumentReaderControl> docReaderControlProvider;
+ private final Provider<DocumentReader> docReaderProvider;
+ private final Provider<FolderEditor> folderEditorProvider;
+ private final Provider<TextEditor> textEditorProvider;
+ private final Provider<FolderViewer> folderViewerProvider;
+ private final Signal0 onEdit;
+ private final Signal0 onCancel;
- public DocumentContentPresenter(final DocumentFactory documentFactory, final DocumentContentListener listener,
- final WorkspaceDeckView view, final Session session, final RateIt rateIt) {
- this.listener = listener;
+ public DocumentContentPresenter(final WorkspaceDeckView view, final Session session, final RateIt rateIt,
+ final Provider<DocumentReader> docReaderProvider,
+ final Provider<DocumentReaderControl> docReaderControlProvider,
+ final Provider<TextEditor> textEditorProvider, final Provider<FolderViewer> folderViewerProvider,
+ final Provider<FolderEditor> folderEditorProvider) {
this.view = view;
this.session = session;
this.rateIt = rateIt;
- this.components = new DocumentContentComponents(documentFactory, this);
- reader = components.getDocumentReader();
- readerControl = components.getDocumentReaderControl();
+ this.docReaderProvider = docReaderProvider;
+ this.docReaderControlProvider = docReaderControlProvider;
+ this.textEditorProvider = textEditorProvider;
+ this.folderViewerProvider = folderViewerProvider;
+ this.folderEditorProvider = folderEditorProvider;
+ this.onEdit = new Signal0("onEdit");
+ this.onCancel = new Signal0("onCancel");
}
- public void attach() {
- }
-
- public void detach() {
- }
-
public View getView() {
return view;
}
public void onCancel() {
showContent();
- listener.onCancel();
+ onCancel.fire();
// Re-enable rateIt widget
rateIt.setVisible(true);
}
+ public void onCancel(final Slot0 slot) {
+ onCancel.add(slot);
+ }
+
public void onDelete() {
DefaultDispatcher.getInstance().fire(DocsEvents.DEL_CONTENT, content.getDocumentId());
}
@@ -90,38 +95,36 @@
if (content.hasDocument()) {
// Don't permit rate content while your are editing
rateIt.setVisible(false);
- final TextEditor editor = components.getDocumentEditor();
+ final TextEditor editor = textEditorProvider.get();
editor.setContent(content.getContent());
view.show(editor.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
- DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT, editor.getToolBar()));
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
} else {
- final FolderEditor editor = components.getFolderEditor();
+ final FolderEditor editor = folderEditorProvider.get();
editor.setFolder(content.getFolder());
view.show(editor.getView());
}
- listener.onEdit();
+ onEdit.fire();
}
});
}
+ public void onEdit(final Slot0 slot) {
+ onEdit.add(slot);
+ }
+
public void onSave(final String text) {
content.setContent(text);
DefaultDispatcher.getInstance().fire(DocsEvents.SAVE_DOCUMENT, new SaveDocumentActionParams(content, this));
// Re-enable rateIt widget
rateIt.setVisible(true);
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
}
public void onSaved() {
- components.getDocumentEditor().onSaved();
+ textEditorProvider.get().onSaved();
}
public void onSaveFailed() {
- components.getDocumentEditor().onSaveFailed();
+ textEditorProvider.get().onSaveFailed();
}
public void onTranslate() {
@@ -134,19 +137,14 @@
private void showContent() {
if (content.hasDocument()) {
- reader.showDocument(content.getContent());
- components.getDocumentEditor().reset();
- readerControl.setRights(content.getContentRights());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
- DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT, readerControl.getView()));
- view.show(reader.getView());
+ docReaderProvider.get().showDocument(content.getContent());
+ textEditorProvider.get().reset();
+ docReaderControlProvider.get().setRights(content.getContentRights());
+ docReaderControlProvider.get().show();
+ docReaderProvider.get().show();
} else {
- final FolderViewer viewer = components.getFolderViewer();
+ final FolderViewer viewer = folderViewerProvider.get();
viewer.setFolder(content.getFolder());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
view.show(viewer.getView());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui/FolderViewerPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -22,11 +22,13 @@
import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.ui.DefaultContentPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-public class FolderViewerPanel extends DefaultContentPanel implements FolderViewerView {
+import com.google.gwt.user.client.ui.Label;
- public FolderViewerPanel() {
- setContent("Folder properties, translations ..." + Site.IN_DEVELOPMENT);
+public class FolderViewerPanel implements FolderViewerView {
+
+ public FolderViewerPanel(final WorkspaceSkeleton ws) {
+ ws.getEntityWorkspace().setContent(new Label("Folder properties, translations ..." + Site.IN_DEVELOPMENT));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -24,7 +24,9 @@
public interface DocumentReader {
+ View getView();
+
+ void show();
+
void showDocument(String text);
-
- View getView();
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControl.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControl.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -25,8 +25,10 @@
public interface DocumentReaderControl {
+ View getView();
+
void setRights(AccessRightsDTO accessRights);
- View getView();
+ void show();
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -24,19 +24,32 @@
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
public class DocumentReaderControlPresenter implements DocumentReaderControl {
- private final DocumentReaderControlView view;
+ private DocumentReaderControlView view;
- public DocumentReaderControlPresenter(final DocumentReaderControlView view) {
- this.view = view;
+ public View getView() {
+ return view;
}
+ public void init(final DocumentReaderControlView view) {
+ this.view = view;
+ }
+
+ public void onDelete() {
+ }
+
+ public void onEdit() {
+ }
+
+ public void onTranslate() {
+ }
+
public void setRights(final AccessRightsDTO accessRights) {
- view.setEditEnabled(accessRights.isEditable());
- view.setDeleteEnabled(accessRights.isAdministrable());
- view.setTranslateEnabled(accessRights.isEditable());
+ view.setEditEnabled(accessRights.isEditable());
+ view.setDeleteEnabled(accessRights.isAdministrable());
+ view.setTranslateEnabled(accessRights.isEditable());
}
- public View getView() {
- return view;
+ public void show() {
+ view.show();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlView.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderControlView.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -24,10 +24,12 @@
public interface DocumentReaderControlView extends View {
+ public void setDeleteEnabled(boolean isEnabled);
+
public void setEditEnabled(boolean isEnabled);
- public void setDeleteEnabled(boolean isEnabled);
-
public void setTranslateEnabled(boolean isEnabled);
+ public void show();
+
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderListener.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderListener.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.docs.client.cnt.reader;
-
-public interface DocumentReaderListener {
-
- void onEdit();
-
- void onDelete();
-
- void onTranslate();
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -26,14 +26,17 @@
private final DocumentReaderView view;
public DocumentReaderPresenter(final DocumentReaderView view) {
- this.view = view;
+ this.view = view;
}
- public void showDocument(final String text) {
- view.setContent(text);
+ public View getView() {
+ return view;
}
- public View getView() {
- return view;
+ public void show() {
}
+
+ public void showDocument(final String text) {
+ view.setContent(text);
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -20,10 +20,10 @@
package org.ourproject.kune.docs.client.cnt.reader.ui;
+import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlPresenter;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlView;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderListener;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.CustomPushButton;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.ClickListener;
@@ -35,25 +35,25 @@
private final CustomPushButton deleteBtn;
private final CustomPushButton translateBtn;
- public DocumentReaderControlPanel(final DocumentReaderListener listener, final I18nTranslationService i18n,
- final WorkspaceSkeleton ws) {
+ public DocumentReaderControlPanel(final DocumentReaderControlPresenter presenter,
+ final I18nUITranslationService i18n, final WorkspaceSkeleton ws) {
editBtn = new CustomPushButton(i18n.tWithNT("Edit", "used in button"), new ClickListener() {
public void onClick(final Widget sender) {
- listener.onEdit();
+ presenter.onEdit();
editBtn.removeStyleDependentName("up-hovering");
}
});
deleteBtn = new CustomPushButton(i18n.tWithNT("Delete", "used in button"), new ClickListener() {
public void onClick(final Widget sender) {
- listener.onDelete();
+ presenter.onDelete();
deleteBtn.removeStyleDependentName("up-hovering");
}
});
translateBtn = new CustomPushButton(i18n.tWithNT("Translate", "used in button"), new ClickListener() {
public void onClick(final Widget sender) {
- listener.onTranslate();
+ presenter.onTranslate();
translateBtn.removeStyleDependentName("up-hovering");
ws.showAlertMessage(i18n.t("Alert"), i18n.t("Sorry, this functionality is currently in development"));
}
@@ -81,4 +81,8 @@
translateBtn.setVisible(isEnabled);
}
+ public void show() {
+
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,11 +21,19 @@
package org.ourproject.kune.docs.client.cnt.reader.ui;
import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderView;
-import org.ourproject.kune.workspace.client.workspace.ui.DefaultContentPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-public class DocumentReaderPanel extends DefaultContentPanel implements DocumentReaderView {
+import com.google.gwt.user.client.ui.HTML;
- public DocumentReaderPanel() {
- setContent("This is the content");
+public class DocumentReaderPanel implements DocumentReaderView {
+
+ private final WorkspaceSkeleton ws;
+
+ public DocumentReaderPanel(final WorkspaceSkeleton ws) {
+ this.ws = ws;
}
+
+ public void setContent(final String content) {
+ ws.getEntityWorkspace().setContent(new HTML(content));
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContext.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,9 +21,9 @@
package org.ourproject.kune.docs.client.ctx;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-public interface DocumentContext extends WorkspaceComponent {
+public interface DocumentContext {
+
void setContext(StateDTO state);
void showAdmin();
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextComponents.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextComponents.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.docs.client.ctx;
-
-import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
-import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
-
-class DocumentContextComponents {
-
- private FolderContext folderContext;
- private AdminContext adminContext;
- private final DocumentFactory documentFactory;
-
- public DocumentContextComponents(final DocumentFactory documentFactory, final DocumentContextPresenter listener) {
- this.documentFactory = documentFactory;
- }
-
- public AdminContext getAdminContext() {
- if (adminContext == null) {
- adminContext = documentFactory.createAdminContext();
- }
- return adminContext;
- }
-
- public FolderContext getFolderContext() {
- if (folderContext == null) {
- folderContext = documentFactory.createFolderContext();
- }
- return folderContext;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -22,47 +22,43 @@
import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
-import org.ourproject.kune.docs.client.ui.DocumentFactory;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
+import com.calclab.suco.client.container.Provider;
+
public class DocumentContextPresenter implements DocumentContext {
private final WorkspaceDeckView view;
- private final DocumentContextComponents components;
+ private final Provider<FolderContext> folderContextProvider;
+ private final Provider<AdminContext> adminContextProvider;
- public DocumentContextPresenter(final DocumentFactory documentFactory, final WorkspaceDeckView view) {
- this.view = view;
- this.components = new DocumentContextComponents(documentFactory, this);
+ public DocumentContextPresenter(final WorkspaceDeckView view, final Provider<FolderContext> folderContexProvider,
+ final Provider<AdminContext> adminContextProvider) {
+ this.view = view;
+ this.folderContextProvider = folderContexProvider;
+ this.adminContextProvider = adminContextProvider;
}
- public void attach() {
- }
-
- public void detach() {
- }
-
public View getView() {
- return view;
+ return view;
}
public void setContext(final StateDTO content) {
- StateToken state = content.getStateToken();
- FolderContext folderContext = components.getFolderContext();
- folderContext.setContainer(state, content.getFolder(), content.getFolderRights());
- AdminContext adminContext = components.getAdminContext();
- adminContext.setState(content);
- view.show(folderContext.getView());
+ final StateToken state = content.getStateToken();
+ folderContextProvider.get().setContainer(state, content.getFolder(), content.getFolderRights());
+ adminContextProvider.get().setState(content);
+ view.show(folderContextProvider.get().getView());
}
public void showAdmin() {
- AdminContext adminContext = components.getAdminContext();
- view.show(adminContext.getView());
+ final AdminContext adminContext = adminContextProvider.get();
+ view.show(adminContext.getView());
}
public void showFolders() {
- FolderContext folderContext = components.getFolderContext();
- view.show(folderContext.getView());
+ final FolderContext folderContext = folderContextProvider.get();
+ view.show(folderContext.getView());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -36,7 +36,7 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
+import org.ourproject.kune.workspace.client.tags.TagsSummary;
import com.calclab.suco.client.container.Provider;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -29,15 +29,13 @@
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
import com.google.gwt.user.client.ui.VerticalPanel;
-import com.gwtext.client.widgets.form.FormPanel;
public class AdminContextPanel extends VerticalPanel implements AdminContextView {
- private static final Images IMG = Images.App.getInstance();
+ // private static final Images IMG = Images.App.getInstance();
- private static final int FORMS_WIDTH = 145;
+ // private static final int FORMS_WIDTH = 145;
// private final IndexedStackPanelWithSubItems options;
// private final AdminContextPresenter presenter;
@@ -195,23 +193,24 @@
// tagsField.setValue(tags);
}
- private void addComponent(final String header, final String headerTitle, final VerticalPanel panel) {
- // panel.addStyleName("kune-AdminContextPanel-inner-wrap");
- // final VerticalPanel vp = options.addStackItem(header, headerTitle,
- // false);
- // vp.setStyleName("kune-AdminContextPanel-inner");
- // vp.add(panel);
- // vp.setCellWidth(panel, "100%");
- // vp.setWidth("100%");
- }
+ // private void addComponent(final String header, final String headerTitle,
+ // final VerticalPanel panel) {
+ // panel.addStyleName("kune-AdminContextPanel-inner-wrap");
+ // final VerticalPanel vp = options.addStackItem(header, headerTitle,
+ // false);
+ // vp.setStyleName("kune-AdminContextPanel-inner");
+ // vp.add(panel);
+ // vp.setCellWidth(panel, "100%");
+ // vp.setWidth("100%");
+ // }
- private FormPanel createDefaultForm() {
- final FormPanel form = new FormPanel();
- form.setHideLabels(true);
- form.setWidth(FORMS_WIDTH);
- form.setBorder(false);
- return form;
- }
+ // private FormPanel createDefaultForm() {
+ // final FormPanel form = new FormPanel();
+ // form.setHideLabels(true);
+ // form.setWidth(FORMS_WIDTH);
+ // form.setBorder(false);
+ // return form;
+ // }
// private VerticalPanel createPublicationComponent() {
// // final FormPanel form = createDefaultForm();
@@ -252,8 +251,8 @@
// return vp;
// }
- private void removeComponent(final String header) {
- // options.removeStackItem(header);
- }
+ // private void removeComponent(final String header) {
+ // options.removeStackItem(header);
+ // }
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,127 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.docs.client.ui;
-
-import org.ourproject.kune.docs.client.cnt.DocumentContent;
-import org.ourproject.kune.docs.client.cnt.DocumentContentListener;
-import org.ourproject.kune.docs.client.cnt.DocumentContentPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.FolderEditor;
-import org.ourproject.kune.docs.client.cnt.folder.FolderEditorPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.ui.FolderEditorPanel;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.ui.FolderViewerPanel;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReader;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControl;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlPresenter;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderControlView;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderListener;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderPresenter;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentReaderView;
-import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderControlPanel;
-import org.ourproject.kune.docs.client.cnt.reader.ui.DocumentReaderPanel;
-import org.ourproject.kune.docs.client.ctx.DocumentContext;
-import org.ourproject.kune.docs.client.ctx.DocumentContextPresenter;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContext;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContextPresenter;
-import org.ourproject.kune.docs.client.ctx.admin.AdminContextView;
-import org.ourproject.kune.docs.client.ctx.admin.ui.AdminContextPanel;
-import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
-import org.ourproject.kune.docs.client.ctx.folder.FolderContextPresenter;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.ui.rate.RateIt;
-import org.ourproject.kune.workspace.client.WorkspaceFactory;
-import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
-
-import com.calclab.suco.client.container.Provider;
-
-public class DocumentFactory {
-
- private final I18nTranslationService i18n;
- private final Session session;
- private final Provider<TagsSummary> tagsSummaryProvider;
- private final WorkspaceSkeleton ws;
- private final RateIt rateIt;
-
- public DocumentFactory(final I18nTranslationService i18n, final Session session,
- final Provider<TagsSummary> tagsSummaryProvider, final WorkspaceSkeleton ws, final RateIt rateIt) {
- this.i18n = i18n;
- this.session = session;
- this.tagsSummaryProvider = tagsSummaryProvider;
- this.ws = ws;
- this.rateIt = rateIt;
- }
-
- public AdminContext createAdminContext() {
- final AdminContextPresenter presenter = new AdminContextPresenter(session, tagsSummaryProvider);
- final AdminContextView view = new AdminContextPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
- public DocumentContent createDocumentContent(final DocumentContentListener listener) {
- final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final DocumentContentPresenter presenter = new DocumentContentPresenter(this, listener, panel, session, rateIt);
- return presenter;
- }
-
- public DocumentContext createDocumentContext() {
- final WorkspaceDeckPanel view = new WorkspaceDeckPanel();
- final DocumentContextPresenter presenter = new DocumentContextPresenter(this, view);
- return presenter;
- }
-
- public DocumentReader createDocumentReader(final DocumentReaderListener listener) {
- final DocumentReaderView view = new DocumentReaderPanel();
- final DocumentReaderPresenter presenter = new DocumentReaderPresenter(view);
- return presenter;
- }
-
- public DocumentReaderControl createDocumentReaderControl(final DocumentReaderListener listener) {
- final DocumentReaderControlView view = new DocumentReaderControlPanel(listener, i18n, ws);
- final DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter(view);
- return presenter;
- }
-
- public FolderContext createFolderContext() {
- final ContextItems contextItems = WorkspaceFactory.createContextItems();
- final FolderContextPresenter presenter = new FolderContextPresenter(contextItems, i18n);
- return presenter;
- }
-
- public FolderEditor createFolderEditor() {
- final FolderEditorPanel view = new FolderEditorPanel();
- final FolderEditorPresenter presenter = new FolderEditorPresenter(view);
- return presenter;
- }
-
- public FolderViewer createFolderViewer() {
- final FolderViewerView view = new FolderViewerPanel();
- final FolderViewerPresenter presenter = new FolderViewerPresenter(view);
- return presenter;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/Component.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/Component.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/Component.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client;
-
-public interface Component {
- View getView();
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -26,7 +26,6 @@
import org.ourproject.kune.platf.client.dispatch.ActionEvent;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ClientTool;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
import com.calclab.suco.client.signal.Slot0;
@@ -34,8 +33,6 @@
ClientTool getTool(String toolName);
- Workspace getWorkspace();
-
void init(StateManager stateManager, HashMap<String, ClientTool> tools);
void onApplicationStart(Slot0 slot);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -38,7 +38,6 @@
import org.ourproject.kune.platf.client.utils.PrefetchUtilities;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.signal.Signal0;
@@ -47,6 +46,7 @@
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.WindowCloseListener;
import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.ui.RootPanel;
public class ApplicationDefault implements Application {
// private final Workspace workspace;
@@ -58,8 +58,6 @@
public ApplicationDefault(final Session session, final KuneErrorHandler errorHandler, final WorkspaceSkeleton ws) {
this.session = session;
- // workspace = WorkspaceFactory.createWorkspace(session,
- // extensionPointManager, i18n, errorHandler);
tools = new HashMap<String, ClientTool>();
this.onApplicationStart = new Signal0("onApplicationStart");
this.onApplicationStop = new Signal0("onApplicationStop");
@@ -78,11 +76,6 @@
return tools.get(toolName);
}
- @Deprecated
- public Workspace getWorkspace() {
- return null;
- }
-
public void init(final StateManager stateManager, final HashMap<String, ClientTool> tools) {
this.stateManager = stateManager;
this.tools = tools;
@@ -125,6 +118,7 @@
final SiteServiceAsync server = SiteService.App.getInstance();
server.getInitData(session.getUserHash(), new AsyncCallback<InitDataDTO>() {
public void onFailure(final Throwable error) {
+ RootPanel.get("kuneinitialcurtain").setVisible(false);
Site.error("Error fetching initial data");
Log.debug(error.getMessage());
}
@@ -134,6 +128,7 @@
session.setInitData(initData);
session.setCurrentUserInfo(initData.getUserInfo());
stateManager.reload();
+ RootPanel.get("kuneinitialcurtain").setVisible(false);
}
private void checkChatDomain(final String chatDomain) {
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidget.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidget.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidget.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,12 +0,0 @@
-package org.ourproject.kune.platf.client.extend;
-
-
-public interface ExtensibleWidget {
-
- public void attach(ExtensibleWidgetChild child);
-
- public void detach(ExtensibleWidgetChild child);
-
- public void detachAll(String id);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetChild.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetChild.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetChild.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,56 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.extend;
-
-import org.ourproject.kune.platf.client.View;
-
-public class ExtensibleWidgetChild {
- private final String parentId;
- private final View view;
-
- /**
- *
- * @param parentId
- * id of the extensible widget
- * @param view
- * view (a widget) to attach/detach to the extensible widget
- */
- public ExtensibleWidgetChild(final String parentId, final View view) {
- this.parentId = parentId;
- this.view = view;
- }
-
- /**
- *
- * @return the id of the extensible widget
- */
- public String getParentId() {
- return parentId;
- }
-
- /**
- *
- * @return the view to attach/dettach to the extensible widget
- */
- public View getView() {
- return view;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetId.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetId.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetId.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,33 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.extend;
-
-public interface ExtensibleWidgetId {
- // Not yet implemented/used EW:
- // public static final String CONTENT_TOOLBAR_RIGHT =
- // "ws.entity.content.toolbar.right";
- // public static final String CONTENT_BOTTOM_TOOLBAR_RIGHT =
- // "ws.entity.content.bottomtb.right";
- // public static final String CONTENT_BOTTOM_TOOLBAR_LEFT =
- // "ws.entity.content.bottomtb.left";
- public static final String CONTENT_TOOLBAR_LEFT = "ws.entity.content.toolbar.left";
- public static final String CONTENT_BOTTOM_ICONBAR = "ws.site.bottom.iconbar";
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetsManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetsManager.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/extend/ExtensibleWidgetsManager.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,72 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.extend;
-
-import java.util.HashMap;
-
-public class ExtensibleWidgetsManager {
-
- private final HashMap<String, ExtensibleWidget> extWidgets;
-
- public ExtensibleWidgetsManager() {
- extWidgets = new HashMap<String, ExtensibleWidget>();
- }
-
- public void registerExtensibleWidget(final String id, final ExtensibleWidget extWidget) {
- extWidgets.put(id, extWidget);
- }
-
- public void attachToExtensible(final ExtensibleWidgetChild child) {
- ExtensibleWidget extWidget = getExtensible(child.getParentId());
- if (extWidget != null) {
- extWidget.attach(child);
- }
- }
-
- public void detachFromExtensible(final ExtensibleWidgetChild child) {
- ExtensibleWidget extWidget = getExtensible(child.getParentId());
- if (extWidget != null) {
- extWidget.detach(child);
- }
- }
-
- public void registerExtensibleWidgets(final HashMap<String, ExtensibleWidget> extWidgets) {
- this.extWidgets.putAll(extWidgets);
- }
-
- private ExtensibleWidget getExtensible(final String id) {
- ExtensibleWidget extWidget = this.extWidgets.get(id);
- return extWidget;
- }
-
- /**
- *
- * Detach all widtgets from a extensible widget
- *
- * @param id
- * id of the extensible widget
- */
- public void detachAll(final String id) {
- ExtensibleWidget extWidget = getExtensible(id);
- if (extWidget != null) {
- extWidget.detachAll(id);
- }
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -32,23 +32,35 @@
import org.ourproject.kune.platf.client.ui.rate.RateItPresenter;
import org.ourproject.kune.platf.client.ui.rate.RatePanel;
import org.ourproject.kune.platf.client.ui.rate.RatePresenter;
-import org.ourproject.kune.workspace.client.WorkspaceClientModule;
+import org.ourproject.kune.workspace.client.editor.TextEditor;
+import org.ourproject.kune.workspace.client.editor.TextEditorPanel;
+import org.ourproject.kune.workspace.client.editor.TextEditorPresenter;
import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPresenter;
import org.ourproject.kune.workspace.client.i18n.I18nTranslatorView;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelector;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPresenter;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelectorView;
import org.ourproject.kune.workspace.client.i18n.ui.I18nTranslatorPanel;
+import org.ourproject.kune.workspace.client.i18n.ui.LanguageSelectorPanel;
import org.ourproject.kune.workspace.client.licensechoose.LicenseChoose;
import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePresenter;
import org.ourproject.kune.workspace.client.newgroup.NewGroup;
+import org.ourproject.kune.workspace.client.newgroup.NewGroupPanel;
import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
-import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
-import org.ourproject.kune.workspace.client.presence.ui.GroupSummaryPanel;
+import org.ourproject.kune.workspace.client.search.EntityLiveSearcherView;
+import org.ourproject.kune.workspace.client.search.GroupLiveSearchPanel;
+import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
+import org.ourproject.kune.workspace.client.search.GroupLiveSearcherPresenter;
import org.ourproject.kune.workspace.client.search.SiteSearcher;
import org.ourproject.kune.workspace.client.search.SiteSearcherPanel;
import org.ourproject.kune.workspace.client.search.SiteSearcherPresenter;
import org.ourproject.kune.workspace.client.search.SiteSearcherView;
+import org.ourproject.kune.workspace.client.search.UserLiveSearcher;
+import org.ourproject.kune.workspace.client.search.UserLiveSearcherPanel;
+import org.ourproject.kune.workspace.client.search.UserLiveSearcherPresenter;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.SiteToken;
import org.ourproject.kune.workspace.client.sitebar.login.SignIn;
@@ -60,21 +72,27 @@
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessageView;
import org.ourproject.kune.workspace.client.sitebar.rpc.UserService;
import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
-import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherView;
-import org.ourproject.kune.workspace.client.socialnet.GroupLiveSearcherPresenter;
+import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPanel;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenter;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryView;
+import org.ourproject.kune.workspace.client.socialnet.ParticipationSummary;
+import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPanel;
import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPresenter;
import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryView;
-import org.ourproject.kune.workspace.client.socialnet.UserLiveSearcherPresenter;
-import org.ourproject.kune.workspace.client.socialnet.ui.GroupLiveSearchPanel;
-import org.ourproject.kune.workspace.client.socialnet.ui.ParticipationSummaryPanel;
-import org.ourproject.kune.workspace.client.socialnet.ui.UserLiveSearcherPanel;
+import org.ourproject.kune.workspace.client.summary.GroupSummary;
+import org.ourproject.kune.workspace.client.summary.GroupSummaryPanel;
import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter;
import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
+import org.ourproject.kune.workspace.client.tags.TagsSummary;
import org.ourproject.kune.workspace.client.tags.TagsSummaryPanel;
import org.ourproject.kune.workspace.client.tags.TagsSummaryPresenter;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPanel;
+import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.entitylogo.EntityLogo;
+import org.ourproject.kune.workspace.client.ui.newtmp.entitylogo.EntityLogoPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.entitylogo.EntityLogoPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
@@ -111,15 +129,6 @@
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupLiveSearcher;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
-import org.ourproject.kune.workspace.client.workspace.GroupSummary;
-import org.ourproject.kune.workspace.client.workspace.ParticipationSummary;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
-import org.ourproject.kune.workspace.client.workspace.UserLiveSearcher;
-import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
-import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel;
-import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPresenter;
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.calclab.suco.client.container.Container;
@@ -377,7 +386,7 @@
public I18nTranslator create() {
final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter($(Session.class),
$(I18nServiceAsync.class), i18n);
- final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n);
+ final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n, $(LanguageSelector.class), ws);
presenter.init(view);
return presenter;
}
@@ -522,7 +531,7 @@
register(SingletonScope.class, new Factory<TagsSummary>(TagsSummary.class) {
public TagsSummary create() {
- final TagsSummaryPresenter presenter = new TagsSummaryPresenter($p(Session.class),
+ final TagsSummaryPresenter presenter = new TagsSummaryPresenter($(Session.class),
$p(SiteSearcher.class), $(StateManager.class), $(WsThemePresenter.class));
final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, i18n, ws);
presenter.init(panel);
@@ -558,6 +567,33 @@
}
});
+ register(SingletonScope.class, new Factory<TextEditor>(TextEditor.class) {
+ public TextEditor create() {
+ final TextEditorPresenter presenter = new TextEditorPresenter(null, true);
+ final TextEditorPanel panel = new TextEditorPanel(presenter, i18n);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<LanguageSelector>(LanguageSelector.class) {
+ public LanguageSelector create() {
+ final LanguageSelectorPresenter presenter = new LanguageSelectorPresenter($(Session.class));
+ final LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ContextItems>(ContextItems.class) {
+ public ContextItems create() {
+ final ContextItemsPresenter presenter = new ContextItemsPresenter(i18n, $(StateManager.class));
+ final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n, $(StateManager.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
load(new EmiteUIModule(), new DocumentClientNewModule(), new ChatClientNewModule());
$(SitePublicSpaceLink.class);
@@ -569,6 +605,11 @@
$(SiteSearch.class);
$(SiteLogo.class);
+ $(GroupMembersSummary.class);
+ $(ParticipationSummary.class);
+ $(TagsSummary.class);
+ $(GroupSummary.class);
+
$(EntityLogo.class);
$(EntityTitlePresenter.class);
$(EntitySubTitlePresenter.class);
@@ -577,11 +618,6 @@
$(RateIt.class);
$(RatePresenter.class);
- $(GroupMembersSummary.class);
- $(ParticipationSummary.class);
- $(TagsSummary.class);
- $(GroupSummary.class);
-
// Register of tokens like "signin", "newgroup", "translate" etcetera
$(StateManager.class).addSiteToken(SiteToken.signin.toString(), new Slot<StateToken>() {
public void onEvent(final StateToken previousStateToken) {
@@ -596,11 +632,8 @@
});
final KunePlatform platform = $(KunePlatform.class);
- platform.install(new WorkspaceClientModule($(Session.class), $(StateManager.class), $(Application.class)
- .getWorkspace(), i18n));
$(Application.class).init($(StateManager.class), platform.getIndexedTools());
$(Application.class).subscribeActions(platform.getActions());
- // $(Application.class).getWorkspace().attachTools(platform.getTools().iterator());
$(Application.class).start();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -21,14 +21,9 @@
package org.ourproject.kune.platf.client.tool;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
public interface ClientTool {
- WorkspaceComponent getContent();
-
- WorkspaceComponent getContext();
-
String getName();
void setContent(StateDTO state);
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/BottomTrayIcon.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/BottomTrayIcon.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/BottomTrayIcon.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,43 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import org.ourproject.kune.platf.client.View;
-
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.MenuBar;
-import com.google.gwt.user.client.ui.MenuItem;
-
-public class BottomTrayIcon extends MenuBar implements View {
-
- public BottomTrayIcon(final String title) {
- super(true);
- KuneUiUtils.setQuickTip(this, title);
- super.addStyleDependentName("kune-IconBottomMenu-offset");
- super.addStyleName("kune-Margin-Medium-r");
- super.setStyleName("kune-IconBottomPanel");
- }
-
- public MenuItem addMainButton(final AbstractImagePrototype icon, final Command cmd) {
- return super.addItem(icon.getHTML(), true, cmd);
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -66,9 +66,9 @@
public void add(final Panel panel, final Widget widget) {
panel.add(widget);
if (panel.isRendered()) {
- mainPanel.doLayout(false);
- // panel.syncSize();
- // panel.doLayout();
+ panel.syncSize();
+ panel.doLayout();
+ doLayoutIfNeeded();
}
// doLayoutIfNeeded();
}
@@ -111,12 +111,6 @@
}
}
- public void doLayoutIfNeeded(final boolean includeChilds) {
- if (mainPanel.isRendered()) {
- mainPanel.doLayout(!includeChilds);
- }
- }
-
public Panel getPanel() {
return mainPanel;
}
@@ -129,11 +123,6 @@
mainPanel.setBorder(border);
}
- @Deprecated
- public void setCls(final String style) {
- mainPanel.setCls(style);
- }
-
public void setPanel(final Panel panel, final Widget widget) {
panel.clear();
add(panel, widget);
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -0,0 +1,34 @@
+package org.ourproject.kune.platf.client.ui;
+
+import com.calclab.suco.client.signal.Signal;
+import com.calclab.suco.client.signal.Slot;
+
+public class MenuItem<T> {
+
+ final String icon;
+ final String title;
+ private final Signal<T> onClick;
+
+ public MenuItem(final String icon, final String title, final Slot<T> slot) {
+ this.icon = icon;
+ this.title = title;
+ this.onClick = new Signal<T>("onClick");
+ onClick(slot);
+ }
+
+ public void fire(final T id) {
+ onClick.fire(id);
+ }
+
+ public String getIcon() {
+ return icon;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void onClick(final Slot<T> slot) {
+ onClick.add(slot);
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -19,12 +19,11 @@
*/
package org.ourproject.kune.platf.client.ui;
-import org.ourproject.kune.platf.client.Component;
import org.ourproject.kune.platf.client.View;
import com.google.gwt.user.client.ui.Label;
-public class UnknowComponent extends Label implements View, Component {
+public class UnknowComponent extends Label implements View {
public static final UnknowComponent instance = new UnknowComponent();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenu.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -23,6 +23,8 @@
import java.util.Iterator;
+import org.ourproject.kune.platf.client.ui.MenuItem;
+
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.gwtext.client.core.EventObject;
@@ -47,7 +49,7 @@
menu = new Menu();
}
- public void addMenuItem(final GridMenuItem<T> menuItem) {
+ public void addMenuItem(final MenuItem<T> menuItem) {
final Item item = new Item(menuItem.getTitle());
item.setIcon(menuItem.getIcon());
menu.addItem(item);
@@ -65,7 +67,7 @@
@SuppressWarnings("unchecked")
public void addMenuItemList(final GridMenuItemCollection list) {
for (final Iterator iterator = list.iterator(); iterator.hasNext();) {
- final GridMenuItem item = (GridMenuItem) iterator.next();
+ final MenuItem item = (MenuItem) iterator.next();
addMenuItem(item);
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItem.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItem.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -1,34 +0,0 @@
-package org.ourproject.kune.platf.client.ui.gridmenu;
-
-import com.calclab.suco.client.signal.Signal;
-import com.calclab.suco.client.signal.Slot;
-
-public class GridMenuItem<T> {
-
- final String icon;
- final String title;
- private final Signal<T> onClick;
-
- public GridMenuItem(final String icon, final String title, final Slot<T> slot) {
- this.icon = icon;
- this.title = title;
- this.onClick = new Signal<T>("onClick");
- onClick(slot);
- }
-
- public void fire(final T id) {
- onClick.fire(id);
- }
-
- public String getIcon() {
- return icon;
- }
-
- public String getTitle() {
- return title;
- }
-
- public void onClick(final Slot<T> slot) {
- onClick.add(slot);
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuItemCollection.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -23,8 +23,10 @@
import java.util.ArrayList;
-public class GridMenuItemCollection<T> extends ArrayList<GridMenuItem<T>> {
+import org.ourproject.kune.platf.client.ui.MenuItem;
+public class GridMenuItemCollection<T> extends ArrayList<MenuItem<T>> {
+
private static final long serialVersionUID = 1L;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -61,9 +61,6 @@
private final Signal<String> onDoubleClick;
private Toolbar topBar;
private Toolbar bottomBar;
- private final String emptyText;
- private final GridDragConfiguration gridDragConfiguration;
- private final GridDropConfiguration gridDropConfiguration;
private ColumnModel columnModel;
private final boolean withEndIcon;
@@ -92,9 +89,6 @@
public GridMenuPanel(final String emptyText, final GridDragConfiguration gridDragConfiguration,
final GridDropConfiguration gridDropConfiguration, final boolean grouped, final boolean withCounters,
final boolean withTopBar, final boolean withBottomBar, final boolean withEndIcon) {
- this.emptyText = emptyText;
- this.gridDragConfiguration = gridDragConfiguration;
- this.gridDropConfiguration = gridDropConfiguration;
this.onClick = new Signal<String>("onClick");
this.onDoubleClick = new Signal<String>("onDoubleClick");
this.grouped = grouped;
@@ -113,6 +107,7 @@
}
menuMap = new HashMap<String, GridMenu<T>>();
recordMap = new HashMap<T, Record>();
+ createGrid(emptyText, gridDragConfiguration, gridDropConfiguration);
}
public GridMenuPanel(final String emptyText, final GridDropConfiguration gridDropConfiguration) {
@@ -125,7 +120,6 @@
}
public void addItem(final GridItem<T> gridItem) {
- createGridIfNeeded();
final String id = gridItem.getId();
final Record newRecord = recordDef
.createRecord(id, new Object[] { gridItem.getGroup().getName(), gridItem.getGroup().getTooltipTitle(),
@@ -170,6 +164,12 @@
};
}
+ @Override
+ public void doLayout(final boolean shallow) {
+ // Grid rendered problems with shallow false
+ super.doLayout();
+ }
+
public void doLayoutIfNeeded() {
if (super.isRendered()) {
super.doLayout();
@@ -446,12 +446,6 @@
super.add(grid);
}
- private void createGridIfNeeded() {
- if (grid == null) {
- createGrid(emptyText, gridDragConfiguration, gridDropConfiguration);
- }
- }
-
private void onClick(final int rowIndex) {
final Record record = store.getRecordAt(rowIndex);
onClick.fire(record.getAsString(ID));
Modified: trunk/src/test/java/org/ourproject/kune/sitebar/client/msg/SiteMessagePresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/sitebar/client/msg/SiteMessagePresenterTest.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/test/java/org/ourproject/kune/sitebar/client/msg/SiteMessagePresenterTest.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -3,7 +3,7 @@
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePresenter;
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessageView;
Added: trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java 2008-08-05 01:27:25 UTC (rev 827)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenterTest.java 2008-08-05 01:29:31 UTC (rev 828)
@@ -0,0 +1,47 @@
+package org.ourproject.kune.workspace.client.tags;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.search.SiteSearcher;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+import com.calclab.suco.client.container.Provider;
+
+public class TagsSummaryPresenterTest {
+
+ private TagsSummaryPresenter tagsSummaryPresenter;
+ private TagsSummaryView view;
+
+ @SuppressWarnings("unchecked")
+ @Before
+ public void before() {
+ final Session session = Mockito.mock(Session.class);
+ final StateManager stateManager = Mockito.mock(StateManager.class);
+ final WsThemePresenter theme = Mockito.mock(WsThemePresenter.class);
+ final SiteSearcher searcher = Mockito.mock(SiteSearcher.class);
+ final Provider searcherProvider = Mockito.mock(Provider.class);
+ Mockito.stub(searcherProvider.get()).toReturn(searcher);
+ view = Mockito.mock(TagsSummaryView.class);
+ tagsSummaryPresenter = new TagsSummaryPresenter(session, searcherProvider, stateManager, theme);
+ tagsSummaryPresenter.init(view);
+ }
+
+ @Test
+ public void noTagsViewNotVisible() {
+ final StateDTO state = new StateDTO();
+ tagsSummaryPresenter.setState(state);
+ Mockito.verify(view).setVisible(false);
+ }
+
+ @Test
+ public void withTagsViewVisible() {
+ final StateDTO state = new StateDTO();
+ state.setTags("test test1");
+ tagsSummaryPresenter.setState(state);
+ Mockito.verify(view).setVisible(true);
+ }
+}
1
0
Author: vjrj
Date: 2008-08-05 03:27:25 +0200 (Tue, 05 Aug 2008)
New Revision: 827
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/
Log:
1
0
Author: vjrj
Date: 2008-08-05 03:27:03 +0200 (Tue, 05 Aug 2008)
New Revision: 826
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelector.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/SiteErrorType.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearchListener.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoView.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/
trunk/src/main/java/org/ourproject/kune/workspace/client/component/WorkspaceComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/
trunk/src/main/java/org/ourproject/kune/workspace/client/presence/
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/
trunk/src/main/java/org/ourproject/kune/workspace/client/theme/
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ThemeMenuComponent.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceListener.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/BottomIconsTrayPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentBottomToolBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentSubTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentToolBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
Modified:
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/MessagePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessageView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
Log:
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,52 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client;
-
-import org.ourproject.kune.platf.client.extend.ClientModule;
-import org.ourproject.kune.platf.client.extend.Register;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.actions.RecalculateWorkspaceAction;
-import org.ourproject.kune.workspace.client.actions.ReloadContextAction;
-import org.ourproject.kune.workspace.client.actions.i18n.ShowTranslatorAction;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class WorkspaceClientModule implements ClientModule {
-
- private final StateManager stateManager;
- private final Workspace workspace;
- private final Session session;
- private final I18nUITranslationService i18n;
-
- public WorkspaceClientModule(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nUITranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- this.workspace = workspace;
- }
-
- public void configure(final Register register) {
- register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n));
- register.addAction(WorkspaceEvents.RELOAD_CONTEXT, new ReloadContextAction(stateManager));
- register.addAction(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, new RecalculateWorkspaceAction(workspace));
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client;
-
-public interface WorkspaceEvents {
- public static final String SHOW_TRANSLATOR = "i18n.ShowTranslator";
- public static final String RELOAD_CONTEXT = "ws.ReoloadContext";
- public static final String WS_SPLITTER_STARTRESIZING = "ws.SplitterStartResizing";
- public static final String WS_SPLITTER_STOPRESIZING = "ws.SplitterStopResizing";
- public static final String RECALCULATE_WORKSPACE_SIZE = "ws.RecalculateWorkspaceSize";
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,130 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client;
-
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.KuneErrorHandler;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.editor.TextEditor;
-import org.ourproject.kune.workspace.client.editor.TextEditorListener;
-import org.ourproject.kune.workspace.client.editor.TextEditorPanel;
-import org.ourproject.kune.workspace.client.editor.TextEditorPresenter;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorComponent;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPresenter;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorView;
-import org.ourproject.kune.workspace.client.i18n.ui.LanguageSelectorPanel;
-import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
-import org.ourproject.kune.workspace.client.licensefoot.LicensePresenter;
-import org.ourproject.kune.workspace.client.licensefoot.LicenseView;
-import org.ourproject.kune.workspace.client.licensefoot.ui.LicensePanel;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPanel;
-import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentSubTitleComponent;
-import org.ourproject.kune.workspace.client.workspace.ContentSubTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentSubTitleView;
-import org.ourproject.kune.workspace.client.workspace.ContentTitleComponent;
-import org.ourproject.kune.workspace.client.workspace.ContentTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentTitleView;
-import org.ourproject.kune.workspace.client.workspace.ContentToolBarComponent;
-import org.ourproject.kune.workspace.client.workspace.ContentToolBarPresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentToolBarView;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-import org.ourproject.kune.workspace.client.workspace.WorkspacePresenter;
-import org.ourproject.kune.workspace.client.workspace.WorkspaceView;
-import org.ourproject.kune.workspace.client.workspace.ui.ContentSubTitlePanel;
-import org.ourproject.kune.workspace.client.workspace.ui.ContentTitlePanel;
-import org.ourproject.kune.workspace.client.workspace.ui.ContentToolBarPanel;
-import org.ourproject.kune.workspace.client.workspace.ui.WorkspacePanel;
-
-import com.calclab.suco.client.container.Provider;
-
-public class WorkspaceFactory {
-
- private static Session session;
- private static I18nTranslationService i18n;
- private static KuneErrorHandler errorHandler;
- private static Provider<StateManager> stateManagerProvider;
-
- public static ContentSubTitleComponent createContentSubTitleComponent() {
- final ContentSubTitlePresenter presenter = new ContentSubTitlePresenter(i18n);
- final ContentSubTitleView view = new ContentSubTitlePanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
- public static ContentTitleComponent createContentTitleComponent() {
- final ContentTitlePresenter presenter = new ContentTitlePresenter(i18n, errorHandler);
- final ContentTitleView view = new ContentTitlePanel(presenter);
- presenter.init(view);
- return presenter;
- }
-
- public static ContentToolBarComponent createContentToolBarComponent() {
- final ContentToolBarPresenter presenter = new ContentToolBarPresenter();
- final ContentToolBarView view = new ContentToolBarPanel(presenter);
- presenter.init(view);
- return presenter;
- }
-
- public static ContextItems createContextItems() {
- final ContextItemsPresenter presenter = new ContextItemsPresenter(i18n);
- final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n, stateManagerProvider);
- presenter.init(panel);
- return presenter;
- }
-
- public static TextEditor createDocumentEditor(final TextEditorListener listener) {
- final TextEditorPresenter presenter = new TextEditorPresenter(listener, true);
- final TextEditorPanel panel = new TextEditorPanel(presenter, i18n);
- presenter.init(panel);
- return presenter;
- }
-
- public static LanguageSelectorComponent createLanguageSelectorComponent() {
- final LanguageSelectorPresenter presenter = new LanguageSelectorPresenter(session);
- final LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
- public static LicenseComponent createLicenseComponent() {
- final LicensePresenter presenter = new LicensePresenter();
- final LicenseView view = new LicensePanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
- public static Workspace createWorkspace(final Session session,
- final ExtensibleWidgetsManager extensionPointManager, final I18nTranslationService i18n,
- final KuneErrorHandler errorHandler, final Provider<StateManager> stateManagerProvider) {
- WorkspaceFactory.session = session;
- WorkspaceFactory.i18n = i18n;
- WorkspaceFactory.errorHandler = errorHandler;
- WorkspaceFactory.stateManagerProvider = stateManagerProvider;
- final WorkspacePresenter workspace = new WorkspacePresenter(session);
- final WorkspaceView view = new WorkspacePanel(workspace, i18n);
- workspace.init(view, extensionPointManager);
- return workspace;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/component/WorkspaceComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/component/WorkspaceComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/component/WorkspaceComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.component;
-
-import org.ourproject.kune.platf.client.Component;
-
-public interface WorkspaceComponent extends Component {
-
- void detach();
-
- void attach();
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -40,7 +40,6 @@
private final Timer saveTimer;
private final I18nTranslationService i18n;
- @Deprecated
public TextEditorPanel(final TextEditorPresenter presenter, final I18nTranslationService i18n) {
this.presenter = presenter;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -19,15 +19,10 @@
*/
package org.ourproject.kune.workspace.client.i18n;
-import org.ourproject.kune.platf.client.PlatformEvents;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -45,19 +40,18 @@
this.i18n = i18n;
}
- public void attachIconToBottomBar(final View view) {
- DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, view));
- }
-
public void doClose() {
view.hide();
- DefaultDispatcher.getInstance().fire(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, view));
}
public void doShowTranslator() {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
+ Site.showProgressLoading();
+ if (session.isLogged()) {
+ view.show();
+ } else {
+ Site.info(i18n.t("Sign in or register to help with translation"));
+ }
+ Site.hideProgress();
}
public void doTranslation(final String id, final String trKey, final String translation) {
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelector.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelector.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,33 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.i18n;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+
+public interface LanguageSelector {
+
+ String getSelectedLanguage();
+
+ View getView();
+
+ void setLanguage(I18nLanguageDTO language);
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.i18n;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-
-public interface LanguageSelectorComponent extends Component {
-
- String getSelectedLanguage();
-
- void setLanguage(I18nLanguageDTO language);
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -23,33 +23,32 @@
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.state.Session;
-public class LanguageSelectorPresenter implements LanguageSelectorComponent {
+public class LanguageSelectorPresenter implements LanguageSelector {
private LanguageSelectorView view;
private final Session session;
public LanguageSelectorPresenter(final Session session) {
- this.session = session;
+ this.session = session;
+ }
+ public Object[][] getLanguages() {
+ return session.getLanguagesArray();
}
- public void init(final LanguageSelectorView view) {
- this.view = view;
+ public String getSelectedLanguage() {
+ return view.getLanguage();
}
public View getView() {
- return view;
+ return view;
}
- public String getSelectedLanguage() {
- return view.getLanguage();
+ public void init(final LanguageSelectorView view) {
+ this.view = view;
}
- public Object[][] getLanguages() {
- return session.getLanguagesArray();
- }
-
public void setLanguage(final I18nLanguageDTO language) {
- view.setLanguage(language.getCode());
+ view.setLanguage(language.getCode());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -23,16 +23,15 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.AbstractSearcherPanel;
-import org.ourproject.kune.platf.client.ui.BottomTrayIcon;
import org.ourproject.kune.platf.client.ui.KuneStringUtils;
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
-import org.ourproject.kune.workspace.client.WorkspaceFactory;
import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPresenter;
import org.ourproject.kune.workspace.client.i18n.I18nTranslatorView;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorComponent;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelector;
+import org.ourproject.kune.workspace.client.search.SiteBottomTrayButton;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.Frame;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.gwtext.client.core.EventObject;
@@ -69,260 +68,251 @@
private Window dialog;
private final I18nTranslatorPresenter presenter;
private LanguageSelectorPanel languageSelectorPanel;
-
private Store unTransStore;
private Store transStore;
-
- private BottomTrayIcon bottomIcon;
-
private GridPanel transGrid;
private GridPanel unTransGrid;
+ private final LanguageSelector languageSelector;
+ private final WorkspaceSkeleton ws;
+ private SiteBottomTrayButton traybarButton;
- public I18nTranslatorPanel(final I18nTranslatorPresenter initPresenter, final I18nTranslationService i18n) {
- super(i18n);
- this.presenter = initPresenter;
+ public I18nTranslatorPanel(final I18nTranslatorPresenter initPresenter, final I18nTranslationService i18n,
+ final LanguageSelector languageSelector, final WorkspaceSkeleton ws) {
+ super(i18n);
+ this.presenter = initPresenter;
+ this.languageSelector = languageSelector;
+ this.ws = ws;
}
public void close() {
- dialog.hide();
+ dialog.hide();
}
public void hide() {
- dialog.hide();
+ dialog.hide();
}
public void show() {
- if (dialog == null) {
- dialog = createDialog();
- }
- // By default we use the user lang to help in translation
- final I18nLanguageDTO lang = presenter.getLanguage();
- setLanguage(lang);
- final String languageNativeNameIfAvailable = lang.getNativeName().length() > 0 ? lang.getNativeName() : lang
- .getEnglishName();
- dialog.setTitle(i18n.t("Help to translate kune to [%s]", languageNativeNameIfAvailable));
- dialog.show();
- dialog.expand();
- dialog.center();
- if (bottomIcon == null) {
- bottomIcon = new BottomTrayIcon(i18n.t("Show/hide translator"));
- bottomIcon.addMainButton(Images.App.getInstance().language(), new Command() {
- public void execute() {
- if (dialog.isVisible()) {
- dialog.hide();
- } else {
- dialog.show();
- }
- }
- });
- presenter.attachIconToBottomBar(bottomIcon);
- }
+ if (dialog == null) {
+ dialog = createDialog();
+ }
+ // By default we use the user lang to help in translation
+ final I18nLanguageDTO lang = presenter.getLanguage();
+ setLanguage(lang);
+ final String languageNativeNameIfAvailable = lang.getNativeName().length() > 0 ? lang.getNativeName() : lang
+ .getEnglishName();
+ dialog.setTitle(i18n.t("Help to translate kune to [%s]", languageNativeNameIfAvailable));
+ dialog.show();
+ dialog.expand();
+ dialog.center();
+ if (traybarButton == null) {
+ traybarButton = new SiteBottomTrayButton("images/language.gif", i18n.t("Show/hide translator"), dialog, ws);
+ }
}
private Window createDialog() {
- final Panel north = new Panel();
- north.setBorder(false);
+ final Panel north = new Panel();
+ north.setBorder(false);
- final Panel center = new TabPanel();
- center.setAutoScroll(false);
- center.setClosable(false);
- center.setBorder(false);
+ final Panel center = new TabPanel();
+ center.setAutoScroll(false);
+ center.setClosable(false);
+ center.setBorder(false);
- final Window dialog = new BasicDialog("", false, false, 720, 330);
- // dialog.setResizable(false);
- dialog.setIconCls("i18n-icon");
+ final Window dialog = new BasicDialog("", false, false, 720, 330);
+ // dialog.setResizable(false);
+ dialog.setIconCls("i18n-icon");
- final Button close = new Button();
- close.setText(i18n.tWithNT("Close", "used in button"));
- close.addListener(new ButtonListenerAdapter() {
- public void onClick(final Button button, final EventObject e) {
- presenter.doClose();
- }
- });
- dialog.addButton(close);
+ final Button close = new Button();
+ close.setText(i18n.tWithNT("Close", "used in button"));
+ close.addListener(new ButtonListenerAdapter() {
+ public void onClick(final Button button, final EventObject e) {
+ presenter.doClose();
+ }
+ });
+ dialog.addButton(close);
- final Panel unTransCenterPanel = new Panel(i18n.t("Untranslated"));
- unTransCenterPanel.setAutoScroll(false);
- unTransCenterPanel.setLayout(new FitLayout());
+ final Panel unTransCenterPanel = new Panel(i18n.t("Untranslated"));
+ unTransCenterPanel.setAutoScroll(false);
+ unTransCenterPanel.setLayout(new FitLayout());
- final Panel transCenterPanel = new Panel(i18n.t("Translated"));
- transCenterPanel.setAutoScroll(false);
- transCenterPanel.setLayout(new FitLayout());
+ final Panel transCenterPanel = new Panel(i18n.t("Translated"));
+ transCenterPanel.setAutoScroll(false);
+ transCenterPanel.setLayout(new FitLayout());
- final Panel recommendationPanel = new Panel(i18n.t("Recommendations"));
- recommendationPanel.setAutoScroll(true);
- recommendationPanel.setLayout(new FitLayout());
+ final Panel recommendationPanel = new Panel(i18n.t("Recommendations"));
+ recommendationPanel.setAutoScroll(true);
+ recommendationPanel.setLayout(new FitLayout());
- transGrid = createGridPanel(true);
- unTransGrid = createGridPanel(false);
- final HorizontalPanel hp = new HorizontalPanel();
- final LanguageSelectorComponent langComponent = WorkspaceFactory.createLanguageSelectorComponent();
- languageSelectorPanel = (LanguageSelectorPanel) langComponent.getView();
- languageSelectorPanel.addChangeListener(new ComboBoxListenerAdapter() {
- public void onSelect(final ComboBox comboBox, final Record record, final int index) {
- setLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
- dialog.setTitle(i18n.t("Help to translate kune to [%s]", record.getAsString("language")));
- }
- });
- hp.add(languageSelectorPanel);
- hp.addStyleName("kune-Margin-Large-trbl");
- north.add(hp);
+ transGrid = createGridPanel(true);
+ unTransGrid = createGridPanel(false);
+ final HorizontalPanel hp = new HorizontalPanel();
+ languageSelectorPanel = (LanguageSelectorPanel) languageSelector.getView();
+ languageSelectorPanel.addChangeListener(new ComboBoxListenerAdapter() {
+ public void onSelect(final ComboBox comboBox, final Record record, final int index) {
+ setLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
+ dialog.setTitle(i18n.t("Help to translate kune to [%s]", record.getAsString("language")));
+ }
+ });
+ hp.add(languageSelectorPanel);
+ hp.addStyleName("kune-Margin-Large-trbl");
+ north.add(hp);
- unTransCenterPanel.add(unTransGrid);
- transCenterPanel.add(transGrid);
- final Frame recommFrame = new Frame("html/i18n-recom.html");
- // recommFrame.setHeight("220");
- recommendationPanel.add(recommFrame);
+ unTransCenterPanel.add(unTransGrid);
+ transCenterPanel.add(transGrid);
+ final Frame recommFrame = new Frame("html/i18n-recom.html");
+ // recommFrame.setHeight("220");
+ recommendationPanel.add(recommFrame);
- center.add(unTransCenterPanel);
- center.add(transCenterPanel);
- center.add(recommendationPanel);
- dialog.add(north, new BorderLayoutData(RegionPosition.NORTH));
- dialog.add(center, new BorderLayoutData(RegionPosition.CENTER));
+ center.add(unTransCenterPanel);
+ center.add(transCenterPanel);
+ center.add(recommendationPanel);
+ dialog.add(north, new BorderLayoutData(RegionPosition.NORTH));
+ dialog.add(center, new BorderLayoutData(RegionPosition.CENTER));
- center.setActiveItemID(unTransCenterPanel.getId());
+ center.setActiveItemID(unTransCenterPanel.getId());
- return dialog;
+ return dialog;
}
private GridPanel createGridPanel(final boolean translated) {
- final Renderer renderNT = new Renderer() {
- public String render(Object value, CellMetadata cellMetadata, Record record, int rowIndex, int colNum,
- Store store) {
- String renderer;
- String[] splitted = splitNT((String) value);
- if (splitted.length > 1) {
- renderer = "{0} " + NOTE_FOR_TRANSLATORS_IMAGE_HTML;
- String tip = "<div style='min-width: 75px'>" + splitted[1] + "</div>";
- cellMetadata.setHtmlAttribute("ext:qtip=\"" + tip + "\" ext:qtitle=\"Note for translators\"");
- } else {
- renderer = "{0}";
- }
- return Format.format(renderer, splitted);
- }
- };
+ final Renderer renderNT = new Renderer() {
+ public String render(Object value, CellMetadata cellMetadata, Record record, int rowIndex, int colNum,
+ Store store) {
+ String renderer;
+ String[] splitted = splitNT((String) value);
+ if (splitted.length > 1) {
+ renderer = "{0} " + NOTE_FOR_TRANSLATORS_IMAGE_HTML;
+ String tip = "<div style='min-width: 75px'>" + splitted[1] + "</div>";
+ cellMetadata.setHtmlAttribute("ext:qtip=\"" + tip + "\" ext:qtitle=\"Note for translators\"");
+ } else {
+ renderer = "{0}";
+ }
+ return Format.format(renderer, splitted);
+ }
+ };
- Store store;
- final String id = "id";
- final FieldDef[] fieldDefs = new FieldDef[] { new StringFieldDef("trKey"), new StringFieldDef("text"),
- new StringFieldDef(id) };
+ Store store;
+ final String id = "id";
+ final FieldDef[] fieldDefs = new FieldDef[] { new StringFieldDef("trKey"), new StringFieldDef("text"),
+ new StringFieldDef(id) };
- if (translated) {
- final String url = "/kune/json/I18nTranslationJSONService/searchtranslated";
- transStore = createStore(fieldDefs, url, id);
- store = transStore;
- } else {
- final String url = "/kune/json/I18nTranslationJSONService/search";
- unTransStore = createStore(fieldDefs, url, id);
- store = unTransStore;
- }
+ if (translated) {
+ final String url = "/kune/json/I18nTranslationJSONService/searchtranslated";
+ transStore = createStore(fieldDefs, url, id);
+ store = transStore;
+ } else {
+ final String url = "/kune/json/I18nTranslationJSONService/search";
+ unTransStore = createStore(fieldDefs, url, id);
+ store = unTransStore;
+ }
- final ColumnConfig trKeyColumn = new ColumnConfig() {
- {
- setHeader(i18n.t("Text to translate"));
- setDataIndex("trKey");
- setWidth(335);
- setTooltip(i18n.t("Click to sort"));
- setRenderer(renderNT);
- }
- };
+ final ColumnConfig trKeyColumn = new ColumnConfig() {
+ {
+ setHeader(i18n.t("Text to translate"));
+ setDataIndex("trKey");
+ setWidth(335);
+ setTooltip(i18n.t("Click to sort"));
+ setRenderer(renderNT);
+ }
+ };
- final GridEditor textColumnEditor = new GridEditor(new TextField());
+ final GridEditor textColumnEditor = new GridEditor(new TextField());
- final ColumnConfig textColumn = new ColumnConfig() {
- {
- setHeader(i18n.t("Translation (click to edit)"));
- setDataIndex("text");
- setWidth(335);
- setEditor(textColumnEditor);
- }
- };
+ final ColumnConfig textColumn = new ColumnConfig() {
+ {
+ setHeader(i18n.t("Translation (click to edit)"));
+ setDataIndex("text");
+ setWidth(335);
+ setEditor(textColumnEditor);
+ }
+ };
- final ColumnModel columnModel = new ColumnModel(new ColumnConfig[] { trKeyColumn, textColumn });
+ final ColumnModel columnModel = new ColumnModel(new ColumnConfig[] { trKeyColumn, textColumn });
- columnModel.setDefaultSortable(true);
+ columnModel.setDefaultSortable(true);
- final EditorGridPanel grid = new EditorGridPanel((translated ? "grid-translated" : "grid-untranslated"), 695,
- 180, store, columnModel);
- createPagingToolbar(store, grid);
+ final EditorGridPanel grid = new EditorGridPanel((translated ? "grid-translated" : "grid-untranslated"), 695,
+ 180, store, columnModel);
+ createPagingToolbar(store, grid);
- // final PagingToolbar pag = new PagingToolbar(store);
- // pag.setPageSize(PAGINATION_SIZE);
- // pag.setDisplayInfo(true);
- // pag.setDisplayMsg(i18n.tWithNT("Displaying results {0} - {1} of
- // {2}",
- // "Respect {} values in translations, "
- // + "these will produce: 'Displaying results 1 - 25 of 95465' for
- // instance"));
- // pag.setEmptyMsg(i18n.t("No results to display"));
- // pag.setAfterPageText(i18n.tWithNT("of {0}", "Used to show
- // multiple results: '1 of 30'"));
- // pag.setBeforePageText(i18n.t("Page"));
- // pag.setFirstText(i18n.t("First Page"));
- // pag.setLastText(i18n.t("Last Page"));
- // pag.setNextText(i18n.t("Next Page"));
- // pag.setPrevText(i18n.t("Previous Page"));
- // pag.setRefreshText(i18n.t("Refresh"));
- // grid.setBottomToolbar(pag);
- // grid.setLoadMask(true);
- // grid.setLoadMask(i18n.t("Loading"));
- grid.setClicksToEdit(1);
- // grid.setStripeRows(true);
- // grid.setFrame(true);
- // grid.setSelectionModel(new RowSelectionModel());
+ // final PagingToolbar pag = new PagingToolbar(store);
+ // pag.setPageSize(PAGINATION_SIZE);
+ // pag.setDisplayInfo(true);
+ // pag.setDisplayMsg(i18n.tWithNT("Displaying results {0} - {1} of
+ // {2}",
+ // "Respect {} values in translations, "
+ // + "these will produce: 'Displaying results 1 - 25 of 95465' for
+ // instance"));
+ // pag.setEmptyMsg(i18n.t("No results to display"));
+ // pag.setAfterPageText(i18n.tWithNT("of {0}", "Used to show
+ // multiple results: '1 of 30'"));
+ // pag.setBeforePageText(i18n.t("Page"));
+ // pag.setFirstText(i18n.t("First Page"));
+ // pag.setLastText(i18n.t("Last Page"));
+ // pag.setNextText(i18n.t("Next Page"));
+ // pag.setPrevText(i18n.t("Previous Page"));
+ // pag.setRefreshText(i18n.t("Refresh"));
+ // grid.setBottomToolbar(pag);
+ // grid.setLoadMask(true);
+ // grid.setLoadMask(i18n.t("Loading"));
+ grid.setClicksToEdit(1);
+ // grid.setStripeRows(true);
+ // grid.setFrame(true);
+ // grid.setSelectionModel(new RowSelectionModel());
- grid.addEditorGridListener(new EditorGridListenerAdapter() {
- public void onAfterEdit(final GridPanel grid, final Record record, final String field,
- final Object newValue, final Object oldValue, final int rowIndex, final int colIndex) {
- final String idValue = record.getAsString(id);
- final String trKey = record.getAsString("trKey");
- presenter.doTranslation(idValue, trKey, (String) newValue);
- record.set(field, KuneStringUtils.escapeHtmlLight((String) newValue));
- }
- });
+ grid.addEditorGridListener(new EditorGridListenerAdapter() {
+ public void onAfterEdit(final GridPanel grid, final Record record, final String field,
+ final Object newValue, final Object oldValue, final int rowIndex, final int colIndex) {
+ final String idValue = record.getAsString(id);
+ final String trKey = record.getAsString("trKey");
+ presenter.doTranslation(idValue, trKey, (String) newValue);
+ record.set(field, KuneStringUtils.escapeHtmlLight((String) newValue));
+ }
+ });
- grid.addGridCellListener(new GridCellListenerAdapter() {
- public void onCellDblClick(final GridPanel grid, final int rowIndex, final int colIndex, final EventObject e) {
- final Record record = unTransStore.getRecordAt(rowIndex);
- final String idValue = record.getAsString(id);
- final String trKey = record.getAsString("trKey");
- final String text = record.getAsString("text");
- if (text == null || text.length() == 0) {
- final String trWithoutNT = removeNT(trKey);
- record.set("text", trWithoutNT);
- presenter.doTranslation(idValue, trKey, trWithoutNT);
- }
- }
- });
+ grid.addGridCellListener(new GridCellListenerAdapter() {
+ public void onCellDblClick(final GridPanel grid, final int rowIndex, final int colIndex, final EventObject e) {
+ final Record record = unTransStore.getRecordAt(rowIndex);
+ final String idValue = record.getAsString(id);
+ final String trKey = record.getAsString("trKey");
+ final String text = record.getAsString("text");
+ if (text == null || text.length() == 0) {
+ final String trWithoutNT = removeNT(trKey);
+ record.set("text", trWithoutNT);
+ presenter.doTranslation(idValue, trKey, trWithoutNT);
+ }
+ }
+ });
- return grid;
+ return grid;
}
private String removeNT(final String string) {
- return i18n.removeNT(string);
+ return i18n.removeNT(string);
}
private void setLanguage(final I18nLanguageDTO language) {
- languageSelectorPanel.setLanguage(language.getCode());
- setLanguage(language.getCode());
+ languageSelectorPanel.setLanguage(language.getCode());
+ setLanguage(language.getCode());
}
private void setLanguage(final String language) {
- Site.showProgressLoading();
- query(unTransStore, unTransGrid, language);
- query(transStore, transGrid, language);
- Site.hideProgress();
+ Site.showProgressLoading();
+ query(unTransStore, unTransGrid, language);
+ query(transStore, transGrid, language);
+ Site.hideProgress();
}
private String[] splitNT(final String textWithNT) {
- String[] nt;
- final String[] splitted = textWithNT.split(" \\[%NT ");
- if (splitted.length > 1) {
- nt = splitted[1].split("\\]$");
- splitted[1] = nt[0];
- }
- return splitted;
+ String[] nt;
+ final String[] splitted = textWithNT.split(" \\[%NT ");
+ if (splitted.length > 1) {
+ nt = splitted[1].split("\\]$");
+ splitted[1] = nt[0];
+ }
+ return splitted;
}
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,344 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.newgroup;
+
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.KuneStringUtils;
+import org.ourproject.kune.platf.client.ui.KuneUiUtils;
+import org.ourproject.kune.platf.client.ui.dialogs.WizardDialog;
+import org.ourproject.kune.platf.client.ui.dialogs.WizardListener;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.licensechoose.LicenseChoose;
+import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
+import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePanel;
+
+import com.calclab.suco.client.container.Provider;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.DeckPanel;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.core.Position;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.ToolTip;
+import com.gwtext.client.widgets.form.Field;
+import com.gwtext.client.widgets.form.FieldSet;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.Radio;
+import com.gwtext.client.widgets.form.TextArea;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class NewGroupPanel extends WizardDialog implements NewGroupView {
+ private static final AbstractImagePrototype INFO_IMAGE = Images.App.getInstance().info();
+ private static final String MUST_BE_BETWEEN_3_AND_15 = "Must be between 3 and 15 lowercase characters. Can only contain characters, numbers, and dashes";
+ private static final String SHORTNAME_FIELD = "short_name";
+ private static final String LONGNAME_FIELD = "long_name";
+ private static final String PUBLICDESC_FIELD = "public_desc";
+ private static final String TYPEOFGROUP_FIELD = "type_of_group";
+ private static final String TAGS_FIELD = "tags";
+
+ private final FormPanel newGroupInitialDataForm;
+ private Radio projectRadio;
+ private Radio orgRadio;
+ private Radio communityRadio;
+ private Radio orphanedProjectRadio;
+ private TextField shortNameField;
+ private TextField longNameField;
+ private TextArea publicDescField;
+ private final DeckPanel deck;
+ private final LicenseChoose licenseChoosePanel;
+ private final SiteMessagePanel messagesPanel;
+ private final I18nUITranslationService i18n;
+ private TextField tags;
+
+ public NewGroupPanel(final NewGroupPresenter presenter, final I18nUITranslationService i18n,
+ final Provider<LicenseChoose> licenseChooseProvider) {
+ super(i18n.t("Register a new Group"), true, false, 460, 480, new WizardListener() {
+ public void onBack() {
+ presenter.onBack();
+ }
+
+ public void onCancel() {
+ presenter.onCancel();
+ }
+
+ public void onClose() {
+ presenter.onClose();
+ }
+
+ public void onFinish() {
+ presenter.onFinish();
+ }
+
+ public void onNext() {
+ presenter.onNext();
+ }
+ }, i18n);
+ this.i18n = i18n;
+ Field.setMsgTarget("side");
+ final Panel centerPanel = new Panel();
+ centerPanel.setLayout(new FitLayout());
+ deck = new DeckPanel();
+ newGroupInitialDataForm = createNewGroupInitialDataForm(presenter);
+ licenseChoosePanel = licenseChooseProvider.get();
+ final VerticalPanel newGroupInitialDataVP = new VerticalPanel();
+ final HorizontalPanel newGroupInitialDataHP = new HorizontalPanel();
+ final VerticalPanel chooseLicenseVP = new VerticalPanel();
+ final HorizontalPanel chooseLicenseHP = new HorizontalPanel();
+ final Images img = Images.App.getInstance();
+ newGroupInitialDataHP.add(img.step1().createImage());
+ final Label step1Label = new Label(i18n
+ .t("Please fill this form and follow the next steps to register a new group:"));
+ newGroupInitialDataHP.add(step1Label);
+ newGroupInitialDataVP.add(newGroupInitialDataHP);
+ newGroupInitialDataVP.add(newGroupInitialDataForm);
+ chooseLicenseHP.add(img.step2().createImage());
+ final HTML step2Label = new HTML(i18n.t("Select a license to share your group contents with other people. "
+ + "We recomend [%s] licenses for practical works.", KuneStringUtils.generateHtmlLink(
+ "http://en.wikipedia.org/wiki/Copyleft", "copyleft")));
+ chooseLicenseHP.add(step2Label);
+ final Label licenseTypeLabel = new Label(i18n.t("Choose a license type:"));
+ chooseLicenseVP.add(chooseLicenseHP);
+ chooseLicenseVP.add(licenseTypeLabel);
+
+ newGroupInitialDataHP.addStyleName("kune-Margin-Medium-b");
+ step1Label.addStyleName("kune-Margin-Large-l");
+ step2Label.addStyleName("kune-Margin-Large-l");
+ step1Label.addStyleName("kune-Margin-Medium-b");
+ step2Label.addStyleName("kune-Margin-Medium-b");
+
+ messagesPanel = new SiteMessagePanel(null, false, i18n);
+ messagesPanel.setWidth("425");
+ messagesPanel.setMessage("", SiteErrorType.info, SiteErrorType.error);
+ newGroupInitialDataVP.add(messagesPanel);
+
+ chooseLicenseVP.add((Widget) licenseChoosePanel.getView());
+ deck.add(newGroupInitialDataVP);
+ deck.add(chooseLicenseVP);
+ centerPanel.add(deck);
+ super.add(centerPanel);
+ deck.showWidget(0);
+ initBottomButtons();
+ // newGroupInitialDataVP.addStyleName("kune-Default-Form");
+ deck.addStyleName("kune-Default-Form");
+ licenseTypeLabel.addStyleName("kune-License-CC-Header");
+ newGroupInitialDataVP.setHeight("10"); // Ext set this to 100% ...
+ chooseLicenseVP.setHeight("10"); // (same here)
+ super.setFinishText(i18n.t("Register"));
+ }
+
+ public void clearData() {
+ deck.showWidget(0);
+ newGroupInitialDataForm.getForm().reset();
+ ((LicenseChoosePanel) licenseChoosePanel.getView()).reset();
+ showNewGroupInitialDataForm();
+ initBottomButtons();
+ shortNameField.focus(false);
+ }
+
+ public LicenseDTO getLicense() {
+ return licenseChoosePanel.getLicense();
+ }
+
+ public String getLongName() {
+ return longNameField.getValueAsString();
+ }
+
+ public String getPublicDesc() {
+ return publicDescField.getValueAsString();
+ }
+
+ public String getShortName() {
+ return shortNameField.getValueAsString();
+ }
+
+ public String getTags() {
+ return tags.getRawValue();
+ }
+
+ public void hideMessage() {
+ messagesPanel.hide();
+ }
+
+ public boolean isCommunity() {
+ return communityRadio.getValue();
+ }
+
+ public boolean isFormValid() {
+ return newGroupInitialDataForm.getForm().isValid();
+ }
+
+ public boolean isOrganization() {
+ return orgRadio.getValue();
+ }
+
+ public boolean isOrphanedProject() {
+ return orphanedProjectRadio.getValue();
+ }
+
+ public boolean isProject() {
+ return projectRadio.getValue();
+ }
+
+ public void setMessage(final String message, final SiteErrorType type) {
+ messagesPanel.setMessage(message, type, type);
+ messagesPanel.show();
+ }
+
+ public void showLicenseForm() {
+ deck.showWidget(1);
+ }
+
+ public void showNewGroupInitialDataForm() {
+ deck.showWidget(0);
+ }
+
+ private FormPanel createNewGroupInitialDataForm(final NewGroupPresenter presenter) {
+ final FormPanel form = new FormPanel();
+ form.setBorder(false);
+ form.setWidth(420);
+ form.setLabelWidth(100);
+ form.setLabelAlign(Position.RIGHT);
+ form.setButtonAlign(Position.RIGHT);
+
+ shortNameField = new TextField();
+ shortNameField.setFieldLabel(i18n.t("Short name"));
+ shortNameField.
+
+ setName(SHORTNAME_FIELD);
+ shortNameField.setWidth(175);
+ shortNameField.setMinLength(3);
+ shortNameField.setMaxLength(15);
+ shortNameField.setAllowBlank(false);
+ shortNameField.setRegex("^[a-z0-9_\\-]+$");
+ shortNameField.setMinLengthText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameField.setMaxLengthText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameField.setRegexText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameField.setValidationDelay(1000);
+
+ form.add(shortNameField);
+
+ longNameField = new TextField();
+ longNameField.setFieldLabel(i18n.t("Long name"));
+ longNameField.setName(LONGNAME_FIELD);
+ longNameField.setWidth(300);
+ longNameField.setAllowBlank(false);
+
+ longNameField.setMinLength(3);
+ longNameField.setMaxLength(50);
+ longNameField.setValidationDelay(1000);
+ form.add(longNameField);
+
+ publicDescField = new TextArea();
+ publicDescField.setFieldLabel(i18n.t("Public description"));
+ publicDescField.setName(PUBLICDESC_FIELD);
+ publicDescField.setWidth(300);
+ publicDescField.setAllowBlank(false);
+ publicDescField.setMinLength(10);
+ publicDescField.setMaxLength(255);
+ publicDescField.setValidationDelay(1000);
+ form.add(publicDescField);
+
+ tags = new TextField();
+ tags.setFieldLabel(i18n.t("Group tags"));
+ tags.setName(TAGS_FIELD);
+ tags.setWidth(300);
+ tags.setAllowBlank(false);
+ final ToolTip fieldToolTip = new ToolTip(i18n.t("Some words related to this group (separated with spaces)."));
+ fieldToolTip.applyTo(tags);
+ tags.setValidationDelay(1000);
+ form.add(tags);
+
+ final FieldSet groupTypeFieldSet = new FieldSet(i18n.t("Type of group"));
+ groupTypeFieldSet.setStyle("margin-left: 105px");
+
+ form.add(groupTypeFieldSet);
+
+ projectRadio = new Radio();
+ createRadio(groupTypeFieldSet, projectRadio, "Project",
+ "A project is a kind of group in which new members inclusion "
+ + "is moderated by the project administrators. "
+ + "An administrator is the person who creates the project "
+ + "and other people she/he choose in the future as administrator too.");
+ projectRadio.setChecked(true);
+
+ orgRadio = new Radio();
+ createRadio(groupTypeFieldSet, orgRadio, "Organization", "An organization is like a project, "
+ + "but organizations must be a legal entity.");
+
+ communityRadio = new Radio();
+ createRadio(groupTypeFieldSet, communityRadio, "Community", "Communities are social group of persons "
+ + "with shared interests and they are open to new members "
+ + "(for instance the environmental community or the LGBT community). "
+ + "Normally they aren't a legal entity.");
+
+ orphanedProjectRadio = new Radio();
+ createRadio(groupTypeFieldSet, orphanedProjectRadio, "Orphaned Project",
+ "If you have an idea but you don't have " + "capacity/possibilities/resources to work on it, "
+ + "just register a orphaned project, and permit others to work and develop it.");
+
+ groupTypeFieldSet.setCollapsible(false);
+
+ return form;
+ }
+
+ private void createRadio(final FieldSet fieldSet, final Radio radio, final String radioLabel, final String radioTip) {
+ radio.setName(TYPEOFGROUP_FIELD);
+ radio.setBoxLabel(KuneUiUtils.genQuickTipLabel(i18n.t(radioLabel), null, i18n.t(radioTip), INFO_IMAGE));
+ radio.setAutoCreate(true);
+ radio.setHideLabel(true);
+ fieldSet.add(radio);
+ // ToolTip fieldToolTip = new ToolTip("Tooltip on a Field.");
+ // fieldToolTip.applyTo(captchaField);
+ // Image info = new Image("images/silk/information.gif");
+ //
+ // ToolTip tooltip = new ToolTip();
+ // tooltip.setHtml("A <b>CAPTCHA</b> is a challenge-response test to
+ // determine whether " +
+ // "the user is human.");
+ // tooltip.setWidth(150);
+ // tooltip.applyTo(info.getElement());
+
+ // Tested:
+ // Set tooltip
+ // Image info = new Image();
+ // ChatIcons.App.getInstance().info().applyTo(info);
+ // ToolTip tooltip = new ToolTip();
+ // tooltip.setHtml(i18n.t("Note that the 'Jabber Id' sometimes is the
+ // same as the email "
+ // + "(in gmail accounts for instance)."));
+ // tooltip.setWidth(250);
+ // tooltip.applyTo(info.getElement());
+ // jidPanel.addToRow(info, new ColumnLayoutData(1));
+ //
+ // formPanel.add(jidPanel);
+
+ }
+
+ private void initBottomButtons() {
+ super.setEnabledBackButton(false);
+ super.setEnabledFinishButton(false);
+ super.setEnabledNextButton(true);
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -29,7 +29,6 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.SiteToken;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -21,7 +21,6 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
public interface NewGroupView extends View {
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/SiteErrorType.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/SiteErrorType.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/SiteErrorType.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/SiteErrorType.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.newgroup;
+
+public enum SiteErrorType {
+ error, veryimp, imp, info
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearchListener.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearchListener.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,28 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.search;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EntityLiveSearchListener extends View {
+
+ void onSelection(String shortName, String longName);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcher.java (from rev 820, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,32 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.search;
+
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+
+import com.calclab.suco.client.signal.Slot;
+
+public interface EntityLiveSearcher {
+
+ void onSelection(Slot<LinkDTO> slot);
+
+ void show();
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java (from rev 820, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,155 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.search;
+
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.gwtext.client.core.Connection;
+import com.gwtext.client.core.Template;
+import com.gwtext.client.core.UrlParam;
+import com.gwtext.client.data.DataProxy;
+import com.gwtext.client.data.FieldDef;
+import com.gwtext.client.data.HttpProxy;
+import com.gwtext.client.data.JsonReader;
+import com.gwtext.client.data.Record;
+import com.gwtext.client.data.RecordDef;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.data.StringFieldDef;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
+
+public class EntityLiveSearcherPanel implements EntityLiveSearcherView {
+
+ private static final String LONG_NAME_FIELD = "longName";
+ private static final String SHORT_NAME_FIELD = "shortName";
+ private static final String ICON_URL_FIELD = "iconUrl";
+ private static final String LINK_FIELD = "link";
+ private static final int PAGINATION_SIZE = 10;
+ private final EntityLiveSearcherPresenter presenter;
+ private BasicDialog dialog;
+ private final int searchType;
+ private FormPanel searchForm;
+ private final I18nTranslationService i18n;
+
+ public EntityLiveSearcherPanel(final EntityLiveSearcherPresenter presenter, final int searchType,
+ final I18nTranslationService i18n) {
+ this.presenter = presenter;
+ this.searchType = searchType;
+ this.i18n = i18n;
+ }
+
+ public void center() {
+ dialog.center();
+ }
+
+ public void hide() {
+ dialog.hide();
+ searchForm.getForm().reset();
+ }
+
+ public void show() {
+ if (dialog == null) {
+ createGroupSearchDialog(searchType);
+ }
+ dialog.show();
+ dialog.center();
+ }
+
+ private void createGroupSearchDialog(final int searchType) {
+ String title;
+ if (searchType == EntityLiveSearcherView.SEARCH_GROUPS) {
+ title = i18n.t("Search existing users and groups");
+ } else {
+ title = i18n.t("Search existing users");
+ }
+ dialog = new BasicDialog(title, true, false, 285, 55);
+ dialog.setClosable(true);
+ dialog.setCollapsible(false);
+
+ DataProxy dataProxy = null;
+ switch (searchType) {
+ case EntityLiveSearcherView.SEARCH_GROUPS:
+ dataProxy = new HttpProxy("/kune/json/GroupJSONService/search", Connection.POST);
+ break;
+ case EntityLiveSearcherView.SEARCH_USERS:
+ dataProxy = new HttpProxy("/kune/json/UserJSONService/search", Connection.POST);
+ break;
+ default:
+ break;
+ }
+
+ final JsonReader reader = new JsonReader(new RecordDef(
+ new FieldDef[] { new StringFieldDef(SHORT_NAME_FIELD), new StringFieldDef(LONG_NAME_FIELD),
+ new StringFieldDef(LINK_FIELD), new StringFieldDef(ICON_URL_FIELD) }));
+ reader.setRoot("list");
+ reader.setTotalProperty("size");
+ reader.setId(SHORT_NAME_FIELD);
+
+ final Store store = new Store(dataProxy, reader);
+
+ store.load(new UrlParam[] { new UrlParam("query", "."), new UrlParam("first", 1),
+ new UrlParam("max", PAGINATION_SIZE) });
+
+ searchForm = new FormPanel();
+ searchForm.setBorder(false);
+ searchForm.setWidth(275);
+ searchForm.setHideLabels(true);
+
+ final Template resultTpl = new Template(
+ "<div class=\"search-item\"><span class=\"kune-IconHyperlink\"><img alt=\"group logo\" src=\"images/group-def-icon.png\" style=\"height: 16px; width: 16px;\" />{shortName}: {longName}</span></div>");
+ final ComboBox cb = new ComboBox();
+ cb.setStore(store);
+ cb.setEmptyText(i18n.t("Write here to search"));
+ cb.setDisplayField(LONG_NAME_FIELD);
+ cb.setTypeAhead(true);
+ cb.setLoadingText(i18n.t("Searching..."));
+ cb.setWidth(268);
+ cb.setPageSize(PAGINATION_SIZE);
+ cb.setTpl(resultTpl);
+ cb.setMode(ComboBox.REMOTE);
+ cb.setMinChars(2);
+ cb.setSelectOnFocus(false);
+ cb.setHideTrigger(true);
+ cb.setHideLabel(true);
+ // setTitle(i18n.t("User or group"));
+ cb.setItemSelector("div.search-item");
+
+ cb.addListener(new ComboBoxListenerAdapter() {
+ public void onSelect(final ComboBox comboBox, final Record record, final int index) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ final LinkDTO link = new LinkDTO(record.getAsString(SHORT_NAME_FIELD), record
+ .getAsString(LONG_NAME_FIELD), record.getAsString(ICON_URL_FIELD), record
+ .getAsString(LINK_FIELD));
+ presenter.onSelection(link);
+ }
+ });
+ }
+ });
+
+ searchForm.add(cb);
+ dialog.add(searchForm);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPresenter.java (from rev 820, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,55 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.search;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+
+import com.calclab.suco.client.signal.Slot;
+
+public class EntityLiveSearcherPresenter implements EntityLiveSearcher {
+
+ private EntityLiveSearcherView view;
+ private Slot<LinkDTO> slot;
+
+ public EntityLiveSearcherPresenter() {
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final EntityLiveSearcherView view) {
+ this.view = view;
+ }
+
+ public void onSelection(final LinkDTO link) {
+ slot.onEvent(link);
+ view.hide();
+ }
+
+ public void onSelection(final Slot<LinkDTO> slot) {
+ this.slot = slot;
+ }
+
+ public void show() {
+ view.show();
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherView.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/EntityLiveSearcherView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,35 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.search;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EntityLiveSearcherView extends View {
+
+ final public static int SEARCH_GROUPS = 1;
+ final public static int SEARCH_USERS = 2;
+
+ void show();
+
+ void hide();
+
+ void center();
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupLiveSearchPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupLiveSearchPanel.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearchPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.search;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+
+public class GroupLiveSearchPanel extends EntityLiveSearcherPanel {
+
+ public GroupLiveSearchPanel(final EntityLiveSearcherPresenter presenter, final I18nTranslationService i18n) {
+ super(presenter, EntityLiveSearcherView.SEARCH_GROUPS, i18n);
+ }
+
+}
\ No newline at end of file
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcher.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,25 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.ourproject.kune.workspace.client.search;
+
+public interface GroupLiveSearcher extends EntityLiveSearcher {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcherPresenter.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/GroupLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,25 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.search;
+
+
+public class GroupLiveSearcherPresenter extends EntityLiveSearcherPresenter implements GroupLiveSearcher {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteBottomTrayButton.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,33 @@
+package org.ourproject.kune.workspace.client.search;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.Window;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+
+public class SiteBottomTrayButton {
+
+ private final ToolbarButton traybarButton;
+
+ public SiteBottomTrayButton(final String icon, final String tooltip, final Window dialog, final WorkspaceSkeleton ws) {
+ traybarButton = new ToolbarButton();
+ traybarButton.setTooltip(tooltip);
+ traybarButton.setIcon(icon);
+ traybarButton.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ if (dialog.isVisible()) {
+ dialog.hide();
+ } else {
+ dialog.show();
+ }
+ }
+
+ });
+ ws.getSiteTraybar().addButton(traybarButton);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -37,7 +37,6 @@
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.TabPanel;
-import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.Window;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.event.PanelListenerAdapter;
@@ -63,7 +62,7 @@
private GridPanel groupsGrid;
private GridPanel contentGrid;
private final WorkspaceSkeleton ws;
- private ToolbarButton traybarButton;
+ private SiteBottomTrayButton traybarButton;
public SiteSearcherPanel(final SiteSearcherPresenter initPresenter, final I18nTranslationService i18n,
final WorkspaceSkeleton ws) {
@@ -100,21 +99,8 @@
dialog.expand();
dialog.center();
if (traybarButton == null) {
- traybarButton = new ToolbarButton();
- traybarButton.setTooltip(i18n.t("Show/hide searcher"));
- traybarButton.setIcon("images/kune-search-ico-push.gif");
- traybarButton.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- if (dialog.isVisible()) {
- dialog.hide();
- } else {
- dialog.show();
- }
- }
-
- });
- ws.getSiteTraybar().addButton(traybarButton);
+ traybarButton = new SiteBottomTrayButton("images/kune-search-ico-push.gif", i18n.t("Show/hide searcher"),
+ dialog, ws);
}
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcher.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,25 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.ourproject.kune.workspace.client.search;
+
+
+public interface UserLiveSearcher extends EntityLiveSearcher {
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearcherPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/UserLiveSearcherPanel.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.search;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+
+public class UserLiveSearcherPanel extends EntityLiveSearcherPanel {
+
+ public UserLiveSearcherPanel(final EntityLiveSearcherPresenter presenter, final I18nTranslationService i18n) {
+ super(presenter, EntityLiveSearcherView.SEARCH_USERS, i18n);
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPresenter.java (from rev 816, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java 2008-07-26 16:44:17 UTC (rev 816)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/UserLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,25 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.search;
+
+
+public class UserLiveSearcherPresenter extends EntityLiveSearcherPresenter implements UserLiveSearcher {
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessage;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress.SiteProgress;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -27,7 +27,7 @@
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.IconLabel;
import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
-import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
+import org.ourproject.kune.workspace.client.newgroup.NewGroupPanel;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.SiteToken;
import org.ourproject.kune.workspace.client.sitebar.login.SignInPanel;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,14 +20,12 @@
package org.ourproject.kune.workspace.client.sitebar.bar;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.GroupListDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
public class SiteBarPresenter implements SiteBar {
@@ -129,7 +127,6 @@
}
public void onHelpInTranslation() {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
}
public void onLoginCancelled() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -22,7 +22,7 @@
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
import org.ourproject.kune.platf.client.ui.dialogs.InfoDialog;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.msg.SimpleMessagePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -33,7 +33,7 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.login;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
public interface SignInView extends View {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/MessagePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/MessagePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/MessagePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.msg;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
public interface MessagePresenter {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,7 +1,7 @@
package org.ourproject.kune.workspace.client.sitebar.msg;
import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.HTML;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.msg;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
public interface SiteMessage extends View {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.msg;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
public class SiteMessagePresenter implements SiteMessage, MessagePresenter {
private SiteMessageView view;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessageView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessageView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessageView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -20,7 +20,7 @@
package org.ourproject.kune.workspace.client.sitebar.msg;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
public interface SiteMessageView extends View {
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearchListener.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.socialnet;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface EntityLiveSearchListener extends View {
-
- void onSelection(String shortName, String longName);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,56 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.socialnet;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.LinkDTO;
-import org.ourproject.kune.workspace.client.workspace.EntityLiveSearcher;
-
-import com.calclab.suco.client.signal.Slot;
-
-public class EntityLiveSearcherPresenter implements EntityLiveSearcher {
-
- private EntityLiveSearcherView view;
- private Slot<LinkDTO> slot;
-
- public EntityLiveSearcherPresenter() {
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final EntityLiveSearcherView view) {
- this.view = view;
- }
-
- public void onSelection(final LinkDTO link) {
- slot.onEvent(link);
- view.hide();
- }
-
- public void onSelection(final Slot<LinkDTO> slot) {
- this.slot = slot;
- }
-
- public void show() {
- view.show();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.socialnet;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface EntityLiveSearcherView extends View {
-
- final public static int SEARCH_GROUPS = 1;
- final public static int SEARCH_USERS = 2;
-
- void show();
-
- void hide();
-
- void center();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.socialnet;
-
-import org.ourproject.kune.workspace.client.workspace.GroupLiveSearcher;
-
-public class GroupLiveSearcherPresenter extends EntityLiveSearcherPresenter implements GroupLiveSearcher {
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,32 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.ourproject.kune.workspace.client.socialnet;
+
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.ui.MenuItem;
+
+public interface GroupMembersSummary {
+
+ void addGroupOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
+
+ void removeGroupOperation(MenuItem<GroupDTO> operation, boolean mustBeLogged);
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -14,6 +14,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import com.calclab.emiteuimodule.client.users.UserGridPanel;
+import com.calclab.suco.client.signal.Slot;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
import com.gwtext.client.core.EventObject;
@@ -40,14 +41,19 @@
super.setHeaderTitle(i18n.t("People and groups collaborating in this group"));
super.setBorderStylePrimaryName("k-dropdownouter-members");
super.addStyleName("kune-Margin-Medium-t");
- // super.addStyleName("kune-Margin-Small-r");
final GridDragConfiguration dragConf = new GridDragConfiguration(UserGridPanel.USER_GROUP_DD, i18n
.t("Drop in the chat area to start a chat.")
+ "<br/>" + i18n.t("Drop into a room to invite the user to join the chat room"));
gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This is an orphaned project, if you are interested "
+ "please request to join to work on it"), dragConf, true, true, false, true, false);
+ gridMenuPanel.onDoubleClick(new Slot<String>() {
+ public void onEvent(final String groupShortName) {
+ presenter.onDoubleClick(groupShortName);
+ }
+ });
final EntitySummary entitySummary = ws.getEntitySummary();
+ this.setContent(gridMenuPanel);
entitySummary.addInSummary(this);
entitySummary.addListener(new ContainerListenerAdapter() {
@Override
@@ -56,7 +62,6 @@
gridMenuPanel.setWidth(adjWidth);
}
});
- this.setContent(gridMenuPanel);
buttonsCache = new HashMap<GridButton, ToolbarButton>();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -18,11 +18,10 @@
import org.ourproject.kune.platf.client.ui.gridmenu.GridButton;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.search.UserLiveSearcher;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
-import org.ourproject.kune.workspace.client.workspace.UserLiveSearcher;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
@@ -176,4 +175,8 @@
}
}
+ public void onDoubleClick(String groupShortName) {
+ stateManager.gotoToken(groupShortName);
+ }
+
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummary.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,26 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.ourproject.kune.workspace.client.socialnet;
+
+
+public interface ParticipationSummary {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java (from rev 822, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,75 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.socialnet;
+
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.DropDownPanel;
+import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
+import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.EntitySummary;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.gwtext.client.widgets.BoxComponent;
+import com.gwtext.client.widgets.event.ContainerListenerAdapter;
+
+public class ParticipationSummaryPanel extends DropDownPanel implements ParticipationSummaryView {
+
+ private final GridMenuPanel<GroupDTO> gridMenuPanel;
+
+ public ParticipationSummaryPanel(final ParticipationSummaryPresenter presenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ super(true);
+ // super.setHeaderText(i18n.t("Participates as..."));
+ super.setHeaderText(i18n.t("Participates in"));
+ super.setHeaderTitle(i18n.t("Groups in which participates"));
+ super.setBorderStylePrimaryName("k-dropdownouter-part");
+ super.addStyleName("kune-Margin-Medium-t");
+ gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This user is not member of any group"), false, false,
+ false, false, false);
+ final EntitySummary entitySummary = ws.getEntitySummary();
+ this.setContent(gridMenuPanel);
+ entitySummary.addInSummary(this);
+ entitySummary.addListener(new ContainerListenerAdapter() {
+ @Override
+ public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,
+ final int rawWidth, final int rawHeight) {
+ gridMenuPanel.setWidth(adjWidth);
+ }
+ });
+ }
+
+ public void addItem(final GridItem<GroupDTO> gridItem) {
+ gridMenuPanel.addItem(gridItem);
+ }
+
+ public void clear() {
+ gridMenuPanel.removeAll();
+ }
+
+ public void hide() {
+ this.setVisible(false);
+ }
+
+ public void show() {
+ this.setVisible(true);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -34,7 +34,6 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.ParticipationSummary;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -10,11 +10,11 @@
import org.ourproject.kune.platf.client.services.ImageUtils;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.MenuItem;
import org.ourproject.kune.platf.client.ui.gridmenu.GridButton;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
import org.ourproject.kune.platf.client.ui.gridmenu.GridMenu;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItem;
import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItemCollection;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
@@ -26,14 +26,14 @@
protected GridButton requestJoin;
protected GridButton unJoinButton;
- protected GridMenuItem<GroupDTO> changeToCollabMenuItem;
- protected GridMenuItem<GroupDTO> removeMemberMenuItem;
- protected GridMenuItem<GroupDTO> changeToAdminMenuItem;
- protected GridMenuItem<GroupDTO> acceptJoinGroupMenuItem;
- protected GridMenuItem<GroupDTO> denyJoinGroupMenuItem;
- protected GridMenuItem<GroupDTO> gotoMemberMenuItem;
- protected GridMenuItem<GroupDTO> gotoGroupMenuItem;
- protected GridMenuItem<GroupDTO> unJoinMenuItem;
+ protected MenuItem<GroupDTO> changeToCollabMenuItem;
+ protected MenuItem<GroupDTO> removeMemberMenuItem;
+ protected MenuItem<GroupDTO> changeToAdminMenuItem;
+ protected MenuItem<GroupDTO> acceptJoinGroupMenuItem;
+ protected MenuItem<GroupDTO> denyJoinGroupMenuItem;
+ protected MenuItem<GroupDTO> gotoMemberMenuItem;
+ protected MenuItem<GroupDTO> gotoGroupMenuItem;
+ protected MenuItem<GroupDTO> unJoinMenuItem;
private final I18nUITranslationService i18n;
private final StateManager stateManager;
private final Provider<SocialNetworkServiceAsync> snServiceProvider;
@@ -56,24 +56,24 @@
otherLoggedOperations = new GridMenuItemCollection<GroupDTO>();
}
- public void addGroupOperation(final GridMenuItem<GroupDTO> operation, final boolean mustBeLogged) {
+ public void addGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
GridMenuItemCollection<GroupDTO> collection;
collection = mustBeLogged ? otherLoggedOperations : otherOperations;
collection.add(operation);
}
- public void removeGroupOperation(final GridMenuItem<GroupDTO> operation, final boolean mustBeLogged) {
+ public void removeGroupOperation(final MenuItem<GroupDTO> operation, final boolean mustBeLogged) {
GridMenuItemCollection<GroupDTO> collection;
collection = mustBeLogged ? otherLoggedOperations : otherOperations;
collection.remove(operation);
}
protected GridItem<GroupDTO> createGridItem(final GridGroup groupCategory, final GroupDTO group,
- final AccessRightsDTO rights, final GridMenuItem<GroupDTO>... gridMenuItems) {
+ final AccessRightsDTO rights, final MenuItem<GroupDTO>... gridMenuItems) {
final GridItem<GroupDTO> gridItem = createDefMemberMenu(group, groupCategory);
final GridMenu<GroupDTO> menu = gridItem.getMenu();
if (rights.isAdministrable()) {
- for (final GridMenuItem<GroupDTO> item : gridMenuItems) {
+ for (final MenuItem<GroupDTO> item : gridMenuItems) {
menu.addMenuItem(item);
}
}
@@ -129,25 +129,25 @@
}
private void createMenuActions() {
- gotoGroupMenuItem = new GridMenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this group homepage"),
+ gotoGroupMenuItem = new MenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this group homepage"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO groupDTO) {
stateManager.gotoToken(groupDTO.getShortName());
}
});
- gotoMemberMenuItem = new GridMenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this member homepage"),
+ gotoMemberMenuItem = new MenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this member homepage"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO groupDTO) {
stateManager.gotoToken(groupDTO.getShortName());
}
});
- unJoinMenuItem = new GridMenuItem<GroupDTO>("images/del.gif", i18n
+ unJoinMenuItem = new MenuItem<GroupDTO>("images/del.gif", i18n
.t("Don't participate more as a member in this group"), new Slot<GroupDTO>() {
public void onEvent(final GroupDTO groupDTO) {
removeMemberAction(groupDTO);
}
});
- changeToCollabMenuItem = new GridMenuItem<GroupDTO>("images/arrow-down-green.gif", i18n
+ changeToCollabMenuItem = new MenuItem<GroupDTO>("images/arrow-down-green.gif", i18n
.t("Change to collaborator"), new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
@@ -162,7 +162,7 @@
});
}
});
- removeMemberMenuItem = new GridMenuItem<GroupDTO>("images/del.gif", i18n.t("Remove this member"),
+ removeMemberMenuItem = new MenuItem<GroupDTO>("images/del.gif", i18n.t("Remove this member"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
@@ -181,7 +181,7 @@
});
}
});
- changeToAdminMenuItem = new GridMenuItem<GroupDTO>("images/arrow-up-green.gif", i18n.t("Change to admin"),
+ changeToAdminMenuItem = new MenuItem<GroupDTO>("images/arrow-up-green.gif", i18n.t("Change to admin"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
@@ -196,7 +196,7 @@
});
}
});
- acceptJoinGroupMenuItem = new GridMenuItem<GroupDTO>("images/accept.gif", i18n.t("Accept this member"),
+ acceptJoinGroupMenuItem = new MenuItem<GroupDTO>("images/accept.gif", i18n.t("Accept this member"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
@@ -211,7 +211,7 @@
});
}
});
- denyJoinGroupMenuItem = new GridMenuItem<GroupDTO>("images/cancel.gif", i18n.t("Don't accept this member"),
+ denyJoinGroupMenuItem = new MenuItem<GroupDTO>("images/cancel.gif", i18n.t("Don't accept this member"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/UserLiveSearcherPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.socialnet;
-
-import org.ourproject.kune.workspace.client.workspace.UserLiveSearcher;
-
-public class UserLiveSearcherPresenter extends EntityLiveSearcherPresenter implements UserLiveSearcher {
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummary.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,26 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.ourproject.kune.workspace.client.summary;
+
+
+public interface GroupSummary {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPanel.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,55 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.summary;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.DropDownPanel;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class GroupSummaryPanel extends DropDownPanel implements GroupSummaryView {
+
+ private final VerticalPanel vp;
+
+ public GroupSummaryPanel(final GroupSummaryPresenter presenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ super(i18n.t("Group Summary"), true);
+ setHeaderTitle(i18n.t("Some summarized information about current project" + Site.IN_DEVELOPMENT));
+ vp = new VerticalPanel();
+ vp.setWidth("100%");
+ super.setContent(vp);
+ super.setContentVisible(true);
+ super.setBorderStylePrimaryName("k-dropdownouter-summary");
+ addStyleName("kune-Margin-Medium-t");
+ // Disabled while in development
+ // ws.getEntitySummary().addInSummary(this);
+ }
+
+ public void setComment(final String comment) {
+ final Label label = new Label(comment);
+ label.addStyleName("kune-Margin-Small-trbl");
+ vp.clear();
+ vp.add(label);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -24,7 +24,6 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupSummary;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot2;
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummary.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,31 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.ourproject.kune.workspace.client.tags;
+
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
+
+public interface TagsSummary {
+
+ void setGroupTags(List<TagResultDTO> result);
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -29,10 +29,11 @@
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -60,31 +61,34 @@
addStyleName("kune-Margin-Medium-t");
flowPanel.addStyleName("kune-Margin-Small-trbl");
ws.getEntitySummary().addInSummary(this);
- RootPanel.get("kuneinitialcurtain").setVisible(false);
}
public void setTags(final List<TagResultDTO> groupTags) {
- flowPanel.clear();
- if (groupTags.size() == 0) {
- flowPanel.add(noTagsLabel);
- } else {
- for (final Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) {
- final TagResultDTO tagResult = iterator.next();
- final Label label = new Label(tagResult.getName());
- // i18n pluralization
- if (tagResult.getCount().intValue() > 1) {
- KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount()));
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ flowPanel.clear();
+ if (groupTags.size() == 0) {
+ flowPanel.add(noTagsLabel);
} else {
- KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount()));
+ for (final Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) {
+ final TagResultDTO tagResult = iterator.next();
+ final Label label = new Label(tagResult.getName());
+ // i18n pluralization
+ if (tagResult.getCount().intValue() > 1) {
+ KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount()));
+ } else {
+ KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount()));
+ }
+ label.addClickListener(new ClickListener() {
+ public void onClick(final Widget sender) {
+ presenter.doSearchTag(tagResult.getName());
+ }
+ });
+ label.addStyleName("kune-TagsPanel-tag");
+ flowPanel.add(label);
+ }
}
- label.addClickListener(new ClickListener() {
- public void onClick(final Widget sender) {
- presenter.doSearchTag(tagResult.getName());
- }
- });
- label.addStyleName("kune-TagsPanel-tag");
- flowPanel.add(label);
}
- }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -31,7 +31,6 @@
import org.ourproject.kune.workspace.client.search.SiteSearcherType;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
@@ -41,11 +40,11 @@
private TagsSummaryView view;
private final Provider<SiteSearcher> searcherProvider;
- private final Provider<Session> sessionProvider;
+ private final Session session;
- public TagsSummaryPresenter(final Provider<Session> sessionProvider, final Provider<SiteSearcher> searcherProvider,
+ public TagsSummaryPresenter(final Session session, final Provider<SiteSearcher> searcherProvider,
final StateManager stateManager, final WsThemePresenter wsThemePresenter) {
- this.sessionProvider = sessionProvider;
+ this.session = session;
this.searcherProvider = searcherProvider;
stateManager.onStateChanged(new Slot<StateDTO>() {
public void onEvent(final StateDTO state) {
@@ -61,7 +60,7 @@
public void doSearchTag(final String name) {
searcherProvider.get().doSearchOfType(
- "group:" + sessionProvider.get().getCurrentState().getGroup().getShortName() + " tag:" + name,
+ "group:" + session.getCurrentState().getGroup().getShortName() + " tag:" + name,
SiteSearcherType.content);
}
@@ -77,8 +76,13 @@
view.setTags(groupTags);
}
- private void setState(final StateDTO state) {
- view.setTags(state.getGroupTags());
+ void setState(final StateDTO state) {
+ if (state.getTags() != null && state.getTags().length() > 0) {
+ view.setVisible(true);
+ view.setTags(state.getGroupTags());
+ } else {
+ view.setVisible(false);
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -32,4 +32,6 @@
void setTheme(WsTheme oldTheme, WsTheme newTheme);
+ void setVisible(boolean visible);
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -27,7 +27,6 @@
import org.ourproject.kune.platf.client.ui.HorizontalLine;
import org.ourproject.kune.platf.client.ui.IconLabel;
-import com.calclab.suco.client.container.Provider;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DockPanel;
@@ -46,10 +45,10 @@
private final I18nTranslationService i18n;
public ContextItemsPanel(final ContextItemsPresenter presenter, final I18nTranslationService i18n,
- final Provider<StateManager> stateManagerProvider) {
+ final StateManager stateManager) {
this.presenter = presenter;
this.i18n = i18n;
- topBar = new ContextTopBar(presenter, i18n, stateManagerProvider);
+ topBar = new ContextTopBar(presenter, i18n, stateManager);
addTopBar(topBar);
items = new ItemsPanel(presenter);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -33,7 +33,7 @@
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ParamCallback;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
import com.calclab.suco.client.signal.Slot;
@@ -42,9 +42,11 @@
public class ContextItemsPresenter implements ContextItems {
protected ContextItemsView view;
private final I18nTranslationService i18n;
+ private final StateManager stateManager;
- public ContextItemsPresenter(final I18nTranslationService i18n) {
+ public ContextItemsPresenter(final I18nTranslationService i18n, final StateManager stateManager) {
this.i18n = i18n;
+ this.stateManager = stateManager;
}
public void canCreate(final String typeName, final String label, final Slot<?> slot) {
@@ -83,7 +85,7 @@
DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
new ParamCallback<String, Object>(text, new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RELOAD_CONTEXT, null);
+ stateManager.reloadContextAndTitles();
Site.hideProgress();
}
}));
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -26,7 +26,6 @@
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
-import com.calclab.suco.client.container.Provider;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.HorizontalPanel;
@@ -46,12 +45,12 @@
private final ContextItemsImages img;
private final MenuBar pathSubmenu;
private final I18nTranslationService i18n;
- private final Provider<StateManager> stateManagerProvider;
+ private final StateManager stateManager;
public ContextTopBar(final ContextItemsPresenter presenter, final I18nTranslationService i18n,
- final Provider<StateManager> stateManagerProvider) {
+ final StateManager stateManager) {
this.i18n = i18n;
- this.stateManagerProvider = stateManagerProvider;
+ this.stateManager = stateManager;
img = ContextItemsImages.App.getInstance();
firstRow = new HorizontalPanel();
final HorizontalPanel secondRow = new HorizontalPanel();
@@ -114,7 +113,7 @@
}
pathSubmenu.addItem(indent + img.folder().getHTML() + " " + folderName, true, new Command() {
public void execute() {
- stateManagerProvider.get().gotoContainer(folder.getId());
+ stateManager.gotoContainer(folder.getId());
}
});
indent = indent + "  ";
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogo.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogo.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,6 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.entitylogo;
+
+
+public interface EntityLogo {
+
+}
\ No newline at end of file
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPanel.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,123 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package org.ourproject.kune.workspace.client.ui.newtmp.entitylogo;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Hyperlink;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class EntityLogoPanel extends SimplePanel implements EntityLogoView {
+ class EntityTextLogo extends VerticalPanel {
+
+ private static final int GROUP_NAME_LIMIT_SIZE = 90;
+ private static final String LOGO_SMALL_FONT_SIZE = "108%";
+ private static final String LOGO_DEFAULT_FONT_SIZE = "167%";
+ private final Label defTextLogoLabel;
+ private final Hyperlink defTextPutYourLogoHL;
+ private final HorizontalPanel putYourLogoHP;
+
+ public EntityTextLogo() {
+ // Initialize
+ super();
+ defTextLogoLabel = new Label();
+ final HTML expandCell = new HTML("<b></b>");
+ putYourLogoHP = new HorizontalPanel();
+ defTextPutYourLogoHL = new Hyperlink();
+
+ // Layout
+ add(defTextLogoLabel);
+ add(putYourLogoHP);
+ putYourLogoHP.add(expandCell);
+ putYourLogoHP.add(defTextPutYourLogoHL);
+
+ // Set properties
+ // TODO: Put your logo here functionality
+ defTextPutYourLogoHL.setText(i18n.t("Put Your Logo Here"));
+ expandCell.setWidth("100%");
+ putYourLogoHP.setCellWidth(expandCell, "100%");
+ // TODO: link to configure the logo
+ setStylePrimaryName("k-entitytextlogo");
+ setDefaultText("");
+ }
+
+ public void setDefaultText(final String text) {
+ if (text.length() > GROUP_NAME_LIMIT_SIZE) {
+ DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_SMALL_FONT_SIZE);
+ } else {
+ DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_DEFAULT_FONT_SIZE);
+ }
+ defTextLogoLabel.setText(text);
+
+ }
+
+ public void setPutYourLogoVisible(final boolean visible) {
+ putYourLogoHP.setVisible(visible);
+ }
+
+ }
+
+ private EntityTextLogo entityTextLogo;
+ private final I18nTranslationService i18n;
+
+ public EntityLogoPanel(final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
+ this.i18n = i18n;
+ ws.getEntityMainHeader().add(this);
+ }
+
+ public void setLogo(final Image image) {
+ clear();
+ add(image);
+ }
+
+ public void setLogo(final String groupName) {
+ clear();
+ add(getEntityTextLogo());
+ entityTextLogo.setDefaultText(groupName);
+ }
+
+ public void setPutYourLogoVisible(final boolean visible) {
+ getEntityTextLogo().setPutYourLogoVisible(visible);
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ getEntityTextLogo().removeStyleDependentName(oldTheme.toString());
+ }
+ getEntityTextLogo().addStyleDependentName(newTheme.toString());
+ }
+
+ private EntityTextLogo getEntityTextLogo() {
+ if (entityTextLogo == null) {
+ this.entityTextLogo = new EntityTextLogo();
+ }
+ return entityTextLogo;
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPresenter.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,37 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.entitylogo;
+
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
+
+public class EntityLogoPresenter implements EntityLogo {
+ private EntityLogoView view;
+
+ public EntityLogoPresenter(final StateManager stateManager, final WsThemePresenter theme) {
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ final GroupDTO group = state.getGroup();
+ final boolean isAdmin = state.getGroupRights().isAdministrable();
+
+ view.setLogo(group.getLongName());
+ view.setPutYourLogoVisible(isAdmin);
+ }
+ });
+ theme.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void init(final EntityLogoView view) {
+ this.view = view;
+
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoView.java (from rev 823, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/entitylogo/EntityLogoView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -0,0 +1,17 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.entitylogo;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Image;
+
+public interface EntityLogoView {
+
+ // FIXME: Don' use Image
+ public abstract void setLogo(final Image image);
+
+ public abstract void setLogo(final String groupName);
+
+ public abstract void setPutYourLogoVisible(final boolean visible);
+
+ public abstract void setTheme(final WsTheme oldTheme, WsTheme newTheme);
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -36,7 +36,7 @@
public void addInTools(final Widget widget) {
entityTools.add(widget);
- mainPanel.doLayoutIfNeeded(true);
+ mainPanel.doLayoutIfNeeded();
}
public void addListener(final ContainerListener listener) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -30,7 +30,6 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
import com.calclab.suco.client.signal.Slot;
@@ -42,11 +41,13 @@
private EntityTitleView view;
private final I18nTranslationService i18n;
private final KuneErrorHandler errorHandler;
+ private final StateManager stateManager;
public EntityTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler,
final StateManager stateManager) {
this.i18n = i18n;
this.errorHandler = errorHandler;
+ this.stateManager = stateManager;
stateManager.onStateChanged(new Slot<StateDTO>() {
public void onEvent(final StateDTO state) {
setState(state);
@@ -73,7 +74,7 @@
public void onSuccess(final String result) {
Site.hideProgress();
view.setContentTitle(result);
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RELOAD_CONTEXT, null);
+ stateManager.reloadContextAndTitles();
}
};
DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-
-public interface ContentBottomToolBarComponent extends Component {
-
- void setEnabledRateIt(boolean enabled);
-
- void setRate(StateDTO state, boolean logged);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,76 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-
-public class ContentBottomToolBarPresenter implements ContentBottomToolBarComponent {
-
- private ContentBottomToolBarView view;
-
- public void init(final ContentBottomToolBarView view) {
- this.view = view;
- }
-
- public View getView() {
- return view;
- }
-
- public void setRate(final StateDTO state, boolean logged) {
- if (state.isRateable()) {
- if (!logged) {
- setRate(state.getRate(), state.getRateByUsers());
- } else {
- setRate(state.getRate(), state.getRateByUsers(), state.getCurrentUserRate());
- }
- } else {
- setRateVisible(false);
- setRateItVisible(false);
- }
- }
-
- private void setRate(final Double value, final Integer rateByUsers, final Double currentUserRate) {
- view.setRate(value, rateByUsers);
- view.setRateIt(currentUserRate);
- setRateVisible(true);
- setRateItVisible(true);
- }
-
- private void setRate(final Double value, final Integer rateByUsers) {
- view.setRate(value, rateByUsers);
- setRateVisible(true);
- setRateItVisible(false);
- }
-
- private void setRateVisible(final boolean visible) {
- view.setRateVisible(visible);
- }
-
- private void setRateItVisible(final boolean visible) {
- view.setRateItVisible(visible);
- }
-
- public void setEnabledRateIt(final boolean enabled) {
- view.setRateItVisible(enabled);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentBottomToolBarView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface ContentBottomToolBarView extends View {
-
- void setRate(Double value, Integer rateByUsers);
-
- void setRateIt(Double currentUserRate);
-
- void setRateVisible(boolean b);
-
- void setRateItVisible(boolean visible);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-
-public interface ContentSubTitleComponent extends Component {
-
- void setState(StateDTO state);
-
- void setContentLanguage(String langName);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitlePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitlePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,65 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-
-public class ContentSubTitlePresenter implements ContentSubTitleComponent {
-
- private ContentSubTitleView view;
- private final I18nTranslationService i18n;
-
- public ContentSubTitlePresenter(final I18nTranslationService i18n) {
- this.i18n = i18n;
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final ContentSubTitleView view) {
- this.view = view;
- }
-
- public void setContentLanguage(final String langName) {
- view.setContentSubTitleRight(i18n.t("Language: [%s]", langName));
- }
-
- public void setState(final StateDTO state) {
- if (state.hasDocument()) {
- view.setContentSubTitleLeft(i18n.tWithNT("by: [%s]", "used in a list of authors", state.getAuthors().get(0)
- .getName()));
- view.setContentSubTitleLeftVisible(true);
- } else {
- view.setContentSubTitleLeftVisible(false);
- }
- if (state.getLanguage() != null) {
- String langName = state.getLanguage().getEnglishName();
- setContentLanguage(langName);
- view.setContentSubTitleRightVisible(true);
- } else {
- view.setContentSubTitleRightVisible(false);
- }
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentSubTitleView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface ContentSubTitleView extends View {
-
- void setContentSubTitleLeft(String subTitle);
-
- void setContentSubTitleRight(String subTitle);
-
- void setContentSubTitleLeftVisible(boolean visible);
-
- void setContentSubTitleRightVisible(boolean visible);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import java.util.Date;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-
-public interface ContentTitleComponent extends Component {
-
- void setState(StateDTO state);
-
- void setContentDate(Date publishedOn);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitlePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitlePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,106 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import java.util.Date;
-
-import org.ourproject.kune.docs.client.actions.DocsEvents;
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.rpc.ParamCallback;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.KuneErrorHandler;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-
-import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class ContentTitlePresenter implements ContentTitleComponent {
-
- private ContentTitleView view;
- private final I18nTranslationService i18n;
- private final KuneErrorHandler errorHandler;
-
- public ContentTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler) {
- this.i18n = i18n;
- this.errorHandler = errorHandler;
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final ContentTitleView view) {
- this.view = view;
- }
-
- public void onTitleRename(final String text) {
- Site.showProgressSaving();
- AsyncCallback<String> callback = new AsyncCallback<String>() {
- public void onFailure(final Throwable caught) {
- view.restoreOldTitle();
- errorHandler.process(caught);
- }
-
- public void onSuccess(final String result) {
- Site.hideProgress();
- view.setContentTitle(result);
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RELOAD_CONTEXT, null);
- }
- };
- DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
- new ParamCallback<String, String>(text, callback));
- }
-
- public void setContentDate(final Date publishedOn) {
- DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy, Z");
- view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
- }
-
- public void setState(final StateDTO state) {
- if (state.hasDocument()) {
- setContentTitle(state.getTitle(), state.getContentRights().isEditable());
- setContentDateVisible(true);
- setContentDate(state.getPublishedOn());
- } else {
- if (state.getFolder().getParentFolderId() == null) {
- // We translate root folder names (documents, chat room,
- // etcetera)
- setContentTitle(i18n.t(state.getTitle()), false);
- } else {
- setContentTitle(state.getTitle(), state.getContentRights().isEditable());
- }
- setContentDateVisible(false);
- }
- }
-
- private void setContentDateVisible(final boolean visible) {
- view.setDateVisible(visible);
- }
-
- private void setContentTitle(final String title, final boolean editable) {
- view.setContentTitle(title);
- view.setContentTitleEditable(editable);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentTitleView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface ContentTitleView extends View {
-
- void setContentTitle(String title);
-
- void setContentDate(String date);
-
- void setDateVisible(boolean visible);
-
- void setContentTitleEditable(boolean editable);
-
- void restoreOldTitle();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.Component;
-
-public interface ContentToolBarComponent extends Component {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.View;
-
-public class ContentToolBarPresenter implements ContentToolBarComponent {
-
- private ContentToolBarView view;
-
- public void init(final ContentToolBarView view) {
- this.view = view;
- }
-
- public View getView() {
- return view;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ContentToolBarView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,27 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface ContentToolBarView extends View {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.dto.LinkDTO;
-
-import com.calclab.suco.client.signal.Slot;
-
-public interface EntityLiveSearcher {
-
- void onSelection(Slot<LinkDTO> slot);
-
- void show();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,25 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-public interface GroupLiveSearcher extends EntityLiveSearcher {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItem;
-
-public interface GroupMembersSummary {
-
- void addGroupOperation(GridMenuItem<GroupDTO> operation, boolean mustBeLogged);
-
- void removeGroupOperation(GridMenuItem<GroupDTO> operation, boolean mustBeLogged);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-
-public interface GroupSummary {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-
-public interface ParticipationSummary {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-
-public interface TagsSummary {
-
- void setGroupTags(List<TagResultDTO> result);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ThemeMenuComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ThemeMenuComponent.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ThemeMenuComponent.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.Component;
-
-public interface ThemeMenuComponent extends Component {
-
- void setThemes(String themes[]);
-
- void setVisible(boolean visible);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/UserLiveSearcher.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-public interface UserLiveSearcher extends EntityLiveSearcher {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,57 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.workspace;
-
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.tool.ClientTool;
-import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
-
-public interface Workspace extends Component {
-
- public static final int MIN_WIDTH = 800;
-
- public static final int MIN_HEIGHT = 480;
-
- public void adjustSize(int windowWidth, int clientHeight);
-
- public void attachTools(Iterator<ClientTool> iterator);
-
- public int calculateHeight(int clientHeight);
-
- public int calculateWidth(int clientWidth);
-
- public ContentSubTitleComponent getContentSubTitleComponent();
-
- public ContentTitleComponent getContentTitleComponent();
-
- public LicenseComponent getLicenseComponent();
-
- public void setTheme(String theme);
-
- public void setTool(String toolName);
-
- public void setVisible(boolean visible);
-
- public void showGroup(GroupDTO group, boolean isAdmin);
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceListener.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceListener.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.workspace;
-
-public interface WorkspaceListener {
- void onTabSelected(int tabIndex);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,164 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.workspace;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidget;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.tool.ClientTool;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
-
-import com.google.gwt.user.client.ui.Widget;
-
-public class WorkspacePresenter implements Workspace {
- private WorkspaceView view;
- private WorkspaceComponent context;
- private WorkspaceComponent content;
- private WorkspaceUIComponents components;
- private ExtensibleWidgetsManager extensionPointManager;
-
- public WorkspacePresenter(final Session session) {
- }
-
- public void adjustSize(final int windowWidth, final int clientHeight) {
- view.adjustSize(windowWidth, clientHeight);
- }
-
- public void attachToExtensibleWidget(final ExtensibleWidgetChild child) {
- extensionPointManager.attachToExtensible(child);
- }
-
- public void attachTools(final Iterator<ClientTool> iterator) {
- ClientTool clientTool;
- while (iterator.hasNext()) {
- clientTool = iterator.next();
- // view.addTab(clientTool.getTrigger());
- }
- }
-
- /**
- * Calculates Workspaceheight depending of the client Window size but with a
- * limit
- */
- public int calculateHeight(final int clientHeight) {
- // 15 is the size of scrollbar
- return clientHeight <= MIN_HEIGHT ? MIN_HEIGHT - 15 : clientHeight;
- }
-
- /**
- * Calculates Workspace width depending of the client Window size but with a
- * limit
- */
- public int calculateWidth(final int clientWidth) {
- return clientWidth <= MIN_WIDTH ? MIN_WIDTH - 15 : clientWidth;
- }
-
- public void clearExtensibleWidget(final String id) {
- extensionPointManager.detachAll(id);
- }
-
- public void detachFromExtensibleWidget(final ExtensibleWidgetChild child) {
- extensionPointManager.detachFromExtensible(child);
- }
-
- public ContentSubTitleComponent getContentSubTitleComponent() {
- return components.getContentSubTitleComponent();
- }
-
- public ContentTitleComponent getContentTitleComponent() {
- return components.getContentTitleComponent();
- }
-
- public LicenseComponent getLicenseComponent() {
- return components.getLicenseComponent();
- }
-
- public View getView() {
- return view;
- }
-
- public void init(final WorkspaceView view, final ExtensibleWidgetsManager extensionPointManager) {
- this.view = view;
- this.extensionPointManager = extensionPointManager;
- this.components = new WorkspaceUIComponents(this);
- view.setComponents(components);
- view.registerUIExtensionPoints();
- }
-
- public void onSplitterStartResizing(final Widget sender) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, null);
- }
-
- public void onSplitterStopResizing(final Widget sender) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, null);
- }
-
- public void registerExtensibleWidget(final String id, final ExtensibleWidget extensibleWidget) {
- extensionPointManager.registerExtensibleWidget(id, extensibleWidget);
- }
-
- public void registerExtensibleWidgets(final HashMap<String, ExtensibleWidget> extensibleWidget) {
- extensionPointManager.registerExtensibleWidgets(extensibleWidget);
- }
-
- public void setContent(final WorkspaceComponent contentComponent) {
- if (content != null) {
- content.detach();
- }
- content = contentComponent;
- content.attach();
- view.setContent(content.getView());
- }
-
- public void setContext(final WorkspaceComponent contextComponent) {
- if (context != null) {
- context.detach();
- }
- context = contextComponent;
- context.attach();
- view.setContext(context.getView());
- }
-
- public void setTheme(final String theme) {
- view.setTheme(theme);
- }
-
- public void setTool(final String toolName) {
- view.setTool(toolName);
- }
-
- public void setVisible(final boolean visible) {
- view.setVisible(visible);
- }
-
- public void showGroup(final GroupDTO group, final boolean isAdmin) {
- view.setGroupLogo(group.getLongName());
- view.setPutYourLogoVisible(isAdmin);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,63 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.workspace.client.WorkspaceFactory;
-import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
-
-public class WorkspaceUIComponents {
- private LicenseComponent license;
- private ContentTitleComponent contentTitle;
- private ContentSubTitleComponent contentSubTitle;
- private ContentToolBarComponent contentToolBar;
-
- public WorkspaceUIComponents(final WorkspacePresenter presenter) {
- }
-
- public ContentSubTitleComponent getContentSubTitleComponent() {
- if (contentSubTitle == null) {
- contentSubTitle = WorkspaceFactory.createContentSubTitleComponent();
- }
- return contentSubTitle;
- }
-
- public ContentTitleComponent getContentTitleComponent() {
- if (contentTitle == null) {
- contentTitle = WorkspaceFactory.createContentTitleComponent();
- }
- return contentTitle;
- }
-
- public ContentToolBarComponent getContentToolBarComponent() {
- if (contentToolBar == null) {
- contentToolBar = WorkspaceFactory.createContentToolBarComponent();
- }
- return contentToolBar;
- }
-
- public LicenseComponent getLicenseComponent() {
- if (license == null) {
- license = WorkspaceFactory.createLicenseComponent();
- }
- return license;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,73 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.workspace;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.tool.ToolTrigger;
-
-import com.google.gwt.user.client.ui.Image;
-
-public interface WorkspaceView extends View {
-
- void setGroupLogo(String groupName);
-
- void setGroupLogo(Image image);
-
- void setContent(View contentView);
-
- void setContext(View contextView);
-
- void setTool(String toolName);
-
- void adjustSize(int windowWidth, int clientHeight);
-
- void addTab(ToolTrigger trigger);
-
- void setContentTitle(View view);
-
- void setContentSubTitle(View view);
-
- void setBottom(View view);
-
- void setGroupMembers(View view);
-
- void setParticipation(View view);
-
- void setSummary(View view);
-
- void addBottomIconComponent(View view);
-
- void setTheme(String theme);
-
- void setVisible(boolean visible);
-
- void setTags(View view);
-
- void setContentToolBar(View view);
-
- void setContentBottomToolBar(View view);
-
- void setPutYourLogoVisible(boolean visible);
-
- void registerUIExtensionPoints();
-
- void setComponents(WorkspaceUIComponents components);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/BottomIconsTrayPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/BottomIconsTrayPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/BottomIconsTrayPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,23 +0,0 @@
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import org.ourproject.kune.platf.client.extend.ExtensibleWidget;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class BottomIconsTrayPanel extends HorizontalPanel implements ExtensibleWidget {
-
- public void attach(final ExtensibleWidgetChild child) {
- super.add((Widget) child.getView());
- }
-
- public void detach(final ExtensibleWidgetChild child) {
- super.remove((Widget) child.getView());
- }
-
- public void detachAll(final String id) {
- super.clear();
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentBottomToolBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentBottomToolBarPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentBottomToolBarPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,88 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.CustomPushButton;
-import org.ourproject.kune.workspace.client.workspace.ContentBottomToolBarPresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentBottomToolBarView;
-
-import com.google.gwt.user.client.ui.ClickListener;
-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 ContentBottomToolBarPanel extends HorizontalPanel implements ContentBottomToolBarView {
-
- // private final RatePanel rate;
- // private final RateItPresenter rateItPresenter;
- // private final RateItPanel rateIt;
- private CustomPushButton btn;
-
- public ContentBottomToolBarPanel(final ContentBottomToolBarPresenter presenter, final I18nTranslationService i18n) {
- // rate = new RatePanel(null, null, i18n);
- // rateItPresenter = null;
- // rateIt = new RateItPanel(rateItPresenter, i18n, null);
- // rateItPresenter.init(rateIt);
- final Label expand = new Label("");
- // this.add(rateIt);
- this.add(expand);
- // this.add(rate);
- this.setWidth("100%");
- expand.setWidth("100%");
- this.setCellWidth(expand, "100%");
- this.addStyleName("kune-ContentToolBarPanel");
- this.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- // this.setCellVerticalAlignment(rate, VerticalPanel.ALIGN_MIDDLE);
- // this.setCellVerticalAlignment(rateIt, VerticalPanel.ALIGN_MIDDLE);
- // rate.setVisible(false);
- // rateIt.setVisible(false);
- // TODO setEnabled false to RateIt
- }
-
- public void addButton(final String caption, final ClickListener listener) {
- btn = new CustomPushButton(caption, listener);
- this.insert(btn, 0);
- btn.addStyleName("kune-Button-Large-lrSpace");
- }
-
- public void setButtonVisible(final boolean isEnabled) {
- btn.setVisible(isEnabled);
- }
-
- public void setRate(final Double value, final Integer rateByUsers) {
- // rate.setRate(value);
- // rate.setByUsers(rateByUsers);
- }
-
- public void setRateIt(final Double currentUserRate) {
- // rateItPresenter.setRate(currentUserRate);
- }
-
- public void setRateItVisible(final boolean visible) {
- // rateIt.setVisible(visible);
- }
-
- public void setRateVisible(final boolean visible) {
- // rate.setVisible(visible);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentSubTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentSubTitlePanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentSubTitlePanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,82 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.workspace.ContentSubTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentSubTitleView;
-
-import com.google.gwt.user.client.DOM;
-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 ContentSubTitlePanel extends HorizontalPanel implements ContentSubTitleView {
- private final Label subTitleLeftLabel;
- private final Label subTitleRightLabel;
-
- public ContentSubTitlePanel(final ContentSubTitlePresenter presenter, final I18nTranslationService i18n) {
-
- subTitleLeftLabel = new Label();
- HorizontalPanel rigthHP = new HorizontalPanel();
- subTitleRightLabel = new Label();
-
- add(subTitleLeftLabel);
- add(rigthHP);
- rigthHP.add(subTitleRightLabel);
-
- setWidth("100%");
- subTitleRightLabel.setText(i18n.t("Language:"));
- subTitleLeftLabel.addStyleName("kune-Margin-Large-l");
- subTitleLeftLabel.addStyleName("kune-ft15px");
- subTitleLeftLabel.addStyleName("kune-ContentSubTitleBar-l");
- subTitleRightLabel.addStyleName("kune-Margin-Large-r");
- subTitleRightLabel.addStyleName("kune-ft12px");
- rigthHP.addStyleName("kune-ContentSubTitleBar-r");
- setCellVerticalAlignment(rigthHP, VerticalPanel.ALIGN_MIDDLE);
- rigthHP.setCellVerticalAlignment(subTitleLeftLabel, VerticalPanel.ALIGN_MIDDLE);
- rigthHP.setCellVerticalAlignment(subTitleRightLabel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setColors(final String background, final String textColor) {
- DOM.setStyleAttribute(this.getElement(), "backgroundColor", background);
- DOM.setStyleAttribute(subTitleLeftLabel.getElement(), "color", textColor);
- DOM.setStyleAttribute(subTitleRightLabel.getElement(), "color", textColor);
- }
-
- public void setContentSubTitleLeft(final String subTitle) {
- subTitleLeftLabel.setText(subTitle);
- }
-
- public void setContentSubTitleLeftVisible(final boolean visible) {
- subTitleLeftLabel.setVisible(visible);
- }
-
- public void setContentSubTitleRight(final String subTitle) {
- subTitleRightLabel.setText(subTitle);
-
- }
-
- public void setContentSubTitleRightVisible(final boolean visible) {
- subTitleRightLabel.setVisible(visible);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentTitlePanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentTitlePanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,88 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import org.ourproject.kune.platf.client.ui.EditableIconLabel;
-import org.ourproject.kune.platf.client.ui.EditableClickListener;
-import org.ourproject.kune.workspace.client.workspace.ContentTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentTitleView;
-
-import com.google.gwt.user.client.DOM;
-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 ContentTitlePanel extends HorizontalPanel implements ContentTitleView {
- private final EditableIconLabel titleLabel;
- private final Label dateLabel;
-
- public ContentTitlePanel(final ContentTitlePresenter presenter) {
- titleLabel = new EditableIconLabel(new EditableClickListener() {
- public void onEdited(final String text) {
- presenter.onTitleRename(text);
- }
- });
- HorizontalPanel rigthHP = new HorizontalPanel();
- dateLabel = new Label();
-
- add(titleLabel);
- add(rigthHP);
- rigthHP.add(dateLabel);
-
- setWidth("100%");
- titleLabel.addStyleName("kune-Margin-Large-l");
- titleLabel.addStyleName("kune-ft17px");
- dateLabel.addStyleName("kune-Margin-Large-r");
- dateLabel.addStyleName("kune-ft12px");
- titleLabel.addStyleName("kune-ContentTitleBar-l");
- rigthHP.addStyleName("kune-ContentTitleBar-r");
- setCellVerticalAlignment(titleLabel, VerticalPanel.ALIGN_MIDDLE);
- setCellVerticalAlignment(rigthHP, VerticalPanel.ALIGN_MIDDLE);
- rigthHP.setCellVerticalAlignment(dateLabel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setContentTitle(final String title) {
- titleLabel.setText(title);
- }
-
- public void setContentTitleEditable(final boolean editable) {
- titleLabel.setEditable(editable);
- }
-
- public void setContentDate(final String date) {
- dateLabel.setText(date);
- }
-
- public void setColors(final String background, final String textColor) {
- DOM.setStyleAttribute(this.getElement(), "backgroundColor", background);
- DOM.setStyleAttribute(titleLabel.getElement(), "color", textColor);
- DOM.setStyleAttribute(dateLabel.getElement(), "color", textColor);
- }
-
- public void setDateVisible(final boolean visible) {
- dateLabel.setVisible(visible);
-
- }
-
- public void restoreOldTitle() {
- titleLabel.restoreOldText();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentToolBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentToolBarPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/ContentToolBarPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,70 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import java.util.HashMap;
-
-import org.ourproject.kune.platf.client.extend.ExtensibleWidget;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
-import org.ourproject.kune.workspace.client.workspace.ContentToolBarPresenter;
-import org.ourproject.kune.workspace.client.workspace.ContentToolBarView;
-
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-
-public class ContentToolBarPanel extends HorizontalPanel implements ContentToolBarView, ExtensibleWidget {
-
- private final HorizontalPanel leftHP;
-
- public ContentToolBarPanel(final ContentToolBarPresenter presenter) {
- leftHP = new HorizontalPanel();
- add(leftHP);
- add(new Label(""));
- this.setWidth("100%");
- this.addStyleName("kune-ContentToolBarPanel");
- leftHP.addStyleName("kune-Margin-Large-l");
- }
-
- public HashMap<String, ExtensibleWidget> getExtensionPoints() {
- HashMap<String, ExtensibleWidget> extPoints = new HashMap<String, ExtensibleWidget>();
- extPoints.put(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT, this);
- return extPoints;
- }
-
- public void attach(final ExtensibleWidgetChild child) {
- if (child.getParentId().equals(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT)) {
- leftHP.add((Widget) child.getView());
- }
- }
-
- public void detach(final ExtensibleWidgetChild child) {
- if (child.getParentId().equals(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT)) {
- leftHP.remove((Widget) child.getView());
- }
- }
-
- public void detachAll(final String id) {
- if (id.equals(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT)) {
- leftHP.clear();
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,6 +0,0 @@
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-
-public interface EntityLogo {
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,123 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Hyperlink;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class EntityLogoPanel extends SimplePanel implements EntityLogoView {
- class EntityTextLogo extends VerticalPanel {
-
- private static final int GROUP_NAME_LIMIT_SIZE = 90;
- private static final String LOGO_SMALL_FONT_SIZE = "108%";
- private static final String LOGO_DEFAULT_FONT_SIZE = "167%";
- private final Label defTextLogoLabel;
- private final Hyperlink defTextPutYourLogoHL;
- private final HorizontalPanel putYourLogoHP;
-
- public EntityTextLogo() {
- // Initialize
- super();
- defTextLogoLabel = new Label();
- final HTML expandCell = new HTML("<b></b>");
- putYourLogoHP = new HorizontalPanel();
- defTextPutYourLogoHL = new Hyperlink();
-
- // Layout
- add(defTextLogoLabel);
- add(putYourLogoHP);
- putYourLogoHP.add(expandCell);
- putYourLogoHP.add(defTextPutYourLogoHL);
-
- // Set properties
- // TODO: Put your logo here functionality
- defTextPutYourLogoHL.setText(i18n.t("Put Your Logo Here"));
- expandCell.setWidth("100%");
- putYourLogoHP.setCellWidth(expandCell, "100%");
- // TODO: link to configure the logo
- setStylePrimaryName("k-entitytextlogo");
- setDefaultText("");
- }
-
- public void setDefaultText(final String text) {
- if (text.length() > GROUP_NAME_LIMIT_SIZE) {
- DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_SMALL_FONT_SIZE);
- } else {
- DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_DEFAULT_FONT_SIZE);
- }
- defTextLogoLabel.setText(text);
-
- }
-
- public void setPutYourLogoVisible(final boolean visible) {
- putYourLogoHP.setVisible(visible);
- }
-
- }
-
- private EntityTextLogo entityTextLogo;
- private final I18nTranslationService i18n;
-
- public EntityLogoPanel(final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
- this.i18n = i18n;
- ws.getEntityMainHeader().add(this);
- }
-
- public void setLogo(final Image image) {
- clear();
- add(image);
- }
-
- public void setLogo(final String groupName) {
- clear();
- add(getEntityTextLogo());
- entityTextLogo.setDefaultText(groupName);
- }
-
- public void setPutYourLogoVisible(final boolean visible) {
- getEntityTextLogo().setPutYourLogoVisible(visible);
- }
-
- public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- if (oldTheme != null) {
- getEntityTextLogo().removeStyleDependentName(oldTheme.toString());
- }
- getEntityTextLogo().addStyleDependentName(newTheme.toString());
- }
-
- private EntityTextLogo getEntityTextLogo() {
- if (entityTextLogo == null) {
- this.entityTextLogo = new EntityTextLogo();
- }
- return entityTextLogo;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,37 +0,0 @@
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-
-import com.calclab.suco.client.signal.Slot;
-import com.calclab.suco.client.signal.Slot2;
-
-public class EntityLogoPresenter implements EntityLogo {
- private EntityLogoView view;
-
- public EntityLogoPresenter(final StateManager stateManager, final WsThemePresenter theme) {
- stateManager.onStateChanged(new Slot<StateDTO>() {
- public void onEvent(final StateDTO state) {
- final GroupDTO group = state.getGroup();
- final boolean isAdmin = state.getGroupRights().isAdministrable();
-
- view.setLogo(group.getLongName());
- view.setPutYourLogoVisible(isAdmin);
- }
- });
- theme.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
- public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
- view.setTheme(oldTheme, newTheme);
- }
- });
- }
-
- public void init(final EntityLogoView view) {
- this.view = view;
-
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,17 +0,0 @@
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-
-import com.google.gwt.user.client.ui.Image;
-
-public interface EntityLogoView {
-
- // FIXME: Don' use Image
- public abstract void setLogo(final Image image);
-
- public abstract void setLogo(final String groupName);
-
- public abstract void setPutYourLogoVisible(final boolean visible);
-
- public abstract void setTheme(final WsTheme oldTheme, WsTheme newTheme);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupToolsBar.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,106 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.tool.ToolTrigger;
-import org.ourproject.kune.platf.client.tool.ToolTrigger.TriggerListener;
-import org.ourproject.kune.platf.client.ui.HasColor;
-import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
-
-import com.google.gwt.user.client.ui.Hyperlink;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-class GroupToolsBar extends VerticalPanel {
- private static final String ITEM_SELECTED = "kune-GroupToolsBar-itemSelected";
- private static final String ITEM_NOT_SELECTED = "kune-GroupToolsBar-itemNotSelected";
- private Widget currentTab;
- private final HashMap<String, Widget> tabs;
-
- public GroupToolsBar() {
- // this.colorTheme = colorTheme;
- tabs = new HashMap<String, Widget>();
- currentTab = null;
- addStyleName("kune-GroupToolsBar");
- }
-
- public void addItem(final ToolTrigger trigger) {
- final int nextIndex = this.getWidgetCount();
- final Widget menuItem = createItem(nextIndex, trigger);
- setTabSelected(menuItem, false);
- tabs.put(trigger.getName(), menuItem);
- this.add(menuItem);
- }
-
- public void selectItem(final String toolName) {
- if (currentTab != null) {
- setTabSelected(currentTab, false);
- }
- currentTab = getWidget(toolName);
- setTabSelected(currentTab, true);
- }
-
- public void setTabsColors(final String selectedColor, final String unSelectedColor) {
- final Iterator<Widget> iter = tabs.values().iterator();
- while (iter.hasNext()) {
- final Widget w = iter.next();
- if (w == currentTab) {
- ((HasColor) w).setColor(selectedColor);
- } else {
- ((HasColor) w).setColor(unSelectedColor);
- }
- }
- }
-
- private Widget createItem(final int index, final ToolTrigger trigger) {
- final SimplePanel menuItem = new SimplePanel();
- addStyleName("Tab");
- final Hyperlink hl = new Hyperlink(trigger.getLabel(), "");
- trigger.setListener(new TriggerListener() {
- public void onStateChanged(final String encoded) {
- hl.setTargetHistoryToken(encoded);
- }
- });
- menuItem.add(hl);
- return new RoundedBorderDecorator(menuItem, RoundedBorderDecorator.RIGHT);
- }
-
- private Widget getWidget(final String toolName) {
- return tabs.get(toolName);
- }
-
- private void setTabSelected(final Widget tab, final boolean isSelected) {
- if (isSelected) {
- tab.removeStyleName(ITEM_NOT_SELECTED);
- tab.addStyleName(ITEM_SELECTED);
- } else {
- tab.removeStyleName(ITEM_SELECTED);
- tab.addStyleName(ITEM_NOT_SELECTED);
- }
- // tring color = isSelected ? colorTheme.getToolSelected() :
- // colorTheme.getToolUnselected();
- // ((HasColor) tab).setColor(color);
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-08-04 12:44:04 UTC (rev 825)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-08-05 01:27:03 UTC (rev 826)
@@ -1,369 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.workspace.ui;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.platf.client.tool.ToolTrigger;
-import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
-import org.ourproject.kune.platf.client.ui.SplitterListener;
-import org.ourproject.kune.platf.client.ui.gwtcustom.CustomHorizontalSplitPanel;
-import org.ourproject.kune.workspace.client.licensefoot.ui.LicensePanel;
-import org.ourproject.kune.workspace.client.workspace.WorkspacePresenter;
-import org.ourproject.kune.workspace.client.workspace.WorkspaceUIComponents;
-import org.ourproject.kune.workspace.client.workspace.WorkspaceView;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.ChangeListener;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.HorizontalSplitPanelImages;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class WorkspacePanel extends Composite implements WorkspaceView {
- private static final int DEF_CONTEXT_WIDTH = 175;
- private static final Images img = Images.App.getInstance();
-
- // private final EntityLogoPanel groupLogoPanel;
- private final HorizontalPanel contentTitleBarHP;
- private final HorizontalPanel contentSubTitleBarHP;
- private final GroupToolsBar groupToolsBar;
- private final CustomHorizontalSplitPanel cntcxtHSP;
- private final VerticalPanel contextVP;
- private final VerticalPanel contentVP;
- private final HorizontalPanel contentBottomBarHP;
- private final VerticalPanel groupDropDownsVP;
- private final RoundedBorderDecorator contentTitleBarBorderDec;
- private final RoundedBorderDecorator bottomBorderDecorator;
- private final VerticalPanel cntcxtVP;
- private final ScrollPanel groupDropDownsSP;
- private final BottomIconsTrayPanel bottomIconsTrayPanel;
- private ContentTitlePanel contentTitlePanel;
- private ContentSubTitlePanel contentSubTitlePanel;
- private ContentToolBarPanel contentToolBarPanel;
- private final HorizontalPanel contentToolBarHP;
- private final ScrollPanel contentSP;
- private final HorizontalPanel contentBottomToolBarHP;
- private ContentBottomToolBarPanel contentBottomToolBarPanel;
- private LicensePanel bottomPanel;
-
- private int previousRightWidgetWidth;
- private final WorkspacePresenter presenter;
-
- public WorkspacePanel(final WorkspacePresenter presenter, final I18nTranslationService i18n) {
- this.presenter = presenter;
- // Initialize
- final VerticalPanel generalVP = new VerticalPanel();
- initWidget(generalVP);
- // groupLogoPanel = new EntityLogoPanel(i18n);
- final HorizontalPanel generalHP = new HorizontalPanel();
- cntcxtVP = new VerticalPanel();
- final VerticalPanel groupNavBarVP = new VerticalPanel();
- groupToolsBar = new GroupToolsBar();
- bottomIconsTrayPanel = new BottomIconsTrayPanel();
- groupDropDownsSP = new ScrollPanel();
- groupDropDownsVP = new VerticalPanel();
- contentTitleBarHP = new HorizontalPanel();
- contentTitleBarBorderDec = new RoundedBorderDecorator(contentTitleBarHP, RoundedBorderDecorator.TOPLEFT);
- contentSubTitleBarHP = new HorizontalPanel();
- contentToolBarHP = new HorizontalPanel();
- cntcxtHSP = new CustomHorizontalSplitPanel(new HorizontalSplitPanelImages() {
- public AbstractImagePrototype horizontalSplitPanelThumb() {
- return img.splitterVertBar();
- }
- });
- cntcxtHSP.addChangeListener(new ChangeListener() {
- public void onChange(final Widget sender) {
- adjustSizeContentSP();
- saveCurrentRightWidgetWidth(cntcxtHSP.getRightWidgetAvailableWidth());
- }
- });
- cntcxtHSP.addSplitterListener(new SplitterListener() {
- public void onStartResizing(final Widget sender) {
- presenter.onSplitterStartResizing(sender);
- }
-
- public void onStopResizing(final Widget sender) {
- presenter.onSplitterStopResizing(sender);
- }
- });
- contentVP = new VerticalPanel();
- contextVP = new VerticalPanel();
- contentSP = new ScrollPanel();
- contentBottomToolBarHP = new HorizontalPanel();
- contentBottomBarHP = new HorizontalPanel();
- bottomBorderDecorator = new RoundedBorderDecorator(contentBottomBarHP, RoundedBorderDecorator.BOTTOMLEFT);
-
- // Layout
- // generalVP.add(groupLogoPanel);
- generalVP.add(generalHP);
- generalHP.add(cntcxtVP);
- generalHP.add(groupNavBarVP);
- groupNavBarVP.add(groupToolsBar);
- groupNavBarVP.add(groupDropDownsSP);
- groupNavBarVP.add(bottomIconsTrayPanel);
- groupDropDownsSP.add(groupDropDownsVP);
- cntcxtVP.add(contentTitleBarBorderDec);
- cntcxtVP.add(contentSubTitleBarHP);
- cntcxtVP.add(cntcxtHSP);
- cntcxtHSP.setLeftWidget(contentVP);
- cntcxtHSP.setRightWidget(contextVP);
- cntcxtVP.add(bottomBorderDecorator);
- contentVP.add(contentToolBarHP);
- contentVP.add(contentSP);
- contentVP.add(contentBottomToolBarHP);
-
- contentVP.addStyleName("kune-WorkspacePanel-Content");
- contextVP.addStyleName("kune-WorkspacePanel-Context");
- contentVP.setWidth("100%");
- contextVP.setWidth("100%");
- contextVP.setHeight("100%");
-
- // Set properties
- addStyleName("kune-WorkspacePanel");
- setGroupLogo("");
- generalHP.addStyleName("GeneralHP");
- // contentTitleBarBorderDec.setColor(colorTheme.getContentMainBorder());
- contentTitleBarHP.setWidth("100%");
- contentSubTitleBarHP.setWidth("100%");
- contentTitleBarHP.addStyleName("kune-ContentTitleBar");
- contentSubTitleBarHP.addStyleName("kune-ContentSubTitleBar");
- contentToolBarHP.setWidth("100%");
- cntcxtVP.addStyleName("ContextPanel");
- cntcxtVP.setCellVerticalAlignment(contentTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
- cntcxtVP.setCellVerticalAlignment(contentSubTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
- cntcxtVP.setCellVerticalAlignment(bottomBorderDecorator, VerticalPanel.ALIGN_MIDDLE);
- contentTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- contentSubTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- contentBottomToolBarHP.setWidth("100%");
- contentBottomBarHP.addStyleName("kune-ContentBottomBar");
- contentBottomBarHP.addStyleName("kune-ft12px");
- groupDropDownsVP.addStyleName("kune-GroupSummaryPanel");
- // bottomBorderDecorator.setColor(colorTheme.getContentMainBorder());
- bottomIconsTrayPanel.addStyleName("kune-Margin-Medium-l");
- bottomIconsTrayPanel.addStyleName("kune-BottomIconsTrayPanel");
- bottomIconsTrayPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
- bottomIconsTrayPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- previousRightWidgetWidth = DEF_CONTEXT_WIDTH;
- }
-
- public void addBottomIconComponent(final View view) {
- bottomIconsTrayPanel.add((Widget) view);
- }
-
- public void addTab(final ToolTrigger trigger) {
- // groupToolsBar.addItem(trigger);
- }
-
- public void adjustSize(final int windowWidth, final int windowHeight) {
- final int contentWidth = windowWidth - 184;
- final int contentHeight = windowHeight - 176;
-
- // FireLog.debug("w1: " + windowWidth + ", h1: " + windowHeight);
- // FireLog.debug("w2: " + contentWidth + ", h2: " + contentHeight);
- // FireLog.debug("sp1: " + previousRightWidgetWidth);
- cntcxtHSP.setSize("" + contentWidth + "px", "" + contentHeight + "px");
- if (contentWidth > previousRightWidgetWidth) {
- cntcxtHSP.setSplitPosition("" + (contentWidth - previousRightWidgetWidth - 6) + "px");
- saveCurrentRightWidgetWidth(previousRightWidgetWidth);
- } else {
- setDefaultSplitterPosition();
- }
- adjustSizeContentSP();
-
- final int bottomMarginForTray = 35;
- final int distanceFromTop = 89;
- final int groupDropDownsHeight = windowHeight - groupToolsBar.getOffsetHeight() - distanceFromTop
- - bottomMarginForTray;
- groupDropDownsSP.setHeight("" + groupDropDownsHeight + "px");
- }
-
- public void registerUIExtensionPoints() {
- presenter.registerExtensibleWidgets(contentToolBarPanel.getExtensionPoints());
- presenter.registerExtensibleWidget(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, bottomIconsTrayPanel);
- }
-
- public void setBottom(final View view) {
- bottomPanel = (LicensePanel) view;
- contentBottomBarHP.add(bottomPanel);
- contentBottomBarHP.setCellVerticalAlignment(bottomPanel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setComponents(final WorkspaceUIComponents components) {
- setContentTitle(components.getContentTitleComponent().getView());
- setContentSubTitle(components.getContentSubTitleComponent().getView());
- setContentToolBar(components.getContentToolBarComponent().getView());
- // setContentBottomToolBar(components.getContentBottomToolBarComponent().getView());
- setBottom(components.getLicenseComponent().getView());
- // addBottomIconComponent(components.getThemeMenuComponent().getView());
- }
-
- public void setContent(final View content) {
- contentSP.clear();
- final Widget widget = (Widget) content;
- contentSP.add(widget);
- }
-
- public void setContentBottomToolBar(final View view) {
- contentBottomToolBarPanel = (ContentBottomToolBarPanel) view;
- contentBottomToolBarHP.add(contentBottomToolBarPanel);
- contentBottomToolBarHP.setCellVerticalAlignment(contentBottomToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setContentSubTitle(final View view) {
- contentSubTitlePanel = (ContentSubTitlePanel) view;
- contentSubTitleBarHP.add(contentSubTitlePanel);
- contentSubTitleBarHP.setCellVerticalAlignment(contentSubTitlePanel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setContentTitle(final View view) {
- contentTitlePanel = (ContentTitlePanel) view;
- contentTitleBarHP.add(contentTitlePanel);
- contentTitleBarHP.setCellVerticalAlignment(contentTitlePanel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setContentToolBar(final View view) {
- contentToolBarPanel = (ContentToolBarPanel) view;
- contentToolBarHP.add(contentToolBarPanel);
- contentToolBarHP.setCellVerticalAlignment(contentToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void setContext(final View contextMenu) {
- contextVP.clear();
- final Widget widget = (Widget) contextMenu;
- contextVP.add(widget);
- widget.setHeight("100%");
- widget.setWidth("100%");
- contextVP.setCellWidth(widget, "100%");
- contextVP.setCellHeight(widget, "100%");
- }
-
- public void setGroupLogo(final Image image) {
- // groupLogoPanel.setLogo(image);
- }
-
- public void setGroupLogo(final String groupName) {
- // groupLogoPanel.setLogo(groupName);
- }
-
- public void setGroupMembers(final View view) {
- // groupMembersPanel = (DropDownPanel) view;
- // AddDropDown(groupMembersPanel, colorTheme.getGroupMembersDD());
- }
-
- public void setParticipation(final View view) {
- // participationPanel = (DropDownPanel) view;
- // AddDropDown(participationPanel, colorTheme.getParticipationDD());
- }
-
- public void setPutYourLogoVisible(final boolean visible) {
- // groupLogoPanel.setPutYourLogoVisible(visible);
- }
-
- public void setSummary(final View view) {
- // groupSummaryPanel = (DropDownPanel) view;
- // AddDropDown(groupSummaryPanel, colorTheme.getSummaryDD());
- }
-
- public void setTags(final View view) {
- // tagsPanel = (DropDownPanel) view;
- // AddDropDown(tagsPanel, colorTheme.getTagsDD());
- }
-
- public void setTheme(final String theme) {
- // colorTheme.setTheme(theme);
- // final String mainColor = colorTheme.getContentMainBorder();
- // // groupLogoPanel.setTextColor(colorTheme.getContentTitleText());
- // contentTitleBarBorderDec.setColor(mainColor);
- // bottomBorderDecorator.setColor(mainColor);
- // DOM.setStyleAttribute(cntcxtVP.getElement(), "borderRightColor",
- // mainColor);
- // contentTitlePanel.setColors(colorTheme.getContentTitle(),
- // colorTheme.getContentTitleText());
- // contentSubTitlePanel.setColors(mainColor,
- // colorTheme.getContentSubTitleText());
- // DOM.setStyleAttribute(contentTitleBarHP.getElement(),
- // "borderLeftColor", mainColor);
- // DOM.setStyleAttribute(contentTitleBarHP.getElement(),
- // "backgroundColor", colorTheme.getContentTitle());
- // DOM.setStyleAttribute(contentSubTitleBarHP.getElement(),
- // "backgroundColor", mainColor);
- // DOM.setStyleAttribute(contentBottomBarHP.getElement(),
- // "backgroundColor", mainColor);
- // DOM.setStyleAttribute(cntcxtHSP.getRightWidget().getElement(),
- // "backgroundColor", colorTheme.getContext());
- // DOM.setStyleAttribute(DOM.getChild(DOM.getChild(cntcxtHSP.getElement(),
- // 0), 1), "backgroundColor", colorTheme
- // .getSplitter());
- // DOM.setStyleAttribute(contentBottomBarHP.getWidget(0).getElement(),
- // "color", colorTheme.getContentBottomText());
- // groupMembersPanel.setColor(colorTheme.getGroupMembersDD());
- // participationPanel.setColor(colorTheme.getParticipationDD());
- // groupSummaryPanel.setColor(colorTheme.getSummaryDD());
- // tagsPanel.setColor(colorTheme.getTagsDD());
- // groupToolsBar.setTabsColors(colorTheme.getToolSelected(),
- // colorTheme.getToolUnselected());
- }
-
- public void setTool(final String toolName) {
- groupToolsBar.selectItem(toolName);
- }
-
- public void setVisible(final boolean visible) {
- // false: Used when the app stops
- super.setVisible(visible);
- }
-
- private void adjustSizeContentSP() {
- final int width = cntcxtHSP.getLeftWidgetAvailableWidth() - 2;
- final int height = cntcxtHSP.getOffsetHeight() - 29 - contentToolBarHP.getOffsetHeight();
- if (width > 0 && height > 0) {
- contentSP.setSize("" + width + "px", "" + height + "px");
- } else {
- Log.debug("Can't resize ScrollPanel now");
- }
- }
-
- private void saveCurrentRightWidgetWidth(final int newRightWidgetWidth) {
- previousRightWidgetWidth = newRightWidgetWidth;
- }
-
- private void setDefaultSplitterPosition() {
- final int newLefttWidgetWidth = (int) (cntcxtHSP.getOffsetWidth() * 0.7);
- cntcxtHSP.setSplitPosition(newLefttWidgetWidth + "px");
- saveCurrentRightWidgetWidth(cntcxtHSP.getLeftWidgetAvailableWidth());
- }
-
- // private void logSplitter(final String count) {
- // FireLog.debug("" + count + " cntcxtHSP.getRightWidgetAvailableWidth: "
- // + cntcxtHSP.getRightWidgetAvailableWidth());
- // FireLog
- // .debug("" + count + " cntcxtHSP.getLeftWidgetAvailableWidth: "
- // + cntcxtHSP.getLeftWidgetAvailableWidth());
- // }
-
-}
1
0
Author: vjrj
Date: 2008-08-04 14:44:04 +0200 (Mon, 04 Aug 2008)
New Revision: 825
Added:
trunk/src/main/java/org/ourproject/kune/platf/public/images/language.gif
Log:
Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/language.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/language.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
Author: vjrj
Date: 2008-08-03 23:45:16 +0200 (Sun, 03 Aug 2008)
New Revision: 824
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java
trunk/src/test/java/org/ourproject/kune/platf/client/tool/
trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/ToolState.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
Modified:
trunk/script/generateBasicUIElements.sh
trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceSaveTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java
Log:
Complete - task 36: New ToolSelector classes
Complete - task 24: Tests problems in SNMTest (close of transaction issue)
Incomplete - task 21: Session timeout problems (cookies issue?)
Modified: trunk/script/generateBasicUIElements.sh
===================================================================
--- trunk/script/generateBasicUIElements.sh 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/script/generateBasicUIElements.sh 2008-08-03 21:45:16 UTC (rev 824)
@@ -14,7 +14,7 @@
fi
# DO
-PACKAGE=`echo $DIR | cut -d "/" -f 4- | sed 's/\//\./g'`
+PACKAGE=`echo $DIR | cut -d "/" -f 4- | sed 's/\//\./g' | sed 's/.$//g'`
if [[ ! -d $DIR ]]
then
@@ -85,12 +85,12 @@
import $PACKAGE.${NAME}Panel;
import $PACKAGE.${NAME};
-builder.registerProvider(${NAME}.class, new Provider<${NAME}>() {
- public ${NAME} get() {
+register(SingletonScope.class, new Factory<${NAME}>(${NAME}.class) {
+ public ${NAME} create() {
final ${NAME}Presenter presenter = new ${NAME}Presenter();
final ${NAME}Panel panel = new ${NAME}Panel(presenter, ws);
presenter.init(panel);
return presenter;
}
-}, SingletonScope.class);
+});
EOF
Modified: trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-08-03 21:45:16 UTC (rev 824)
@@ -19,111 +19,6 @@
<link rel="shortcut icon" href="images/favicon.ico" />
<title>Kune</title>
-<script type="text/javascript" language="javascript">
-var defaultKuneTheme = {
- themeName: "Default",
- toolSelected: "#DD8A3D",
- toolUnselected: "#FFE9A5",
- contentMainBorder: "#DD8A3D",
- contentTitle: "#F1BB59",
- contentTitleText: "#69312F",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#FFD09D",
- splitter: "#DEAA87",
- groupMembersDD: "#DF5244",
- participationDD: "#CA5842",
- summaryDD: "#9F734B",
- tagsDD: "#87501E"
-};
-
-var greenKuneTheme = {
- themeName: "Green",
- toolSelected: "#5FD35F",
- toolUnselected: "#D6F4D6",
- contentMainBorder: "#5FD35F",
- contentTitle: "#AFA",
- contentTitleText: "#250",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#CFA",
- splitter: "#DCE8AB",
- groupMembersDD: "#008000",
- participationDD: "#00AA00",
- summaryDD: "#4CE14C",
- tagsDD: "#00D400"
-};
-
-var blueKuneTheme = {
- themeName: "Blue",
- toolSelected: "#0066FF",
- toolUnselected: "#D7D7F4",
- contentMainBorder: "#0066FF",
- contentTitle: "#AFDDE9",
- contentTitleText: "#000080",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#AACCFF",
- splitter: "#D5D5FF",
- groupMembersDD: "#5500D4",
- participationDD: "#6600FF",
- summaryDD: "#69A5FF",
- tagsDD: "#9955FF"
-};
-
-var greyKuneTheme = {
- themeName: "Grey",
- toolSelected: "#4D4D4D",
- toolUnselected: "#E6E6E6",
- contentMainBorder: "#4D4D4D",
- contentTitle: "#CCCCCC",
- contentTitleText: "#1A1A1A",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#B3B3B3",
- splitter: "#999999",
- groupMembersDD: "#4D4D4D",
- participationDD: "#666666",
- summaryDD: "#A6A6A6",
- tagsDD: "#808080"
-};
-
-var purpleKuneTheme = {
- themeName: "Purple",
- toolSelected: "#660080",
- toolUnselected: "#EED7F4",
- contentMainBorder: "#660080",
- contentTitle: "#DDAFE9",
- contentTitleText: "#440055",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#DDAFE9",
- splitter: "#A793AC",
- groupMembersDD: "#672178",
- participationDD: "#892CA0",
- summaryDD: "#C473D8",
- tagsDD: "#AB37C8"
-};
-
-var redKuneTheme = {
- themeName: "Red",
- toolSelected: "#D40000",
- toolUnselected: "#FFD5D5",
- contentMainBorder: "#D40000",
- contentTitle: "#FF8080",
- contentTitleText: "#800000",
- contentSubTitleText: "#FFF",
- contentBottomText: "#FFF",
- context: "#FFAAAA",
- splitter: "#FF5555",
- groupMembersDD: "#A02C2C",
- participationDD: "#C83737",
- summaryDD: "#E08F8F",
- tagsDD: "#D35F5F"
-};
-
-</script>
-
</head>
<body>
<script type="text/javascript" language="javascript"
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-08-03 21:45:16 UTC (rev 824)
@@ -3172,27 +3172,27 @@
color: #FFF;
}
-.k-entity-bottom-rd-default, .k-entity-bottom-default {
+.k-entity-bottom-rd-default, .k-entity-bottom-default, .k-toolselectoritem-sel-default {
background: #DD8A3D;
}
-.k-entity-bottom-rd-green, .k-entity-bottom-green {
+.k-entity-bottom-rd-green, .k-entity-bottom-green, .k-toolselectoritem-sel-green {
background: #5FD35F;
}
-.k-entity-bottom-rd-blue, .k-entity-bottom-blue {
+.k-entity-bottom-rd-blue, .k-entity-bottom-blue, .k-toolselectoritem-sel-blue {
background: #0066FF;
}
-.k-entity-bottom-rd-grey, .k-entity-bottom-grey {
+.k-entity-bottom-rd-grey, .k-entity-bottom-grey, .k-toolselectoritem-sel-grey {
background: #4D4D4D;
}
-.k-entity-bottom-rd-purple, .k-entity-bottom-purple {
+.k-entity-bottom-rd-purple, .k-entity-bottom-purple, .k-toolselectoritem-sel-purple {
background: #660080;
}
-.k-entity-bottom-rd-red, .k-entity-bottom-red {
+.k-entity-bottom-rd-red, .k-entity-bottom-red, .k-toolselectoritem-sel-red {
background: #D40000;
}
@@ -3435,3 +3435,62 @@
background: red;
}
+/* Tool selector items */
+
+.k-toolselectoritem {
+ width: auto;
+ margin-bottom: 5px;
+ cursor: pointer;
+}
+
+.k-toolselectoritem-sel {
+}
+
+.k-toolselectoritem-notsel-default {
+ background: #FFE9A5;
+}
+
+.k-toolselectoritem-notsel-green {
+ background: #D6F4D6;
+}
+
+.k-toolselectoritem-notsel-blue {
+ background: #D7D7F4;
+}
+
+.k-toolselectoritem-notsel-grey {
+ background: #E6E6E6;
+}
+
+.k-toolselectoritem-notsel-purple {
+ background: #EED7F4;
+}
+
+.k-toolselectoritem-notsel-red {
+ background: #FFD5D5;
+}
+
+.k-toolselectoritem-sel a {
+ color: #FFF;
+ padding: 0 9px;
+ text-decoration: none;
+}
+
+.k-toolselectoritem-sel a:hover {
+ text-decoration: none;
+}
+
+.k-toolselectoritem-notsel {
+}
+
+.k-toolselectoritem-notsel a {
+ color: blue;
+ padding: 0 9px;
+ text-decoration: none;
+}
+
+.k-toolselectoritem-notsel a:hover {
+ text-decoration: none;
+}
+
+
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-08-03 21:45:16 UTC (rev 824)
@@ -306,27 +306,27 @@
color: #FFF;
}
-.k-entity-bottom-rd-default, .k-entity-bottom-default {
+.k-entity-bottom-rd-default, .k-entity-bottom-default, .k-toolselectoritem-sel-default {
background: #DD8A3D;
}
-.k-entity-bottom-rd-green, .k-entity-bottom-green {
+.k-entity-bottom-rd-green, .k-entity-bottom-green, .k-toolselectoritem-sel-green {
background: #5FD35F;
}
-.k-entity-bottom-rd-blue, .k-entity-bottom-blue {
+.k-entity-bottom-rd-blue, .k-entity-bottom-blue, .k-toolselectoritem-sel-blue {
background: #0066FF;
}
-.k-entity-bottom-rd-grey, .k-entity-bottom-grey {
+.k-entity-bottom-rd-grey, .k-entity-bottom-grey, .k-toolselectoritem-sel-grey {
background: #4D4D4D;
}
-.k-entity-bottom-rd-purple, .k-entity-bottom-purple {
+.k-entity-bottom-rd-purple, .k-entity-bottom-purple, .k-toolselectoritem-sel-purple {
background: #660080;
}
-.k-entity-bottom-rd-red, .k-entity-bottom-red {
+.k-entity-bottom-rd-red, .k-entity-bottom-red, .k-toolselectoritem-sel-red {
background: #D40000;
}
@@ -567,4 +567,62 @@
.k-wstheme-icon-red {
background: red;
-}
\ No newline at end of file
+}
+
+/* Tool selector items */
+
+.k-toolselectoritem {
+ width: auto;
+ margin-bottom: 5px;
+ cursor: pointer;
+}
+
+.k-toolselectoritem-sel {
+}
+
+.k-toolselectoritem-notsel-default {
+ background: #FFE9A5;
+}
+
+.k-toolselectoritem-notsel-green {
+ background: #D6F4D6;
+}
+
+.k-toolselectoritem-notsel-blue {
+ background: #D7D7F4;
+}
+
+.k-toolselectoritem-notsel-grey {
+ background: #E6E6E6;
+}
+
+.k-toolselectoritem-notsel-purple {
+ background: #EED7F4;
+}
+
+.k-toolselectoritem-notsel-red {
+ background: #FFD5D5;
+}
+
+.k-toolselectoritem-sel a {
+ color: #FFF;
+ padding: 0 9px;
+ text-decoration: none;
+}
+
+.k-toolselectoritem-sel a:hover {
+ text-decoration: none;
+}
+
+.k-toolselectoritem-notsel {
+}
+
+.k-toolselectoritem-notsel a {
+ color: blue;
+ padding: 0 9px;
+ text-decoration: none;
+}
+
+.k-toolselectoritem-notsel a:hover {
+ text-decoration: none;
+}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -5,8 +5,10 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
@@ -26,7 +28,8 @@
public ChatClientTool create() {
return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
$(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $p(GroupMembersSummary.class),
- $p(StateManager.class), $p(ContentServiceAsync.class));
+ $p(StateManager.class), $p(ContentServiceAsync.class), $(ToolSelector.class),
+ $(WsThemePresenter.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -30,15 +30,18 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItem;
import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
import com.calclab.emite.client.xmpp.stanzas.XmppURI;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public class ChatClientTool extends AbstractClientTool implements ChatProvider {
public static final String NAME = "chats";
@@ -47,17 +50,14 @@
public static final String TYPE_CHAT = "chat.chat";
private final ChatToolComponents components;
private ChatEngine chat;
- private final Provider<StateManager> stateManagerProvider;
- private final Provider<ContentServiceAsync> contentServiceProvider;
public ChatClientTool(final Session session, final Application application, final I18nTranslationService i18n,
final EmiteUIDialog emiteUIDialog, final WorkspaceSkeleton ws,
final Provider<GroupMembersSummary> groupMembersSummaryProvider,
final Provider<StateManager> stateManagerProvider,
- final Provider<ContentServiceAsync> contentServiceProvider) {
- super(i18n.t("chat rooms"));
- this.stateManagerProvider = stateManagerProvider;
- this.contentServiceProvider = contentServiceProvider;
+ final Provider<ContentServiceAsync> contentServiceProvider, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter) {
+ super(NAME, i18n.t("chat rooms"), toolSelector, wsThemePresenter, ws);
components = new ChatToolComponents(emiteUIDialog, i18n, stateManagerProvider, session, contentServiceProvider);
session.onInitDataReceived(new Slot<InitDataDTO>() {
public void onEvent(final InitDataDTO initData) {
@@ -75,13 +75,13 @@
}), true);
}
});
- application.onApplicationStop(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ application.onApplicationStop(new Slot0() {
+ public void onEvent() {
chat.logout();
}
});
- session.onUserSignOut(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ session.onUserSignOut(new Slot0() {
+ public void onEvent() {
chat.logout();
}
});
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -5,9 +5,11 @@
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.workspace.TagsSummary;
import com.calclab.suco.client.modules.AbstractModule;
@@ -32,7 +34,8 @@
register(SingletonScope.class, new Factory<DocumentClientTool>(DocumentClientTool.class) {
public DocumentClientTool create() {
final DocumentFactory factory = $(DocumentFactory.class);
- return new DocumentClientTool(factory, $(I18nUITranslationService.class));
+ return new DocumentClientTool(factory, $(I18nUITranslationService.class), $(ToolSelector.class),
+ $(WsThemePresenter.class), $(WorkspaceSkeleton.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -26,8 +26,11 @@
import org.ourproject.kune.docs.client.ui.DocumentFactory;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
public class DocumentClientTool extends AbstractClientTool implements DocumentContentListener {
public static final String TYPE_ROOT = "docs.root";
@@ -36,42 +39,43 @@
public static final String NAME = "docs";
private final DocToolComponents components;
- public DocumentClientTool(final DocumentFactory documentFactory, final I18nUITranslationService i18n) {
- super(i18n.t("documents"));
- components = new DocToolComponents(documentFactory, this);
+ public DocumentClientTool(final DocumentFactory documentFactory, final I18nUITranslationService i18n,
+ final ToolSelector toolSelector, final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws) {
+ super(NAME, i18n.t("documents"), toolSelector, wsThemePresenter, ws);
+ components = new DocToolComponents(documentFactory, this);
}
public WorkspaceComponent getContent() {
- return components.getContent();
+ return components.getContent();
}
public WorkspaceComponent getContext() {
- return components.getContext();
+ return components.getContext();
}
public String getName() {
- return NAME;
+ return NAME;
}
public void onCancel() {
- components.getContext().showFolders();
+ components.getContext().showFolders();
}
public void onEdit() {
- components.getContext().showAdmin();
+ components.getContext().showAdmin();
}
public void setContent(final StateDTO state) {
- DocumentContent docContent = components.getContent();
- docContent.setContent(state);
+ final DocumentContent docContent = components.getContent();
+ docContent.setContent(state);
- // TODO: check trigger interface (setState)
- trigger.setState(state.getStateToken().toString());
+ // TODO: check trigger interface (setState)
+ // trigger.setState(state.getStateToken().toString());
}
public void setContext(final StateDTO state) {
- DocumentContext context = components.getContext();
- context.setContext(state);
+ final DocumentContext context = components.getContext();
+ context.setContext(state);
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ToolState.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ToolState.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ToolState.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -1,25 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.platf.client;
-
-public class ToolState {
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -28,7 +28,7 @@
import org.ourproject.kune.platf.client.tool.ClientTool;
import org.ourproject.kune.workspace.client.workspace.Workspace;
-import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public interface Application {
@@ -38,12 +38,10 @@
void init(StateManager stateManager, HashMap<String, ClientTool> tools);
- void onApplicationStart(Slot<Object> slot);
+ void onApplicationStart(Slot0 slot);
- void onApplicationStop(Slot<Object> slot);
+ void onApplicationStop(Slot0 slot);
- void setGroupState(String groupShortName);
-
void start();
void stop();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -41,8 +41,8 @@
import org.ourproject.kune.workspace.client.workspace.Workspace;
import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.signal.Signal;
-import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Signal0;
+import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.WindowCloseListener;
@@ -52,8 +52,8 @@
// private final Workspace workspace;
private Map<String, ClientTool> tools;
private final Session session;
- private final Signal<Object> onApplicationStart;
- private final Signal<Object> onApplicationStop;
+ private final Signal0 onApplicationStart;
+ private final Signal0 onApplicationStop;
private StateManager stateManager;
public ApplicationDefault(final Session session, final KuneErrorHandler errorHandler, final WorkspaceSkeleton ws) {
@@ -61,8 +61,8 @@
// workspace = WorkspaceFactory.createWorkspace(session,
// extensionPointManager, i18n, errorHandler);
tools = new HashMap<String, ClientTool>();
- this.onApplicationStart = new Signal<Object>("onApplicationStart");
- this.onApplicationStop = new Signal<Object>("onApplicationStop");
+ this.onApplicationStart = new Signal0("onApplicationStart");
+ this.onApplicationStop = new Signal0("onApplicationStop");
Window.addWindowCloseListener(new WindowCloseListener() {
public void onWindowClosed() {
stop();
@@ -88,24 +88,16 @@
this.tools = tools;
}
- public void onApplicationStart(final Slot<Object> slot) {
+ public void onApplicationStart(final Slot0 slot) {
onApplicationStart.add(slot);
}
- public void onApplicationStop(final Slot<Object> slot) {
+ public void onApplicationStop(final Slot0 slot) {
onApplicationStop.add(slot);
}
- public void setGroupState(final String groupShortName) {
- final Iterator<ClientTool> iterator = tools.values().iterator();
- while (iterator.hasNext()) {
- final ClientTool tool = iterator.next();
- tool.setGroupState(groupShortName);
- }
- }
-
public void start() {
- onApplicationStart.fire(null);
+ onApplicationStart.fire();
PrefetchUtilities.preFetchImpImages();
getInitData();
final Timer prefetchTimer = new Timer() {
@@ -117,7 +109,7 @@
}
public void stop() {
- onApplicationStop.fire(null);
+ onApplicationStop.fire();
}
public void subscribeActions(final ArrayList<ActionEvent<?>> actions) {
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperDefault.java (from rev 792, trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperDefault.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.platf.client.app;
+
+import com.google.gwt.user.client.History;
+
+public class HistoryWrapperDefault implements HistoryWrapper {
+
+ public String getToken() {
+ return History.getToken();
+ }
+
+ public void newItem(final String historyToken) {
+ History.newItem(historyToken);
+ }
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/HistoryWrapperImpl.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.app;
-
-import com.google.gwt.user.client.History;
-
-public class HistoryWrapperImpl implements HistoryWrapper {
-
- public HistoryWrapperImpl() {
- }
-
- public void newItem(final String historyToken) {
- History.newItem(historyToken);
- }
-
- public String getToken() {
- return History.getToken();
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateToken.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -27,158 +27,163 @@
public class StateToken implements IsSerializable {
private static final String[] EMPTY = new String[0];
private static final String DOT = ".";
+
+ public static String encode(final String group, final String tool, final String folder, final String document) {
+ String encoded = "";
+ if (group != null) {
+ encoded += group;
+ }
+ if (tool != null) {
+ encoded += DOT + tool;
+ }
+ if (folder != null) {
+ encoded += DOT + folder;
+ }
+ if (document != null) {
+ encoded += DOT + document;
+ }
+ return encoded;
+ }
private String group;
private String tool;
private String folder;
private String document;
+
private String encoded;
- public StateToken(final String group, final String tool, final String folder, final String document) {
- this.setGroup(group);
- this.setTool(tool);
- this.setFolder(folder);
- this.setDocument(document);
- encoded = null;
+ public StateToken() {
+ this(null, null, null, null);
}
- public StateToken() {
- this(null, null, null, null);
+ public StateToken(final String encoded) {
+ String[] splitted;
+ if (encoded != null && encoded.length() > 0) {
+ splitted = encoded.split("\\.");
+ } else {
+ splitted = EMPTY;
+ }
+ setGroup(conditionalAssign(0, splitted));
+ setTool(conditionalAssign(1, splitted));
+ setFolder(conditionalAssign(2, splitted));
+ setDocument(conditionalAssign(3, splitted));
}
- public String toString() {
- return getEncoded();
+ public StateToken(final String group, final String tool) {
+ this(group, tool, null, null);
}
- public String getEncoded() {
- if (encoded == null) {
- encoded = StateToken.encode(getGroup(), getTool(), getFolder(), getDocument());
- }
- return encoded;
+ public StateToken(final String group, final String tool, final String folder, final String document) {
+ this.setGroup(group);
+ this.setTool(tool);
+ this.setFolder(folder);
+ this.setDocument(document);
+ encoded = null;
}
- @Override
- public int hashCode() {
- return getEncoded().hashCode();
+ public String getDocument() {
+ return document;
}
- public StateToken(final String encoded) {
- String[] splitted;
- if (encoded != null && encoded.length() > 0) {
- splitted = encoded.split("\\.");
- } else {
- splitted = EMPTY;
- }
- setGroup(conditionalAssign(0, splitted));
- setTool(conditionalAssign(1, splitted));
- setFolder(conditionalAssign(2, splitted));
- setDocument(conditionalAssign(3, splitted));
+ public String getEncoded() {
+ if (encoded == null) {
+ encoded = StateToken.encode(getGroup(), getTool(), getFolder(), getDocument());
+ }
+ return encoded;
}
- private String conditionalAssign(final int index, final String[] splitted) {
- if (splitted.length > index) {
- return splitted[index];
- } else {
- return null;
- }
+ public String getFolder() {
+ return folder;
}
- public static String encode(final String group, final String tool, final String folder, final String document) {
- String encoded = "";
- if (group != null) {
- encoded += group;
- }
- if (tool != null) {
- encoded += DOT + tool;
- }
- if (folder != null) {
- encoded += DOT + folder;
- }
- if (document != null) {
- encoded += DOT + document;
- }
- return encoded;
+ public String getGroup() {
+ return group;
}
- public boolean isComplete() {
- return getDocument() != null;
+ public String getPublicUrl() {
+ String publicUrl = "http://";
+
+ if (group != null) {
+ publicUrl += group + DOT;
+ }
+
+ // FIXME: Maybe get from InitData the site.domain
+ publicUrl += WindowUtils.getLocation().getHostName() + "/";
+
+ if (tool != null) {
+ publicUrl += tool;
+ }
+ if (folder != null) {
+ publicUrl += DOT + folder;
+ }
+ if (document != null) {
+ publicUrl += DOT + document;
+ }
+
+ return publicUrl;
}
+ public String getTool() {
+ return tool;
+ }
+
public boolean hasAll() {
- return getGroup() != null && getTool() != null && getFolder() != null && getDocument() != null;
+ return getGroup() != null && getTool() != null && getFolder() != null && getDocument() != null;
}
- public boolean hasGroupToolAndFolder() {
- return getGroup() != null && getTool() != null && getFolder() != null;
+ public boolean hasGroup() {
+ return getGroup() != null;
}
public boolean hasGroupAndTool() {
- return getGroup() != null && getTool() != null;
+ return getGroup() != null && getTool() != null;
}
- public boolean hasGroup() {
- return getGroup() != null;
+ public boolean hasGroupToolAndFolder() {
+ return getGroup() != null && getTool() != null && getFolder() != null;
}
- public boolean hasNothing() {
- return getGroup() == null && getTool() == null && getFolder() == null && getDocument() == null;
+ @Override
+ public int hashCode() {
+ return getEncoded().hashCode();
}
- public void setGroup(final String group) {
- this.group = group;
- encoded = null;
+ public boolean hasNothing() {
+ return getGroup() == null && getTool() == null && getFolder() == null && getDocument() == null;
}
- public String getGroup() {
- return group;
+ public boolean isComplete() {
+ return getDocument() != null;
}
- public void setTool(final String tool) {
- this.tool = tool;
- encoded = null;
+ public void setDocument(final String document) {
+ this.document = document;
+ encoded = null;
}
- public String getTool() {
- return tool;
- }
-
public void setFolder(final String folder) {
- this.folder = folder;
- encoded = null;
+ this.folder = folder;
+ encoded = null;
}
- public String getFolder() {
- return folder;
+ public void setGroup(final String group) {
+ this.group = group;
+ encoded = null;
}
- public void setDocument(final String document) {
- this.document = document;
- encoded = null;
+ public void setTool(final String tool) {
+ this.tool = tool;
+ encoded = null;
}
- public String getDocument() {
- return document;
+ public String toString() {
+ return getEncoded();
}
- public String getPublicUrl() {
- String publicUrl = "http://";
-
- if (group != null) {
- publicUrl += group + DOT;
- }
-
- // FIXME: Maybe get from InitData the site.domain
- publicUrl += WindowUtils.getLocation().getHostName() + "/";
-
- if (tool != null) {
- publicUrl += tool;
- }
- if (folder != null) {
- publicUrl += DOT + folder;
- }
- if (document != null) {
- publicUrl += DOT + document;
- }
-
- return publicUrl;
+ private String conditionalAssign(final int index, final String[] splitted) {
+ if (splitted.length > index) {
+ return splitted[index];
+ } else {
+ return null;
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -34,15 +34,15 @@
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.container.Provider;
-import com.calclab.suco.client.signal.Signal;
-import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Signal0;
+import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.core.client.GWT;
public class KuneErrorHandler {
private final Session session;
private final I18nTranslationService i18n;
private final Provider<WorkspaceSkeleton> wsProvider;
- private final Signal<Object> onSessionExpired;
+ private final Signal0 onSessionExpired;
private final Provider<StateManager> stateManagerProvider;
public KuneErrorHandler(final Session session, final I18nTranslationService i18n,
@@ -51,14 +51,14 @@
this.i18n = i18n;
this.wsProvider = wsProvider;
this.stateManagerProvider = stateManagerProvider;
- this.onSessionExpired = new Signal<Object>("onSessionExpired");
+ this.onSessionExpired = new Signal0("onSessionExpired");
}
public WorkspaceSkeleton getWorkspaceSkeleton() {
return wsProvider.get();
}
- public void onSessionExpired(final Slot<Object> slot) {
+ public void onSessionExpired(final Slot0 slot) {
onSessionExpired.add(slot);
}
@@ -107,7 +107,7 @@
}
private void doSessionExpired() {
- onSessionExpired.fire(null);
+ onSessionExpired.fire();
getWorkspaceSkeleton().showAlertMessage(i18n.t("Session expired"),
i18n.t("Your session has expired. Please login again."));
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -6,7 +6,7 @@
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ApplicationDefault;
import org.ourproject.kune.platf.client.app.HistoryWrapper;
-import org.ourproject.kune.platf.client.app.HistoryWrapperImpl;
+import org.ourproject.kune.platf.client.app.HistoryWrapperDefault;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ContentService;
@@ -23,6 +23,9 @@
import org.ourproject.kune.platf.client.state.SessionImpl;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.state.StateManagerDefault;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.platf.client.tool.ToolSelectorPanel;
+import org.ourproject.kune.platf.client.tool.ToolSelectorPresenter;
import org.ourproject.kune.platf.client.ui.QuickTipsHelper;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.platf.client.ui.rate.RateItPanel;
@@ -214,7 +217,7 @@
register(SingletonScope.class, new Factory<HistoryWrapper>(HistoryWrapper.class) {
public HistoryWrapper create() {
- return new HistoryWrapperImpl();
+ return new HistoryWrapperDefault();
}
}, new Factory<ContentProvider>(ContentProvider.class) {
public ContentProvider create() {
@@ -545,6 +548,16 @@
}
});
+ register(SingletonScope.class, new Factory<ToolSelector>(ToolSelector.class) {
+ public ToolSelector create() {
+ final ToolSelectorPresenter presenter = new ToolSelectorPresenter($(StateManager.class),
+ $(WsThemePresenter.class));
+ final ToolSelectorPanel panel = new ToolSelectorPanel(presenter, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
load(new EmiteUIModule(), new DocumentClientNewModule(), new ChatClientNewModule());
$(SitePublicSpaceLink.class);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -31,6 +31,7 @@
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public interface Session {
@@ -73,7 +74,7 @@
void onUserSignIn(Slot<UserInfoDTO> slot);
- void onUserSignOut(Slot<Object> slot);
+ void onUserSignOut(Slot0 slot);
void setCurrentUserInfo(UserInfoDTO currentUserInfo);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -36,7 +36,9 @@
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Signal;
+import com.calclab.suco.client.signal.Signal0;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public class SessionImpl implements Session {
private String userHash;
@@ -49,7 +51,7 @@
private I18nLanguageDTO currentLanguage;
private final Signal<InitDataDTO> onInitDataReceived;
private final Signal<UserInfoDTO> onUserSignIn;
- private final Signal<Object> onUserSignOut;
+ private final Signal0 onUserSignOut;
private final Provider<UserServiceAsync> userServiceProvider;
public SessionImpl(final String userHash, final Provider<UserServiceAsync> userServiceProvider) {
@@ -58,7 +60,7 @@
languagesArray = null;
this.onInitDataReceived = new Signal<InitDataDTO>("initDataReceived");
this.onUserSignIn = new Signal<UserInfoDTO>("onUserSignIn");
- this.onUserSignOut = new Signal<Object>("onUserSignOut");
+ this.onUserSignOut = new Signal0("onUserSignOut");
}
public void check(final AsyncCallbackSimple<?> callback) {
@@ -127,7 +129,7 @@
onUserSignIn.add(slot);
}
- public void onUserSignOut(final Slot<Object> slot) {
+ public void onUserSignOut(final Slot0 slot) {
onUserSignOut.add(slot);
}
@@ -148,7 +150,7 @@
if (currentUserInfo != null) {
onUserSignIn.fire(currentUserInfo);
} else {
- onUserSignOut.fire(null);
+ onUserSignOut.fire();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -25,6 +25,7 @@
import org.ourproject.kune.platf.client.dto.StateToken;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
import com.google.gwt.user.client.HistoryListener;
public interface StateManager extends HistoryListener {
@@ -35,10 +36,14 @@
void gotoToken(String token);
+ void onGroupChanged(Slot2<String, String> slot);
+
void onSocialNetworkChanged(Slot<StateDTO> slot);
void onStateChanged(Slot<StateDTO> slot);
+ void onToolChanged(Slot2<String, String> slot);
+
void reload();
void reloadContextAndTitles();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -34,7 +34,10 @@
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.signal.Signal;
+import com.calclab.suco.client.signal.Signal2;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
+import com.calclab.suco.client.signal.Slot2;
public class StateManagerDefault implements StateManager {
private final ContentProvider contentProvider;
@@ -44,6 +47,8 @@
private final HashMap<String, Slot<StateToken>> siteTokens;
private final Signal<StateDTO> onStateChanged;
private final Signal<StateDTO> onSocialNetworkChanged;
+ private final Signal2<String, String> onToolChanged;
+ private final Signal2<String, String> onGroupChanged;
public StateManagerDefault(final ContentProvider contentProvider, final Session session,
final HistoryWrapper history) {
@@ -52,14 +57,16 @@
this.history = history;
this.oldState = null;
this.onStateChanged = new Signal<StateDTO>("onStateChanged");
+ this.onGroupChanged = new Signal2<String, String>("onGroupChanged");
+ this.onToolChanged = new Signal2<String, String>("onToolChanged");
this.onSocialNetworkChanged = new Signal<StateDTO>("onSocialNetworkChanged");
session.onUserSignIn(new Slot<UserInfoDTO>() {
public void onEvent(final UserInfoDTO parameter) {
restorePreviousState();
}
});
- session.onUserSignOut(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ session.onUserSignOut(new Slot0() {
+ public void onEvent() {
reload();
}
});
@@ -81,6 +88,10 @@
setState(new StateToken(token));
}
+ public void onGroupChanged(final Slot2<String, String> slot) {
+ onGroupChanged.add(slot);
+ }
+
public void onHistoryChanged(final String historyToken) {
final Slot<StateToken> tokenSlot = siteTokens.get(historyToken);
Log.debug("history token: " + historyToken);
@@ -107,6 +118,10 @@
onStateChanged.add(slot);
}
+ public void onToolChanged(final Slot2<String, String> slot) {
+ onToolChanged.add(slot);
+ }
+
/**
* <p>
* Reload current state (using client cache if available)
@@ -157,6 +172,20 @@
history.newItem(state.getEncoded());
}
+ private void checkGroupAndToolChange(final StateDTO oldState, final StateDTO newState) {
+ final String oldGroupName = oldState != null ? oldState.getGroup().getShortName() : null;
+ final String newGroupName = newState.getGroup().getShortName();
+ final String oldToolName = oldState != null ? oldState.getToolName() : null;
+ final String newToolName = newState.getToolName();
+ if (oldState == null || !oldGroupName.equals(newGroupName)) {
+ onGroupChanged.fire(oldGroupName, newGroupName);
+ }
+ if (oldState == null || !oldToolName.equals(newToolName)) {
+ onToolChanged.fire(oldToolName, newToolName);
+ }
+
+ }
+
private void loadContent(final StateDTO state) {
session.setCurrent(state);
onStateChanged.fire(state);
@@ -196,9 +225,10 @@
private void onHistoryChanged(final StateToken newState) {
contentProvider.getContent(session.getUserHash(), newState, new AsyncCallbackSimple<StateDTO>() {
- public void onSuccess(final StateDTO newStateDTO) {
- loadContent(newStateDTO);
- oldState = newStateDTO;
+ public void onSuccess(final StateDTO newState) {
+ loadContent(newState);
+ checkGroupAndToolChange(oldState, newState);
+ oldState = newState;
}
});
}
@@ -207,6 +237,8 @@
if (oldState == null) {
onHistoryChanged(new StateToken());
} else {
+ final StateDTO currentState = session.getCurrentState();
+ checkGroupAndToolChange(oldState, currentState);
loadContent(oldState);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/AbstractClientTool.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -18,23 +18,19 @@
*
*/
-package org.ourproject.kune.platf.client.tool;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public abstract class AbstractClientTool implements ClientTool {
- protected final ToolTriggerDefault trigger;
-
- public AbstractClientTool(final String label) {
- trigger = new ToolTriggerDefault(getName(), label);
- }
-
- public ToolTrigger getTrigger() {
- return trigger;
- }
-
- public void setGroupState(final String groupShortName) {
- trigger.setState(new StateToken(groupShortName, getName(), null, null));
- }
-
-}
+package org.ourproject.kune.platf.client.tool;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+public abstract class AbstractClientTool implements ClientTool {
+
+ public AbstractClientTool(final String shortName, final String longName, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws) {
+ final ToolSelectorItemPresenter presenter = new ToolSelectorItemPresenter(shortName, longName, toolSelector,
+ wsThemePresenter);
+ final ToolSelectorItemPanel panel = new ToolSelectorItemPanel(presenter, ws);
+ presenter.init(panel);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ClientTool.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -24,18 +24,15 @@
import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
public interface ClientTool {
- String getName();
- ToolTrigger getTrigger();
+ WorkspaceComponent getContent();
WorkspaceComponent getContext();
- WorkspaceComponent getContent();
+ String getName();
void setContent(StateDTO state);
void setContext(StateDTO state);
- void setGroupState(String groupShortName);
-
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelector.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,8 @@
+package org.ourproject.kune.platf.client.tool;
+
+
+public interface ToolSelector {
+
+ public void addTool(ToolSelectorItem item);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItem.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,11 @@
+package org.ourproject.kune.platf.client.tool;
+
+public interface ToolSelectorItem {
+
+ String getShortName();
+
+ void setGroupShortName(String groupShortName);
+
+ void setSelected(boolean selected);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPanel.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,50 @@
+package org.ourproject.kune.platf.client.tool;
+
+import org.ourproject.kune.platf.client.ui.RoundedPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.ui.Hyperlink;
+
+public class ToolSelectorItemPanel extends RoundedPanel implements ToolSelectorItemView {
+ private final Hyperlink hl;
+
+ public ToolSelectorItemPanel(final ToolSelectorItemPresenter presenter, final WorkspaceSkeleton ws) {
+ super(RoundedPanel.RIGHT, 2);
+ hl = new Hyperlink();
+ super.setWidget(hl);
+ ws.getEntitySummary().addInTools(this);
+ super.sinkEvents(Event.ONCLICK);
+ super.addStyleName("k-toolselectoritem");
+ }
+
+ @Override
+ public void onBrowserEvent(final Event event) {
+ super.onBrowserEvent(event);
+ }
+
+ public void setLink(final String text, final String targetHistoryToken) {
+ hl.setText(text);
+ hl.setTargetHistoryToken(targetHistoryToken);
+ }
+
+ public void setSelected(final boolean selected) {
+ if (selected) {
+ hl.setStylePrimaryName("k-toolselectoritem-sel");
+ } else {
+ hl.setStylePrimaryName("k-toolselectoritem-notsel");
+ }
+ super.setCornerStyleName(hl.getStyleName());
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ final String oldName = oldTheme.getName();
+ hl.removeStyleDependentName(oldName);
+ }
+ final String newName = newTheme.getName();
+ hl.addStyleDependentName(newName);
+ super.setCornerStyleName(hl.getStyleName());
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,57 @@
+package org.ourproject.kune.platf.client.tool;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+import com.calclab.suco.client.signal.Slot2;
+
+public class ToolSelectorItemPresenter implements ToolSelectorItem {
+
+ private ToolSelectorItemView view;
+ private final ToolSelector toolSelector;
+ private final WsThemePresenter wsThemePresenter;
+ private final String shortName;
+ private final String longName;
+
+ public ToolSelectorItemPresenter(final String shortName, final String longName, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter) {
+ this.shortName = shortName;
+ this.longName = longName;
+ this.toolSelector = toolSelector;
+ this.wsThemePresenter = wsThemePresenter;
+ }
+
+ public String getShortName() {
+ return shortName;
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final ToolSelectorItemView view) {
+ this.view = view;
+ toolSelector.addTool(this);
+ wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void setGroupShortName(final String groupShortName) {
+ final StateToken token = new StateToken(groupShortName, getShortName(), null, null);
+ view.setLink(longName, token.toString());
+ }
+
+ public void setSelected(final boolean selected) {
+ view.setSelected(selected);
+ }
+
+ private void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorItemView.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,13 @@
+package org.ourproject.kune.platf.client.tool;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface ToolSelectorItemView extends View {
+
+ void setLink(String text, String targetHistoryToken);
+
+ void setSelected(boolean selected);
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPanel.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,94 @@
+package org.ourproject.kune.platf.client.tool;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.ourproject.kune.platf.client.tool.ToolTrigger.TriggerListener;
+import org.ourproject.kune.platf.client.ui.HasColor;
+import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Hyperlink;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class ToolSelectorPanel extends VerticalPanel implements ToolSelectorView {
+
+ private static final String ITEM_SELECTED = "kune-GroupToolsBar-itemSelected";
+ private static final String ITEM_NOT_SELECTED = "kune-GroupToolsBar-itemNotSelected";
+ private Widget currentTab;
+ private final HashMap<String, Widget> tabs;
+
+ public ToolSelectorPanel(final ToolSelectorPresenter presenter, final WorkspaceSkeleton ws) {
+ tabs = new HashMap<String, Widget>();
+ currentTab = null;
+ addStyleName("kune-GroupToolsBar");
+ ws.getEntitySummary().addInTools(this);
+ }
+
+ public void addItem(final ToolTrigger trigger) {
+ final int nextIndex = this.getWidgetCount();
+ final Widget menuItem = createItem(nextIndex, trigger);
+ setTabSelected(menuItem, false);
+ tabs.put(trigger.getName(), menuItem);
+ this.add(menuItem);
+ }
+
+ public void selectItem(final String toolName) {
+ if (currentTab != null) {
+ setTabSelected(currentTab, false);
+ }
+ currentTab = getWidget(toolName);
+ setTabSelected(currentTab, true);
+ }
+
+ public void setTabsColors(final String selectedColor, final String unSelectedColor) {
+ final Iterator<Widget> iter = tabs.values().iterator();
+ while (iter.hasNext()) {
+ final Widget w = iter.next();
+ if (w == currentTab) {
+ ((HasColor) w).setColor(selectedColor);
+ } else {
+ ((HasColor) w).setColor(unSelectedColor);
+ }
+ }
+ }
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ // TODO Auto-generated method stub
+
+ }
+
+ private Widget createItem(final int index, final ToolTrigger trigger) {
+ final SimplePanel menuItem = new SimplePanel();
+ addStyleName("Tab");
+ final Hyperlink hl = new Hyperlink(trigger.getLabel(), "");
+ trigger.setListener(new TriggerListener() {
+ public void onStateChanged(final String encoded) {
+ hl.setTargetHistoryToken(encoded);
+ }
+ });
+ menuItem.add(hl);
+ return new RoundedBorderDecorator(menuItem, RoundedBorderDecorator.RIGHT);
+ }
+
+ private Widget getWidget(final String toolName) {
+ return tabs.get(toolName);
+ }
+
+ private void setTabSelected(final Widget tab, final boolean isSelected) {
+ if (isSelected) {
+ tab.removeStyleName(ITEM_NOT_SELECTED);
+ tab.addStyleName(ITEM_SELECTED);
+ } else {
+ tab.removeStyleName(ITEM_SELECTED);
+ tab.addStyleName(ITEM_NOT_SELECTED);
+ }
+ // tring color = isSelected ? colorTheme.getToolSelected() :
+ // colorTheme.getToolUnselected();
+ // ((HasColor) tab).setColor(color);
+ }
+
+}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,69 @@
+package org.ourproject.kune.platf.client.tool;
+
+import java.util.HashMap;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+import com.calclab.suco.client.signal.Slot2;
+
+public class ToolSelectorPresenter implements ToolSelector {
+
+ private ToolSelectorView view;
+ private final HashMap<String, ToolSelectorItem> tools;
+
+ public ToolSelectorPresenter(final StateManager stateManager, final WsThemePresenter wsThemePresenter) {
+ tools = new HashMap<String, ToolSelectorItem>();
+ stateManager.onGroupChanged(new Slot2<String, String>() {
+ public void onEvent(final String oldGroupName, final String newGroupName) {
+ onGroupChanged(newGroupName);
+ }
+ });
+ stateManager.onToolChanged(new Slot2<String, String>() {
+ public void onEvent(final String oldTool, final String newTool) {
+ onToolChanged(oldTool, newTool);
+ }
+ });
+ wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void addTool(final ToolSelectorItem item) {
+ final String name = item.getShortName();
+ if (name == null) {
+ throw new RuntimeException("You cannot add a tool without a name");
+ }
+ if (tools.get(name) != null) {
+ throw new RuntimeException("A tool with the same name already added");
+ }
+ tools.put(name, item);
+ item.setSelected(false);
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final ToolSelectorView view) {
+ this.view = view;
+ }
+
+ void onGroupChanged(final String newGroupName) {
+ for (final String name : tools.keySet()) {
+ tools.get(name).setGroupShortName(newGroupName);
+ }
+ }
+
+ void onToolChanged(final String oldTool, final String newTool) {
+ if (oldTool != null) {
+ tools.get(oldTool).setSelected(false);
+ }
+ tools.get(newTool).setSelected(true);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorView.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.platf.client.tool;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface ToolSelectorView extends View {
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -15,7 +15,7 @@
public static final int DEF_TOOLBAR_HEIGHT = 26;
- private static final int NO_SIZE = -1;
+ private static final int NO_SIZE = -666;
private static RegionPosition[] regionPositions = new RegionPosition[] { RegionPosition.NORTH,
RegionPosition.CENTER, RegionPosition.SOUTH, RegionPosition.EAST, RegionPosition.WEST };
@@ -66,10 +66,11 @@
public void add(final Panel panel, final Widget widget) {
panel.add(widget);
if (panel.isRendered()) {
- panel.syncSize();
- panel.doLayout();
+ mainPanel.doLayout(false);
+ // panel.syncSize();
+ // panel.doLayout();
}
- doLayoutIfNeeded();
+ // doLayoutIfNeeded();
}
public void addStyle(final String style) {
@@ -110,6 +111,12 @@
}
}
+ public void doLayoutIfNeeded(final boolean includeChilds) {
+ if (mainPanel.isRendered()) {
+ mainPanel.doLayout(!includeChilds);
+ }
+ }
+
public Panel getPanel() {
return mainPanel;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/DefaultManager.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -27,16 +27,28 @@
import org.apache.lucene.search.Query;
import org.hibernate.search.jpa.FullTextEntityManager;
import org.hibernate.search.jpa.FullTextQuery;
+import org.hibernate.search.jpa.Search;
import com.google.inject.Provider;
public abstract class DefaultManager<T, K> {
private final Provider<EntityManager> provider;
+ private final Provider<FullTextEntityManager> fullTextEntityManagerProvider;
private final Class<T> entityClass;
public DefaultManager(final Provider<EntityManager> provider, final Class<T> entityClass) {
this.provider = provider;
this.entityClass = entityClass;
+ fullTextEntityManagerProvider = new Provider<FullTextEntityManager>() {
+ private FullTextEntityManager searchManager;
+
+ public FullTextEntityManager get() {
+ if (searchManager == null) {
+ searchManager = Search.createFullTextEntityManager(getEntityManager());
+ }
+ return searchManager;
+ }
+ };
}
public T find(final Long primaryKey) {
@@ -63,9 +75,7 @@
@SuppressWarnings("unchecked")
public void reIndex() {
- // TODO: Inject this
- final FullTextEntityManager fullTextEm = org.hibernate.search.jpa.Search
- .createFullTextEntityManager(getEntityManager());
+ final FullTextEntityManager fullTextEm = fullTextEntityManagerProvider.get();
fullTextEm.purgeAll(entityClass);
fullTextEm.getTransaction().commit();
fullTextEm.getTransaction().begin();
@@ -83,10 +93,7 @@
@SuppressWarnings("unchecked")
public SearchResult<T> search(final Query query, final Integer firstResult, final Integer maxResults) {
- // TODO: Inject this?
- final FullTextEntityManager fullTextEm = org.hibernate.search.jpa.Search
- .createFullTextEntityManager(getEntityManager());
- final FullTextQuery emQuery = fullTextEm.createFullTextQuery(query, entityClass);
+ final FullTextQuery emQuery = fullTextEntityManagerProvider.get().createFullTextQuery(query, entityClass);
if (firstResult != null && maxResults != null) {
emQuery.setFirstResult(firstResult);
emQuery.setMaxResults(maxResults);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -141,16 +141,19 @@
}
} else {
// Not translated and not in db, make a petition for translation
- i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text, new AsyncCallback<String>() {
- public void onFailure(final Throwable caught) {
- }
+ if (session.isLogged()) {
+ i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text,
+ new AsyncCallback<String>() {
+ public void onFailure(final Throwable caught) {
+ }
- public void onSuccess(final String result) {
- }
- });
- Log.debug("Registering in db '" + text + "' as pending translation");
+ public void onSuccess(final String result) {
+ }
+ });
+ Log.debug("Registering in db '" + text + "' as pending translation");
+ lexicon.put(encodeText, UNTRANSLATED_VALUE);
+ }
translation = removeNT(encodeText);
- lexicon.put(encodeText, UNTRANSLATED_VALUE);
}
return decodeHtml(translation);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -31,8 +31,10 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.sitebar.SiteToken;
import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.signal.Slot;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -50,10 +52,15 @@
this.session = session;
this.stateManager = stateManager;
this.groupServiceProvider = groupServiceProvider;
+ stateManager.addSiteToken(SiteToken.newgroup.toString(), new Slot<StateToken>() {
+ public void onEvent(final StateToken previousStateToken) {
+ doNewGroup(previousStateToken);
+ }
+ });
}
- public void doNewGroup(final StateToken previousTokenOrig) {
- previousToken = previousTokenOrig;
+ public void doNewGroup(final StateToken previousToken) {
+ this.previousToken = previousToken;
session.check(new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
if (session.isLogged()) {
@@ -62,7 +69,7 @@
view.center();
Site.hideProgress();
} else {
- stateManager.setState(previousTokenOrig);
+ stateManager.setState(previousToken);
Site.info(i18n.t("Sign in or register to create a group"));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -49,11 +49,13 @@
this.stateManager = stateManager;
this.session = session;
this.snServiceProvider = snServiceProvider;
- stateManager.onStateChanged(new Slot<StateDTO>() {
- public void onEvent(final StateDTO state) {
+ final Slot<StateDTO> setStateSlot = new Slot<StateDTO>() {
+ public void onEvent(StateDTO state) {
setState(state);
}
- });
+ };
+ stateManager.onStateChanged(setStateSlot);
+ stateManager.onSocialNetworkChanged(setStateSlot);
wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
view.setTheme(oldTheme, newTheme);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -58,11 +58,13 @@
collabOnlyCategory = new GridGroup(i18n.t("collaborator in:"), " ", i18n.t("Collaborate in these groups"),
false);
super.addGroupOperation(gotoGroupMenuItem, false);
- stateManager.onStateChanged(new Slot<StateDTO>() {
- public void onEvent(final StateDTO state) {
+ final Slot<StateDTO> setStateSlot = new Slot<StateDTO>() {
+ public void onEvent(StateDTO state) {
setState(state);
}
- });
+ };
+ stateManager.onStateChanged(setStateSlot);
+ stateManager.onSocialNetworkChanged(setStateSlot);
wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
view.setTheme(oldTheme, newTheme);
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -1,54 +0,0 @@
-package org.ourproject.kune.workspace.client.ui.newtmp;
-
-import org.ourproject.kune.platf.client.ui.rate.RateIt;
-import org.ourproject.kune.platf.client.ui.rate.RatePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLink;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
-import org.ourproject.kune.workspace.client.workspace.GroupSummary;
-import org.ourproject.kune.workspace.client.workspace.ParticipationSummary;
-import org.ourproject.kune.workspace.client.workspace.TagsSummary;
-import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
-
-import com.calclab.suco.client.container.Provider;
-
-public class WorkspaceManager {
-
- private final EntityLogo entityLogo;
- private final EntityTitlePresenter entityTitlePresenter;
- private final WsThemePresenter wsThemePresenter;
- private final EntityLicensePresenter entityLicensePresenter;
- private final EntitySubTitlePresenter entitySubTitlePresenter;
- private final Provider<TagsSummary> tagsProvider;
- private final Provider<GroupMembersSummary> groupMembersSummaryProvider;
- private final Provider<ParticipationSummary> participationSummaryProvider;
- private final Provider<GroupSummary> groupSummaryProvider;
- private final SitePublicSpaceLink publicSpaceLink;
- private final Provider<RateIt> rateItProvider;
- private final Provider<RatePresenter> ratePresenterProvider;
-
- public WorkspaceManager(final SitePublicSpaceLink publicSpaceLink, final EntityLogo entityLogo,
- final EntityTitlePresenter entityTitlePresenter, final EntitySubTitlePresenter entitySubTitlePresenter,
- final WsThemePresenter wsThemePresenter, final EntityLicensePresenter entityLicensePresenter,
- final Provider<GroupMembersSummary> groupMembersSummaryProvider,
- final Provider<ParticipationSummary> participationSummaryProvider,
- final Provider<TagsSummary> tagsSummaryProvider, final Provider<GroupSummary> groupSummaryProvider,
- final Provider<RateIt> rateItProvider, final Provider<RatePresenter> rateProvider) {
- this.publicSpaceLink = publicSpaceLink;
- this.entityLogo = entityLogo;
- this.entityTitlePresenter = entityTitlePresenter;
- this.entitySubTitlePresenter = entitySubTitlePresenter;
- this.entityLicensePresenter = entityLicensePresenter;
- this.wsThemePresenter = wsThemePresenter;
- this.groupMembersSummaryProvider = groupMembersSummaryProvider;
- this.participationSummaryProvider = participationSummaryProvider;
- this.tagsProvider = tagsSummaryProvider;
- this.groupSummaryProvider = groupSummaryProvider;
- this.rateItProvider = rateItProvider;
- this.ratePresenterProvider = rateProvider;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -5,6 +5,7 @@
import org.ourproject.kune.platf.client.state.Session;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public class SiteSignInLinkPresenter implements SiteSignInLink {
@@ -16,8 +17,8 @@
view.setVisible(false);
}
});
- session.onUserSignOut(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ session.onUserSignOut(new Slot0() {
+ public void onEvent() {
view.setVisible(true);
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -13,6 +13,7 @@
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -32,13 +33,13 @@
view.setVisible(true);
}
});
- session.onUserSignOut(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ session.onUserSignOut(new Slot0() {
+ public void onEvent() {
view.setVisible(false);
}
});
- kuneErrorHandlerProvider.get().onSessionExpired(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ kuneErrorHandlerProvider.get().onSessionExpired(new Slot0() {
+ public void onEvent() {
clientUIsignOut();
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -5,6 +5,7 @@
import org.ourproject.kune.platf.client.state.Session;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
public class SiteUserMenuPresenter implements SiteUserMenu {
@@ -18,8 +19,8 @@
view.setUseGroupsIsMember(userInfoDTO.getGroupsIsAdmin(), userInfoDTO.getGroupsIsCollab());
}
});
- session.onUserSignOut(new Slot<Object>() {
- public void onEvent(final Object parameter) {
+ session.onUserSignOut(new Slot0() {
+ public void onEvent() {
view.setVisible(false);
view.setLoggedUserName("");
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -16,6 +16,7 @@
public EntitySummary() {
mainPanel = new DefaultBorderLayout();
entityTools = new Panel();
+ entityTools.setAutoHeight(true);
entitySummary = new Panel();
entitySummary.setCls("k-entity-summary");
entityTools.setBorder(false);
@@ -23,7 +24,7 @@
entityTools.setAutoScroll(false);
entitySummary.setAutoScroll(true);
trayBar = mainPanel.createBottomBar(entitySummary, "k-site-traybar");
- mainPanel.add(entityTools, DefaultBorderLayout.Position.NORTH, 30);
+ mainPanel.add(entityTools, DefaultBorderLayout.Position.NORTH);
mainPanel.add(entitySummary, DefaultBorderLayout.Position.CENTER);
trayBar.addFill();
}
@@ -35,7 +36,7 @@
public void addInTools(final Widget widget) {
entityTools.add(widget);
- mainPanel.doLayoutIfNeeded();
+ mainPanel.doLayoutIfNeeded(true);
}
public void addListener(final ContainerListener listener) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -58,7 +58,7 @@
ClientTool clientTool;
while (iterator.hasNext()) {
clientTool = iterator.next();
- view.addTab(clientTool.getTrigger());
+ // view.addTab(clientTool.getTrigger());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -176,7 +176,7 @@
}
public void addTab(final ToolTrigger trigger) {
- groupToolsBar.addItem(trigger);
+ // groupToolsBar.addItem(trigger);
}
public void adjustSize(final int windowWidth, final int windowHeight) {
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -9,6 +9,7 @@
import org.ourproject.kune.workspace.client.sitebar.SiteToken;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
import com.google.gwt.user.client.rpc.AsyncCallback;
public class StateManagerTest {
@@ -21,6 +22,28 @@
@SuppressWarnings("unchecked")
@Test
+ public void changeStateWithDifferentGroupsMustFireSlot() {
+ final Slot2<String, String> groupSlot = Mockito.mock(Slot2.class);
+ stateManager.onGroupChanged(groupSlot);
+ stateManager.onHistoryChanged("group1.tool1");
+ stateManager.onHistoryChanged("group2.tool1");
+ // TODO, think how to test this
+ // Mockito.verify(groupSlot).onEvent("group1", "group2");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void changeStateWithDifferentToolsMustFireSlot() {
+ final Slot2<String, String> toolSlot = Mockito.mock(Slot2.class);
+ stateManager.onToolChanged(toolSlot);
+ stateManager.gotoToken("group1.tool1");
+ stateManager.gotoToken("group1.tool2");
+ // TODO, think how to test this
+ // Mockito.verify(toolSlot).onEvent("tool1", "tool2");
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
public void getDefGroup() {
stateManager.onHistoryChanged("site.docs");
Mockito.verify(contentProvider, Mockito.times(1)).getContent(Mockito.anyString(),
Added: trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenterTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -0,0 +1,92 @@
+package org.ourproject.kune.platf.client.tool;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+public class ToolSelectorPresenterTest {
+
+ private static final String TOOL1_NAME = "tool1";
+ private static final String TOOL2_NAME = "tool2";
+ private static final String GROUP1_NAME = "group1";
+ private ToolSelectorPresenter toolSelector;
+ private ToolSelectorItem toolSelectorItem1;
+ private ToolSelectorItem toolSelectorItem2;
+
+ @Test
+ public void addFirstToolMustNotSelect() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ Mockito.verify(toolSelectorItem1).setSelected(false);
+ }
+
+ @Test(expected = RuntimeException.class)
+ public void addToolWithoutNameMustGiveException() {
+ toolSelector.addTool(toolSelectorItem1);
+ }
+
+ @Test
+ public void addTwoToolsMustSelectNothing() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ Mockito.verify(toolSelectorItem1).setSelected(false);
+ Mockito.verify(toolSelectorItem2).setSelected(false);
+ }
+
+ @Test(expected = RuntimeException.class)
+ public void addTwoToolsWithSameNameMustGiveException() {
+ setToolNames();
+ final ToolSelectorItem toolSelectorItemCopy = Mockito.mock(ToolSelectorItem.class);
+ Mockito.stub(toolSelectorItemCopy.getShortName()).toReturn(TOOL1_NAME);
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItemCopy);
+ }
+
+ @Before
+ public void begin() {
+ final StateManager stateManager = Mockito.mock(StateManager.class);
+ final WsThemePresenter themePresenter = Mockito.mock(WsThemePresenter.class);
+ toolSelector = new ToolSelectorPresenter(stateManager, themePresenter);
+ toolSelectorItem1 = Mockito.mock(ToolSelectorItem.class);
+ toolSelectorItem2 = Mockito.mock(ToolSelectorItem.class);
+ }
+
+ @Test
+ public void setStateFirstMustSelect() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.onToolChanged(null, TOOL1_NAME);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(true);
+ }
+
+ @Test
+ public void setStateWithADifferentGroupMustSetLink() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onGroupChanged(GROUP1_NAME);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
+ }
+
+ @Test
+ public void setStateWithADifferentToolNameMustSelectAndUnSelectTheOlder() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onToolChanged(TOOL1_NAME, TOOL2_NAME);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(true);
+ }
+
+ public void setToolNames() {
+ Mockito.stub(toolSelectorItem1.getShortName()).toReturn(TOOL1_NAME);
+ Mockito.stub(toolSelectorItem2.getShortName()).toReturn(TOOL2_NAME);
+ }
+
+}
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceSaveTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceSaveTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceSaveTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -15,34 +15,34 @@
@Before
public void init() throws Exception {
- new IntegrationTestHelper(this);
+ new IntegrationTestHelper(this);
- defaultContent = getDefaultContent();
- groupName = defaultContent.getGroup().getShortName();
- doLogin();
+ defaultContent = getDefaultContent();
+ groupName = defaultContent.getGroup().getShortName();
+ doLogin();
}
@Test
public void testSaveAndRetrieve() throws Exception {
- final String text = "Lorem ipsum dolor sit amet";
- final int version = defaultContent.getVersion();
- final int currentVersion = contentService.save(getHash(), groupName, defaultContent.getDocumentId(), text);
- assertEquals(version + 2, currentVersion);
- final StateDTO again = contentService.getContent(getHash(), groupName, defaultContent.getStateToken());
- assertEquals(text, again.getContent());
- assertEquals(0, (int) again.getRateByUsers());
- assertEquals(0, (double) again.getRate());
+ final String text = "Lorem ipsum dolor sit amet";
+ final int version = defaultContent.getVersion();
+ final int currentVersion = contentService.save(getHash(), groupName, defaultContent.getDocumentId(), text);
+ assertEquals(version + 2, currentVersion);
+ final StateDTO again = contentService.getContent(getHash(), groupName, defaultContent.getStateToken());
+ assertEquals(text, again.getContent());
+ assertEquals(0, (int) again.getRateByUsers());
+ assertEquals(new Double(0), again.getRate());
}
@Test
public void testSaveAndRetrieveBig() throws Exception {
- final String text = TestDomainHelper.createBigText();
- ;
- final int version = defaultContent.getVersion();
- final int currentVersion = contentService.save(getHash(), groupName, defaultContent.getDocumentId(), text);
- assertEquals(version + 2, currentVersion);
- final StateDTO again = contentService.getContent(getHash(), groupName, defaultContent.getStateToken());
- assertEquals(text, again.getContent());
+ final String text = TestDomainHelper.createBigText();
+ ;
+ final int version = defaultContent.getVersion();
+ final int currentVersion = contentService.save(getHash(), groupName, defaultContent.getDocumentId(), text);
+ assertEquals(version + 2, currentVersion);
+ final StateDTO again = contentService.getContent(getHash(), groupName, defaultContent.getStateToken());
+ assertEquals(text, again.getContent());
}
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -22,166 +22,166 @@
@Test
public void addRemoveAuthor() throws Exception {
- final List<UserSimpleDTO> authors = defaultContent.getAuthors();
- assertEquals(1, authors.size());
- final UserSimpleDTO author = authors.get(0);
- final String authorShortName = author.getShortName();
- contentService.removeAuthor(getHash(), groupShortName, defDocument, authorShortName);
- final List<UserSimpleDTO> authors2 = getDefaultContent().getAuthors();
- assertEquals(0, authors2.size());
- contentService.addAuthor(getHash(), groupShortName, defDocument, authorShortName);
- final List<UserSimpleDTO> authors3 = getDefaultContent().getAuthors();
- assertEquals(1, authors3.size());
- contentService.addAuthor(getHash(), groupShortName, defDocument, authorShortName);
- final List<UserSimpleDTO> authors4 = getDefaultContent().getAuthors();
- assertEquals(1, authors4.size());
+ final List<UserSimpleDTO> authors = defaultContent.getAuthors();
+ assertEquals(1, authors.size());
+ final UserSimpleDTO author = authors.get(0);
+ final String authorShortName = author.getShortName();
+ contentService.removeAuthor(getHash(), groupShortName, defDocument, authorShortName);
+ final List<UserSimpleDTO> authors2 = getDefaultContent().getAuthors();
+ assertEquals(0, authors2.size());
+ contentService.addAuthor(getHash(), groupShortName, defDocument, authorShortName);
+ final List<UserSimpleDTO> authors3 = getDefaultContent().getAuthors();
+ assertEquals(1, authors3.size());
+ contentService.addAuthor(getHash(), groupShortName, defDocument, authorShortName);
+ final List<UserSimpleDTO> authors4 = getDefaultContent().getAuthors();
+ assertEquals(1, authors4.size());
}
@Test
public void contentRateAndRetrieve() throws Exception {
- contentService.rateContent(getHash(), groupShortName, defDocument, 4.5);
- final StateDTO again = contentService.getContent(getHash(), groupShortName, defaultContent.getStateToken());
- assertEquals(true, again.isRateable());
- assertEquals(4.5, (double) again.getCurrentUserRate());
- assertEquals(4.5, (double) again.getRate());
- assertEquals(1, (double) again.getRateByUsers());
+ contentService.rateContent(getHash(), groupShortName, defDocument, 4.5);
+ final StateDTO again = contentService.getContent(getHash(), groupShortName, defaultContent.getStateToken());
+ assertEquals(true, again.isRateable());
+ assertEquals(new Double(4.5), again.getCurrentUserRate());
+ assertEquals(new Double(4.5), again.getRate());
+ assertEquals(new Integer(1), again.getRateByUsers());
}
@Test
public void contentSetLanguage() throws Exception {
- contentService.setLanguage(getHash(), groupShortName, defDocument, "es");
- final StateDTO contentRetrieved = contentService.getContent(getHash(), groupShortName, defaultContent
- .getStateToken());
- assertEquals("es", contentRetrieved.getLanguage().getCode());
+ contentService.setLanguage(getHash(), groupShortName, defDocument, "es");
+ final StateDTO contentRetrieved = contentService.getContent(getHash(), groupShortName, defaultContent
+ .getStateToken());
+ assertEquals("es", contentRetrieved.getLanguage().getCode());
}
@Test
public void folderRename() throws Exception {
- doLogin();
- defaultContent = getDefaultContent();
- final ContainerDTO folder = defaultContent.getFolder();
+ doLogin();
+ defaultContent = getDefaultContent();
+ final ContainerDTO folder = defaultContent.getFolder();
- final String oldTitle = "some title";
- String newTitle = "folder new name";
- final StateDTO newState = contentService.addFolder(session.getHash(), groupShortName, folder.getId(), oldTitle);
+ final String oldTitle = "some title";
+ String newTitle = "folder new name";
+ final StateDTO newState = contentService.addFolder(session.getHash(), groupShortName, folder.getId(), oldTitle);
- final ContainerDTO newFolder = newState.getFolder().getChilds().get(0);
+ final ContainerDTO newFolder = newState.getFolder().getChilds().get(0);
- assertEquals(oldTitle, newFolder.getName());
+ assertEquals(oldTitle, newFolder.getName());
- final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
- newFolder.getId().toString(), null);
- String result = contentService.rename(getHash(), groupShortName, folderToken.getEncoded(), newTitle);
+ final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
+ newFolder.getId().toString(), null);
+ String result = contentService.rename(getHash(), groupShortName, folderToken.getEncoded(), newTitle);
- assertEquals(newTitle, result);
+ assertEquals(newTitle, result);
- final StateToken newFolderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
- newFolder.getId().toString(), null);
- StateDTO folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
+ final StateToken newFolderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
+ newFolder.getId().toString(), null);
+ StateDTO folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
- assertEquals(newTitle, folderAgain.getFolder().getName());
+ assertEquals(newTitle, folderAgain.getFolder().getName());
- newTitle = "folder last name";
+ newTitle = "folder last name";
- result = contentService.rename(getHash(), groupShortName, newFolderToken.getEncoded(), newTitle);
+ result = contentService.rename(getHash(), groupShortName, newFolderToken.getEncoded(), newTitle);
- folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
+ folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
- assertEquals(newTitle, folderAgain.getFolder().getName());
+ assertEquals(newTitle, folderAgain.getFolder().getName());
}
@Test(expected = AccessViolationException.class)
public void folderRenameOtherGroupFails() throws Exception {
- doLogin();
- defaultContent = getDefaultContent();
- final ContainerDTO folder = defaultContent.getFolder();
- final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(), folder
- .getId().toString(), null);
+ doLogin();
+ defaultContent = getDefaultContent();
+ final ContainerDTO folder = defaultContent.getFolder();
+ final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(), folder
+ .getId().toString(), null);
- final String newTitle = "folder new name";
- contentService.rename(getHash(), super.getSiteAdminShortName(), folderToken.getEncoded(), newTitle);
+ final String newTitle = "folder new name";
+ contentService.rename(getHash(), super.getSiteAdminShortName(), folderToken.getEncoded(), newTitle);
}
@Test(expected = RuntimeException.class)
public void folderRootRenameMustFail() throws Exception {
- doLogin();
- defaultContent = getDefaultContent();
- final ContainerDTO folder = defaultContent.getFolder();
+ doLogin();
+ defaultContent = getDefaultContent();
+ final ContainerDTO folder = defaultContent.getFolder();
- final String newTitle = "folder new name";
- final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(), folder
- .getId().toString(), null);
- final String result = contentService.rename(getHash(), groupShortName, folderToken.getEncoded(), newTitle);
+ final String newTitle = "folder new name";
+ final StateToken folderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(), folder
+ .getId().toString(), null);
+ final String result = contentService.rename(getHash(), groupShortName, folderToken.getEncoded(), newTitle);
- assertEquals(newTitle, result);
+ assertEquals(newTitle, result);
- final ContainerDTO folderAgain = getDefaultContent().getFolder();
+ final ContainerDTO folderAgain = getDefaultContent().getFolder();
- assertEquals(newTitle, folderAgain.getName());
+ assertEquals(newTitle, folderAgain.getName());
}
@Before
public void init() throws Exception {
- new IntegrationTestHelper(this);
- doLogin();
- defaultContent = getDefaultContent();
- groupShortName = defaultContent.getStateToken().getGroup();
- defDocument = defaultContent.getStateToken().getDocument();
+ new IntegrationTestHelper(this);
+ doLogin();
+ defaultContent = getDefaultContent();
+ groupShortName = defaultContent.getStateToken().getGroup();
+ defDocument = defaultContent.getStateToken().getDocument();
}
@Test
public void setTagsAndResults() throws Exception {
- contentService.setTags(getHash(), groupShortName, defDocument, "bfoo cfoa afoo2");
- final List<TagResultDTO> summaryTags = contentService.getSummaryTags(getHash(), groupShortName);
- assertEquals(3, summaryTags.size());
+ contentService.setTags(getHash(), groupShortName, defDocument, "bfoo cfoa afoo2");
+ final List<TagResultDTO> summaryTags = contentService.getSummaryTags(getHash(), groupShortName);
+ assertEquals(3, summaryTags.size());
- TagResultDTO tagResultDTO = summaryTags.get(0);
- assertEquals("afoo2", tagResultDTO.getName());
- assertEquals(1, (long) tagResultDTO.getCount());
+ TagResultDTO tagResultDTO = summaryTags.get(0);
+ assertEquals("afoo2", tagResultDTO.getName());
+ assertEquals(1, (long) tagResultDTO.getCount());
- tagResultDTO = summaryTags.get(1);
- assertEquals("bfoo", tagResultDTO.getName());
- assertEquals(1, (long) tagResultDTO.getCount());
+ tagResultDTO = summaryTags.get(1);
+ assertEquals("bfoo", tagResultDTO.getName());
+ assertEquals(1, (long) tagResultDTO.getCount());
- tagResultDTO = summaryTags.get(2);
- assertEquals("cfoa", tagResultDTO.getName());
- assertEquals(1, (long) tagResultDTO.getCount());
+ tagResultDTO = summaryTags.get(2);
+ assertEquals("cfoa", tagResultDTO.getName());
+ assertEquals(1, (long) tagResultDTO.getCount());
}
@Test
public void setTagsAndRetrieve() throws Exception {
- contentService.setTags(getHash(), groupShortName, defDocument, "foo foa foo");
- final String tagsRetrieved = getDefaultContent().getTags();
- assertEquals("foo foa", tagsRetrieved);
+ contentService.setTags(getHash(), groupShortName, defDocument, "foo foa foo");
+ final String tagsRetrieved = getDefaultContent().getTags();
+ assertEquals("foo foa", tagsRetrieved);
}
@Test
public void tokenRename() throws Exception {
- doLogin();
- defaultContent = getDefaultContent();
- final ContainerDTO folder = defaultContent.getFolder();
+ doLogin();
+ defaultContent = getDefaultContent();
+ final ContainerDTO folder = defaultContent.getFolder();
- final String oldTitle = "some title";
- String newTitle = "folder new name";
- final StateDTO newState = contentService.addFolder(session.getHash(), groupShortName, folder.getId(), oldTitle);
+ final String oldTitle = "some title";
+ String newTitle = "folder new name";
+ final StateDTO newState = contentService.addFolder(session.getHash(), groupShortName, folder.getId(), oldTitle);
- final ContainerDTO newFolder = newState.getFolder().getChilds().get(0);
+ final ContainerDTO newFolder = newState.getFolder().getChilds().get(0);
- assertEquals(oldTitle, newFolder.getName());
+ assertEquals(oldTitle, newFolder.getName());
- final StateToken newFolderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
- newFolder.getId().toString(), null);
+ final StateToken newFolderToken = new StateToken(groupShortName, defaultContent.getStateToken().getTool(),
+ newFolder.getId().toString(), null);
- newTitle = "folder last name";
+ newTitle = "folder last name";
- final String result = contentService.rename(getHash(), groupShortName, newFolderToken.getEncoded(), newTitle);
+ final String result = contentService.rename(getHash(), groupShortName, newFolderToken.getEncoded(), newTitle);
- assertEquals(newTitle, result);
+ assertEquals(newTitle, result);
- final StateDTO folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
+ final StateDTO folderAgain = contentService.getContent(getHash(), groupShortName, newFolderToken);
- assertEquals(newTitle, folderAgain.getFolder().getName());
+ assertEquals(newTitle, folderAgain.getFolder().getName());
}
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/finders/RateFinderTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -34,75 +34,75 @@
@After
public void close() {
- if (getTransaction().isActive()) {
- getTransaction().rollback();
- }
+ if (getTransaction().isActive()) {
+ getTransaction().rollback();
+ }
}
@Before
public void insertData() throws Exception {
- english = new I18nLanguage(new Long(1819), "English", "English", "en");
- languageManager.persist(english);
- gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom", "western", ",");
- countryManager.persist(gb);
+ english = new I18nLanguage(new Long(1819), "English", "English", "en");
+ languageManager.persist(english);
+ gb = new I18nCountry(new Long(75), "GB", "GBP", ".", "£%n", "", ".", "United Kingdom", "western", ",");
+ countryManager.persist(gb);
}
@Test
public void testContentNotRated() {
- final EntityManager manager = openTransaction();
+ final EntityManager manager = openTransaction();
- final Content cd = new Content();
- cd.setLanguage(english);
- cd.setPublishedOn(new Date());
- manager.persist(cd);
+ final Content cd = new Content();
+ cd.setLanguage(english);
+ cd.setPublishedOn(new Date());
+ manager.persist(cd);
- closeTransaction();
- final Double rate = rateFinder.calculateRate(cd);
- final Long rateByUsers = rateFinder.calculateRateNumberOfUsers(cd);
- assertEquals(0, (long) rateByUsers);
+ closeTransaction();
+ final Double rate = rateFinder.calculateRate(cd);
+ final Long rateByUsers = rateFinder.calculateRateNumberOfUsers(cd);
+ assertEquals(0, (long) rateByUsers);
- // FIXME: Why null? in other tests this return zero
- assertEquals(null, rate);
+ // FIXME: Why null? in other tests this return zero
+ assertEquals(null, rate);
}
@Test
public void testContentRateAverage() {
- final EntityManager manager = openTransaction();
+ final EntityManager manager = openTransaction();
- final User user1 = TestDomainHelper.createUser(1);
- final User user2 = TestDomainHelper.createUser(2);
+ final User user1 = TestDomainHelper.createUser(1);
+ final User user2 = TestDomainHelper.createUser(2);
- user1.setLanguage(english);
- user2.setLanguage(english);
+ user1.setLanguage(english);
+ user2.setLanguage(english);
- user1.setCountry(gb);
- user2.setCountry(gb);
+ user1.setCountry(gb);
+ user2.setCountry(gb);
- manager.persist(user1);
- manager.persist(user2);
+ manager.persist(user1);
+ manager.persist(user2);
- final Content cd = new Content();
- cd.setLanguage(english);
- cd.setPublishedOn(new Date());
- manager.persist(cd);
+ final Content cd = new Content();
+ cd.setLanguage(english);
+ cd.setPublishedOn(new Date());
+ manager.persist(cd);
- manager.persist(new Rate(user1, cd, 1.3));
- manager.persist(new Rate(user2, cd, 3.3));
- // same user and content other rate
- final Rate rateFinded = rateFinder.find(user2, cd);
- rateFinded.setValue(4.3);
- manager.persist(rateFinded);
+ manager.persist(new Rate(user1, cd, 1.3));
+ manager.persist(new Rate(user2, cd, 3.3));
+ // same user and content other rate
+ final Rate rateFinded = rateFinder.find(user2, cd);
+ rateFinded.setValue(4.3);
+ manager.persist(rateFinded);
- closeTransaction();
- final Double rate = rateFinder.calculateRate(cd);
- final Long rateByUsers = rateFinder.calculateRateNumberOfUsers(cd);
- final Double average = (1.3 + 4.3) / 2;
- assertEquals(average, rate);
- assertEquals(new Long(2), rateByUsers);
- final Rate newRate1 = rateFinder.find(user1, cd);
- final Rate newRate2 = rateFinder.find(user2, cd);
- assertEquals(1.3, (double) newRate1.getValue());
- assertEquals(4.3, (double) newRate2.getValue());
+ closeTransaction();
+ final Double rate = rateFinder.calculateRate(cd);
+ final Long rateByUsers = rateFinder.calculateRateNumberOfUsers(cd);
+ final Double average = (1.3 + 4.3) / 2;
+ assertEquals(average, rate);
+ assertEquals(new Long(2), rateByUsers);
+ final Rate newRate1 = rateFinder.find(user1, cd);
+ final Rate newRate2 = rateFinder.find(user2, cd);
+ assertEquals(new Double(1.3), newRate1.getValue());
+ assertEquals(new Double(4.3), newRate2.getValue());
}
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java 2008-08-01 10:53:22 UTC (rev 823)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java 2008-08-03 21:45:16 UTC (rev 824)
@@ -29,6 +29,7 @@
private User user;
private User admin;
private User otherUser;
+ private DomainContext ctx;
@Test
public void acceptJoinGroup() throws Exception {
@@ -163,7 +164,7 @@
@Before
public void init() {
openTransaction();
- final DomainContext ctx = new DomainContext();
+ ctx = new DomainContext();
ctx.createUsers("user1");
ctx.createUsers("admin");
ctx.createUsers("otheruser");
1
0
Author: vjrj
Date: 2008-08-01 12:53:22 +0200 (Fri, 01 Aug 2008)
New Revision: 823
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java
Removed:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEvents.java
trunk/src/main/java/org/ourproject/kune/platf/client/AbstractPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/PlatformClientModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/GotoAction.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/IndexedStackPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/IndexedStackPanelWithSubItems.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackSubItemAction.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackedDropDownPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AttachToExtensibleWidgetAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ClearExtensibleWidgetAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/DetachFromExtensibleWidgetAction.java
Modified:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/PlatformEvents.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateIt.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/utils/PrefetchUtilities.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItems.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLink.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
Log:
Workspace refactorization
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.chat.client;
-
-import org.ourproject.kune.chat.client.actions.AddRoomAction;
-import org.ourproject.kune.platf.client.extend.ClientModule;
-import org.ourproject.kune.platf.client.extend.Register;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-
-public class ChatClientModule implements ClientModule {
-
- private final Session session;
- private final StateManager stateManager;
-
- public ChatClientModule(final Session session, final StateManager stateManager, final ChatClientTool chatTool) {
- this.session = session;
- this.stateManager = stateManager;
- }
-
- public void configure(final Register register) {
- register.addAction(ChatEvents.ADD_ROOM, new AddRoomAction(session, stateManager));
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -2,6 +2,7 @@
import org.ourproject.kune.platf.client.KunePlatform;
import org.ourproject.kune.platf.client.app.Application;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
@@ -24,12 +25,12 @@
register(SingletonScope.class, new Factory<ChatClientTool>(ChatClientTool.class) {
public ChatClientTool create() {
return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
- $(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $p(GroupMembersSummary.class));
+ $(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $p(GroupMembersSummary.class),
+ $p(StateManager.class), $p(ContentServiceAsync.class));
}
});
final ChatClientTool chatClientTool = $(ChatClientTool.class);
$(KunePlatform.class).addTool(chatClientTool);
- $(KunePlatform.class).install(new ChatClientModule($(Session.class), $(StateManager.class), chatClientTool));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -25,8 +25,10 @@
import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.AbstractClientTool;
import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItem;
import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
@@ -45,12 +47,18 @@
public static final String TYPE_CHAT = "chat.chat";
private final ChatToolComponents components;
private ChatEngine chat;
+ private final Provider<StateManager> stateManagerProvider;
+ private final Provider<ContentServiceAsync> contentServiceProvider;
public ChatClientTool(final Session session, final Application application, final I18nTranslationService i18n,
final EmiteUIDialog emiteUIDialog, final WorkspaceSkeleton ws,
- final Provider<GroupMembersSummary> groupMembersSummaryProvider) {
+ final Provider<GroupMembersSummary> groupMembersSummaryProvider,
+ final Provider<StateManager> stateManagerProvider,
+ final Provider<ContentServiceAsync> contentServiceProvider) {
super(i18n.t("chat rooms"));
- components = new ChatToolComponents(emiteUIDialog, i18n);
+ this.stateManagerProvider = stateManagerProvider;
+ this.contentServiceProvider = contentServiceProvider;
+ components = new ChatToolComponents(emiteUIDialog, i18n, stateManagerProvider, session, contentServiceProvider);
session.onInitDataReceived(new Slot<InitDataDTO>() {
public void onEvent(final InitDataDTO initData) {
final ChatOptions chatOptions = new ChatOptions(initData.getChatHttpBase(), initData.getChatDomain(),
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEvents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEvents.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEvents.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,25 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client;
-
-public interface ChatEvents {
- public static final String ADD_ROOM = "chats.AddRoom";
- public static final String JOIN_ROOM = "chats.JoinRoom";
-}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -35,19 +35,31 @@
import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdminPresenter;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.WorkspaceFactory;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
+import com.calclab.suco.client.container.Provider;
public class ChatFactory {
private static I18nTranslationService i18n;
+ private static Provider<StateManager> stateManagerProvider;
+ private static Session session;
+ private static Provider<ContentServiceAsync> contentServiceProvider;
- public static ChatContent createChatContent(final EmiteUIDialog emiteUIDialog, final I18nTranslationService i18n) {
+ public static ChatContent createChatContent(final EmiteUIDialog emiteUIDialog, final I18nTranslationService i18n,
+ final Provider<StateManager> stateManagerProvider, final Session session,
+ final Provider<ContentServiceAsync> contentServiceProvider) {
ChatFactory.i18n = i18n;
+ ChatFactory.stateManagerProvider = stateManagerProvider;
+ ChatFactory.session = session;
+ ChatFactory.contentServiceProvider = contentServiceProvider;
final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
final ChatContentPresenter presenter = new ChatContentPresenter(emiteUIDialog, panel);
return presenter;
@@ -78,7 +90,8 @@
public static RoomsAdmin createRoomsAdmin() {
final ContextItems contextItems = WorkspaceFactory.createContextItems();
- final RoomsAdminPresenter presenter = new RoomsAdminPresenter(contextItems, i18n);
+ final RoomsAdminPresenter presenter = new RoomsAdminPresenter(contextItems, i18n, stateManagerProvider,
+ session, contentServiceProvider);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatToolComponents.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -22,33 +22,46 @@
import org.ourproject.kune.chat.client.cnt.ChatContent;
import org.ourproject.kune.chat.client.ctx.ChatContext;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
+import com.calclab.suco.client.container.Provider;
class ChatToolComponents {
private ChatContent content;
private ChatContext context;
private final EmiteUIDialog emiteUIDialog;
private final I18nTranslationService i18n;
+ private final Provider<StateManager> stateManagerProvider;
+ private final Session session;
+ private final Provider<ContentServiceAsync> contentServiceProvider;
- public ChatToolComponents(final EmiteUIDialog emiteUIDialog, final I18nTranslationService i18n) {
- this.emiteUIDialog = emiteUIDialog;
- this.i18n = i18n;
+ public ChatToolComponents(final EmiteUIDialog emiteUIDialog, final I18nTranslationService i18n,
+ final Provider<StateManager> stateManagerProvider, final Session session,
+ final Provider<ContentServiceAsync> contentServiceProvider) {
+ this.emiteUIDialog = emiteUIDialog;
+ this.i18n = i18n;
+ this.stateManagerProvider = stateManagerProvider;
+ this.session = session;
+ this.contentServiceProvider = contentServiceProvider;
}
public ChatContent getContent() {
- if (content == null) {
- content = ChatFactory.createChatContent(emiteUIDialog, i18n);
- }
- return content;
+ if (content == null) {
+ content = ChatFactory.createChatContent(emiteUIDialog, i18n, stateManagerProvider, session,
+ contentServiceProvider);
+ }
+ return content;
}
public ChatContext getContext() {
- if (context == null) {
- context = ChatFactory.createChatContext();
- }
- return context;
+ if (context == null) {
+ context = ChatFactory.createChatContext();
+ }
+ return context;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -28,7 +28,6 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
import org.ourproject.kune.platf.client.ui.UnknowComponent;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
@@ -44,9 +43,9 @@
private final EmiteUIDialog emiteUIDialog;
public ChatContentPresenter(final EmiteUIDialog emiteUIDialog, final WorkspaceDeckView view) {
- this.emiteUIDialog = emiteUIDialog;
- this.view = view;
- this.components = new ChatComponents(this);
+ this.emiteUIDialog = emiteUIDialog;
+ this.view = view;
+ this.components = new ChatComponents(this);
}
public void attach() {
@@ -56,36 +55,32 @@
}
public View getView() {
- return view;
+ return view;
}
public void onEnterRoom() {
- String roomName = state.getFolder().getName();
- emiteUIDialog.joinRoom(XmppURI.uri(roomName));
+ final String roomName = state.getFolder().getName();
+ emiteUIDialog.joinRoom(XmppURI.uri(roomName));
}
public void setState(final StateDTO state) {
- this.state = state;
- String typeId = state.getTypeId();
- if (typeId.equals(ChatClientTool.TYPE_ROOT)) {
- ChatInfo info = components.getChatInfo();
- view.show(info.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
- } else if (typeId.equals(ChatClientTool.TYPE_ROOM)) {
- ChatRoom viewer = components.getChatRoom();
- view.show(viewer.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
- DefaultDispatcher.getInstance().fire(
- PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT, components.getChatRoomControl()
- .getView()));
- } else {
- view.show(UnknowComponent.instance.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
- }
+ this.state = state;
+ final String typeId = state.getTypeId();
+ if (typeId.equals(ChatClientTool.TYPE_ROOT)) {
+ final ChatInfo info = components.getChatInfo();
+ view.show(info.getView());
+ DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
+ ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ } else if (typeId.equals(ChatClientTool.TYPE_ROOM)) {
+ final ChatRoom viewer = components.getChatRoom();
+ view.show(viewer.getView());
+ DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
+ ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ } else {
+ view.show(UnknowComponent.instance.getView());
+ DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
+ ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -22,4 +22,5 @@
import org.ourproject.kune.platf.client.Component;
public interface ChatRoomControl extends Component {
+
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -21,40 +21,66 @@
package org.ourproject.kune.chat.client.ctx.rooms;
import org.ourproject.kune.chat.client.ChatClientTool;
-import org.ourproject.kune.chat.client.ChatEvents;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsImages;
+import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.signal.Slot;
+
public class RoomsAdminPresenter implements RoomsAdmin {
private final ContextItems contextItems;
- public RoomsAdminPresenter(final ContextItems contextItems, final I18nTranslationService i18n) {
- this.contextItems = contextItems;
- ContextItemsImages images = ContextItemsImages.App.getInstance();
- contextItems.setParentTreeVisible(false);
- contextItems.registerType(ChatClientTool.TYPE_CHAT, images.page());
- contextItems.registerType(ChatClientTool.TYPE_ROOM, images.chatGreen());
- contextItems.canCreate(ChatClientTool.TYPE_ROOM, i18n.t("New chat room"), ChatEvents.ADD_ROOM);
+ public RoomsAdminPresenter(final ContextItems contextItems, final I18nTranslationService i18n,
+ final Provider<StateManager> stateManagerProvider, final Session session,
+ final Provider<ContentServiceAsync> contentServiceProvider) {
+ this.contextItems = contextItems;
+ final ContextItemsImages images = ContextItemsImages.App.getInstance();
+ contextItems.setParentTreeVisible(false);
+ contextItems.registerType(ChatClientTool.TYPE_CHAT, images.page());
+ contextItems.registerType(ChatClientTool.TYPE_ROOM, images.chatGreen());
+ contextItems.canCreate(ChatClientTool.TYPE_ROOM, i18n.t("New chat room"), new Slot<String>() {
+ public void onEvent(final String name) {
+ Site.showProgressProcessing();
+ final String groupShortName = session.getCurrentState().getGroup().getShortName();
+ final Long containerId = session.getCurrentState().getFolder().getId();
+ contentServiceProvider.get().addRoom(session.getUserHash(), groupShortName, containerId,
+ groupShortName + "-" + name, new AsyncCallbackSimple<StateDTO>() {
+ public void onSuccess(final StateDTO state) {
+ final StateManager stateManager = stateManagerProvider.get();
+ stateManager.setRetrievedState(state);
+ // FIXME: Isn't using cache (same in Add folder)
+ stateManager.reloadContextAndTitles();
+ Site.hideProgress();
+ }
+ });
+ }
+ });
}
public View getView() {
- return contextItems.getView();
+ return contextItems.getView();
}
// FIXME: cierta lógica de negocio en el cliente
// ¿debemos quitarla? es decir, enviar desde el servidor si se puede añadir
// hijos al contenedor
public void showRoom(final StateToken token, final ContainerDTO container, final AccessRightsDTO rights) {
- contextItems.showContainer(token, container, rights);
- String type = container.getTypeId();
- if (type.equals(ChatClientTool.TYPE_ROOM)) {
- contextItems.setControlsVisible(false);
- }
+ contextItems.showContainer(token, container, rights);
+ final String type = container.getTypeId();
+ if (type.equals(ChatClientTool.TYPE_ROOM)) {
+ contextItems.setControlsVisible(false);
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -24,7 +24,6 @@
import java.util.List;
import org.ourproject.kune.docs.client.actions.DocsEvents;
-import org.ourproject.kune.platf.client.AbstractPresenter;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
@@ -41,7 +40,7 @@
import com.calclab.suco.client.container.Provider;
-public class AdminContextPresenter extends AbstractPresenter implements AdminContext {
+public class AdminContextPresenter implements AdminContext {
private AdminContextView view;
private final Session session;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui/AdminContextPanel.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -21,10 +21,8 @@
package org.ourproject.kune.docs.client.ctx.admin.ui;
import java.util.Date;
-import java.util.Iterator;
import java.util.List;
-import org.ourproject.kune.docs.client.actions.DocsEvents;
import org.ourproject.kune.docs.client.ctx.admin.AdminContextPresenter;
import org.ourproject.kune.docs.client.ctx.admin.AdminContextView;
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
@@ -32,232 +30,230 @@
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.platf.client.ui.IconLabel;
-import org.ourproject.kune.platf.client.ui.stacks.IndexedStackPanelWithSubItems;
-import org.ourproject.kune.platf.client.ui.stacks.StackSubItemAction;
-import org.ourproject.kune.workspace.client.WorkspaceFactory;
-import org.ourproject.kune.workspace.client.i18n.LanguageSelectorComponent;
-import org.ourproject.kune.workspace.client.i18n.ui.LanguageSelectorPanel;
-import org.ourproject.kune.workspace.client.ui.ctx.admin.AccessListsPanel;
-import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.data.Record;
-import com.gwtext.client.widgets.form.ComboBox;
-import com.gwtext.client.widgets.form.DateField;
-import com.gwtext.client.widgets.form.Field;
import com.gwtext.client.widgets.form.FormPanel;
-import com.gwtext.client.widgets.form.TextArea;
-import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
-import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
public class AdminContextPanel extends VerticalPanel implements AdminContextView {
private static final Images IMG = Images.App.getInstance();
private static final int FORMS_WIDTH = 145;
- private final IndexedStackPanelWithSubItems options;
- private final AdminContextPresenter presenter;
- private AccessListsPanel accessListsPanel;
- private DateField publishedOnField;
- private TextArea tagsField;
- private VerticalPanel tagsComponent;
- private VerticalPanel publishedOnComponent;
- private LanguageSelectorComponent langPresenter;
- private VerticalPanel authorsComponent;
- private VerticalPanel langComponent;
- private IconLabel addAuthorLabel;
- private final I18nTranslationService i18n;
- private final String authors_item;
- private final String publication_item;
- private final String perms_item;
- private final String language_item;
- private final String tags_item;
+ // private final IndexedStackPanelWithSubItems options;
+ // private final AdminContextPresenter presenter;
+ //
+ // private AccessListsPanel accessListsPanel;
+ // private DateField publishedOnField;
+ // private TextArea tagsField;
+ // private VerticalPanel tagsComponent;
+ // private VerticalPanel publishedOnComponent;
+ // private LanguageSelectorComponent langPresenter;
+ // private VerticalPanel authorsComponent;
+ // private VerticalPanel langComponent;
+ // private IconLabel addAuthorLabel;
+ // private final I18nTranslationService i18n;
+ // private final String authors_item;
+ // private final String publication_item;
+ // private final String perms_item;
+ // private final String language_item;
+ // private final String tags_item;
public AdminContextPanel(final AdminContextPresenter presenter, final I18nTranslationService i18n) {
- this.presenter = presenter;
- this.i18n = i18n;
- options = new IndexedStackPanelWithSubItems();
- options.addStyleName("kune-AdminContextPanel");
-
- add(options);
- setCellWidth(options, "100%");
- setWidth("100%");
- authors_item = i18n.t("Authors");
- publication_item = i18n.t("Publication");
- perms_item = i18n.t("Permissions");
- language_item = i18n.t("Language");
- tags_item = i18n.t("Tags");
+ // this.presenter = presenter;
+ // this.i18n = i18n;
+ // //options = new IndexedStackPanelWithSubItems();
+ // //options.addStyleName("kune-AdminContextPanel");
+ //
+ // //add(options);
+ // //setCellWidth(options, "100%");
+ // setWidth("100%");
+ // authors_item = i18n.t("Authors");
+ // publication_item = i18n.t("Publication");
+ // perms_item = i18n.t("Permissions");
+ // language_item = i18n.t("Language");
+ // tags_item = i18n.t("Tags");
}
public void removeAccessListComponent() {
- if (options.containsItem(perms_item)) {
- removeComponent(perms_item);
- }
+ // if (options.containsItem(perms_item)) {
+ // removeComponent(perms_item);
+ // }
}
public void removeAuthorsComponent() {
- if (options.containsItem(authors_item)) {
- removeComponent(authors_item);
- }
+ // if (options.containsItem(authors_item)) {
+ // removeComponent(authors_item);
+ // }
}
public void removeLangComponent() {
- if (options.containsItem(language_item)) {
- removeComponent(language_item);
- }
+ // if (options.containsItem(language_item)) {
+ // removeComponent(language_item);
+ // }
}
public void removePublishedOnComponent() {
- if (options.containsItem(publication_item)) {
- removeComponent(publication_item);
- }
+ // if (options.containsItem(publication_item)) {
+ // removeComponent(publication_item);
+ // }
}
public void removeTagsComponent() {
- if (options.containsItem(tags_item)) {
- removeComponent(tags_item);
- }
+ // if (options.containsItem(tags_item)) {
+ // removeComponent(tags_item);
+ // }
}
public void reset() {
- options.clear();
+ // options.clear();
}
public void setAccessLists(final AccessListsDTO accessLists) {
- if (accessListsPanel == null) {
- accessListsPanel = new AccessListsPanel(i18n);
- }
- if (!options.containsItem(perms_item)) {
- addComponent(perms_item, i18n.t("Who can admin/edit/view this work"), accessListsPanel);
- }
- accessListsPanel.setAccessLists(accessLists);
+ // if (accessListsPanel == null) {
+ // accessListsPanel = new AccessListsPanel(i18n);
+ // }
+ // if (!options.containsItem(perms_item)) {
+ // addComponent(perms_item, i18n.t("Who can admin/edit/view this work"),
+ // accessListsPanel);
+ // }
+ // accessListsPanel.setAccessLists(accessLists);
}
public void setAuthors(final List<UserSimpleDTO> authors) {
- if (authorsComponent == null) {
- authorsComponent = new VerticalPanel();
- addAuthorLabel = new IconLabel(IMG.addGreen(), i18n.t("Add author"));
- addAuthorLabel.addClickListener(new ClickListener() {
- public void onClick(final Widget sender) {
- presenter.doAction(DocsEvents.ADD_AUTHOR, null);
- }
- });
- } else {
- if (options.containsItem(authors_item)) {
- options.removeStackItem(authors_item);
- }
- authorsComponent.clear();
- }
- if (!options.containsItem(authors_item)) {
- addComponent(authors_item, i18n.t("Authors of this work"), authorsComponent);
- }
- for (final Iterator<UserSimpleDTO> iterator = authors.iterator(); iterator.hasNext();) {
- final UserSimpleDTO author = iterator.next();
- final StackSubItemAction[] authorActions = { new StackSubItemAction(IMG.del(), i18n.t("Remove author"),
- DocsEvents.REMOVE_AUTHOR) };
- options.addStackSubItem(authors_item, IMG.personDef(), author.getShortName(), author.getName(),
- authorActions, presenter);
- }
- authorsComponent.add(addAuthorLabel);
+ // if (authorsComponent == null) {
+ // authorsComponent = new VerticalPanel();
+ // addAuthorLabel = new IconLabel(IMG.addGreen(), i18n.t("Add author"));
+ // addAuthorLabel.addClickListener(new ClickListener() {
+ // public void onClick(final Widget sender) {
+ // presenter.doAction(DocsEvents.ADD_AUTHOR, null);
+ // }
+ // });
+ // } else {
+ // if (options.containsItem(authors_item)) {
+ // options.removeStackItem(authors_item);
+ // }
+ // authorsComponent.clear();
+ // }
+ // if (!options.containsItem(authors_item)) {
+ // addComponent(authors_item, i18n.t("Authors of this work"),
+ // authorsComponent);
+ // }
+ // for (final Iterator<UserSimpleDTO> iterator = authors.iterator();
+ // iterator.hasNext();) {
+ // final UserSimpleDTO author = iterator.next();
+ // final StackSubItemAction[] authorActions = { new
+ // StackSubItemAction(IMG.del(), i18n.t("Remove author"),
+ // DocsEvents.REMOVE_AUTHOR) };
+ // options.addStackSubItem(authors_item, IMG.personDef(),
+ // author.getShortName(), author.getName(),
+ // authorActions, presenter);
+ // }
+ // authorsComponent.add(addAuthorLabel);
}
public void setLanguage(final I18nLanguageDTO language) {
- if (langComponent == null) {
- langPresenter = WorkspaceFactory.createLanguageSelectorComponent();
- langComponent = new VerticalPanel();
- final LanguageSelectorPanel view = (LanguageSelectorPanel) langPresenter.getView();
- view.setWidth("" + FORMS_WIDTH);
- langComponent.add(view);
- view.addChangeListener(new ComboBoxListenerAdapter() {
- public void onSelect(final ComboBox comboBox, final Record record, final int index) {
- presenter.doChangeLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
- }
- });
- }
- if (!options.containsItem(language_item)) {
- addComponent(language_item, i18n.t("The language of this work"), langComponent);
- }
- langPresenter.setLanguage(language);
+ // if (langComponent == null) {
+ // langPresenter = WorkspaceFactory.createLanguageSelectorComponent();
+ // langComponent = new VerticalPanel();
+ // final LanguageSelectorPanel view = (LanguageSelectorPanel)
+ // langPresenter.getView();
+ // view.setWidth("" + FORMS_WIDTH);
+ // langComponent.add(view);
+ // view.addChangeListener(new ComboBoxListenerAdapter() {
+ // public void onSelect(final ComboBox comboBox, final Record record,
+ // final int index) {
+ // presenter.doChangeLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
+ // }
+ // });
+ // }
+ // if (!options.containsItem(language_item)) {
+ // addComponent(language_item, i18n.t("The language of this work"),
+ // langComponent);
+ // }
+ // langPresenter.setLanguage(language);
}
public void setPublishedOn(final Date publishedOn) {
- if (publishedOnField == null) {
- publishedOnComponent = createPublicationComponent();
- }
- if (!options.containsItem(publication_item)) {
- addComponent(publication_item, i18n.t("Date of publication of this work"), publishedOnComponent);
- }
- // publishedOnField.setValue(publishedOn);
+ // if (publishedOnField == null) {
+ // publishedOnComponent = createPublicationComponent();
+ // }
+ // if (!options.containsItem(publication_item)) {
+ // addComponent(publication_item, i18n.t("Date of publication of this
+ // work"), publishedOnComponent);
+ // }
+ // // publishedOnField.setValue(publishedOn);
}
public void setTags(final String tags) {
- if (tagsComponent == null) {
- tagsComponent = createTagsComponent();
- }
- if (!options.containsItem(tags_item)) {
- addComponent(tags_item, i18n.t("Keywords or terms associated with this work"), tagsComponent);
- }
- tagsField.setValue(tags);
+ // if (tagsComponent == null) {
+ // tagsComponent = createTagsComponent();
+ // }
+ // if (!options.containsItem(tags_item)) {
+ // addComponent(tags_item, i18n.t("Keywords or terms associated with
+ // this work"), tagsComponent);
+ // }
+ // tagsField.setValue(tags);
}
private void addComponent(final String header, final String headerTitle, final VerticalPanel panel) {
- panel.addStyleName("kune-AdminContextPanel-inner-wrap");
- final VerticalPanel vp = options.addStackItem(header, headerTitle, false);
- vp.setStyleName("kune-AdminContextPanel-inner");
- vp.add(panel);
- vp.setCellWidth(panel, "100%");
- vp.setWidth("100%");
+ // panel.addStyleName("kune-AdminContextPanel-inner-wrap");
+ // final VerticalPanel vp = options.addStackItem(header, headerTitle,
+ // false);
+ // vp.setStyleName("kune-AdminContextPanel-inner");
+ // vp.add(panel);
+ // vp.setCellWidth(panel, "100%");
+ // vp.setWidth("100%");
}
private FormPanel createDefaultForm() {
- final FormPanel form = new FormPanel();
- form.setHideLabels(true);
- form.setWidth(FORMS_WIDTH);
- form.setBorder(false);
- return form;
+ final FormPanel form = new FormPanel();
+ form.setHideLabels(true);
+ form.setWidth(FORMS_WIDTH);
+ form.setBorder(false);
+ return form;
}
- private VerticalPanel createPublicationComponent() {
- final FormPanel form = createDefaultForm();
+ // private VerticalPanel createPublicationComponent() {
+ // // final FormPanel form = createDefaultForm();
+ // //
+ // // publishedOnField = new DateField();
+ // // publishedOnField.setWidth("140");
+ // // publishedOnField.setFormat("Y-m-d");
+ // //
+ // // publishedOnField.addListener(new FieldListenerAdapter() {
+ // // public void onChange(final Field field, final Object newVal, final
+ // // Object oldVal) {
+ // // presenter.setPublishedOn((Date) newVal);
+ // // }
+ // // });
+ // //
+ // // form.add(publishedOnField);
+ // //
+ // // final VerticalPanel vp = new VerticalPanel();
+ // // vp.add(form);
+ // // return vp;
+ // //// }
+ //
+ // private VerticalPanel createTagsComponent() {
+ // final FormPanel form = createDefaultForm();
+ // tagsField = new TextArea();
+ // tagsField.setWidth("" + FORMS_WIDTH);
+ // tagsField.setHeight("3em");
+ // tagsField.addListener(new FieldListenerAdapter() {
+ // public void onChange(final Field field, final Object newVal, final
+ // Object oldVal) {
+ // presenter.setTags((String) newVal);
+ // }
+ // });
+ //
+ // form.add(tagsField);
+ // final VerticalPanel vp = new VerticalPanel();
+ // vp.add(form);
+ // return vp;
+ // }
- publishedOnField = new DateField();
- publishedOnField.setWidth("140");
- publishedOnField.setFormat("Y-m-d");
-
- publishedOnField.addListener(new FieldListenerAdapter() {
- public void onChange(final Field field, final Object newVal, final Object oldVal) {
- presenter.setPublishedOn((Date) newVal);
- }
- });
-
- form.add(publishedOnField);
-
- final VerticalPanel vp = new VerticalPanel();
- vp.add(form);
- return vp;
- }
-
- private VerticalPanel createTagsComponent() {
- final FormPanel form = createDefaultForm();
- tagsField = new TextArea();
- tagsField.setWidth("" + FORMS_WIDTH);
- tagsField.setHeight("3em");
- tagsField.addListener(new FieldListenerAdapter() {
- public void onChange(final Field field, final Object newVal, final Object oldVal) {
- presenter.setTags((String) newVal);
- }
- });
-
- form.add(tagsField);
- final VerticalPanel vp = new VerticalPanel();
- vp.add(form);
- return vp;
- }
-
private void removeComponent(final String header) {
- options.removeStackItem(header);
+ // options.removeStackItem(header);
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/AbstractPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/AbstractPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/AbstractPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client;
-
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-
-public abstract class AbstractPresenter {
-
- public void doAction(final String action, final Object value) {
- DefaultDispatcher.getInstance().fire(action, value);
- }
-
- public void doGoto(final String token) {
- DefaultDispatcher.getInstance().fire(PlatformEvents.GOTO, token);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/PlatformClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/PlatformClientModule.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/PlatformClientModule.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,45 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.platf.client;
-
-import org.ourproject.kune.platf.client.actions.GotoAction;
-import org.ourproject.kune.platf.client.actions.GotoContainerAction;
-import org.ourproject.kune.platf.client.extend.ClientModule;
-import org.ourproject.kune.platf.client.extend.Register;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-
-import com.calclab.suco.client.container.Provider;
-
-public class PlatformClientModule implements ClientModule {
- private final Provider<StateManager> stateManager;
- private final Session session;
-
- public PlatformClientModule(final Session session, final Provider<StateManager> provider) {
- this.stateManager = provider;
- this.session = session;
- }
-
- public void configure(final Register register) {
- register.addAction(PlatformEvents.GOTO, new GotoAction(stateManager));
- register.addAction(PlatformEvents.GOTO_CONTAINER, new GotoContainerAction(stateManager, session));
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/PlatformEvents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/PlatformEvents.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/PlatformEvents.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -23,6 +23,4 @@
public static final String ATTACH_TO_EXTENSIBLE_WIDGET = "ws.AttachToExtensibleWidget";
public static final String DETACH_FROM_EXTENSIBLE_WIDGET = "ws.DetachToExtensibleWidget";
public static final String CLEAR_EXTENSIBLE_WIDGET = "ws.ClearExtensionPoint";
- public static final String GOTO = "ws.Goto";
- public static final String GOTO_CONTAINER = "ws.GotoContainer";
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/GotoAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/GotoAction.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/GotoAction.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,43 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.actions;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.state.StateManager;
-
-import com.calclab.suco.client.container.Provider;
-
-public class GotoAction implements Action<String> {
-
- private final Provider<StateManager> stateManager;
-
- public GotoAction(final Provider<StateManager> stateManager) {
- this.stateManager = stateManager;
- }
-
- public void execute(final String value) {
- onGoto(value);
- }
-
- private void onGoto(final String token) {
- stateManager.get().setState(new StateToken(token));
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -28,17 +28,14 @@
import org.ourproject.kune.platf.client.dispatch.ActionEvent;
import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.InitDataDTO;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
import org.ourproject.kune.platf.client.rpc.SiteService;
import org.ourproject.kune.platf.client.rpc.SiteServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ClientTool;
import org.ourproject.kune.platf.client.ui.WindowUtils;
import org.ourproject.kune.platf.client.utils.PrefetchUtilities;
-import org.ourproject.kune.workspace.client.WorkspaceFactory;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.workspace.Workspace;
@@ -52,17 +49,17 @@
import com.google.gwt.user.client.rpc.AsyncCallback;
public class ApplicationDefault implements Application {
- private final Workspace workspace;
+ // private final Workspace workspace;
private Map<String, ClientTool> tools;
private final Session session;
private final Signal<Object> onApplicationStart;
private final Signal<Object> onApplicationStop;
private StateManager stateManager;
- public ApplicationDefault(final Session session, final ExtensibleWidgetsManager extensionPointManager,
- final I18nTranslationService i18n, final KuneErrorHandler errorHandler, final WorkspaceSkeleton ws) {
+ public ApplicationDefault(final Session session, final KuneErrorHandler errorHandler, final WorkspaceSkeleton ws) {
this.session = session;
- workspace = WorkspaceFactory.createWorkspace(session, extensionPointManager, i18n, errorHandler);
+ // workspace = WorkspaceFactory.createWorkspace(session,
+ // extensionPointManager, i18n, errorHandler);
tools = new HashMap<String, ClientTool>();
this.onApplicationStart = new Signal<Object>("onApplicationStart");
this.onApplicationStop = new Signal<Object>("onApplicationStop");
@@ -81,8 +78,9 @@
return tools.get(toolName);
}
+ @Deprecated
public Workspace getWorkspace() {
- return workspace;
+ return null;
}
public void init(final StateManager stateManager, final HashMap<String, ClientTool> tools) {
@@ -112,7 +110,7 @@
getInitData();
final Timer prefetchTimer = new Timer() {
public void run() {
- PrefetchUtilities.doTasksDeferred(workspace);
+ PrefetchUtilities.doTasksDeferred();
}
};
prefetchTimer.schedule(20000);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -19,8 +19,6 @@
*/
package org.ourproject.kune.platf.client.services;
-import org.ourproject.kune.platf.client.PlatformEvents;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.errors.AccessViolationException;
import org.ourproject.kune.platf.client.errors.AlreadyGroupMemberException;
import org.ourproject.kune.platf.client.errors.AlreadyUserMemberException;
@@ -30,6 +28,7 @@
import org.ourproject.kune.platf.client.errors.SessionExpiredException;
import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
@@ -44,12 +43,14 @@
private final I18nTranslationService i18n;
private final Provider<WorkspaceSkeleton> wsProvider;
private final Signal<Object> onSessionExpired;
+ private final Provider<StateManager> stateManagerProvider;
public KuneErrorHandler(final Session session, final I18nTranslationService i18n,
- final Provider<WorkspaceSkeleton> wsProvider) {
+ final Provider<WorkspaceSkeleton> wsProvider, final Provider<StateManager> stateManagerProvider) {
this.session = session;
this.i18n = i18n;
this.wsProvider = wsProvider;
+ this.stateManagerProvider = stateManagerProvider;
this.onSessionExpired = new Signal<Object>("onSessionExpired");
}
@@ -81,11 +82,11 @@
} catch (final GroupNotFoundException e) {
logException(e);
Site.error(i18n.t("Group not found"));
- DefaultDispatcher.getInstance().fire(PlatformEvents.GOTO, "");
+ stateManagerProvider.get().gotoToken("");
} catch (final ContentNotFoundException e) {
logException(e);
Site.error(i18n.t("Content not found"));
- DefaultDispatcher.getInstance().fire(PlatformEvents.GOTO, "");
+ stateManagerProvider.get().gotoToken("");
} catch (final LastAdminInGroupException e) {
logException(e);
getWorkspaceSkeleton().showAlertMessage(
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -3,13 +3,11 @@
import org.ourproject.kune.chat.client.ChatClientNewModule;
import org.ourproject.kune.docs.client.DocumentClientNewModule;
import org.ourproject.kune.platf.client.KunePlatform;
-import org.ourproject.kune.platf.client.PlatformClientModule;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ApplicationDefault;
import org.ourproject.kune.platf.client.app.HistoryWrapper;
import org.ourproject.kune.platf.client.app.HistoryWrapperImpl;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ContentService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
@@ -74,7 +72,6 @@
import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
import org.ourproject.kune.workspace.client.tags.TagsSummaryPanel;
import org.ourproject.kune.workspace.client.tags.TagsSummaryPresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
@@ -119,6 +116,7 @@
import org.ourproject.kune.workspace.client.workspace.UserLiveSearcher;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel;
+import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPresenter;
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.calclab.suco.client.container.Container;
@@ -149,27 +147,19 @@
public Session create() {
return new SessionImpl(Cookies.getCookie(Site.USERHASH), $p(UserServiceAsync.class));
}
- });
-
- /** Services (this in other module after UI refactor * */
-
- register(SingletonScope.class, new Factory<I18nServiceAsync>(I18nServiceAsync.class) {
+ }, new Factory<I18nServiceAsync>(I18nServiceAsync.class) {
public I18nServiceAsync create() {
final I18nServiceAsync service = (I18nServiceAsync) GWT.create(I18nService.class);
((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + "I18nService");
return service;
}
- });
-
- register(SingletonScope.class, new Factory<UserServiceAsync>(UserServiceAsync.class) {
+ }, new Factory<UserServiceAsync>(UserServiceAsync.class) {
public UserServiceAsync create() {
final UserServiceAsync service = (UserServiceAsync) GWT.create(UserService.class);
((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + "UserService");
return service;
}
- });
-
- register(SingletonScope.class, new Factory<SocialNetworkServiceAsync>(SocialNetworkServiceAsync.class) {
+ }, new Factory<SocialNetworkServiceAsync>(SocialNetworkServiceAsync.class) {
public SocialNetworkServiceAsync create() {
final SocialNetworkServiceAsync snServiceAsync = (SocialNetworkServiceAsync) GWT
.create(SocialNetworkService.class);
@@ -177,18 +167,15 @@
+ "SocialNetworkService");
return snServiceAsync;
}
- });
-
- register(SingletonScope.class, new Factory<GroupServiceAsync>(GroupServiceAsync.class) {
+ }, new Factory<GroupServiceAsync>(GroupServiceAsync.class) {
public GroupServiceAsync create() {
final GroupServiceAsync groupServiceAsync = (GroupServiceAsync) GWT.create(GroupService.class);
((ServiceDefTarget) groupServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() + "GroupService");
return groupServiceAsync;
}
- });
-
- register(SingletonScope.class, new Factory<ContentServiceAsync>(ContentServiceAsync.class) {
+ }, new Factory<ContentServiceAsync>(ContentServiceAsync.class) {
public ContentServiceAsync create() {
+ // FIXME
return ContentService.App.getInstance();
}
});
@@ -225,35 +212,26 @@
$(QuickTipsHelper.class);
- register(SingletonScope.class, new Factory<UserServiceAsync>(UserServiceAsync.class) {
- public UserServiceAsync create() {
- final UserServiceAsync service = (UserServiceAsync) GWT.create(UserService.class);
- ((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + "UserService");
- return service;
+ register(SingletonScope.class, new Factory<HistoryWrapper>(HistoryWrapper.class) {
+ public HistoryWrapper create() {
+ return new HistoryWrapperImpl();
}
- });
-
- register(SingletonScope.class, new Factory<SocialNetworkServiceAsync>(SocialNetworkServiceAsync.class) {
- public SocialNetworkServiceAsync create() {
- final SocialNetworkServiceAsync snServiceAsync = (SocialNetworkServiceAsync) GWT
- .create(SocialNetworkService.class);
- ((ServiceDefTarget) snServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL()
- + "SocialNetworkService");
- return snServiceAsync;
+ }, new Factory<ContentProvider>(ContentProvider.class) {
+ public ContentProvider create() {
+ return new ContentProviderImpl($(ContentServiceAsync.class));
}
- });
-
- register(SingletonScope.class, new Factory<GroupServiceAsync>(GroupServiceAsync.class) {
- public GroupServiceAsync create() {
- final GroupServiceAsync groupServiceAsync = (GroupServiceAsync) GWT.create(GroupService.class);
- ((ServiceDefTarget) groupServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() + "GroupService");
- return groupServiceAsync;
+ }, new Factory<StateManager>(StateManager.class) {
+ public StateManager create() {
+ final StateManagerDefault stateManager = new StateManagerDefault($(ContentProvider.class),
+ $(Session.class), $(HistoryWrapper.class));
+ History.addHistoryListener(stateManager);
+ return stateManager;
}
});
- register(SingletonScope.class, new Factory<ContentServiceAsync>(ContentServiceAsync.class) {
- public ContentServiceAsync create() {
- return ContentService.App.getInstance();
+ register(SingletonScope.class, new Factory<KuneErrorHandler>(KuneErrorHandler.class) {
+ public KuneErrorHandler create() {
+ return new KuneErrorHandler($(Session.class), i18n, $p(WorkspaceSkeleton.class), $p(StateManager.class));
}
});
@@ -261,20 +239,12 @@
public Images create() {
return Images.App.getInstance();
}
- });
-
- register(SingletonScope.class, new Factory<ImageUtils>(ImageUtils.class) {
+ }, new Factory<ImageUtils>(ImageUtils.class) {
public ImageUtils create() {
return new ImageUtils();
}
});
- register(SingletonScope.class, new Factory<KuneErrorHandler>(KuneErrorHandler.class) {
- public KuneErrorHandler create() {
- return new KuneErrorHandler($(Session.class), i18n, $p(WorkspaceSkeleton.class));
- }
- });
-
register(SingletonScope.class, new Factory<WorkspaceSkeleton>(WorkspaceSkeleton.class) {
public WorkspaceSkeleton create() {
return new WorkspaceSkeleton();
@@ -290,26 +260,19 @@
}
});
- register(SingletonScope.class, new Factory<ExtensibleWidgetsManager>(ExtensibleWidgetsManager.class) {
- public ExtensibleWidgetsManager create() {
- return new ExtensibleWidgetsManager();
- }
- });
-
final WorkspaceSkeleton ws = $(WorkspaceSkeleton.class);
final Images images = $(Images.class);
register(SingletonScope.class, new Factory<Application>(Application.class) {
public Application create() {
final Session session = $(Session.class);
- final ExtensibleWidgetsManager extensionPointManager = $(ExtensibleWidgetsManager.class);
- return new ApplicationDefault(session, extensionPointManager, i18n, $(KuneErrorHandler.class), ws);
+ return new ApplicationDefault(session, $(KuneErrorHandler.class), ws);
}
});
register(SingletonScope.class, new Factory<SitePublicSpaceLink>(SitePublicSpaceLink.class) {
public SitePublicSpaceLink create() {
- final SitePublicSpaceLinkPresenter presenter = new SitePublicSpaceLinkPresenter();
+ final SitePublicSpaceLinkPresenter presenter = new SitePublicSpaceLinkPresenter($(StateManager.class));
final SitePublicSpaceLinkPanel panel = new SitePublicSpaceLinkPanel(presenter, ws, i18n, images);
presenter.init(panel);
return presenter;
@@ -400,7 +363,7 @@
register(SingletonScope.class, new Factory<SiteSearcher>(SiteSearcher.class) {
public SiteSearcher create() {
- final SiteSearcherPresenter presenter = new SiteSearcherPresenter();
+ final SiteSearcherPresenter presenter = new SiteSearcherPresenter($p(StateManager.class));
final SiteSearcherView view = new SiteSearcherPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
@@ -455,24 +418,20 @@
}
});
- $(SitePublicSpaceLink.class);
- $(SiteMessage.class);
- $(SiteUserMenu.class);
- $(SiteSignInLink.class);
- $(SiteSignOutLink.class);
- $(SiteNewGroupLink.class);
- $(SiteSearch.class);
- $(SiteLogo.class);
-
register(SingletonScope.class, new Factory<EntityLogo>(EntityLogo.class) {
public EntityLogo create() {
- return new EntityLogoPanel(i18n, ws);
+ final EntityLogoPresenter presenter = new EntityLogoPresenter($(StateManager.class),
+ $(WsThemePresenter.class));
+ final EntityLogoPanel panel = new EntityLogoPanel(i18n, ws);
+ presenter.init(panel);
+ return presenter;
}
});
register(SingletonScope.class, new Factory<WsThemePresenter>(WsThemePresenter.class) {
public WsThemePresenter create() {
- final WsThemePresenter presenter = new WsThemePresenter($(Session.class), $p(GroupServiceAsync.class));
+ final WsThemePresenter presenter = new WsThemePresenter($(Session.class), $p(GroupServiceAsync.class),
+ $(StateManager.class));
final WsThemePanel panel = new WsThemePanel(ws, presenter, i18n);
presenter.init(panel);
return presenter;
@@ -481,7 +440,8 @@
register(SingletonScope.class, new Factory<EntityTitlePresenter>(EntityTitlePresenter.class) {
public EntityTitlePresenter create() {
- final EntityTitlePresenter presenter = new EntityTitlePresenter(i18n, $(KuneErrorHandler.class));
+ final EntityTitlePresenter presenter = new EntityTitlePresenter(i18n, $(KuneErrorHandler.class),
+ $(StateManager.class));
final EntityTitlePanel panel = new EntityTitlePanel(ws, presenter);
presenter.init(panel);
return presenter;
@@ -490,7 +450,7 @@
register(SingletonScope.class, new Factory<EntitySubTitlePresenter>(EntitySubTitlePresenter.class) {
public EntitySubTitlePresenter create() {
- final EntitySubTitlePresenter presenter = new EntitySubTitlePresenter(i18n);
+ final EntitySubTitlePresenter presenter = new EntitySubTitlePresenter(i18n, $(StateManager.class));
final EntitySubTitlePanel panel = new EntitySubTitlePanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
@@ -499,7 +459,7 @@
register(SingletonScope.class, new Factory<EntityLicensePresenter>(EntityLicensePresenter.class) {
public EntityLicensePresenter create() {
- final EntityLicensePresenter presenter = new EntityLicensePresenter();
+ final EntityLicensePresenter presenter = new EntityLicensePresenter($(StateManager.class));
final EntityLicensePanel panel = new EntityLicensePanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
@@ -508,7 +468,7 @@
register(SingletonScope.class, new Factory<RatePresenter>(RatePresenter.class) {
public RatePresenter create() {
- final RatePresenter presenter = new RatePresenter();
+ final RatePresenter presenter = new RatePresenter($(StateManager.class));
final RatePanel panel = new RatePanel(null, null, i18n, ws);
presenter.init(panel);
return presenter;
@@ -518,7 +478,7 @@
register(SingletonScope.class, new Factory<RateIt>(RateIt.class) {
public RateIt create() {
final RateItPresenter presenter = new RateItPresenter(i18n, $(Session.class),
- $p(ContentServiceAsync.class), $p(StateManager.class));
+ $p(ContentServiceAsync.class), $(StateManager.class));
final RateItPanel panel = new RateItPanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
@@ -528,8 +488,8 @@
register(SingletonScope.class, new Factory<GroupMembersSummary>(GroupMembersSummary.class) {
public GroupMembersSummary create() {
final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(i18n,
- $p(StateManager.class), $(ImageUtils.class), $(Session.class),
- $p(SocialNetworkServiceAsync.class), $p(UserLiveSearcher.class));
+ $(StateManager.class), $(ImageUtils.class), $(Session.class),
+ $p(SocialNetworkServiceAsync.class), $p(UserLiveSearcher.class), $(WsThemePresenter.class));
final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
@@ -538,7 +498,8 @@
register(SingletonScope.class, new Factory<GroupSummary>(GroupSummary.class) {
public GroupSummary create() {
- final GroupSummaryPresenter presenter = new GroupSummaryPresenter();
+ final GroupSummaryPresenter presenter = new GroupSummaryPresenter($(StateManager.class),
+ $(WsThemePresenter.class));
final GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
@@ -548,8 +509,8 @@
register(SingletonScope.class, new Factory<ParticipationSummary>(ParticipationSummary.class) {
public ParticipationSummary create() {
final ParticipationSummaryPresenter presenter = new ParticipationSummaryPresenter(i18n,
- $p(StateManager.class), $(ImageUtils.class), $(Session.class),
- $p(SocialNetworkServiceAsync.class));
+ $(StateManager.class), $(ImageUtils.class), $(Session.class),
+ $p(SocialNetworkServiceAsync.class), $(WsThemePresenter.class));
final ParticipationSummaryView view = new ParticipationSummaryPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
@@ -559,43 +520,13 @@
register(SingletonScope.class, new Factory<TagsSummary>(TagsSummary.class) {
public TagsSummary create() {
final TagsSummaryPresenter presenter = new TagsSummaryPresenter($p(Session.class),
- $p(SiteSearcher.class));
+ $p(SiteSearcher.class), $(StateManager.class), $(WsThemePresenter.class));
final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
}
});
- register(SingletonScope.class, new Factory<WorkspaceManager>(WorkspaceManager.class) {
- public WorkspaceManager create() {
- final WorkspaceManager presenter = new WorkspaceManager($(SitePublicSpaceLink.class),
- $(EntityLogo.class), $(EntityTitlePresenter.class), $(EntitySubTitlePresenter.class),
- $(WsThemePresenter.class), $(EntityLicensePresenter.class), $p(GroupMembersSummary.class),
- $p(ParticipationSummary.class), $p(TagsSummary.class), $p(GroupSummary.class),
- $p(RateIt.class), $p(RatePresenter.class));
- return presenter;
- }
- });
-
- $(WorkspaceManager.class);
-
- register(SingletonScope.class, new Factory<HistoryWrapper>(HistoryWrapper.class) {
- public HistoryWrapper create() {
- return new HistoryWrapperImpl();
- }
- }, new Factory<ContentProvider>(ContentProvider.class) {
- public ContentProvider create() {
- return new ContentProviderImpl($(ContentServiceAsync.class));
- }
- }, new Factory<StateManager>(StateManager.class) {
- public StateManager create() {
- final StateManagerDefault stateManager = new StateManagerDefault($(ContentProvider.class),
- $(Session.class), $(HistoryWrapper.class), $(WorkspaceManager.class));
- History.addHistoryListener(stateManager);
- return stateManager;
- }
- });
-
register(SingletonScope.class, new Factory<UserLiveSearcher>(UserLiveSearcher.class) {
public UserLiveSearcher create() {
final UserLiveSearcherPresenter presenter = new UserLiveSearcherPresenter();
@@ -616,6 +547,28 @@
load(new EmiteUIModule(), new DocumentClientNewModule(), new ChatClientNewModule());
+ $(SitePublicSpaceLink.class);
+ $(SiteMessage.class);
+ $(SiteUserMenu.class);
+ $(SiteSignInLink.class);
+ $(SiteSignOutLink.class);
+ $(SiteNewGroupLink.class);
+ $(SiteSearch.class);
+ $(SiteLogo.class);
+
+ $(EntityLogo.class);
+ $(EntityTitlePresenter.class);
+ $(EntitySubTitlePresenter.class);
+ $(WsThemePresenter.class);
+ $(EntityLicensePresenter.class);
+ $(RateIt.class);
+ $(RatePresenter.class);
+
+ $(GroupMembersSummary.class);
+ $(ParticipationSummary.class);
+ $(TagsSummary.class);
+ $(GroupSummary.class);
+
// Register of tokens like "signin", "newgroup", "translate" etcetera
$(StateManager.class).addSiteToken(SiteToken.signin.toString(), new Slot<StateToken>() {
public void onEvent(final StateToken previousStateToken) {
@@ -630,12 +583,11 @@
});
final KunePlatform platform = $(KunePlatform.class);
- platform.install(new PlatformClientModule($(Session.class), $p(StateManager.class)));
platform.install(new WorkspaceClientModule($(Session.class), $(StateManager.class), $(Application.class)
.getWorkspace(), i18n));
$(Application.class).init($(StateManager.class), platform.getIndexedTools());
$(Application.class).subscribeActions(platform.getActions());
- $(Application.class).getWorkspace().attachTools(platform.getTools().iterator());
+ // $(Application.class).getWorkspace().attachTools(platform.getTools().iterator());
$(Application.class).start();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -31,8 +31,14 @@
void addSiteToken(String token, Slot<StateToken> whenToken);
+ void gotoContainer(Long containerId);
+
void gotoToken(String token);
+ void onSocialNetworkChanged(Slot<StateDTO> slot);
+
+ void onStateChanged(Slot<StateDTO> slot);
+
void reload();
void reloadContextAndTitles();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -31,9 +31,9 @@
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.signal.Signal;
import com.calclab.suco.client.signal.Slot;
public class StateManagerDefault implements StateManager {
@@ -41,16 +41,18 @@
private StateDTO oldState;
private final Session session;
private final HistoryWrapper history;
- private final WorkspaceManager workspaceManager;
private final HashMap<String, Slot<StateToken>> siteTokens;
+ private final Signal<StateDTO> onStateChanged;
+ private final Signal<StateDTO> onSocialNetworkChanged;
public StateManagerDefault(final ContentProvider contentProvider, final Session session,
- final HistoryWrapper history, final WorkspaceManager workspaceManager) {
+ final HistoryWrapper history) {
this.contentProvider = contentProvider;
this.session = session;
this.history = history;
- this.workspaceManager = workspaceManager;
this.oldState = null;
+ this.onStateChanged = new Signal<StateDTO>("onStateChanged");
+ this.onSocialNetworkChanged = new Signal<StateDTO>("onSocialNetworkChanged");
session.onUserSignIn(new Slot<UserInfoDTO>() {
public void onEvent(final UserInfoDTO parameter) {
restorePreviousState();
@@ -68,6 +70,13 @@
siteTokens.put(token, slot);
}
+ public void gotoContainer(final Long containerId) {
+ final StateToken newStateToken = session.getCurrentState().getStateToken();
+ newStateToken.setDocument(null);
+ newStateToken.setFolder(containerId.toString());
+ setState(newStateToken);
+ }
+
public void gotoToken(final String token) {
setState(new StateToken(token));
}
@@ -90,6 +99,14 @@
}
}
+ public void onSocialNetworkChanged(final Slot<StateDTO> slot) {
+ onSocialNetworkChanged.add(slot);
+ }
+
+ public void onStateChanged(final Slot<StateDTO> slot) {
+ onStateChanged.add(slot);
+ }
+
/**
* <p>
* Reload current state (using client cache if available)
@@ -132,7 +149,7 @@
final ParticipationDataDTO userParticipation = socialNet.getUserParticipation();
state.setGroupMembers(groupMembers);
state.setParticipation(userParticipation);
- workspaceManager.setSocialNetwork(state);
+ onSocialNetworkChanged.fire(state);
}
}
@@ -142,7 +159,7 @@
private void loadContent(final StateDTO state) {
session.setCurrent(state);
- workspaceManager.setState(state);
+ onStateChanged.fire(state);
// final GroupDTO group = state.getGroup();
// app.setGroupState(group.getShortName());
// final boolean isAdmin = state.getGroupRights().isAdministrable();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/UnknowComponent.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -29,7 +29,7 @@
public static final UnknowComponent instance = new UnknowComponent();
public UnknowComponent() {
- super("programming error: unknown component!! please contact kune_dev(a)ourproject.org");
+ super("programming error: unknown component!! please contact kune-devel(a)lists-ourproject.org");
}
public View getView() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateIt.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateIt.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateIt.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,11 +1,8 @@
package org.ourproject.kune.platf.client.ui.rate;
-import org.ourproject.kune.platf.client.dto.StateDTO;
public interface RateIt {
- void setState(StateDTO state);
-
void setVisible(boolean visible);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -28,6 +28,7 @@
import org.ourproject.kune.workspace.client.sitebar.Site;
import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.signal.Slot;
public class RateItPresenter implements RateIt {
@@ -38,15 +39,19 @@
private final I18nTranslationService i18n;
private final Provider<ContentServiceAsync> contentServiceProvider;
private final Session session;
- private final Provider<StateManager> stateManagerProvider;
+ private final StateManager stateManager;
public RateItPresenter(final I18nTranslationService i18n, final Session session,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final Provider<StateManager> stateManagerProvider) {
+ final Provider<ContentServiceAsync> contentServiceProvider, final StateManager stateManager) {
this.i18n = i18n;
this.session = session;
this.contentServiceProvider = contentServiceProvider;
- this.stateManagerProvider = stateManagerProvider;
+ this.stateManager = stateManager;
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
}
public void init(final RateItView view) {
@@ -64,19 +69,6 @@
setRatePanel(currentRate);
}
- public void setState(final StateDTO state) {
- if (state.isRateable()) {
- if (session.isLogged()) {
- setRate(state.getCurrentUserRate());
- view.setVisible(true);
- } else {
- view.setVisible(false);
- }
- } else {
- view.setVisible(false);
- }
- }
-
public void setVisible(final boolean visible) {
view.setVisible(visible);
}
@@ -98,7 +90,7 @@
public void onSuccess(final Object result) {
Site.hideProgress();
Site.info(i18n.t("Content rated"));
- stateManagerProvider.get().reload();
+ stateManager.reload();
}
});
}
@@ -140,4 +132,17 @@
setDesc((int) Math.ceil(value.doubleValue()));
}
}
+
+ private void setState(final StateDTO state) {
+ if (state.isRateable()) {
+ if (session.isLogged()) {
+ setRate(state.getCurrentUserRate());
+ view.setVisible(true);
+ } else {
+ view.setVisible(false);
+ }
+ } else {
+ view.setVisible(false);
+ }
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RatePresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,19 +1,31 @@
package org.ourproject.kune.platf.client.ui.rate;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.state.StateManager;
+import com.calclab.suco.client.signal.Slot;
+
public class RatePresenter {
private RateView view;
- public RatePresenter() {
+ public RatePresenter(final StateManager stateManager) {
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
}
public void init(final RateView view) {
this.view = view;
}
- public void setState(final StateDTO state) {
+ public void setVisible(final boolean visible) {
+ view.setVisible(visible);
+ }
+
+ private void setState(final StateDTO state) {
if (state.isRateable()) {
view.setVisible(true);
view.setRate(state.getRate());
@@ -23,8 +35,4 @@
}
}
-
- public void setVisible(final boolean visible) {
- view.setVisible(visible);
- }
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/IndexedStackPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/IndexedStackPanel.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/IndexedStackPanel.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,195 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.stacks;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.ui.AbstractLabel;
-import org.ourproject.kune.platf.client.ui.IconLabel;
-import org.ourproject.kune.platf.client.ui.KuneUiUtils;
-import org.ourproject.kune.platf.client.ui.LabelWrapper;
-import org.ourproject.kune.platf.client.ui.UIConstants;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.StackPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class IndexedStackPanel extends StackPanel {
- public class StackItem {
- private String text;
- private String title;
- private AbstractImagePrototype icon;
- private String iconAlign;
- private boolean countVisible;
- private final ArrayList<String> subItems;
-
- public StackItem(final String text, final String title, final AbstractImagePrototype icon,
- final String iconAlign, final boolean countVisible) {
- this.text = text;
- this.title = title;
- this.icon = icon;
- this.iconAlign = iconAlign;
- this.countVisible = countVisible;
- subItems = new ArrayList<String>();
- }
-
- public void addSubItem(final String name) {
- subItems.add(name);
- }
-
- public void clear() {
- subItems.clear();
- }
-
- public int getCount() {
- return subItems.size();
- }
-
- public String getHtml() {
- final boolean insertIcon = icon != null && iconAlign != null;
- final String textWithCount = text + (countVisible ? " (" + subItems.size() + ")" : "");
- AbstractLabel label;
- if (insertIcon) {
- if (iconAlign == UIConstants.ICON_HORIZ_ALIGN_RIGHT) {
- label = new IconLabel(textWithCount, icon);
- } else {
- label = new IconLabel(textWithCount, icon);
- }
- } else {
- label = new LabelWrapper(textWithCount);
- }
- KuneUiUtils.setQuickTip(label.getElement(), title);
- return label.toString();
- }
-
- public String getName() {
- return text;
- }
-
- public int indexOfSubItem(final String name) {
- return subItems.indexOf(name);
- }
-
- public boolean isCountVisible() {
- return countVisible;
- }
-
- public void removeSubItem(final String name) {
- subItems.remove(name);
- }
-
- public void setCountVisible(final boolean visible) {
- this.countVisible = visible;
- }
-
- public void setIcon(final AbstractImagePrototype icon) {
- this.icon = icon;
- }
-
- public void setIconAlign(final String iconAlign) {
- this.iconAlign = iconAlign;
- }
-
- public void setText(final String text) {
- this.text = text;
- }
-
- public void setTitle(final String title) {
- this.title = title;
- }
- }
-
- private final ArrayList<StackItem> stackList;
-
- /* Stack items */
-
- public IndexedStackPanel() {
- stackList = new ArrayList<StackItem>();
- }
-
- public VerticalPanel addStackItem(final String name, final String title, final AbstractImagePrototype icon,
- final String iconAlign, final boolean countVisible) {
- final ScrollPanel siSP = new ScrollPanel();
- final VerticalPanel siVP = new VerticalPanel();
- siSP.add(siVP);
- final StackItem stackItem = new StackItem(name, title, icon, iconAlign, countVisible);
- add(siSP, stackItem.getHtml(), true);
- stackList.add(stackItem);
- return siVP;
- }
-
- public VerticalPanel addStackItem(final String name, final String title, final boolean countVisible) {
- return addStackItem(name, title, null, null, countVisible);
- }
-
- public void clear() {
- for (final Iterator<StackItem> iterator = stackList.iterator(); iterator.hasNext();) {
- final StackItem item = iterator.next();
- item.clear();
- }
- stackList.clear();
- super.clear();
- }
-
- public boolean containsItem(final String name) {
- return indexOf(name) == -1 ? false : true;
- }
-
- public StackItem getItem(final int indexOfStackItem) {
- return stackList.get(indexOfStackItem);
- }
-
- public StackItem getItem(final String name) {
- return stackList.get(indexOf(name));
- }
-
- public int indexOf(final String name) {
- final Iterator<StackItem> iter = stackList.iterator();
- int i = 0;
- while (iter.hasNext()) {
- final StackItem stackItem = iter.next();
- if (stackItem.getName() == name) {
- return i;
- } else {
- i++;
- }
- }
- return -1;
- }
-
- public void removeStackItem(final String name) {
- final int idx = indexOf(name);
- remove(idx);
- stackList.remove(idx);
- }
-
- /*
- * Unattached stack item. We update the stack using this object and
- * generating the Html with getHtml
- */
-
- public void showStackItem(final String name) {
- final int idx = indexOf(name);
- showStack(idx);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/IndexedStackPanelWithSubItems.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/IndexedStackPanelWithSubItems.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/IndexedStackPanelWithSubItems.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,136 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.stacks;
-
-import org.ourproject.kune.platf.client.AbstractPresenter;
-import org.ourproject.kune.platf.client.ui.IconLabel;
-
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.MenuBar;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class IndexedStackPanelWithSubItems extends IndexedStackPanel {
-
- private static final int MAX_ELEMENTS_PER_STACKITEM = 5;
-
- public IndexedStackPanelWithSubItems() {
- }
-
- /* Stack subItems */
-
- public void addStackSubItem(final String parentItemName, final AbstractImagePrototype icon, final String name,
- final String title, final StackSubItemAction[] memberActions, final AbstractPresenter presenter) {
- StackSubItem stackSubItem = new StackSubItem(icon, name, title, memberActions, presenter);
- int indexOfStackItem = this.indexOf(parentItemName);
- ScrollPanel sp = (ScrollPanel) this.getWidget(indexOfStackItem);
- VerticalPanel vp = (VerticalPanel) sp.getWidget();
- vp.add(stackSubItem);
- StackItem stackItem = this.getItem(indexOfStackItem);
- stackItem.addSubItem(name);
- this.setStackText(indexOfStackItem, stackItem.getHtml(), true);
- updateScroll(indexOfStackItem, stackItem.getCount());
- }
-
- public void removeStackSubItem(final String parentItemName, final String name) {
- int indexOfStackItem = this.indexOf(parentItemName);
- int indexOfStackSubItem = this.getItem(indexOfStackItem).indexOfSubItem(name);
-
- ScrollPanel sp = (ScrollPanel) this.getWidget(indexOfStackItem);
- ((VerticalPanel) sp.getWidget()).remove(indexOfStackSubItem);
- StackItem stackItem = this.getItem(indexOfStackItem);
- stackItem.removeSubItem(name);
- this.setStackText(indexOfStackItem, stackItem.getHtml(), true);
- updateScroll(indexOfStackItem, stackItem.getCount());
- }
-
- public void clear() {
- super.clear();
- }
-
- private void updateScroll(final int member, final int count) {
- if (count > MAX_ELEMENTS_PER_STACKITEM) {
- this.getWidget(member).setHeight("6em");
- } else {
- this.getWidget(member).setHeight("100%");
- }
- }
-
- protected class StackSubItem extends MenuBar {
- private final MenuBar actions;
- private AbstractImagePrototype icon;
- private String name;
- private final AbstractPresenter presenter;
-
- public StackSubItem(final AbstractImagePrototype icon, final String name, final String title,
- final StackSubItemAction[] memberActions, final AbstractPresenter presenter) {
- super(false);
- this.icon = icon;
- this.name = name;
- this.presenter = presenter;
- IconLabel label = new IconLabel(icon, name);
- label.setTitle(title);
- actions = new MenuBar(true);
- addItem(label.toString(), true, actions);
- setAutoOpen(false);
- actions.setAutoOpen(true);
- setStyleName("kune-StackSubItemLabel");
- actions.setStyleName("kune-StackSubItemActions");
- for (int i = 0; i < memberActions.length; i++) {
- addAction(memberActions[i], name);
- }
- }
-
- public void setName(final String name) {
- this.name = name;
- setMenu();
- }
-
- public void setImage(final AbstractImagePrototype icon) {
- this.icon = icon;
- setMenu();
- }
-
- public void addAction(final StackSubItemAction memberAction, final String param) {
- String itemHtml = "";
- AbstractImagePrototype icon = memberAction.getIcon();
- if (icon != null) {
- itemHtml = icon.getHTML();
- }
- itemHtml += memberAction.getText();
- actions.addItem(itemHtml, true, createCommand(memberAction.getAction(), param));
- }
-
- private void setMenu() {
- String label = icon.getHTML() + name;
- getItems().get(0).setText(label);
- }
-
- private Command createCommand(final String action, final String param) {
- return new Command() {
- public void execute() {
- presenter.doAction(action, param);
- }
- };
- }
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackSubItemAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackSubItemAction.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackSubItemAction.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.stacks;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-
-public class StackSubItemAction {
- private final AbstractImagePrototype icon;
- private final String text;
- private final String action;
-
- public StackSubItemAction(final AbstractImagePrototype icon, final String text, final String action) {
- this.icon = icon;
- this.text = text;
- this.action = action;
- }
-
- public String getAction() {
- return action;
- }
-
- public AbstractImagePrototype getIcon() {
- return icon;
- }
-
- public String getText() {
- return text;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackedDropDownPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackedDropDownPanel.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackedDropDownPanel.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,214 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui.stacks;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.AbstractPresenter;
-import org.ourproject.kune.platf.client.ui.DropDownPanel;
-import org.ourproject.kune.platf.client.ui.IconLabel;
-import org.ourproject.kune.platf.client.ui.UIConstants;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class StackedDropDownPanel extends DropDownPanel implements UIConstants {
- private final AbstractPresenter presenter;
- private final IndexedStackPanelWithSubItems stack;
- private final VerticalPanel bottomLinksVP;
- private final ArrayList<String> bottomLinksIndex;
- private String headerText;
- private String headerTitle;
- private int headerCount;
- private boolean headerCountVisible;
- private final VerticalPanel commentsVP;
- private final VerticalPanel generalVP;
-
- public StackedDropDownPanel(final AbstractPresenter presenter, final String borderColor, final String headerText,
- final String headerTitle, final boolean headerCountVisible) {
- this.presenter = presenter;
- this.headerText = headerText;
- this.headerTitle = headerTitle;
- this.headerCountVisible = headerCountVisible;
- this.headerCount = 0;
- generalVP = new VerticalPanel();
- commentsVP = new VerticalPanel();
- stack = new IndexedStackPanelWithSubItems();
- bottomLinksVP = new VerticalPanel();
- bottomLinksIndex = new ArrayList<String>();
-
- // Layout
- // generalVP.add(commentsVP);
- generalVP.add(stack);
- generalVP.add(bottomLinksVP);
- setContent(generalVP);
-
- // Set properties
- // super.setColor(borderColor);
- setContentVisible(false); // DropDown
- setHeaderText(headerText);
- setHeaderTitle(headerTitle);
- addStyleName("kune-StackedDropDownPanel");
- addStyleName("kune-Margin-Medium-t");
- stack.setStyleName("kune-StackedDropDownPanel");
- }
-
- /* Header */
-
- public void addBottomLink(final AbstractImagePrototype icon, final String text, final String title,
- final String action) {
- this.addBottomLink(icon, text, title, action, null);
- }
-
- public void addBottomLink(final AbstractImagePrototype icon, final String text, final String title,
- final String action, final Object value) {
- final IconLabel link = new IconLabel(icon, text);
- link.setTitle(title);
- bottomLinksVP.add(link);
- link.addStyleName("kune-StackedDropDownPanelLink");
- link.addClickListener(new ClickListener() {
- public void onClick(final Widget arg0) {
- presenter.doAction(action, value);
- }
- });
- bottomLinksVP.setCellHorizontalAlignment(link, HorizontalPanel.ALIGN_CENTER);
- bottomLinksIndex.add(text);
- }
-
- public void addComment(final String comment) {
- if (!commentsVP.isVisible()) {
- generalVP.insert(commentsVP, 0);
- commentsVP.setVisible(true);
- }
- final Label label = new Label(comment);
- commentsVP.add(label);
- label.addStyleName("kune-Margin-Small-trbl");
- }
-
- public void addStackItem(final String name, final String title, final AbstractImagePrototype icon,
- final String iconAlign, final boolean countVisible) {
- stack.addStackItem(name, title, icon, iconAlign, countVisible);
- }
-
- public void addStackItem(final String name, final String title, final boolean countVisible) {
- stack.addStackItem(name, title, countVisible);
- }
-
- public void addStackSubItem(final String parentItemName, final AbstractImagePrototype icon, final String name,
- final String title, final StackSubItemAction[] memberActions) {
- stack.addStackSubItem(parentItemName, icon, name, title, memberActions, presenter);
- headerCount++;
- updateHeaderText();
- }
-
- public void cleanBottomLinks() {
- final Iterator<String> iter = bottomLinksIndex.iterator();
- while (iter.hasNext()) {
- bottomLinksVP.remove(0);
- }
- bottomLinksIndex.clear();
- }
-
- public void clear() {
- commentsVP.clear();
- commentsVP.setVisible(false);
- generalVP.remove(commentsVP);
- stack.clear();
- bottomLinksIndex.clear();
- bottomLinksVP.clear();
- headerCount = 0;
- updateHeaderText();
- }
-
- /* Stack items */
-
- public int getHeaderCount() {
- return headerCount;
- }
-
- public String getHeaderText() {
- return headerText;
- }
-
- public String getHeaderTitle() {
- return headerTitle;
- }
-
- public boolean isHeaderCountVisible() {
- return headerCountVisible;
- }
-
- /* Stack subItems */
-
- public void removeBottomLink(final String text) {
- bottomLinksVP.remove(indexOfLink(text));
- }
-
- public void removeStackItem(final String name) {
- stack.removeStackItem(name);
- }
-
- /* Bottom links */
-
- public void removeStackSubItem(final String parentItemName, final String name) {
- stack.removeStackSubItem(parentItemName, name);
- headerCount--;
- updateHeaderText();
- }
-
- public void setDropDownContentVisible(final boolean visible) {
- setContentVisible(visible);
- }
-
- public void setHeaderCountVisible(final boolean headerCountVisible) {
- this.headerCountVisible = headerCountVisible;
- }
-
- public void setHeaderText(final String headerText) {
- this.headerText = headerText;
- }
-
- public void setHeaderTitle(final String headerTitle) {
- this.headerTitle = headerTitle;
- super.setHeaderTitle(headerTitle);
- }
-
- public void showStackItem(final String name) {
- stack.showStackItem(name);
- }
-
- public void updateHeaderText() {
- if (headerCountVisible) {
- super.setHeaderText(headerText + " (" + headerCount + ")");
- } else {
- super.setHeaderText(headerText);
- }
- }
-
- private int indexOfLink(final String text) {
- return bottomLinksIndex.indexOf(text);
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/utils/PrefetchUtilities.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/utils/PrefetchUtilities.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/utils/PrefetchUtilities.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -20,75 +20,73 @@
package org.ourproject.kune.platf.client.utils;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.IncrementalCommand;
import com.google.gwt.user.client.ui.Image;
public class PrefetchUtilities {
- public static void preFetchImpImages() {
- String[] imgs = { "images/spin-kune-thund-green.gif", "css/img/button-bg-hard.gif",
- "css/img/button-bg-soft.gif", "css/img/arrow-down-white.gif", "css/img/arrow-right-white.gif",
- "images/lic/bysa80x15.png" };
- for (int i = 0; i < imgs.length; i++) {
- String img = imgs[i];
- Image.prefetch(img);
- }
- }
+ public static void doTasksDeferred() {
- public static void doTasksDeferred(final Workspace workspace) {
+ DeferredCommand.addCommand(new IncrementalCommand() {
+ int i = 0;
+ int j = 0;
- DeferredCommand.addCommand(new IncrementalCommand() {
- int i = 0;
- int j = 0;
+ String[] lic = { "gnu-fdl.gif", "bynd80x15.png", "byncsa80x15.png", "byncnd80x15.png", "bync80x15.png",
+ "by80x15.png", "fal-license.gif" };
- String[] lic = { "gnu-fdl.gif", "bynd80x15.png", "byncsa80x15.png", "byncnd80x15.png", "bync80x15.png",
- "by80x15.png", "fal-license.gif" };
+ String[] ext = { "default/form/text-bg.gif", "default/form/trigger.gif", "default/form/date-trigger.gif",
+ "gray/window/left-corners.png", "gray/button/btn-sprite.gif", "gray/window/top-bottom.png",
+ "gray/window/right-corners.png", "gray/window/left-right.png", "default/sizer/s-handle.gif",
+ "default/sizer/e-handle.gif", "default/sizer/ne-handle.gif", "default/sizer/se-handle.gif",
+ "default/sizer/sw-handle.gif", "gray/panel/tool-sprites.gif", "default/sizer/nw-handle.gif",
+ "gray/tabs/tabs-sprite.gif", "gray/tabs/tab-strip-bg.gif", "default/shadow.png",
+ "default/shadow-lr.png", "default/shadow-c.png", "default/grid/invalid_line.gif",
+ "default/form/exclamation.gif", "default/box/tb-blue.gif", "default/grid/loading.gif",
+ "gray/toolbar/bg.gif", "default/grid/grid3-hrow.gif", "default/dd/drop-no.gif",
+ "default/grid/col-move-top.gif", "default/grid/col-move-bottom.gif", "default/grid/row-over.gif",
+ "default/grid/grid-split.gif", "default/grid/page-first-disabled.gif",
+ "default/grid/page-last-disabled.gif", "default/grid/done.gif",
+ "default/grid/page-prev-disabled.gif", "default/grid/done.gif",
+ "default/grid/page-next-disabled.gif", "default/qtip/tip-sprite.gif",
+ "default/grid/grid3-hrow-over.gif", "default/grid/grid3-hd-btn.gif",
+ "gray/panel/white-top-bottom.gif", "gray/tabs/tab-close.gif", "gray/toolbar/btn-arrow.gif",
+ "gray/toolbar/tb-btn-sprite.gif", "gray/panel/light-hd.gif" };
- String[] ext = { "default/form/text-bg.gif", "default/form/trigger.gif", "default/form/date-trigger.gif",
- "gray/window/left-corners.png", "gray/button/btn-sprite.gif", "gray/window/top-bottom.png",
- "gray/window/right-corners.png", "gray/window/left-right.png", "default/sizer/s-handle.gif",
- "default/sizer/e-handle.gif", "default/sizer/ne-handle.gif", "default/sizer/se-handle.gif",
- "default/sizer/sw-handle.gif", "gray/panel/tool-sprites.gif", "default/sizer/nw-handle.gif",
- "gray/tabs/tabs-sprite.gif", "gray/tabs/tab-strip-bg.gif", "default/shadow.png",
- "default/shadow-lr.png", "default/shadow-c.png", "default/grid/invalid_line.gif",
- "default/form/exclamation.gif", "default/box/tb-blue.gif", "default/grid/loading.gif",
- "gray/toolbar/bg.gif", "default/grid/grid3-hrow.gif", "default/dd/drop-no.gif",
- "default/grid/col-move-top.gif", "default/grid/col-move-bottom.gif", "default/grid/row-over.gif",
- "default/grid/grid-split.gif", "default/grid/page-first-disabled.gif",
- "default/grid/page-last-disabled.gif", "default/grid/done.gif",
- "default/grid/page-prev-disabled.gif", "default/grid/done.gif",
- "default/grid/page-next-disabled.gif", "default/qtip/tip-sprite.gif",
- "default/grid/grid3-hrow-over.gif", "default/grid/grid3-hd-btn.gif",
- "gray/panel/white-top-bottom.gif", "gray/tabs/tab-close.gif", "gray/toolbar/btn-arrow.gif",
- "gray/toolbar/tb-btn-sprite.gif", "gray/panel/light-hd.gif" };
+ public boolean execute() {
- public boolean execute() {
+ while (i < lic.length) {
+ final String licImg = lic[i];
+ Image.prefetch("images/lic/" + licImg);
+ i++;
+ }
- while (i < lic.length) {
- String licImg = lic[i];
- Image.prefetch("images/lic/" + licImg);
- i++;
- }
+ while (j < ext.length) {
+ final String extImg = ext[j];
+ Image.prefetch("js/ext/resources/images/" + extImg);
+ j++;
+ }
- while (j < ext.length) {
- String extImg = ext[j];
- Image.prefetch("js/ext/resources/images/" + extImg);
- j++;
- }
+ boolean notFinished = i + j < lic.length + ext.length;
- boolean notFinished = i + j < lic.length + ext.length;
+ final boolean finished = !notFinished;
- boolean finished = !notFinished;
+ if (finished) {
+ // In the future maybe: workspace.getLoginComponent()
+ }
- if (finished) {
- // In the future maybe: workspace.getLoginComponent()
- }
+ return notFinished;
+ }
+ });
+ }
- return notFinished;
- }
- });
+ public static void preFetchImpImages() {
+ final String[] imgs = { "images/spin-kune-thund-green.gif", "css/img/button-bg-hard.gif",
+ "css/img/button-bg-soft.gif", "css/img/arrow-down-white.gif", "css/img/arrow-right-white.gif",
+ "images/lic/bysa80x15.png" };
+ for (int i = 0; i < imgs.length; i++) {
+ final String img = imgs[i];
+ Image.prefetch(img);
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -19,14 +19,10 @@
*/
package org.ourproject.kune.workspace.client;
-import org.ourproject.kune.platf.client.PlatformEvents;
import org.ourproject.kune.platf.client.extend.ClientModule;
import org.ourproject.kune.platf.client.extend.Register;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.actions.AttachToExtensibleWidgetAction;
-import org.ourproject.kune.workspace.client.actions.ClearExtensibleWidgetAction;
-import org.ourproject.kune.workspace.client.actions.DetachFromExtensibleWidgetAction;
import org.ourproject.kune.workspace.client.actions.RecalculateWorkspaceAction;
import org.ourproject.kune.workspace.client.actions.ReloadContextAction;
import org.ourproject.kune.workspace.client.actions.i18n.ShowTranslatorAction;
@@ -49,10 +45,6 @@
}
public void configure(final Register register) {
- register.addAction(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET, new AttachToExtensibleWidgetAction(workspace));
- register.addAction(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
- new DetachFromExtensibleWidgetAction(workspace));
- register.addAction(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET, new ClearExtensibleWidgetAction(workspace));
register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n));
register.addAction(WorkspaceEvents.RELOAD_CONTEXT, new ReloadContextAction(stateManager));
register.addAction(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, new RecalculateWorkspaceAction(workspace));
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -23,6 +23,7 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.editor.TextEditorListener;
import org.ourproject.kune.workspace.client.editor.TextEditorPanel;
@@ -55,11 +56,14 @@
import org.ourproject.kune.workspace.client.workspace.ui.ContentToolBarPanel;
import org.ourproject.kune.workspace.client.workspace.ui.WorkspacePanel;
+import com.calclab.suco.client.container.Provider;
+
public class WorkspaceFactory {
private static Session session;
private static I18nTranslationService i18n;
private static KuneErrorHandler errorHandler;
+ private static Provider<StateManager> stateManagerProvider;
public static ContentSubTitleComponent createContentSubTitleComponent() {
final ContentSubTitlePresenter presenter = new ContentSubTitlePresenter(i18n);
@@ -84,7 +88,7 @@
public static ContextItems createContextItems() {
final ContextItemsPresenter presenter = new ContextItemsPresenter(i18n);
- final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n);
+ final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n, stateManagerProvider);
presenter.init(panel);
return presenter;
}
@@ -112,10 +116,11 @@
public static Workspace createWorkspace(final Session session,
final ExtensibleWidgetsManager extensionPointManager, final I18nTranslationService i18n,
- final KuneErrorHandler errorHandler) {
+ final KuneErrorHandler errorHandler, final Provider<StateManager> stateManagerProvider) {
WorkspaceFactory.session = session;
WorkspaceFactory.i18n = i18n;
WorkspaceFactory.errorHandler = errorHandler;
+ WorkspaceFactory.stateManagerProvider = stateManagerProvider;
final WorkspacePresenter workspace = new WorkspacePresenter(session);
final WorkspaceView view = new WorkspacePanel(workspace, i18n);
workspace.init(view, extensionPointManager);
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AttachToExtensibleWidgetAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AttachToExtensibleWidgetAction.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/AttachToExtensibleWidgetAction.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class AttachToExtensibleWidgetAction implements Action<ExtensibleWidgetChild> {
-
- private final Workspace workspace;
-
- public AttachToExtensibleWidgetAction(final Workspace workspace) {
- this.workspace = workspace;
- }
-
- public void execute(final ExtensibleWidgetChild element) {
- workspace.attachToExtensibleWidget(element);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ClearExtensibleWidgetAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ClearExtensibleWidgetAction.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ClearExtensibleWidgetAction.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class ClearExtensibleWidgetAction implements Action<String> {
-
- private final Workspace workspace;
-
- public ClearExtensibleWidgetAction(final Workspace workspace) {
- this.workspace = workspace;
- }
-
- public void execute(final String extId) {
- workspace.clearExtensibleWidget(extId);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/DetachFromExtensibleWidgetAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/DetachFromExtensibleWidgetAction.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/DetachFromExtensibleWidgetAction.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class DetachFromExtensibleWidgetAction implements Action<ExtensibleWidgetChild> {
-
- private final Workspace workspace;
-
- public DetachFromExtensibleWidgetAction(final Workspace workspace) {
- this.workspace = workspace;
- }
-
- public void execute(final ExtensibleWidgetChild element) {
- workspace.detachFromExtensibleWidget(element);
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -19,10 +19,10 @@
*/
package org.ourproject.kune.workspace.client.presence.ui;
-import org.ourproject.kune.platf.client.AbstractPresenter;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.DropDownPanel;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter;
import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
@@ -33,7 +33,7 @@
private final VerticalPanel vp;
- public GroupSummaryPanel(final AbstractPresenter presenter, final I18nTranslationService i18n,
+ public GroupSummaryPanel(final GroupSummaryPresenter presenter, final I18nTranslationService i18n,
final WorkspaceSkeleton ws) {
super(i18n.t("Group Summary"), true);
setHeaderTitle(i18n.t("Some summarized information about current project" + Site.IN_DEVELOPMENT));
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -22,17 +22,21 @@
import java.util.HashMap;
import java.util.Iterator;
-import org.ourproject.kune.platf.client.AbstractPresenter;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
-public class SiteSearcherPresenter extends AbstractPresenter implements SiteSearcher {
+import com.calclab.suco.client.container.Provider;
+public class SiteSearcherPresenter implements SiteSearcher {
+
private SiteSearcherView view;
private SiteSearcherType currentSearch;
private final HashMap<String, Integer> searchHistory;
+ private final Provider<StateManager> stateManagerProvider;
- public SiteSearcherPresenter() {
+ public SiteSearcherPresenter(final Provider<StateManager> stateManagerProvider) {
+ this.stateManagerProvider = stateManagerProvider;
searchHistory = new HashMap<String, Integer>();
currentSearch = SiteSearcherType.group_user;
}
@@ -41,6 +45,10 @@
view.hide();
}
+ public void doGoto(final String groupShortName) {
+ stateManagerProvider.get().gotoToken(groupShortName);
+ }
+
public void doSearch(final SiteSearcherType typeOfSearch) {
doSearchOfType(view.getTextToSearch(), typeOfSearch);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -20,11 +20,13 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
import org.ourproject.kune.workspace.client.workspace.UserLiveSearcher;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
public class GroupMembersSummaryPresenter extends SocialNetworkPresenter implements GroupMembersSummary {
@@ -36,15 +38,27 @@
private final GridGroup pendigCategory;
private final Session session;
private final Provider<SocialNetworkServiceAsync> snServiceProvider;
+ private final StateManager stateManager;
- public GroupMembersSummaryPresenter(final I18nUITranslationService i18n,
- final Provider<StateManager> stateManagerProvider, final ImageUtils imageUtils, final Session session,
+ public GroupMembersSummaryPresenter(final I18nUITranslationService i18n, final StateManager stateManager,
+ final ImageUtils imageUtils, final Session session,
final Provider<SocialNetworkServiceAsync> snServiceProvider,
- final Provider<UserLiveSearcher> userLiveSearcherProvider) {
- super(i18n, stateManagerProvider, imageUtils, session, snServiceProvider);
+ final Provider<UserLiveSearcher> userLiveSearcherProvider, final WsThemePresenter wsThemePresenter) {
+ super(i18n, stateManager, imageUtils, session, snServiceProvider);
this.i18n = i18n;
+ this.stateManager = stateManager;
this.session = session;
this.snServiceProvider = snServiceProvider;
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
+ wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+ });
final String adminsTitle = i18n.t("Admins");
final String collabsTitle = i18n.t("Collaborators");
final String pendingTitle = i18n.t("Pending");
@@ -77,7 +91,7 @@
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
Site.info(i18n.t("Member added as collaborator"));
- getStateManager().setSocialNetwork(result);
+ stateManager.setSocialNetwork(result);
}
});
@@ -87,18 +101,6 @@
this.view = view;
}
- public void setState(final StateDTO state) {
- if (state.getGroup().getType().equals(GroupDTO.PERSONAL)) {
- view.setVisible(false);
- } else {
- setGroupMembers(state.getGroupMembers(), state.getGroupRights());
- }
- }
-
- public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- view.setTheme(oldTheme, newTheme);
- }
-
private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) {
return userIsAdmin || userIsCollab;
}
@@ -164,4 +166,12 @@
}
}
+ private void setState(final StateDTO state) {
+ if (state.getGroup().getType().equals(GroupDTO.PERSONAL)) {
+ view.setVisible(false);
+ } else {
+ setGroupMembers(state.getGroupMembers(), state.getGroupRights());
+ }
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -33,9 +33,12 @@
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.workspace.ParticipationSummary;
import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
public class ParticipationSummaryPresenter extends SocialNetworkPresenter implements ParticipationSummary {
@@ -44,10 +47,10 @@
private GridGroup collabCategory;
private final GridGroup collabOnlyCategory;
- public ParticipationSummaryPresenter(final I18nUITranslationService i18n,
- final Provider<StateManager> stateManagerProvider, final ImageUtils imageUtils, final Session session,
- final Provider<SocialNetworkServiceAsync> snServiceProvider) {
- super(i18n, stateManagerProvider, imageUtils, session, snServiceProvider);
+ public ParticipationSummaryPresenter(final I18nUITranslationService i18n, final StateManager stateManager,
+ final ImageUtils imageUtils, final Session session,
+ final Provider<SocialNetworkServiceAsync> snServiceProvider, final WsThemePresenter wsThemePresenter) {
+ super(i18n, stateManager, imageUtils, session, snServiceProvider);
adminCategory = new GridGroup("admin in:", " ", i18n.tWithNT("Administrate these groups",
"talking about a person"), false);
collabCategory = new GridGroup(i18n.t("and as collaborator in:"), " ", i18n.t("Collaborate in these groups"),
@@ -55,14 +58,28 @@
collabOnlyCategory = new GridGroup(i18n.t("collaborator in:"), " ", i18n.t("Collaborate in these groups"),
false);
super.addGroupOperation(gotoGroupMenuItem, false);
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
+ wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+ });
}
public void init(final ParticipationSummaryView view) {
this.view = view;
}
+ private void hide() {
+ view.hide();
+ }
+
@SuppressWarnings("unchecked")
- public void setState(final StateDTO state) {
+ private void setState(final StateDTO state) {
final ParticipationDataDTO participation = state.getParticipation();
final AccessRightsDTO rights = state.getGroupRights();
view.clear();
@@ -95,12 +112,4 @@
}
- public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- view.setTheme(oldTheme, newTheme);
- }
-
- private void hide() {
- view.hide();
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -35,18 +35,18 @@
protected GridMenuItem<GroupDTO> gotoGroupMenuItem;
protected GridMenuItem<GroupDTO> unJoinMenuItem;
private final I18nUITranslationService i18n;
- private final Provider<StateManager> stateManagerProvider;
+ private final StateManager stateManager;
private final Provider<SocialNetworkServiceAsync> snServiceProvider;
private final Session session;
private final GridMenuItemCollection<GroupDTO> otherOperations;
private final GridMenuItemCollection<GroupDTO> otherLoggedOperations;
private final ImageUtils imageUtils;
- public SocialNetworkPresenter(final I18nUITranslationService i18n,
- final Provider<StateManager> stateManagerProvider, final ImageUtils imageUtils, final Session session,
+ public SocialNetworkPresenter(final I18nUITranslationService i18n, final StateManager stateManager,
+ final ImageUtils imageUtils, final Session session,
final Provider<SocialNetworkServiceAsync> snServiceProvider) {
this.i18n = i18n;
- this.stateManagerProvider = stateManagerProvider;
+ this.stateManager = stateManager;
this.imageUtils = imageUtils;
this.session = session;
this.snServiceProvider = snServiceProvider;
@@ -80,10 +80,6 @@
return gridItem;
}
- protected StateManager getStateManager() {
- return stateManagerProvider.get();
- }
-
private void createButtons() {
requestJoin = new GridButton("images/add-green.gif", i18n.t("Participate"), i18n
.t("Request to participate in this group"), new Slot<String>() {
@@ -96,7 +92,7 @@
final String resultType = (String) result;
if (resultType == SocialNetworkDTO.REQ_JOIN_ACEPTED) {
Site.info(i18n.t("You are now member of this group"));
- getStateManager().reload();
+ stateManager.reload();
}
if (resultType == SocialNetworkDTO.REQ_JOIN_DENIED) {
Site.important(i18n.t("Sorry this is a closed group"));
@@ -136,13 +132,13 @@
gotoGroupMenuItem = new GridMenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this group homepage"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO groupDTO) {
- getStateManager().gotoToken(groupDTO.getShortName());
+ stateManager.gotoToken(groupDTO.getShortName());
}
});
gotoMemberMenuItem = new GridMenuItem<GroupDTO>("images/group-home.gif", i18n.t("Visit this member homepage"),
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO groupDTO) {
- getStateManager().gotoToken(groupDTO.getShortName());
+ stateManager.gotoToken(groupDTO.getShortName());
}
});
unJoinMenuItem = new GridMenuItem<GroupDTO>("images/del.gif", i18n
@@ -161,7 +157,7 @@
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
Site.info(i18n.t("Type of member changed"));
- getStateManager().setSocialNetwork(result);
+ stateManager.setSocialNetwork(result);
}
});
}
@@ -176,7 +172,7 @@
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
Site.info(i18n.t("Member removed"));
- getStateManager().reload();
+ stateManager.reload();
// in the future, only if I cannot
// be affected:
// snService.stateManager.reloadSocialNetwork((SocialNetworkResultDTO)
@@ -195,7 +191,7 @@
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
Site.info(i18n.t("Type of member changed"));
- getStateManager().setSocialNetwork(result);
+ stateManager.setSocialNetwork(result);
}
});
}
@@ -210,7 +206,7 @@
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
Site.info(i18n.t("Member accepted"));
- getStateManager().setSocialNetwork(result);
+ stateManager.setSocialNetwork(result);
}
});
}
@@ -225,7 +221,7 @@
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
Site.info(i18n.t("Member rejected"));
- getStateManager().setSocialNetwork(result);
+ stateManager.setSocialNetwork(result);
}
});
}
@@ -243,7 +239,7 @@
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
Site.info(i18n.t("Removed as member"));
- getStateManager().reload();
+ stateManager.reload();
// in the future with user info:
// services.stateManager.reloadSocialNetwork((SocialNetworkResultDTO)
// result);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -19,16 +19,33 @@
*/
package org.ourproject.kune.workspace.client.summary;
-import org.ourproject.kune.platf.client.AbstractPresenter;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.workspace.GroupSummary;
-public class GroupSummaryPresenter extends AbstractPresenter implements GroupSummary {
+import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
+public class GroupSummaryPresenter implements GroupSummary {
+
private GroupSummaryView view;
+ public GroupSummaryPresenter(final StateManager stateManager, final WsThemePresenter wsThemePresenter) {
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
+ wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
public View getView() {
return view;
}
@@ -37,12 +54,8 @@
this.view = view;
}
- public void setState(final StateDTO state) {
+ private void setState(final StateDTO state) {
view.setComment("Summary about this group (in development)");
}
- public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- view.setTheme(oldTheme, newTheme);
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -26,12 +26,16 @@
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.TagResultDTO;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.search.SiteSearcher;
import org.ourproject.kune.workspace.client.search.SiteSearcherType;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.workspace.TagsSummary;
import com.calclab.suco.client.container.Provider;
+import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
public class TagsSummaryPresenter implements TagsSummary {
@@ -39,9 +43,20 @@
private final Provider<SiteSearcher> searcherProvider;
private final Provider<Session> sessionProvider;
- public TagsSummaryPresenter(final Provider<Session> sessionProvider, final Provider<SiteSearcher> searcherProvider) {
+ public TagsSummaryPresenter(final Provider<Session> sessionProvider, final Provider<SiteSearcher> searcherProvider,
+ final StateManager stateManager, final WsThemePresenter wsThemePresenter) {
this.sessionProvider = sessionProvider;
this.searcherProvider = searcherProvider;
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
+ wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+ });
}
public void doSearchTag(final String name) {
@@ -62,11 +77,8 @@
view.setTags(groupTags);
}
- public void setState(final StateDTO state) {
+ private void setState(final StateDTO state) {
view.setTags(state.getGroupTags());
}
- public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- view.setTheme(oldTheme, newTheme);
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItems.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItems.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItems.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -25,18 +25,23 @@
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
+import com.calclab.suco.client.signal.Slot;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
public interface ContextItems {
+
+ public void canCreate(String typeName, String label, Slot<?> slot);
+
+ public void canCreate(String typeName, String label, String eventName);
+
public View getView();
public void registerType(String typeName, AbstractImagePrototype pageWhite);
- public void canCreate(String typeName, String label, String eventName);
+ public void setControlsVisible(boolean visible);
public void setParentTreeVisible(boolean visible);
public void showContainer(StateToken state, ContainerDTO container, AccessRightsDTO rights);
- public void setControlsVisible(boolean visible);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPanel.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -23,9 +23,11 @@
import org.ourproject.kune.platf.client.dto.ContainerSimpleDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.HorizontalLine;
import org.ourproject.kune.platf.client.ui.IconLabel;
+import com.calclab.suco.client.container.Provider;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.DockPanel;
@@ -43,103 +45,104 @@
private String workaroundTypeName;
private final I18nTranslationService i18n;
- public ContextItemsPanel(final ContextItemsPresenter presenter, final I18nTranslationService i18n) {
- this.presenter = presenter;
- this.i18n = i18n;
- topBar = new ContextTopBar(presenter, i18n);
- addTopBar(topBar);
+ public ContextItemsPanel(final ContextItemsPresenter presenter, final I18nTranslationService i18n,
+ final Provider<StateManager> stateManagerProvider) {
+ this.presenter = presenter;
+ this.i18n = i18n;
+ topBar = new ContextTopBar(presenter, i18n, stateManagerProvider);
+ addTopBar(topBar);
- items = new ItemsPanel(presenter);
- add(items, DockPanel.NORTH);
- HTML expand = new HTML("<b></b>");
- add(expand, DockPanel.CENTER);
- controls = new VerticalPanel();
- add(controls, DockPanel.SOUTH);
- controls.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- HorizontalLine horizontalLine = new HorizontalLine();
- controls.add(horizontalLine);
+ items = new ItemsPanel(presenter);
+ add(items, DockPanel.NORTH);
+ final HTML expand = new HTML("<b></b>");
+ add(expand, DockPanel.CENTER);
+ controls = new VerticalPanel();
+ add(controls, DockPanel.SOUTH);
+ controls.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+ final HorizontalLine horizontalLine = new HorizontalLine();
+ controls.add(horizontalLine);
- // setHeight("100%");
- expand.setHeight("15px");
- setCellHeight(expand, "15px");
- addStyleName("kune-NavigationBar");
- controls.setWidth("100%");
- controls.setCellWidth(horizontalLine, "100%");
- horizontalLine.setWidth("100%");
+ // setHeight("100%");
+ expand.setHeight("15px");
+ setCellHeight(expand, "15px");
+ addStyleName("kune-NavigationBar");
+ controls.setWidth("100%");
+ controls.setCellWidth(horizontalLine, "100%");
+ horizontalLine.setWidth("100%");
}
public void addCommand(final String typeName, final String label, final String eventName) {
- final String type = typeName;
- IconLabel iconLabel = new IconLabel(Images.App.getInstance().addGreen(), label);
- iconLabel.addClickListener(new ClickListener() {
- public void onClick(final Widget sender) {
- currentEventName = eventName;
- presenter.onNew(type);
- }
- });
- iconLabel.addStyleName("kune-ContextItemsPanel-LabelLink");
- controls.add(iconLabel);
+ final String type = typeName;
+ final IconLabel iconLabel = new IconLabel(Images.App.getInstance().addGreen(), label);
+ iconLabel.addClickListener(new ClickListener() {
+ public void onClick(final Widget sender) {
+ currentEventName = eventName;
+ presenter.onNew(type);
+ }
+ });
+ iconLabel.addStyleName("kune-ContextItemsPanel-LabelLink");
+ controls.add(iconLabel);
}
public void addItem(final String name, final String type, final String event, final boolean editable) {
- items.add(name, type, event, editable);
+ items.add(name, type, event, editable);
}
public void clear() {
- items.clear();
+ items.clear();
}
public void registerType(final String typeName, final AbstractImagePrototype image) {
- items.registerType(typeName, image);
+ items.registerType(typeName, image);
}
public void selectItem(final int index) {
}
public void setAbsolutePath(final ContainerSimpleDTO[] absolutePath) {
- topBar.setAbsolutePath(absolutePath);
+ topBar.setAbsolutePath(absolutePath);
}
public void setControlsVisible(final boolean visible) {
- controls.setVisible(visible);
+ controls.setVisible(visible);
}
public void setCurrentName(final String name) {
- topBar.currentFolder.setText(name);
+ topBar.currentFolder.setText(name);
}
public void setParentButtonEnabled(final boolean isEnabled) {
- topBar.btnGoParent.setVisible(isEnabled);
- topBar.btnGoParentDisabled.setVisible(!isEnabled);
+ topBar.btnGoParent.setVisible(isEnabled);
+ topBar.btnGoParentDisabled.setVisible(!isEnabled);
}
public void setParentTreeVisible(final boolean visible) {
- topBar.firstRow.setVisible(visible);
+ topBar.firstRow.setVisible(visible);
}
public void showCreationField(final String typeName) {
- String title;
- // Workaround: gwt-ext bug, I cannot use typeName directly
- workaroundTypeName = typeName;
+ String title;
+ // Workaround: gwt-ext bug, I cannot use typeName directly
+ workaroundTypeName = typeName;
- // FIXME use constants!!!!
- if (typeName.equals("docs.doc")) {
- title = i18n.t("Add a document");
- } else if (typeName.equals("docs.folder")) {
- title = i18n.t("Add a folder");
- } else if (typeName.equals("chat.room")) {
- title = i18n.t("Add a chat room");
- } else {
- title = i18n.t("Add a new [%s]", typeName);
- }
- MessageBox.prompt(title, i18n.t("Please enter a name:"), new MessageBox.PromptCallback() {
- public void execute(final String btnID, final String text) {
- presenter.create(workaroundTypeName, text, currentEventName);
- }
- });
+ // FIXME use constants!!!!
+ if (typeName.equals("docs.doc")) {
+ title = i18n.t("Add a document");
+ } else if (typeName.equals("docs.folder")) {
+ title = i18n.t("Add a folder");
+ } else if (typeName.equals("chat.room")) {
+ title = i18n.t("Add a chat room");
+ } else {
+ title = i18n.t("Add a new [%s]", typeName);
+ }
+ MessageBox.prompt(title, i18n.t("Please enter a name:"), new MessageBox.PromptCallback() {
+ public void execute(final String btnID, final String text) {
+ presenter.create(workaroundTypeName, text, currentEventName);
+ }
+ });
}
private void addTopBar(final Widget widget) {
- add(topBar, DockPanel.NORTH);
+ add(topBar, DockPanel.NORTH);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextItemsPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -36,6 +36,7 @@
import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import com.calclab.suco.client.signal.Slot;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
public class ContextItemsPresenter implements ContextItems {
@@ -43,85 +44,89 @@
private final I18nTranslationService i18n;
public ContextItemsPresenter(final I18nTranslationService i18n) {
- this.i18n = i18n;
+ this.i18n = i18n;
}
+ public void canCreate(final String typeName, final String label, final Slot<?> slot) {
+ // TODO
+ }
+
public void canCreate(final String typeName, final String label, final String eventName) {
- view.addCommand(typeName, label, eventName);
+ view.addCommand(typeName, label, eventName);
}
public void create(final String typeName, final String value, final String eventName) {
- if (value != null) {
- final Dispatcher dispatcher = DefaultDispatcher.getInstance();
- dispatcher.fire(eventName, value);
- }
+ if (value != null) {
+ final Dispatcher dispatcher = DefaultDispatcher.getInstance();
+ dispatcher.fire(eventName, value);
+ }
}
public View getView() {
- return view;
+ return view;
}
public void init(final ContextItemsView view) {
- this.view = view;
+ this.view = view;
}
public void onGoUp() {
- DefaultDispatcher.getInstance().fire(DocsEvents.GO_PARENT_FOLDER, null);
+ DefaultDispatcher.getInstance().fire(DocsEvents.GO_PARENT_FOLDER, null);
}
public void onNew(final String typeName) {
- view.showCreationField(typeName);
+ view.showCreationField(typeName);
}
public void onTitleRename(final String text, final String token) {
- Site.showProgressSaving();
- DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
- new ParamCallback<String, Object>(text, new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RELOAD_CONTEXT, null);
- Site.hideProgress();
- }
- }));
+ Site.showProgressSaving();
+ DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
+ new ParamCallback<String, Object>(text, new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.RELOAD_CONTEXT, null);
+ Site.hideProgress();
+ }
+ }));
}
public void registerType(final String typeName, final AbstractImagePrototype image) {
- view.registerType(typeName, image);
+ view.registerType(typeName, image);
}
public void setControlsVisible(final boolean visible) {
- view.setControlsVisible(visible);
+ view.setControlsVisible(visible);
}
public void setParentTreeVisible(final boolean visible) {
- view.setParentTreeVisible(visible);
+ view.setParentTreeVisible(visible);
}
public void showContainer(final StateToken state, final ContainerDTO container, final AccessRightsDTO rights) {
- state.setDocument(null);
- if (container.getParentFolderId() == null) {
- // We translate root folder names (documents, chat room,
- // etcetera)
- view.setCurrentName(i18n.t(container.getName()));
- } else {
- view.setCurrentName(container.getName());
- }
- view.clear();
- final List<ContainerDTO> folders = container.getChilds();
- for (int index = 0; index < folders.size(); index++) {
- final ContainerDTO child = folders.get(index);
- state.setFolder(child.getId().toString());
- view.addItem(child.getName(), child.getTypeId(), state.getEncoded(), rights.isEditable());
- }
+ state.setDocument(null);
+ if (container.getParentFolderId() == null) {
+ // We translate root folder names (documents, chat room,
+ // etcetera)
+ view.setCurrentName(i18n.t(container.getName()));
+ } else {
+ view.setCurrentName(container.getName());
+ }
+ view.clear();
+ final List<ContainerDTO> folders = container.getChilds();
+ for (int index = 0; index < folders.size(); index++) {
+ final ContainerDTO child = folders.get(index);
+ state.setFolder(child.getId().toString());
+ view.addItem(child.getName(), child.getTypeId(), state.getEncoded(), rights.isEditable());
+ }
- state.setFolder(container.getId().toString());
- final List<ContentDTO> contents = container.getContents();
- for (int index = 0; index < contents.size(); index++) {
- final ContentDTO dto = contents.get(index);
- state.setDocument(dto.getId().toString());
- view.addItem(dto.getTitle(), dto.getTypeId(), state.getEncoded(), rights.isEditable());
- }
- view.setParentButtonEnabled(container.getParentFolderId() != null);
- view.setControlsVisible(rights.isEditable());
- view.setAbsolutePath(container.getAbsolutePath());
+ state.setFolder(container.getId().toString());
+ final List<ContentDTO> contents = container.getContents();
+ for (int index = 0; index < contents.size(); index++) {
+ final ContentDTO dto = contents.get(index);
+ state.setDocument(dto.getId().toString());
+ view.addItem(dto.getTitle(), dto.getTypeId(), state.getEncoded(), rights.isEditable());
+ }
+ view.setParentButtonEnabled(container.getParentFolderId() != null);
+ view.setControlsVisible(rights.isEditable());
+ view.setAbsolutePath(container.getAbsolutePath());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/ctx/items/ContextTopBar.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -20,13 +20,13 @@
package org.ourproject.kune.workspace.client.ui.ctx.items;
-import org.ourproject.kune.platf.client.PlatformEvents;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.ContainerSimpleDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
+import com.calclab.suco.client.container.Provider;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.HorizontalPanel;
@@ -46,76 +46,79 @@
private final ContextItemsImages img;
private final MenuBar pathSubmenu;
private final I18nTranslationService i18n;
+ private final Provider<StateManager> stateManagerProvider;
- public ContextTopBar(final ContextItemsPresenter presenter, final I18nTranslationService i18n) {
- this.i18n = i18n;
- img = ContextItemsImages.App.getInstance();
- firstRow = new HorizontalPanel();
- final HorizontalPanel secondRow = new HorizontalPanel();
- final HorizontalPanel iconBarHP = new HorizontalPanel();
- final HorizontalPanel currentFolderHP = new HorizontalPanel();
- btnGoParent = new PushButton(img.folderGoUp().createImage(), img.folderGoUpLight().createImage());
- btnGoParent.addClickListener(new ClickListener() {
- public void onClick(final Widget sender) {
- presenter.onGoUp();
- }
- });
+ public ContextTopBar(final ContextItemsPresenter presenter, final I18nTranslationService i18n,
+ final Provider<StateManager> stateManagerProvider) {
+ this.i18n = i18n;
+ this.stateManagerProvider = stateManagerProvider;
+ img = ContextItemsImages.App.getInstance();
+ firstRow = new HorizontalPanel();
+ final HorizontalPanel secondRow = new HorizontalPanel();
+ final HorizontalPanel iconBarHP = new HorizontalPanel();
+ final HorizontalPanel currentFolderHP = new HorizontalPanel();
+ btnGoParent = new PushButton(img.folderGoUp().createImage(), img.folderGoUpLight().createImage());
+ btnGoParent.addClickListener(new ClickListener() {
+ public void onClick(final Widget sender) {
+ presenter.onGoUp();
+ }
+ });
- KuneUiUtils.setQuickTip(btnGoParent, i18n.t("Go to parent folder"));
- btnGoParentDisabled = img.folderGoUpLight().createImage();
- final MenuBar pathMenu = new MenuBar();
- pathSubmenu = new MenuBar(true);
- // Layout
- add(firstRow);
- add(secondRow);
- firstRow.add(iconBarHP);
- secondRow.add(currentFolderHP);
- // iconBarHP.add(btnGoParent);
- final RoundedBorderDecorator buttonRounded = new RoundedBorderDecorator(pathMenu, RoundedBorderDecorator.ALL,
- RoundedBorderDecorator.SIMPLE);
- iconBarHP.add(buttonRounded);
- pathMenu.addItem(img.folderpathmenu().getHTML(), true, pathSubmenu);
- KuneUiUtils.setQuickTip(pathMenu, i18n.t("Navigation tree"));
- currentFolderHP.add(btnGoParent);
- currentFolderHP.add(btnGoParentDisabled);
- currentFolder = new Label("Current Container");
- currentFolderHP.add(currentFolder);
+ KuneUiUtils.setQuickTip(btnGoParent, i18n.t("Go to parent folder"));
+ btnGoParentDisabled = img.folderGoUpLight().createImage();
+ final MenuBar pathMenu = new MenuBar();
+ pathSubmenu = new MenuBar(true);
+ // Layout
+ add(firstRow);
+ add(secondRow);
+ firstRow.add(iconBarHP);
+ secondRow.add(currentFolderHP);
+ // iconBarHP.add(btnGoParent);
+ final RoundedBorderDecorator buttonRounded = new RoundedBorderDecorator(pathMenu, RoundedBorderDecorator.ALL,
+ RoundedBorderDecorator.SIMPLE);
+ iconBarHP.add(buttonRounded);
+ pathMenu.addItem(img.folderpathmenu().getHTML(), true, pathSubmenu);
+ KuneUiUtils.setQuickTip(pathMenu, i18n.t("Navigation tree"));
+ currentFolderHP.add(btnGoParent);
+ currentFolderHP.add(btnGoParentDisabled);
+ currentFolder = new Label("Current Container");
+ currentFolderHP.add(currentFolder);
- // Set properties
- addStyleName("kune-NavigationBar");
- firstRow.addStyleName("topBar");
- firstRow.addStyleName("topBar-margin");
- secondRow.addStyleName("topBar");
- firstRow.setWidth("100%");
- secondRow.setWidth("100%");
- setCellWidth(firstRow, "100%");
- setCellWidth(secondRow, "100%");
- firstRow.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- iconBarHP.addStyleName("kune-topBar-iconBar");
- iconBarHP.setCellVerticalAlignment(btnGoParent, VerticalPanel.ALIGN_MIDDLE);
- iconBarHP.setCellVerticalAlignment(buttonRounded, VerticalPanel.ALIGN_MIDDLE);
- pathMenu.setStyleName("pathMenu");
- buttonRounded.setColor("AAA");
- btnGoParent.addStyleName("kune-pointer");
+ // Set properties
+ addStyleName("kune-NavigationBar");
+ firstRow.addStyleName("topBar");
+ firstRow.addStyleName("topBar-margin");
+ secondRow.addStyleName("topBar");
+ firstRow.setWidth("100%");
+ secondRow.setWidth("100%");
+ setCellWidth(firstRow, "100%");
+ setCellWidth(secondRow, "100%");
+ firstRow.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+ iconBarHP.addStyleName("kune-topBar-iconBar");
+ iconBarHP.setCellVerticalAlignment(btnGoParent, VerticalPanel.ALIGN_MIDDLE);
+ iconBarHP.setCellVerticalAlignment(buttonRounded, VerticalPanel.ALIGN_MIDDLE);
+ pathMenu.setStyleName("pathMenu");
+ buttonRounded.setColor("AAA");
+ btnGoParent.addStyleName("kune-pointer");
}
public void setAbsolutePath(final ContainerSimpleDTO[] absolutePath) {
- pathSubmenu.clearItems();
- String indent = "";
- for (int i = 0; i < absolutePath.length; i++) {
- final ContainerSimpleDTO folder = absolutePath[i];
- String folderName = folder.getName();
- if (i == 0) {
- // We translate root folders
- folderName = i18n.t(folderName);
- }
- pathSubmenu.addItem(indent + img.folder().getHTML() + " " + folderName, true, new Command() {
- public void execute() {
- DefaultDispatcher.getInstance().fire(PlatformEvents.GOTO_CONTAINER, folder.getId());
- }
- });
- indent = indent + "  ";
- }
+ pathSubmenu.clearItems();
+ String indent = "";
+ for (int i = 0; i < absolutePath.length; i++) {
+ final ContainerSimpleDTO folder = absolutePath[i];
+ String folderName = folder.getName();
+ if (i == 0) {
+ // We translate root folders
+ folderName = i18n.t(folderName);
+ }
+ pathSubmenu.addItem(indent + img.folder().getHTML() + " " + folderName, true, new Command() {
+ public void execute() {
+ stateManagerProvider.get().gotoContainer(folder.getId());
+ }
+ });
+ indent = indent + "  ";
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,12 +1,9 @@
package org.ourproject.kune.workspace.client.ui.newtmp;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.platf.client.ui.rate.RatePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLink;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
@@ -17,7 +14,6 @@
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
import com.calclab.suco.client.container.Provider;
-import com.calclab.suco.client.signal.Slot2;
public class WorkspaceManager {
@@ -53,37 +49,6 @@
this.groupSummaryProvider = groupSummaryProvider;
this.rateItProvider = rateItProvider;
this.ratePresenterProvider = rateProvider;
- wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
- public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
- entityLogo.setTheme(oldTheme, newTheme);
- groupMembersSummaryProvider.get().setTheme(oldTheme, newTheme);
- participationSummaryProvider.get().setTheme(oldTheme, newTheme);
- groupSummaryProvider.get().setTheme(oldTheme, newTheme);
- tagsSummaryProvider.get().setTheme(oldTheme, newTheme);
- }
- });
}
- public void setSocialNetwork(final StateDTO state) {
- groupMembersSummaryProvider.get().setState(state);
- participationSummaryProvider.get().setState(state);
- }
-
- public void setState(final StateDTO state) {
- publicSpaceLink.setState(state);
- final GroupDTO group = state.getGroup();
- final boolean isAdmin = state.getGroupRights().isAdministrable();
- entityLogo.setLogo(group.getLongName());
- entityLogo.setPutYourLogoVisible(isAdmin);
- entityTitlePresenter.setState(state);
- entitySubTitlePresenter.setState(state);
- entityLicensePresenter.setLicense(state);
- setSocialNetwork(state);
- groupSummaryProvider.get().setState(state);
- tagsProvider.get().setState(state);
- wsThemePresenter.setState(state);
- rateItProvider.get().setState(state);
- ratePresenterProvider.get().setState(state);
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -22,13 +22,21 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.state.StateManager;
+import com.calclab.suco.client.signal.Slot;
+
public class EntityLicensePresenter {
private EntityLicenseView view;
private LicenseDTO license;
- public EntityLicensePresenter() {
+ public EntityLicensePresenter(final StateManager stateManager) {
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setLicense(state);
+ }
+ });
}
public View getView() {
@@ -43,7 +51,7 @@
view.openWindow(license.getUrl());
}
- public void setLicense(final StateDTO state) {
+ private void setLicense(final StateDTO state) {
this.license = state.getLicense();
view.showLicense(state.getGroup().getLongName(), license);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLink.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLink.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLink.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,11 +1,8 @@
package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic;
-import org.ourproject.kune.platf.client.dto.StateDTO;
public interface SitePublicSpaceLink {
- void setState(StateDTO state);
-
void setVisible(boolean visible);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLinkPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -4,12 +4,20 @@
import org.ourproject.kune.platf.client.dto.GroupListDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.StateManager;
+import com.calclab.suco.client.signal.Slot;
+
public class SitePublicSpaceLinkPresenter implements SitePublicSpaceLink {
private SitePublicSpaceLinkView view;
- public SitePublicSpaceLinkPresenter() {
+ public SitePublicSpaceLinkPresenter(final StateManager stateManager) {
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
}
public View getView() {
@@ -20,7 +28,11 @@
this.view = view;
}
- public void setState(final StateDTO state) {
+ public void setVisible(final boolean visible) {
+ view.setVisible(visible);
+ }
+
+ private void setState(final StateDTO state) {
final StateToken token = state.getStateToken();
if (state.getAccessLists().getViewers().getMode().equals(GroupListDTO.EVERYONE)) {
final String publicUrl = token.getPublicUrl();
@@ -31,8 +43,4 @@
}
}
- public void setVisible(final boolean visible) {
- view.setVisible(visible);
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -5,6 +5,7 @@
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.sitebar.Site;
import com.calclab.suco.client.container.Provider;
@@ -20,7 +21,8 @@
private final Provider<GroupServiceAsync> groupServiceProvider;
private final Session session;
- public WsThemePresenter(final Session session, final Provider<GroupServiceAsync> groupServiceProvider) {
+ public WsThemePresenter(final Session session, final Provider<GroupServiceAsync> groupServiceProvider,
+ final StateManager stateManager) {
this.session = session;
this.groupServiceProvider = groupServiceProvider;
this.onThemeChanged = new Signal2<WsTheme, WsTheme>("onThemeChanged");
@@ -29,6 +31,11 @@
view.setThemes(initData.getWsThemes());
}
});
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
}
public void init(final WsThemeView view) {
@@ -39,15 +46,6 @@
onThemeChanged.add(slot);
}
- public void setState(final StateDTO state) {
- setTheme(new WsTheme(state.getGroup().getWorkspaceTheme()));
- if (state.getGroupRights().isAdministrable()) {
- view.setVisible(true);
- } else {
- view.setVisible(false);
- }
- }
-
protected void onChangeGroupWsTheme(final WsTheme newTheme) {
Site.showProgressProcessing();
groupServiceProvider.get().changeGroupWsTheme(session.getUserHash(),
@@ -60,6 +58,15 @@
});
}
+ private void setState(final StateDTO state) {
+ setTheme(new WsTheme(state.getGroup().getWorkspaceTheme()));
+ if (state.getGroupRights().isAdministrable()) {
+ view.setVisible(true);
+ } else {
+ view.setVisible(false);
+ }
+ }
+
private void setTheme(final WsTheme newTheme) {
if (previousTheme == null || !previousTheme.equals(newTheme)) {
onThemeChanged.fire(previousTheme, newTheme);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -23,14 +23,22 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.StateManager;
+import com.calclab.suco.client.signal.Slot;
+
public class EntitySubTitlePresenter {
private EntitySubTitleView view;
private final I18nTranslationService i18n;
- public EntitySubTitlePresenter(final I18nTranslationService i18n) {
+ public EntitySubTitlePresenter(final I18nTranslationService i18n, final StateManager stateManager) {
this.i18n = i18n;
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
}
public View getView() {
@@ -45,7 +53,7 @@
view.setContentSubTitleRight(i18n.t("Language: [%s]", langName));
}
- public void setState(final StateDTO state) {
+ private void setState(final StateDTO state) {
if (state.hasDocument()) {
view.setContentSubTitleLeft(i18n.tWithNT("by: [%s]", "used in a list of authors", state.getAuthors().get(0)
.getName()));
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -29,9 +29,11 @@
import org.ourproject.kune.platf.client.rpc.ParamCallback;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import com.calclab.suco.client.signal.Slot;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -41,9 +43,15 @@
private final I18nTranslationService i18n;
private final KuneErrorHandler errorHandler;
- public EntityTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler) {
+ public EntityTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler,
+ final StateManager stateManager) {
this.i18n = i18n;
this.errorHandler = errorHandler;
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ setState(state);
+ }
+ });
}
public View getView() {
@@ -72,7 +80,21 @@
new ParamCallback<String, String>(text, callback));
}
- public void setState(final StateDTO state) {
+ private void setContentDate(final Date publishedOn) {
+ final DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy, Z");
+ view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
+ }
+
+ private void setContentDateVisible(final boolean visible) {
+ view.setDateVisible(visible);
+ }
+
+ private void setContentTitle(final String title, final boolean editable) {
+ view.setContentTitle(title);
+ view.setContentTitleEditable(editable);
+ }
+
+ private void setState(final StateDTO state) {
if (state.hasDocument()) {
setContentTitle(state.getTitle(), state.getContentRights().isEditable());
setContentDateVisible(true);
@@ -89,18 +111,4 @@
}
}
- private void setContentDate(final Date publishedOn) {
- final DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy, Z");
- view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
- }
-
- private void setContentDateVisible(final boolean visible) {
- view.setDateVisible(visible);
- }
-
- private void setContentTitle(final String title, final boolean editable) {
- view.setContentTitle(title);
- view.setContentTitleEditable(editable);
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -21,16 +21,10 @@
package org.ourproject.kune.workspace.client.workspace;
import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItem;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
public interface GroupMembersSummary {
- public void setState(StateDTO state);
-
- public void setTheme(WsTheme oldTheme, WsTheme newTheme);
-
void addGroupOperation(GridMenuItem<GroupDTO> operation, boolean mustBeLogged);
void removeGroupOperation(GridMenuItem<GroupDTO> operation, boolean mustBeLogged);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -20,13 +20,7 @@
package org.ourproject.kune.workspace.client.workspace;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
public interface GroupSummary {
- void setState(StateDTO state);
-
- void setTheme(WsTheme oldTheme, WsTheme newTheme);
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -20,13 +20,7 @@
package org.ourproject.kune.workspace.client.workspace;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
public interface ParticipationSummary {
- void setState(StateDTO state);
-
- void setTheme(WsTheme oldTheme, WsTheme newTheme);
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -22,16 +22,10 @@
import java.util.List;
-import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.TagResultDTO;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
public interface TagsSummary {
void setGroupTags(List<TagResultDTO> result);
- void setState(StateDTO state);
-
- void setTheme(WsTheme oldTheme, WsTheme newTheme);
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -23,9 +23,7 @@
import org.ourproject.kune.platf.client.Component;
import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
import org.ourproject.kune.platf.client.tool.ClientTool;
-import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
public interface Workspace extends Component {
@@ -36,28 +34,18 @@
public void adjustSize(int windowWidth, int clientHeight);
- public void attachToExtensibleWidget(ExtensibleWidgetChild ext);
-
public void attachTools(Iterator<ClientTool> iterator);
public int calculateHeight(int clientHeight);
public int calculateWidth(int clientWidth);
- public void clearExtensibleWidget(String extId);
-
- public void detachFromExtensibleWidget(ExtensibleWidgetChild ext);
-
public ContentSubTitleComponent getContentSubTitleComponent();
public ContentTitleComponent getContentTitleComponent();
public LicenseComponent getLicenseComponent();
- public void setContent(WorkspaceComponent contentComponent);
-
- public void setContext(WorkspaceComponent contextComponent);
-
public void setTheme(String theme);
public void setTool(String toolName);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -1,17 +1,6 @@
package org.ourproject.kune.workspace.client.workspace.ui;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-import com.google.gwt.user.client.ui.Image;
-
public interface EntityLogo {
- public abstract void setLogo(final Image image);
-
- public abstract void setLogo(final String groupName);
-
- public abstract void setPutYourLogoVisible(final boolean visible);
-
- public abstract void setTheme(final WsTheme oldTheme, WsTheme newTheme);
-
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -33,7 +33,7 @@
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
-public class EntityLogoPanel extends SimplePanel implements EntityLogo {
+public class EntityLogoPanel extends SimplePanel implements EntityLogoView {
class EntityTextLogo extends VerticalPanel {
private static final int GROUP_NAME_LIMIT_SIZE = 90;
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPresenter.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -0,0 +1,37 @@
+package org.ourproject.kune.workspace.client.workspace.ui;
+
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+
+import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot2;
+
+public class EntityLogoPresenter implements EntityLogo {
+ private EntityLogoView view;
+
+ public EntityLogoPresenter(final StateManager stateManager, final WsThemePresenter theme) {
+ stateManager.onStateChanged(new Slot<StateDTO>() {
+ public void onEvent(final StateDTO state) {
+ final GroupDTO group = state.getGroup();
+ final boolean isAdmin = state.getGroupRights().isAdministrable();
+
+ view.setLogo(group.getLongName());
+ view.setPutYourLogoVisible(isAdmin);
+ }
+ });
+ theme.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void init(final EntityLogoView view) {
+ this.view = view;
+
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoView.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -0,0 +1,17 @@
+package org.ourproject.kune.workspace.client.workspace.ui;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Image;
+
+public interface EntityLogoView {
+
+ // FIXME: Don' use Image
+ public abstract void setLogo(final Image image);
+
+ public abstract void setLogo(final String groupName);
+
+ public abstract void setPutYourLogoVisible(final boolean visible);
+
+ public abstract void setTheme(final WsTheme oldTheme, WsTheme newTheme);
+}
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-07-31 13:28:16 UTC (rev 822)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-08-01 10:53:22 UTC (rev 823)
@@ -7,7 +7,6 @@
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.workspace.client.sitebar.SiteToken;
-import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
import com.calclab.suco.client.signal.Slot;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -34,8 +33,7 @@
contentProvider = Mockito.mock(ContentProvider.class);
session = Mockito.mock(Session.class);
history = Mockito.mock(HistoryWrapper.class);
- final WorkspaceManager ws = Mockito.mock(WorkspaceManager.class);
- stateManager = new StateManagerDefault(contentProvider, session, history, ws);
+ stateManager = new StateManagerDefault(contentProvider, session, history);
Mockito.stub(session.getUserHash()).toReturn(HASH);
}
1
0
Author: vjrj
Date: 2008-07-31 15:28:16 +0200 (Thu, 31 Jul 2008)
New Revision: 822
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslator.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenu.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuView.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/DesktopView.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ui/DesktopPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipHelper.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/DoTranslationAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/GetLexiconAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/GetTranslationAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorComponent.java
Modified:
trunk/pom.xml
trunk/script/css-compact-and-tidy.css
trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/I18nService.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/ShowTranslatorAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
trunk/src/main/resources/dozerBeanMapping.xml
trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
Log:
Workspace refactorization
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/pom.xml 2008-07-31 13:28:16 UTC (rev 822)
@@ -271,12 +271,12 @@
<dependency>
<groupId>com.calclab.emite</groupId>
<artifactId>emite</artifactId>
- <version>0.3.0</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>com.calclab</groupId>
<artifactId>suco</artifactId>
- <version>0.3.0</version>
+ <version>0.3.2</version>
</dependency>
</dependencies>
<!-- http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit2-plugin/ind… -->
Modified: trunk/script/css-compact-and-tidy.css
===================================================================
--- trunk/script/css-compact-and-tidy.css 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/script/css-compact-and-tidy.css 2008-07-31 13:28:16 UTC (rev 822)
@@ -27,7 +27,7 @@
--silent=true \
$CSSTMPFILE
else
- echo Waring: Dependency csstidy, in debian: apt-get install csstidy
+ echo Warning: Dependency csstidy, in debian: apt-get install csstidy
cp $CATTMPFILE $CSSTMPFILE
fi
cat $CSSTMPFILE | sed 's/\.\.\/images/\.\.\/js\/ext\/resources\/images/g' > $1
Modified: trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -19,20 +19,12 @@
*/
package org.ourproject.kune.app.client;
-import java.util.HashMap;
+import org.ourproject.kune.platf.client.services.Kune;
-import org.ourproject.kune.platf.client.app.ApplicationBuilder;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.rpc.I18nService;
-import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
-import org.ourproject.kune.platf.client.ui.Location;
-import org.ourproject.kune.platf.client.ui.WindowUtils;
-
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DeferredCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
public class KuneEntryPoint implements EntryPoint {
@@ -40,38 +32,20 @@
}
public void onModuleLoad() {
- Log.setUncaughtExceptionHandler();
+ Log.setUncaughtExceptionHandler();
- // At the moment, in runtime:
- Log.setCurrentLogLevel(Log.LOG_LEVEL_DEBUG);
+ // At the moment, in runtime:
+ Log.setCurrentLogLevel(Log.LOG_LEVEL_DEBUG);
- DeferredCommand.addCommand(new Command() {
- public void execute() {
- onModuleLoadCont();
- }
- });
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ onModuleLoadCont();
+ }
+ });
}
public void onModuleLoadCont() {
- Location loc = WindowUtils.getLocation();
- String locale = loc.getParameter("locale");
- final I18nServiceAsync server = I18nService.App.getInstance();
- server.getInitialLanguage(locale, new AsyncCallback<I18nLanguageDTO>() {
- public void onFailure(final Throwable caught) {
- Log.debug("Workspace adaptation to your language failed");
- }
-
- public void onSuccess(final I18nLanguageDTO initialLang) {
- server.getLexicon(initialLang.getCode(), new AsyncCallback<HashMap<String, String>>() {
- public void onFailure(final Throwable caught) {
- Log.debug("Workspace adaptation to your language failed");
- }
-
- public void onSuccess(final HashMap<String, String> lexicon) {
- new ApplicationBuilder().build(initialLang, lexicon);
- }
- });
- }
- });
+ Kune.create();
+ // RootPanel.getBodyElement().setClassName("kunebody");
}
}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-07-31 13:28:16 UTC (rev 822)
@@ -1973,14 +1973,6 @@
width: 10px;
}
-.kune-SiteBarPanel-LabelLink {
- white-space: nowrap;
- color: #B3B3B3;
- margin-left: 3px;
- cursor: pointer;
- text-decoration: underline;
-}
-
.kune-SiteMessagePanel {
color: #250;
position: absolute;
@@ -2894,6 +2886,13 @@
color: #B3B3B3;
}
+.k-sitebar-labellink {
+ white-space: nowrap;
+ color: #B3B3B3;
+ cursor: pointer;
+ text-decoration: underline;
+}
+
.k-sitebar {
margin-right: 10px;
height: 16px;
@@ -2920,7 +2919,6 @@
.k-sitebar-LabelLink {
white-space: nowrap;
color: #B3B3B3;
- margin-left: 3px;
cursor: pointer;
text-decoration: underline;
}
@@ -3253,6 +3251,7 @@
.k-toolbar-sep {
padding-top: 4px;
+ padding-left: 5px;
}
/* Custom gwt-ext styles */
.ytb-sep {
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-31 13:28:16 UTC (rev 822)
@@ -20,6 +20,13 @@
color: #B3B3B3;
}
+.k-sitebar-labellink {
+ white-space: nowrap;
+ color: #B3B3B3;
+ cursor: pointer;
+ text-decoration: underline;
+}
+
.k-sitebar {
margin-right: 10px;
height: 16px;
@@ -46,7 +53,6 @@
.k-sitebar-LabelLink {
white-space: nowrap;
color: #B3B3B3;
- margin-left: 3px;
cursor: pointer;
text-decoration: underline;
}
@@ -379,6 +385,7 @@
.k-toolbar-sep {
padding-top: 4px;
+ padding-left: 5px;
}
/* Custom gwt-ext styles */
.ytb-sep {
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-07-31 13:28:16 UTC (rev 822)
@@ -65,14 +65,6 @@
width: 10px;
}
-.kune-SiteBarPanel-LabelLink {
- white-space: nowrap;
- color: #B3B3B3;
- margin-left: 3px;
- cursor: pointer;
- text-decoration: underline;
-}
-
.kune-SiteMessagePanel {
color: #250;
position: absolute;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientNewModule.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -9,34 +9,27 @@
import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.suco.client.container.Container;
-import com.calclab.suco.client.container.Provider;
-import com.calclab.suco.client.modules.Module;
-import com.calclab.suco.client.modules.ModuleBuilder;
+import com.calclab.suco.client.modules.AbstractModule;
+import com.calclab.suco.client.provider.Factory;
import com.calclab.suco.client.scopes.SingletonScope;
-public class ChatClientNewModule implements Module {
- public static ChatClientTool getChatClientTool(final Container components) {
- return components.getInstance(ChatClientTool.class);
- }
+public class ChatClientNewModule extends AbstractModule {
- public Class<? extends Module> getType() {
- return ChatClientNewModule.class;
+ public ChatClientNewModule() {
+ super(ChatClientNewModule.class);
}
- public void onLoad(final ModuleBuilder builder) {
- builder.registerProvider(ChatClientTool.class, new Provider<ChatClientTool>() {
- public ChatClientTool get() {
- return new ChatClientTool(builder.getInstance(Session.class), builder.getInstance(Application.class),
- builder.getInstance(I18nUITranslationService.class), builder.getInstance(EmiteUIDialog.class),
- builder.getInstance(WorkspaceSkeleton.class), builder.getProvider(GroupMembersSummary.class));
+ @Override
+ public void onLoad() {
+ register(SingletonScope.class, new Factory<ChatClientTool>(ChatClientTool.class) {
+ public ChatClientTool create() {
+ return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
+ $(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $p(GroupMembersSummary.class));
}
- }, SingletonScope.class);
+ });
- final ChatClientTool chatClientTool = getChatClientTool(builder);
- builder.getInstance(KunePlatform.class).addTool(chatClientTool);
- builder.getInstance(KunePlatform.class).install(
- new ChatClientModule(builder.getInstance(Session.class), builder.getInstance(StateManager.class),
- chatClientTool));
+ final ChatClientTool chatClientTool = $(ChatClientTool.class);
+ $(KunePlatform.class).addTool(chatClientTool);
+ $(KunePlatform.class).install(new ChatClientModule($(Session.class), $(StateManager.class), chatClientTool));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -72,7 +72,8 @@
};
final String initialWindowTitle = Window.getTitle();
chatOptions.userOptions = userChatOptions;
- emiteDialog.start(userChatOptions, chatOptions.httpBase, chatOptions.roomHost, avatarProvider, i18n.t("Chat"));
+ emiteDialog.start(userChatOptions, chatOptions.httpBase, chatOptions.roomHost, initialWindowTitle,
+ avatarProvider, i18n.t("Chat"));
emiteDialog.show(OwnStatus.online);
if (traybarButton == null) {
traybarButton = new ToolbarButton();
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -10,45 +10,40 @@
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.workspace.TagsSummary;
-import com.calclab.suco.client.container.Container;
-import com.calclab.suco.client.container.Provider;
-import com.calclab.suco.client.modules.Module;
-import com.calclab.suco.client.modules.ModuleBuilder;
+import com.calclab.suco.client.modules.AbstractModule;
+import com.calclab.suco.client.provider.Factory;
import com.calclab.suco.client.scopes.SingletonScope;
-public class DocumentClientNewModule implements Module {
- public static DocumentClientTool getDocumentClientTool(final Container components) {
- return components.getInstance(DocumentClientTool.class);
- }
+public class DocumentClientNewModule extends AbstractModule {
- public Class<? extends Module> getType() {
- return DocumentClientNewModule.class;
+ public DocumentClientNewModule() {
+ super(DocumentClientNewModule.class);
}
- public void onLoad(final ModuleBuilder builder) {
- builder.registerProvider(DocumentFactory.class, new Provider<DocumentFactory>() {
- public DocumentFactory get() {
- return new DocumentFactory(builder.getInstance(I18nUITranslationService.class), builder
- .getInstance(Session.class), builder.getProvider(TagsSummary.class), builder
- .getInstance(WorkspaceSkeleton.class), builder.getInstance(RateIt.class));
+ @Override
+ public void onLoad() {
+ register(SingletonScope.class, new Factory<DocumentFactory>(DocumentFactory.class) {
+ public DocumentFactory create() {
+ return new DocumentFactory($(I18nUITranslationService.class), $(Session.class), $p(TagsSummary.class),
+ $(WorkspaceSkeleton.class), $(RateIt.class));
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(DocumentClientTool.class, new Provider<DocumentClientTool>() {
- public DocumentClientTool get() {
- final DocumentFactory factory = builder.getInstance(DocumentFactory.class);
- return new DocumentClientTool(factory, builder.getInstance(I18nUITranslationService.class));
+ register(SingletonScope.class, new Factory<DocumentClientTool>(DocumentClientTool.class) {
+ public DocumentClientTool create() {
+ final DocumentFactory factory = $(DocumentFactory.class);
+ return new DocumentClientTool(factory, $(I18nUITranslationService.class));
}
- }, SingletonScope.class);
+ });
- final KunePlatform platform = builder.getInstance(KunePlatform.class);
- final DocumentClientTool docClientTool = getDocumentClientTool(builder);
+ final KunePlatform platform = $(KunePlatform.class);
+ final DocumentClientTool docClientTool = $(DocumentClientTool.class);
platform.addTool(docClientTool);
- final Session session = builder.getInstance(Session.class);
- final StateManager stateManager = builder.getInstance(StateManager.class);
- final Application application = builder.getInstance(Application.class);
- final I18nUITranslationService i18n = builder.getInstance(I18nUITranslationService.class);
+ final Session session = $(Session.class);
+ final StateManager stateManager = $(StateManager.class);
+ final Application application = $(Application.class);
+ final I18nUITranslationService i18n = $(I18nUITranslationService.class);
platform.install(new DocsClientModule(session, stateManager, application.getWorkspace(), i18n));
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/Application.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -20,9 +20,10 @@
package org.ourproject.kune.platf.client.app;
+import java.util.ArrayList;
import java.util.HashMap;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
+import org.ourproject.kune.platf.client.dispatch.ActionEvent;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ClientTool;
import org.ourproject.kune.workspace.client.workspace.Workspace;
@@ -35,7 +36,7 @@
Workspace getWorkspace();
- void init(DefaultDispatcher dispatcher, StateManager stateManager, HashMap<String, ClientTool> tools);
+ void init(StateManager stateManager, HashMap<String, ClientTool> tools);
void onApplicationStart(Slot<Object> slot);
@@ -47,4 +48,6 @@
void stop();
+ void subscribeActions(ArrayList<ActionEvent<?>> actions);
+
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -1,101 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.platf.client.app;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.ourproject.kune.chat.client.ChatClientNewModule;
-import org.ourproject.kune.docs.client.DocumentClientNewModule;
-import org.ourproject.kune.platf.client.KunePlatform;
-import org.ourproject.kune.platf.client.PlatformClientModule;
-import org.ourproject.kune.platf.client.dispatch.ActionEvent;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.services.Kune;
-import org.ourproject.kune.platf.client.services.KuneModule;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.WorkspaceClientModule;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-
-import com.calclab.emiteuimodule.client.EmiteUIModule;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.WindowCloseListener;
-import com.google.gwt.user.client.ui.Label;
-
-public class ApplicationBuilder {
-
- public ApplicationBuilder() {
- }
-
- public void build(final I18nLanguageDTO initialLang, final HashMap<String, String> lexicon) {
- final Kune kune = Kune.create(new KuneModule(initialLang, lexicon), new EmiteUIModule(),
- new DocumentClientNewModule(), new ChatClientNewModule());
-
- final Session session = kune.getSession();
-
- Site.showProgressStarting();
-
- final KunePlatform platform = kune.getPlatform();
- final StateManager stateManager = kune.getStateManager();
- final Application application = kune.getInstance(Application.class);
- final I18nUITranslationService i18n = kune.getI18N();
-
- // Temporary new ws
- final WorkspaceSkeleton ws = kune.getInstance(WorkspaceSkeleton.class);
- ws.show();
- ws.getEntityWorkspace().getContentTopBar().add(new Label("Sorry, kune workspace under heavy refactorization"));
-
- // Testing providers:
- platform.install(new PlatformClientModule(session, kune.getProvider(StateManager.class)));
- platform.install(new WorkspaceClientModule(session, stateManager, application.getWorkspace(), i18n));
-
- final DefaultDispatcher dispatcher = DefaultDispatcher.getInstance();
-
- application.init(dispatcher, stateManager, platform.getIndexedTools());
- subscribeActions(dispatcher, platform.getActions());
-
- Window.addWindowCloseListener(new WindowCloseListener() {
- public void onWindowClosed() {
- application.stop();
- }
-
- public String onWindowClosing() {
- return null;
- }
- });
- application.start();
- }
-
- private void subscribeActions(final DefaultDispatcher dispatcher, final ArrayList<ActionEvent<?>> actions) {
- ActionEvent<?> actionEvent;
-
- for (final Iterator<ActionEvent<?>> it = actions.iterator(); it.hasNext();) {
- actionEvent = it.next();
- dispatcher.subscribe(actionEvent.event, actionEvent.action);
- }
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -20,10 +20,12 @@
package org.ourproject.kune.platf.client.app;
+import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+import org.ourproject.kune.platf.client.dispatch.ActionEvent;
import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
@@ -45,6 +47,8 @@
import com.calclab.suco.client.signal.Signal;
import com.calclab.suco.client.signal.Slot;
import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.WindowCloseListener;
import com.google.gwt.user.client.rpc.AsyncCallback;
public class ApplicationDefault implements Application {
@@ -53,17 +57,24 @@
private final Session session;
private final Signal<Object> onApplicationStart;
private final Signal<Object> onApplicationStop;
- private final WorkspaceSkeleton ws;
private StateManager stateManager;
public ApplicationDefault(final Session session, final ExtensibleWidgetsManager extensionPointManager,
final I18nTranslationService i18n, final KuneErrorHandler errorHandler, final WorkspaceSkeleton ws) {
this.session = session;
- this.ws = ws;
workspace = WorkspaceFactory.createWorkspace(session, extensionPointManager, i18n, errorHandler);
tools = new HashMap<String, ClientTool>();
this.onApplicationStart = new Signal<Object>("onApplicationStart");
this.onApplicationStop = new Signal<Object>("onApplicationStop");
+ Window.addWindowCloseListener(new WindowCloseListener() {
+ public void onWindowClosed() {
+ stop();
+ }
+
+ public String onWindowClosing() {
+ return null;
+ }
+ });
}
public ClientTool getTool(final String toolName) {
@@ -74,11 +85,9 @@
return workspace;
}
- public void init(final DefaultDispatcher dispatcher, final StateManager stateManager,
- final HashMap<String, ClientTool> tools) {
+ public void init(final StateManager stateManager, final HashMap<String, ClientTool> tools) {
this.stateManager = stateManager;
this.tools = tools;
- workspace.attachTools(tools.values().iterator());
}
public void onApplicationStart(final Slot<Object> slot) {
@@ -113,6 +122,15 @@
onApplicationStop.fire(null);
}
+ public void subscribeActions(final ArrayList<ActionEvent<?>> actions) {
+ ActionEvent<?> actionEvent;
+
+ for (final Iterator<ActionEvent<?>> it = actions.iterator(); it.hasNext();) {
+ actionEvent = it.next();
+ DefaultDispatcher.getInstance().subscribe(actionEvent.event, actionEvent.action);
+ }
+ }
+
private void getInitData() {
final SiteServiceAsync server = SiteService.App.getInstance();
server.getInitData(session.getUserHash(), new AsyncCallback<InitDataDTO>() {
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/app/DesktopView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/DesktopView.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/DesktopView.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.app;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface DesktopView extends View {
- void attach();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/app/ui/DesktopPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ui/DesktopPanel.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ui/DesktopPanel.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -1,99 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.platf.client.app.ui;
-
-import org.ourproject.kune.platf.client.app.DesktopView;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarListener;
-import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessage;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.WindowResizeListener;
-import com.google.gwt.user.client.ui.AbsolutePanel;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-@Deprecated
-public class DesktopPanel extends AbsolutePanel implements DesktopView {
-
- public DesktopPanel(final Workspace workspace, final SiteBarListener listener, final Session session,
- final I18nTranslationService i18n) {
- // QuickTips.init(); // extgwt tips
- // final QuickTip quickTipInstance = QuickTips.getQuickTip();
- // quickTipInstance.setDismissDelay(8000);
- // quickTipInstance.setHideDelay(500);
- // quickTipInstance.setInterceptTitles(true);
- // SiteBar siteBar = SiteBarFactory.createSiteBar(listener, session,
- // i18n);
- // final SiteMessage siteMessage = SiteBarFactory.getSiteMessage();
- // this.add((Widget) siteMessage.getView(),
- // calculateMessageWidth(Window.getClientWidth()),
- // calculateMessageHeight());
- // this.add((Widget) siteBar.getView(), 0, 0);
- this.add((Widget) workspace.getView(), 0, 20);
- this.addStyleName("kunebody");
- // initResizeListener(this, workspace, siteMessage);
- // resizeDesktop(this, workspace, siteMessage, Window.getClientWidth(),
- // Window.getClientHeight());
- }
-
- public void attach() {
- RootPanel.get().add(this);
- }
-
- private int calculateMessageHeight() {
- return 2;
- }
-
- private int calculateMessageWidth(final int width) {
- return width * 20 / 100 - 10;
- }
-
- private void initResizeListener(final AbsolutePanel desktop, final Workspace workspace,
- final SiteMessage siteMessage) {
- Window.addWindowResizeListener(new WindowResizeListener() {
- public void onWindowResized(final int width, final int height) {
- resizeDesktop(desktop, workspace, siteMessage, width, height);
- }
- });
- }
-
- private void resizeDesktop(final AbsolutePanel desktop, final Workspace workspace, final SiteMessage siteMessage,
- final int clientWidth, final int clientHeight) {
- final int width = workspace.calculateWidth(clientWidth);
- final int height = workspace.calculateHeight(clientHeight);
- final boolean scroll = width <= Workspace.MIN_WIDTH || height <= Workspace.MIN_HEIGHT ? true : false;
- Window.enableScrolling(scroll);
- if (scroll) {
- desktop.setSize("" + width, "" + height);
- } else {
- desktop.setSize("100%", "100%");
- }
- workspace.adjustSize(width, height);
- // siteMessage.adjustWidth(width);
- // desktop.setWidgetPosition((Widget) siteMessage.getView(),
- // calculateMessageWidth(width),
- // calculateMessageHeight());
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -24,9 +24,7 @@
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.DefaultException;
-import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
public interface GroupService extends RemoteService {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/I18nService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/I18nService.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/I18nService.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -24,25 +24,10 @@
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.errors.DefaultException;
-import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
public interface I18nService extends RemoteService {
- public class App {
- private static I18nServiceAsync ourInstance = null;
-
- public static synchronized I18nServiceAsync getInstance() {
- if (ourInstance == null) {
- ourInstance = (I18nServiceAsync) GWT.create(I18nService.class);
- ((ServiceDefTarget) ourInstance).setServiceEntryPoint(GWT.getModuleBaseURL() + "I18nService");
- }
- return ourInstance;
- }
-
- }
-
I18nLanguageDTO getInitialLanguage(String localeParam);
HashMap<String, String> getLexicon(String language);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/Kune.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -20,24 +20,16 @@
package org.ourproject.kune.platf.client.services;
-import org.ourproject.kune.platf.client.KunePlatform;
-import org.ourproject.kune.platf.client.app.Application;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-import com.calclab.emiteuimodule.client.EmiteUIDialog;
+import com.calclab.suco.client.Suco;
import com.calclab.suco.client.container.Container;
import com.calclab.suco.client.container.DelegatedContainer;
import com.calclab.suco.client.modules.Module;
-import com.calclab.suco.client.modules.ModuleBuilder;
public class Kune extends DelegatedContainer {
public static Kune create(final Module... modules) {
- final ModuleBuilder container = new ModuleBuilder();
- container.add(modules);
+ final Container container = Suco.create(modules);
+ Suco.add(container, new KuneModule());
return container.getInstance(Kune.class);
}
@@ -45,32 +37,4 @@
super(container);
}
- public ColorTheme getColorTheme() {
- return this.getInstance(ColorTheme.class);
- }
-
- public EmiteUIDialog getEmiteUIDialog() {
- return this.getInstance(EmiteUIDialog.class);
- }
-
- public I18nUITranslationService getI18N() {
- return this.getInstance(I18nUITranslationService.class);
- }
-
- public KunePlatform getPlatform() {
- return this.getInstance(KunePlatform.class);
- }
-
- public Session getSession() {
- return this.getInstance(Session.class);
- }
-
- public StateManager getStateManager() {
- return this.getInstance(StateManager.class);
- }
-
- public Workspace getWorkspace() {
- return this.getInstance(Application.class).getWorkspace();
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -1,12 +1,13 @@
package org.ourproject.kune.platf.client.services;
-import java.util.HashMap;
-
+import org.ourproject.kune.chat.client.ChatClientNewModule;
+import org.ourproject.kune.docs.client.DocumentClientNewModule;
import org.ourproject.kune.platf.client.KunePlatform;
+import org.ourproject.kune.platf.client.PlatformClientModule;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ApplicationDefault;
+import org.ourproject.kune.platf.client.app.HistoryWrapper;
import org.ourproject.kune.platf.client.app.HistoryWrapperImpl;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
@@ -14,20 +15,28 @@
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupService;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.rpc.I18nService;
+import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
+import org.ourproject.kune.platf.client.state.ContentProvider;
import org.ourproject.kune.platf.client.state.ContentProviderImpl;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.SessionImpl;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.state.StateManagerDefault;
-import org.ourproject.kune.platf.client.ui.QuickTipHelper;
+import org.ourproject.kune.platf.client.ui.QuickTipsHelper;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.platf.client.ui.rate.RateItPanel;
import org.ourproject.kune.platf.client.ui.rate.RateItPresenter;
import org.ourproject.kune.platf.client.ui.rate.RatePanel;
import org.ourproject.kune.platf.client.ui.rate.RatePresenter;
+import org.ourproject.kune.workspace.client.WorkspaceClientModule;
+import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
+import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPresenter;
+import org.ourproject.kune.workspace.client.i18n.I18nTranslatorView;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.i18n.ui.I18nTranslatorPanel;
import org.ourproject.kune.workspace.client.licensechoose.LicenseChoose;
import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePresenter;
@@ -92,6 +101,9 @@
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign.SiteSignOutLink;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign.SiteSignOutLinkPanel;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesign.SiteSignOutLinkPresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu.SiteUserMenu;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu.SiteUserMenuPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu.SiteUserMenuPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
@@ -108,443 +120,523 @@
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel;
-import com.calclab.suco.client.container.Provider;
-import com.calclab.suco.client.modules.Module;
-import com.calclab.suco.client.modules.ModuleBuilder;
+import com.calclab.emiteuimodule.client.EmiteUIModule;
+import com.calclab.suco.client.container.Container;
+import com.calclab.suco.client.modules.AbstractModule;
+import com.calclab.suco.client.provider.Factory;
import com.calclab.suco.client.scopes.SingletonScope;
import com.calclab.suco.client.signal.Slot;
+import com.calclab.suco.client.signal.Slot0;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.rpc.ServiceDefTarget;
-public class KuneModule implements Module {
- private final I18nLanguageDTO initialLang;
- private final HashMap<String, String> lexicon;
- private ModuleBuilder builder;
-
- public KuneModule(final I18nLanguageDTO initialLang, final HashMap<String, String> lexicon) {
- this.initialLang = initialLang;
- this.lexicon = lexicon;
+public class KuneModule extends AbstractModule {
+ public KuneModule() {
+ super(KuneModule.class);
}
- public Class<? extends Module> getType() {
- return KuneModule.class;
- }
+ @Override
+ public void onLoad() {
+ register(SingletonScope.class, new Factory<Kune>(Kune.class) {
+ public Kune create() {
+ return new Kune($(Container.class));
+ }
+ });
- public void onLoad(final ModuleBuilder builder) {
- this.builder = builder;
+ register(SingletonScope.class, new Factory<Session>(Session.class) {
+ public Session create() {
+ return new SessionImpl(Cookies.getCookie(Site.USERHASH), $p(UserServiceAsync.class));
+ }
+ });
- builder.registerProvider(Kune.class, new Provider<Kune>() {
- public Kune get() {
- return new Kune(builder);
+ /** Services (this in other module after UI refactor * */
+
+ register(SingletonScope.class, new Factory<I18nServiceAsync>(I18nServiceAsync.class) {
+ public I18nServiceAsync create() {
+ final I18nServiceAsync service = (I18nServiceAsync) GWT.create(I18nService.class);
+ ((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + "I18nService");
+ return service;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(I18nUITranslationService.class, new Provider<I18nUITranslationService>() {
- public I18nUITranslationService get() {
+ register(SingletonScope.class, new Factory<UserServiceAsync>(UserServiceAsync.class) {
+ public UserServiceAsync create() {
+ final UserServiceAsync service = (UserServiceAsync) GWT.create(UserService.class);
+ ((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + "UserService");
+ return service;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<SocialNetworkServiceAsync>(SocialNetworkServiceAsync.class) {
+ public SocialNetworkServiceAsync create() {
+ final SocialNetworkServiceAsync snServiceAsync = (SocialNetworkServiceAsync) GWT
+ .create(SocialNetworkService.class);
+ ((ServiceDefTarget) snServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL()
+ + "SocialNetworkService");
+ return snServiceAsync;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<GroupServiceAsync>(GroupServiceAsync.class) {
+ public GroupServiceAsync create() {
+ final GroupServiceAsync groupServiceAsync = (GroupServiceAsync) GWT.create(GroupService.class);
+ ((ServiceDefTarget) groupServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() + "GroupService");
+ return groupServiceAsync;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<ContentServiceAsync>(ContentServiceAsync.class) {
+ public ContentServiceAsync create() {
+ return ContentService.App.getInstance();
+ }
+ });
+
+ register(SingletonScope.class, new Factory<I18nUITranslationService>(I18nUITranslationService.class) {
+ public I18nUITranslationService create() {
final I18nUITranslationService i18n = new I18nUITranslationService();
- i18n.setCurrentLanguage(initialLang.getCode());
- i18n.setLexicon(lexicon);
+ i18n.init($(I18nServiceAsync.class), $(Session.class), new Slot0() {
+ public void onEvent() {
+ onI18nReady();
+ }
+ });
return i18n;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(QuickTipHelper.class, new Provider<QuickTipHelper>() {
- public QuickTipHelper get() {
- return new QuickTipHelper();
+ $(I18nUITranslationService.class);
+ }
+
+ private void onI18nReady() {
+ final I18nUITranslationService i18n = $(I18nUITranslationService.class);
+
+ register(SingletonScope.class, new Factory<I18nTranslationService>(I18nTranslationService.class) {
+ public I18nTranslationService create() {
+ return i18n;
}
- }, SingletonScope.class);
+ });
- i(QuickTipHelper.class);
+ register(SingletonScope.class, new Factory<QuickTipsHelper>(QuickTipsHelper.class) {
+ public QuickTipsHelper create() {
+ return new QuickTipsHelper();
+ }
+ });
- builder.registerProvider(UserServiceAsync.class, new Provider<UserServiceAsync>() {
- public UserServiceAsync get() {
+ $(QuickTipsHelper.class);
+
+ register(SingletonScope.class, new Factory<UserServiceAsync>(UserServiceAsync.class) {
+ public UserServiceAsync create() {
final UserServiceAsync service = (UserServiceAsync) GWT.create(UserService.class);
((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + "UserService");
return service;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(SocialNetworkServiceAsync.class, new Provider<SocialNetworkServiceAsync>() {
- public SocialNetworkServiceAsync get() {
+ register(SingletonScope.class, new Factory<SocialNetworkServiceAsync>(SocialNetworkServiceAsync.class) {
+ public SocialNetworkServiceAsync create() {
final SocialNetworkServiceAsync snServiceAsync = (SocialNetworkServiceAsync) GWT
.create(SocialNetworkService.class);
((ServiceDefTarget) snServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL()
+ "SocialNetworkService");
return snServiceAsync;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(GroupServiceAsync.class, new Provider<GroupServiceAsync>() {
- public GroupServiceAsync get() {
+ register(SingletonScope.class, new Factory<GroupServiceAsync>(GroupServiceAsync.class) {
+ public GroupServiceAsync create() {
final GroupServiceAsync groupServiceAsync = (GroupServiceAsync) GWT.create(GroupService.class);
((ServiceDefTarget) groupServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() + "GroupService");
return groupServiceAsync;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(ContentServiceAsync.class, new Provider<ContentServiceAsync>() {
- public ContentServiceAsync get() {
+ register(SingletonScope.class, new Factory<ContentServiceAsync>(ContentServiceAsync.class) {
+ public ContentServiceAsync create() {
return ContentService.App.getInstance();
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(Session.class, new Provider<Session>() {
- public Session get() {
- return new SessionImpl(Cookies.getCookie(Site.USERHASH), initialLang, p(UserServiceAsync.class));
- }
- }, SingletonScope.class);
-
- builder.registerProvider(Images.class, new Provider<Images>() {
- public Images get() {
+ register(SingletonScope.class, new Factory<Images>(Images.class) {
+ public Images create() {
return Images.App.getInstance();
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(ImageUtils.class, new Provider<ImageUtils>() {
- public ImageUtils get() {
+ register(SingletonScope.class, new Factory<ImageUtils>(ImageUtils.class) {
+ public ImageUtils create() {
return new ImageUtils();
}
- }, SingletonScope.class);
+ });
- final I18nUITranslationService i18n = i(I18nUITranslationService.class);
- builder.registerProvider(KuneErrorHandler.class, new Provider<KuneErrorHandler>() {
- public KuneErrorHandler get() {
- return new KuneErrorHandler(i(Session.class), i18n, p(WorkspaceSkeleton.class));
+ register(SingletonScope.class, new Factory<KuneErrorHandler>(KuneErrorHandler.class) {
+ public KuneErrorHandler create() {
+ return new KuneErrorHandler($(Session.class), i18n, $p(WorkspaceSkeleton.class));
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(WorkspaceSkeleton.class, new Provider<WorkspaceSkeleton>() {
- public WorkspaceSkeleton get() {
+ register(SingletonScope.class, new Factory<WorkspaceSkeleton>(WorkspaceSkeleton.class) {
+ public WorkspaceSkeleton create() {
return new WorkspaceSkeleton();
}
- }, SingletonScope.class);
+ });
- final KuneErrorHandler errorHandler = i(KuneErrorHandler.class);
+ final KuneErrorHandler errorHandler = $(KuneErrorHandler.class);
AsyncCallbackSimple.init(errorHandler);
- builder.registerProvider(KunePlatform.class, new Provider<KunePlatform>() {
- public KunePlatform get() {
+ register(SingletonScope.class, new Factory<KunePlatform>(KunePlatform.class) {
+ public KunePlatform create() {
return new KunePlatform();
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(ExtensibleWidgetsManager.class, new Provider<ExtensibleWidgetsManager>() {
- public ExtensibleWidgetsManager get() {
+ register(SingletonScope.class, new Factory<ExtensibleWidgetsManager>(ExtensibleWidgetsManager.class) {
+ public ExtensibleWidgetsManager create() {
return new ExtensibleWidgetsManager();
}
- }, SingletonScope.class);
+ });
- final WorkspaceSkeleton ws = i(WorkspaceSkeleton.class);
- final Images images = i(Images.class);
+ final WorkspaceSkeleton ws = $(WorkspaceSkeleton.class);
+ final Images images = $(Images.class);
- builder.registerProvider(Application.class, new Provider<Application>() {
- public Application get() {
- final Session session = i(Session.class);
- final ExtensibleWidgetsManager extensionPointManager = i(ExtensibleWidgetsManager.class);
- return new ApplicationDefault(session, extensionPointManager, i18n, i(KuneErrorHandler.class), ws);
+ register(SingletonScope.class, new Factory<Application>(Application.class) {
+ public Application create() {
+ final Session session = $(Session.class);
+ final ExtensibleWidgetsManager extensionPointManager = $(ExtensibleWidgetsManager.class);
+ return new ApplicationDefault(session, extensionPointManager, i18n, $(KuneErrorHandler.class), ws);
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(SitePublicSpaceLink.class, new Provider<SitePublicSpaceLink>() {
- public SitePublicSpaceLink get() {
+ register(SingletonScope.class, new Factory<SitePublicSpaceLink>(SitePublicSpaceLink.class) {
+ public SitePublicSpaceLink create() {
final SitePublicSpaceLinkPresenter presenter = new SitePublicSpaceLinkPresenter();
final SitePublicSpaceLinkPanel panel = new SitePublicSpaceLinkPanel(presenter, ws, i18n, images);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(SiteProgress.class, new Provider<SiteProgress>() {
- public SiteProgress get() {
+ register(SingletonScope.class, new Factory<SiteProgress>(SiteProgress.class) {
+ public SiteProgress create() {
final SiteProgressPresenter presenter = new SiteProgressPresenter();
- final SiteProgressPanel panel = new SiteProgressPanel(presenter, p(SitePublicSpaceLink.class));
+ final SiteProgressPanel panel = new SiteProgressPanel(presenter, $p(SitePublicSpaceLink.class));
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(Site.class, new Provider<Site>() {
- public Site get() {
- return new Site(i18n, i(SiteProgress.class), p(SiteMessage.class));
+ register(SingletonScope.class, new Factory<Site>(Site.class) {
+ public Site create() {
+ return new Site(i18n, $(SiteProgress.class), $p(SiteMessage.class));
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(SiteMessage.class, new Provider<SiteMessage>() {
- public SiteMessage get() {
+ register(SingletonScope.class, new Factory<SiteMessage>(SiteMessage.class) {
+ public SiteMessage create() {
final SiteMessagePresenter siteMessagePresenter = new SiteMessagePresenter();
final SiteMessageView siteMessageView = new SiteMessagePanel(siteMessagePresenter, true, i18n);
siteMessagePresenter.init(siteMessageView);
return siteMessagePresenter;
}
- }, SingletonScope.class);
+ });
- i(SiteProgress.class);
- i(Site.class);
+ $(SiteProgress.class);
+ $(Site.class);
- builder.registerProvider(SiteSignInLink.class, new Provider<SiteSignInLink>() {
- public SiteSignInLink get() {
- final SiteSignInLinkPresenter presenter = new SiteSignInLinkPresenter(i(Session.class));
+ register(SingletonScope.class, new Factory<SiteSignInLink>(SiteSignInLink.class) {
+ public SiteSignInLink create() {
+ final SiteSignInLinkPresenter presenter = new SiteSignInLinkPresenter($(Session.class));
final SiteSignInLinkPanel panel = new SiteSignInLinkPanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(SiteSignOutLink.class, new Provider<SiteSignOutLink>() {
- public SiteSignOutLink get() {
- final SiteSignOutLinkPresenter presenter = new SiteSignOutLinkPresenter(i(Session.class),
- p(UserServiceAsync.class), p(KuneErrorHandler.class));
+ register(SingletonScope.class, new Factory<SiteUserMenu>(SiteUserMenu.class) {
+ public SiteUserMenu create() {
+ final SiteUserMenuPresenter presenter = new SiteUserMenuPresenter($(Session.class));
+ final SiteUserMenuPanel panel = new SiteUserMenuPanel(presenter, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<SiteSignOutLink>(SiteSignOutLink.class) {
+ public SiteSignOutLink create() {
+ final SiteSignOutLinkPresenter presenter = new SiteSignOutLinkPresenter($(Session.class),
+ $p(UserServiceAsync.class), $p(KuneErrorHandler.class));
final SiteSignOutLinkPanel panel = new SiteSignOutLinkPanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(SiteNewGroupLink.class, new Provider<SiteNewGroupLink>() {
- public SiteNewGroupLink get() {
+ register(SingletonScope.class, new Factory<SiteNewGroupLink>(SiteNewGroupLink.class) {
+ public SiteNewGroupLink create() {
final SiteNewGroupLinkPresenter presenter = new SiteNewGroupLinkPresenter();
final SiteNewGroupLinkPanel panel = new SiteNewGroupLinkPanel(presenter, ws, i18n);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(SiteOptions.class, new Provider<SiteOptions>() {
- public SiteOptions get() {
+ register(SingletonScope.class, new Factory<SiteOptions>(SiteOptions.class) {
+ public SiteOptions create() {
final SiteOptionsPresenter presenter = new SiteOptionsPresenter();
final SiteOptionsPanel panel = new SiteOptionsPanel(presenter, ws);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(SiteLogo.class, new Provider<SiteLogo>() {
- public SiteLogo get() {
- final SiteLogoPresenter presenter = new SiteLogoPresenter(i(Session.class));
+ register(SingletonScope.class, new Factory<SiteLogo>(SiteLogo.class) {
+ public SiteLogo create() {
+ final SiteLogoPresenter presenter = new SiteLogoPresenter($(Session.class));
final SiteLogoPanel panel = new SiteLogoPanel(presenter, ws);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(SiteSearcher.class, new Provider<SiteSearcher>() {
- public SiteSearcher get() {
+ register(SingletonScope.class, new Factory<SiteSearcher>(SiteSearcher.class) {
+ public SiteSearcher create() {
final SiteSearcherPresenter presenter = new SiteSearcherPresenter();
final SiteSearcherView view = new SiteSearcherPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(SiteSearch.class, new Provider<SiteSearch>() {
- public SiteSearch get() {
- final SiteSearchPresenter presenter = new SiteSearchPresenter(p(SiteSearcher.class));
+ register(SingletonScope.class, new Factory<I18nTranslator>(I18nTranslator.class) {
+ public I18nTranslator create() {
+ final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter($(Session.class),
+ $(I18nServiceAsync.class), i18n);
+ final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<SiteSearch>(SiteSearch.class) {
+ public SiteSearch create() {
+ final SiteSearchPresenter presenter = new SiteSearchPresenter($p(SiteSearcher.class));
final SiteSearchPanel panel = new SiteSearchPanel(presenter, ws, i18n);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(SignIn.class, new Provider<SignIn>() {
- public SignIn get() {
- final SignInPresenter presenter = new SignInPresenter(i(Session.class), i(StateManager.class), i18n,
- i(UserServiceAsync.class));
+ register(SingletonScope.class, new Factory<SignIn>(SignIn.class) {
+ public SignIn create() {
+ final SignInPresenter presenter = new SignInPresenter($(Session.class), $(StateManager.class), i18n,
+ $(UserServiceAsync.class));
final SignInPanel view = new SignInPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(LicenseChoose.class, new Provider<LicenseChoose>() {
- public LicenseChoose get() {
- final LicenseChoosePresenter presenter = new LicenseChoosePresenter(i(Session.class));
+ register(SingletonScope.class, new Factory<LicenseChoose>(LicenseChoose.class) {
+ public LicenseChoose create() {
+ final LicenseChoosePresenter presenter = new LicenseChoosePresenter($(Session.class));
final LicenseChoosePanel view = new LicenseChoosePanel(presenter, i18n);
presenter.init(view);
return presenter;
}
});
- builder.registerProvider(NewGroup.class, new Provider<NewGroup>() {
- public NewGroup get() {
- final NewGroupPresenter presenter = new NewGroupPresenter(i18n, i(Session.class),
- i(StateManager.class), p(GroupServiceAsync.class));
- final NewGroupPanel view = new NewGroupPanel(presenter, i18n, p(LicenseChoose.class));
+ register(SingletonScope.class, new Factory<NewGroup>(NewGroup.class) {
+ public NewGroup create() {
+ final NewGroupPresenter presenter = new NewGroupPresenter(i18n, $(Session.class),
+ $(StateManager.class), $p(GroupServiceAsync.class));
+ final NewGroupPanel view = new NewGroupPanel(presenter, i18n, $p(LicenseChoose.class));
presenter.init(view);
return presenter;
}
- }, SingletonScope.class);
+ });
- i(SitePublicSpaceLink.class);
- i(SiteMessage.class);
- i(SiteSignInLink.class);
- i(SiteSignOutLink.class);
- i(SiteNewGroupLink.class);
- i(SiteSearch.class);
- i(SiteLogo.class);
+ $(SitePublicSpaceLink.class);
+ $(SiteMessage.class);
+ $(SiteUserMenu.class);
+ $(SiteSignInLink.class);
+ $(SiteSignOutLink.class);
+ $(SiteNewGroupLink.class);
+ $(SiteSearch.class);
+ $(SiteLogo.class);
- builder.registerProvider(EntityLogo.class, new Provider<EntityLogo>() {
- public EntityLogo get() {
+ register(SingletonScope.class, new Factory<EntityLogo>(EntityLogo.class) {
+ public EntityLogo create() {
return new EntityLogoPanel(i18n, ws);
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(WsThemePresenter.class, new Provider<WsThemePresenter>() {
- public WsThemePresenter get() {
- final WsThemePresenter presenter = new WsThemePresenter(i(Session.class), p(GroupServiceAsync.class));
+ register(SingletonScope.class, new Factory<WsThemePresenter>(WsThemePresenter.class) {
+ public WsThemePresenter create() {
+ final WsThemePresenter presenter = new WsThemePresenter($(Session.class), $p(GroupServiceAsync.class));
final WsThemePanel panel = new WsThemePanel(ws, presenter, i18n);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(EntityTitlePresenter.class, new Provider<EntityTitlePresenter>() {
- public EntityTitlePresenter get() {
- final EntityTitlePresenter presenter = new EntityTitlePresenter(i18n, i(KuneErrorHandler.class));
+ register(SingletonScope.class, new Factory<EntityTitlePresenter>(EntityTitlePresenter.class) {
+ public EntityTitlePresenter create() {
+ final EntityTitlePresenter presenter = new EntityTitlePresenter(i18n, $(KuneErrorHandler.class));
final EntityTitlePanel panel = new EntityTitlePanel(ws, presenter);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(EntitySubTitlePresenter.class, new Provider<EntitySubTitlePresenter>() {
- public EntitySubTitlePresenter get() {
+ register(SingletonScope.class, new Factory<EntitySubTitlePresenter>(EntitySubTitlePresenter.class) {
+ public EntitySubTitlePresenter create() {
final EntitySubTitlePresenter presenter = new EntitySubTitlePresenter(i18n);
final EntitySubTitlePanel panel = new EntitySubTitlePanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(EntityLicensePresenter.class, new Provider<EntityLicensePresenter>() {
- public EntityLicensePresenter get() {
+ register(SingletonScope.class, new Factory<EntityLicensePresenter>(EntityLicensePresenter.class) {
+ public EntityLicensePresenter create() {
final EntityLicensePresenter presenter = new EntityLicensePresenter();
final EntityLicensePanel panel = new EntityLicensePanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(RatePresenter.class, new Provider<RatePresenter>() {
- public RatePresenter get() {
+ register(SingletonScope.class, new Factory<RatePresenter>(RatePresenter.class) {
+ public RatePresenter create() {
final RatePresenter presenter = new RatePresenter();
final RatePanel panel = new RatePanel(null, null, i18n, ws);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(RateIt.class, new Provider<RateIt>() {
- public RateIt get() {
- final RateItPresenter presenter = new RateItPresenter(i18n, i(Session.class),
- p(ContentServiceAsync.class), p(StateManager.class));
+ register(SingletonScope.class, new Factory<RateIt>(RateIt.class) {
+ public RateIt create() {
+ final RateItPresenter presenter = new RateItPresenter(i18n, $(Session.class),
+ $p(ContentServiceAsync.class), $p(StateManager.class));
final RateItPanel panel = new RateItPanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(WorkspaceManager.class, new Provider<WorkspaceManager>() {
- public WorkspaceManager get() {
- final WorkspaceManager presenter = new WorkspaceManager(i(SitePublicSpaceLink.class),
- i(EntityLogo.class), i(EntityTitlePresenter.class), i(EntitySubTitlePresenter.class),
- i(WsThemePresenter.class), i(EntityLicensePresenter.class), p(GroupMembersSummary.class),
- p(ParticipationSummary.class), p(TagsSummary.class), p(GroupSummary.class), i(RateIt.class),
- i(RatePresenter.class));
+ register(SingletonScope.class, new Factory<GroupMembersSummary>(GroupMembersSummary.class) {
+ public GroupMembersSummary create() {
+ final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(i18n,
+ $p(StateManager.class), $(ImageUtils.class), $(Session.class),
+ $p(SocialNetworkServiceAsync.class), $p(UserLiveSearcher.class));
+ final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter, i18n, ws);
+ presenter.init(view);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(StateManager.class, new Provider<StateManager>() {
- public StateManager get() {
- final StateManagerDefault stateManager = new StateManagerDefault(new ContentProviderImpl(
- ContentService.App.getInstance()), i(Session.class), new HistoryWrapperImpl(),
- i(WorkspaceManager.class));
- History.addHistoryListener(stateManager);
- return stateManager;
- }
- }, SingletonScope.class);
-
- builder.registerProvider(UserLiveSearcher.class, new Provider<UserLiveSearcher>() {
- public UserLiveSearcher get() {
- final UserLiveSearcherPresenter presenter = new UserLiveSearcherPresenter();
- final EntityLiveSearcherView view = new UserLiveSearcherPanel(presenter, i18n);
+ register(SingletonScope.class, new Factory<GroupSummary>(GroupSummary.class) {
+ public GroupSummary create() {
+ final GroupSummaryPresenter presenter = new GroupSummaryPresenter();
+ final GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(GroupLiveSearcher.class, new Provider<GroupLiveSearcher>() {
- public GroupLiveSearcher get() {
- final GroupLiveSearcherPresenter presenter = new GroupLiveSearcherPresenter();
- final EntityLiveSearcherView view = new GroupLiveSearchPanel(presenter, i18n);
+ register(SingletonScope.class, new Factory<ParticipationSummary>(ParticipationSummary.class) {
+ public ParticipationSummary create() {
+ final ParticipationSummaryPresenter presenter = new ParticipationSummaryPresenter(i18n,
+ $p(StateManager.class), $(ImageUtils.class), $(Session.class),
+ $p(SocialNetworkServiceAsync.class));
+ final ParticipationSummaryView view = new ParticipationSummaryPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(GroupMembersSummary.class, new Provider<GroupMembersSummary>() {
- public GroupMembersSummary get() {
- final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(i18n,
- p(StateManager.class), i(ImageUtils.class), i(Session.class),
- p(SocialNetworkServiceAsync.class), p(UserLiveSearcher.class));
- final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter, i18n, ws);
- presenter.init(view);
+ register(SingletonScope.class, new Factory<TagsSummary>(TagsSummary.class) {
+ public TagsSummary create() {
+ final TagsSummaryPresenter presenter = new TagsSummaryPresenter($p(Session.class),
+ $p(SiteSearcher.class));
+ final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, i18n, ws);
+ presenter.init(panel);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(GroupSummary.class, new Provider<GroupSummary>() {
- public GroupSummary get() {
- final GroupSummaryPresenter presenter = new GroupSummaryPresenter();
- final GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, ws);
- presenter.init(view);
+ register(SingletonScope.class, new Factory<WorkspaceManager>(WorkspaceManager.class) {
+ public WorkspaceManager create() {
+ final WorkspaceManager presenter = new WorkspaceManager($(SitePublicSpaceLink.class),
+ $(EntityLogo.class), $(EntityTitlePresenter.class), $(EntitySubTitlePresenter.class),
+ $(WsThemePresenter.class), $(EntityLicensePresenter.class), $p(GroupMembersSummary.class),
+ $p(ParticipationSummary.class), $p(TagsSummary.class), $p(GroupSummary.class),
+ $p(RateIt.class), $p(RatePresenter.class));
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(ParticipationSummary.class, new Provider<ParticipationSummary>() {
- public ParticipationSummary get() {
- final ParticipationSummaryPresenter presenter = new ParticipationSummaryPresenter(i18n,
- p(StateManager.class), i(ImageUtils.class), i(Session.class),
- p(SocialNetworkServiceAsync.class));
- final ParticipationSummaryView view = new ParticipationSummaryPanel(presenter, i18n, ws);
+ $(WorkspaceManager.class);
+
+ register(SingletonScope.class, new Factory<HistoryWrapper>(HistoryWrapper.class) {
+ public HistoryWrapper create() {
+ return new HistoryWrapperImpl();
+ }
+ }, new Factory<ContentProvider>(ContentProvider.class) {
+ public ContentProvider create() {
+ return new ContentProviderImpl($(ContentServiceAsync.class));
+ }
+ }, new Factory<StateManager>(StateManager.class) {
+ public StateManager create() {
+ final StateManagerDefault stateManager = new StateManagerDefault($(ContentProvider.class),
+ $(Session.class), $(HistoryWrapper.class), $(WorkspaceManager.class));
+ History.addHistoryListener(stateManager);
+ return stateManager;
+ }
+ });
+
+ register(SingletonScope.class, new Factory<UserLiveSearcher>(UserLiveSearcher.class) {
+ public UserLiveSearcher create() {
+ final UserLiveSearcherPresenter presenter = new UserLiveSearcherPresenter();
+ final EntityLiveSearcherView view = new UserLiveSearcherPanel(presenter, i18n);
presenter.init(view);
return presenter;
}
- }, SingletonScope.class);
+ });
- builder.registerProvider(TagsSummary.class, new Provider<TagsSummary>() {
- public TagsSummary get() {
- final TagsSummaryPresenter presenter = new TagsSummaryPresenter(p(Session.class), p(SiteSearcher.class));
- final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, i18n, ws);
- presenter.init(panel);
+ register(SingletonScope.class, new Factory<GroupLiveSearcher>(GroupLiveSearcher.class) {
+ public GroupLiveSearcher create() {
+ final GroupLiveSearcherPresenter presenter = new GroupLiveSearcherPresenter();
+ final EntityLiveSearcherView view = new GroupLiveSearchPanel(presenter, i18n);
+ presenter.init(view);
return presenter;
}
- }, SingletonScope.class);
+ });
+ load(new EmiteUIModule(), new DocumentClientNewModule(), new ChatClientNewModule());
+
// Register of tokens like "signin", "newgroup", "translate" etcetera
- i(StateManager.class).addSiteToken(SiteToken.signin.toString(), new Slot<StateToken>() {
+ $(StateManager.class).addSiteToken(SiteToken.signin.toString(), new Slot<StateToken>() {
public void onEvent(final StateToken previousStateToken) {
- i(SignIn.class).doSignIn(previousStateToken);
+ $(SignIn.class).doSignIn(previousStateToken);
}
});
- i(StateManager.class).addSiteToken(SiteToken.newgroup.toString(), new Slot<StateToken>() {
+ $(StateManager.class).addSiteToken(SiteToken.newgroup.toString(), new Slot<StateToken>() {
public void onEvent(final StateToken previousStateToken) {
- i(NewGroup.class).doNewGroup(previousStateToken);
+ $(NewGroup.class).doNewGroup(previousStateToken);
}
});
- }
+ final KunePlatform platform = $(KunePlatform.class);
+ platform.install(new PlatformClientModule($(Session.class), $p(StateManager.class)));
+ platform.install(new WorkspaceClientModule($(Session.class), $(StateManager.class), $(Application.class)
+ .getWorkspace(), i18n));
+ $(Application.class).init($(StateManager.class), platform.getIndexedTools());
+ $(Application.class).subscribeActions(platform.getActions());
+ $(Application.class).getWorkspace().attachTools(platform.getTools().iterator());
+ $(Application.class).start();
- private <T> T i(final Class<T> componentType) {
- return builder.getInstance(componentType);
}
-
- private <T> Provider<T> p(final Class<T> componentKey) {
- return builder.getProvider(componentKey);
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -52,10 +52,8 @@
private final Signal<Object> onUserSignOut;
private final Provider<UserServiceAsync> userServiceProvider;
- public SessionImpl(final String userHash, final I18nLanguageDTO initialLanguage,
- final Provider<UserServiceAsync> userServiceProvider) {
+ public SessionImpl(final String userHash, final Provider<UserServiceAsync> userServiceProvider) {
this.userHash = userHash;
- currentLanguage = initialLanguage;
this.userServiceProvider = userServiceProvider;
languagesArray = null;
this.onInitDataReceived = new Signal<InitDataDTO>("initDataReceived");
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -130,5 +130,6 @@
public void setPanel(final Panel panel, final Widget widget) {
panel.clear();
add(panel, widget);
+ doLayoutIfNeeded();
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipHelper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipHelper.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipHelper.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -1,15 +0,0 @@
-package org.ourproject.kune.platf.client.ui;
-
-import com.gwtext.client.widgets.QuickTip;
-import com.gwtext.client.widgets.QuickTips;
-
-public class QuickTipHelper {
-
- public QuickTipHelper() {
- QuickTips.init();
- final QuickTip quickTipInstance = QuickTips.getQuickTip();
- quickTipInstance.setDismissDelay(8000);
- quickTipInstance.setHideDelay(500);
- quickTipInstance.setInterceptTitles(true);
- }
-}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java (from rev 821, trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipHelper.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipHelper.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -0,0 +1,25 @@
+package org.ourproject.kune.platf.client.ui;
+
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.gwtext.client.widgets.QuickTip;
+import com.gwtext.client.widgets.QuickTips;
+
+public class QuickTipsHelper {
+
+ public QuickTipsHelper() {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ if (!QuickTips.isEnabled()) {
+ // If not enabled before by another UI component
+ QuickTips.init();
+ final QuickTip quickTipInstance = QuickTips.getQuickTip();
+ quickTipInstance.setInterceptTitles(true);
+ quickTipInstance.setDismissDelay(7000);
+ quickTipInstance.setHideDelay(400);
+ quickTipInstance.setMinWidth(100);
+ }
+ }
+ });
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -1,5 +1,6 @@
package org.ourproject.kune.platf.client.ui.gridmenu;
+import java.util.ArrayList;
import java.util.HashMap;
import com.allen_sauer.gwt.log.client.Log;
@@ -101,7 +102,7 @@
this.withEndIcon = withEndIcon;
super.setBorder(false);
super.setLayout(new FitLayout());
- //super.setAutoScroll(true);
+ // super.setAutoScroll(true);
if (withTopBar) {
topBar = new Toolbar();
super.setTopToolbar(topBar);
@@ -225,7 +226,7 @@
if (grid != null) {
// grid.setWidth(width - 27);
grid.setWidth(width - 27);
- //super.setWidth(width - 11);
+ // super.setWidth(width - 11);
doLayoutIfNeeded();
}
}
@@ -352,8 +353,17 @@
iconColumn.setFixed(true);
titleColumn.setFixed(false);
endIconColumn.setFixed(true);
- final ColumnConfig[] columnsConfigs = withEndIcon ? new ColumnConfig[] { iconColumn, titleColumn,
- endIconColumn, groupColumn } : new ColumnConfig[] { iconColumn, titleColumn, groupColumn };
+ final ArrayList<ColumnConfig> columnList = new ArrayList<ColumnConfig>();
+ columnList.add(iconColumn);
+ columnList.add(titleColumn);
+ if (grouped) {
+ columnList.add(groupColumn);
+ }
+ if (withEndIcon) {
+ columnList.add(endIconColumn);
+ }
+ ColumnConfig[] columnsConfigs = {};
+ columnsConfigs = columnList.toArray(columnsConfigs);
columnModel = new ColumnModel(columnsConfigs);
grid.setColumnModel(columnModel);
Modified: trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -84,10 +84,10 @@
throws IOException, ServletException {
final String relative = RackHelper.getRelativeURL(request);
- log.debug("REQUEST: " + relative);
+ // log.debug("REQUEST: " + relative);
for (final RequestMatcher matcher : excludes) {
if (matcher.matches(relative)) {
- log.debug("SKIPING!");
+ // log.debug("SKIPING!");
chain.doFilter(request, response);
return;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -29,9 +29,6 @@
import org.ourproject.kune.workspace.client.actions.DetachFromExtensibleWidgetAction;
import org.ourproject.kune.workspace.client.actions.RecalculateWorkspaceAction;
import org.ourproject.kune.workspace.client.actions.ReloadContextAction;
-import org.ourproject.kune.workspace.client.actions.i18n.DoTranslationAction;
-import org.ourproject.kune.workspace.client.actions.i18n.GetLexiconAction;
-import org.ourproject.kune.workspace.client.actions.i18n.GetTranslationAction;
import org.ourproject.kune.workspace.client.actions.i18n.ShowTranslatorAction;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.workspace.Workspace;
@@ -56,10 +53,7 @@
register.addAction(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
new DetachFromExtensibleWidgetAction(workspace));
register.addAction(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET, new ClearExtensibleWidgetAction(workspace));
- register.addAction(WorkspaceEvents.GET_TRANSLATION, new GetTranslationAction(session));
register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n));
- register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n));
- register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n));
register.addAction(WorkspaceEvents.RELOAD_CONTEXT, new ReloadContextAction(stateManager));
register.addAction(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, new RecalculateWorkspaceAction(workspace));
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -21,11 +21,7 @@
package org.ourproject.kune.workspace.client;
public interface WorkspaceEvents {
- public static final String GET_LEXICON = "i18n.getLexicon";
public static final String SHOW_TRANSLATOR = "i18n.ShowTranslator";
- public static final String SHOW_SEARCHER = "ws.ShowSearcher";
- public static final String GET_TRANSLATION = "i18n.GetTranslation";
- public static final String DO_TRANSLATION = "i18n.doTranslation";
public static final String RELOAD_CONTEXT = "ws.ReoloadContext";
public static final String WS_SPLITTER_STARTRESIZING = "ws.SplitterStartResizing";
public static final String WS_SPLITTER_STOPRESIZING = "ws.SplitterStopResizing";
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -19,8 +19,6 @@
*/
package org.ourproject.kune.workspace.client;
-import org.ourproject.kune.platf.client.app.DesktopView;
-import org.ourproject.kune.platf.client.app.ui.DesktopPanel;
import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
@@ -29,19 +27,14 @@
import org.ourproject.kune.workspace.client.editor.TextEditorListener;
import org.ourproject.kune.workspace.client.editor.TextEditorPanel;
import org.ourproject.kune.workspace.client.editor.TextEditorPresenter;
-import org.ourproject.kune.workspace.client.i18n.I18nTranslatorComponent;
-import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPresenter;
-import org.ourproject.kune.workspace.client.i18n.I18nTranslatorView;
import org.ourproject.kune.workspace.client.i18n.LanguageSelectorComponent;
import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPresenter;
import org.ourproject.kune.workspace.client.i18n.LanguageSelectorView;
-import org.ourproject.kune.workspace.client.i18n.ui.I18nTranslatorPanel;
import org.ourproject.kune.workspace.client.i18n.ui.LanguageSelectorPanel;
import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
import org.ourproject.kune.workspace.client.licensefoot.LicensePresenter;
import org.ourproject.kune.workspace.client.licensefoot.LicenseView;
import org.ourproject.kune.workspace.client.licensefoot.ui.LicensePanel;
-import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarListener;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPanel;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPresenter;
@@ -96,12 +89,6 @@
return presenter;
}
- @Deprecated
- public static DesktopView createDesktop(final Workspace workspace, final SiteBarListener listener,
- final Session session) {
- return new DesktopPanel(workspace, listener, session, i18n);
- }
-
public static TextEditor createDocumentEditor(final TextEditorListener listener) {
final TextEditorPresenter presenter = new TextEditorPresenter(listener, true);
final TextEditorPanel panel = new TextEditorPanel(presenter, i18n);
@@ -109,13 +96,6 @@
return presenter;
}
- public static I18nTranslatorComponent createI18nTranslatorComponent() {
- final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter(session);
- final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
public static LanguageSelectorComponent createLanguageSelectorComponent() {
final LanguageSelectorPresenter presenter = new LanguageSelectorPresenter(session);
final LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n);
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/DoTranslationAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/DoTranslationAction.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/DoTranslationAction.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -1,61 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.i18n;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.DoTranslationActionParams;
-import org.ourproject.kune.platf.client.rpc.I18nService;
-import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class DoTranslationAction implements Action<DoTranslationActionParams> {
-
- private final Session session;
- private final I18nUITranslationService i18n;
-
- public DoTranslationAction(final Session session, final I18nUITranslationService i18n) {
- this.session = session;
- this.i18n = i18n;
- }
-
- public void execute(final DoTranslationActionParams params) {
- onDoTranslationAction(params);
- }
-
- private void onDoTranslationAction(final DoTranslationActionParams params) {
- Site.showProgressSaving();
- final I18nServiceAsync server = I18nService.App.getInstance();
- server.setTranslation(session.getUserHash(), params.getId(), params.getText(), new AsyncCallback<String>() {
- public void onFailure(final Throwable caught) {
- Site.hideProgress();
- Site.error(i18n.t("Server error saving translation"));
- }
-
- public void onSuccess(final String result) {
- Site.hideProgress();
- i18n.setTranslationAfterSave(params.getTrKey(), result);
- }
- });
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/GetLexiconAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/GetLexiconAction.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/GetLexiconAction.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -1,57 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.i18n;
-
-import java.util.HashMap;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.rpc.I18nService;
-import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class GetLexiconAction implements Action<String> {
-
- private final I18nUITranslationService i18n;
-
- public GetLexiconAction(final I18nUITranslationService i18n) {
- this.i18n = i18n;
- }
-
- public void execute(final String value) {
- onGetLexicon(value);
- }
-
- private void onGetLexicon(final String language) {
- final I18nServiceAsync server = I18nService.App.getInstance();
- server.getLexicon(language, new AsyncCallback<HashMap<String, String>>() {
- public void onFailure(final Throwable caught) {
- Log.debug("Workspace adaptation to your language failed");
- }
-
- public void onSuccess(final HashMap<String, String> result) {
- i18n.setLexicon(result);
- }
- });
-
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/GetTranslationAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/GetTranslationAction.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/GetTranslationAction.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -1,52 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.i18n;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.GetTranslationActionParams;
-import org.ourproject.kune.platf.client.rpc.I18nService;
-import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
-import org.ourproject.kune.platf.client.state.Session;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class GetTranslationAction implements Action<GetTranslationActionParams> {
- private final Session session;
-
- public GetTranslationAction(final Session session) {
- this.session = session;
- }
-
- public void execute(final GetTranslationActionParams params) {
- onGetTranslation(params.getLanguage(), params.getText());
- }
-
- private void onGetTranslation(final String language, final String text) {
- final I18nServiceAsync server = I18nService.App.getInstance();
- server.getTranslation(session.getUserHash(), language, text, new AsyncCallback<String>() {
- public void onFailure(final Throwable caught) {
- }
-
- public void onSuccess(final String result) {
- }
- });
-
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/ShowTranslatorAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/ShowTranslatorAction.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/i18n/ShowTranslatorAction.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -33,22 +33,22 @@
private final I18nTranslationService i18n;
public ShowTranslatorAction(final Session session, final Workspace workspace, final I18nTranslationService i18n) {
- this.session = session;
- this.workspace = workspace;
- this.i18n = i18n;
+ this.session = session;
+ this.workspace = workspace;
+ this.i18n = i18n;
}
public void execute(final Object value) {
- onShowTranslatorAction();
+ onShowTranslatorAction();
}
private void onShowTranslatorAction() {
- Site.showProgressLoading();
- if (session.isLogged()) {
- workspace.getI18nTranslatorComponent().show();
- } else {
- Site.info(i18n.t("Sign in or register to help with translation"));
- }
- Site.hideProgress();
+ Site.showProgressLoading();
+ if (session.isLogged()) {
+ // workspace.getI18nTranslatorComponent().show();
+ } else {
+ Site.info(i18n.t("Sign in or register to help with translation"));
+ }
+ Site.hideProgress();
}
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslator.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorComponent.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorComponent.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslator.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -0,0 +1,26 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.i18n;
+
+public interface I18nTranslator {
+
+ void show();
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorComponent.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorComponent.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.i18n;
-
-import org.ourproject.kune.platf.client.Component;
-
-public interface I18nTranslatorComponent extends Component {
-
- void show();
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -22,63 +22,81 @@
import org.ourproject.kune.platf.client.PlatformEvents;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dto.DoTranslationActionParams;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
+import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.WorkspaceEvents;
+import org.ourproject.kune.workspace.client.sitebar.Site;
-public class I18nTranslatorPresenter implements I18nTranslatorComponent {
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public class I18nTranslatorPresenter implements I18nTranslator {
private I18nTranslatorView view;
private final Session session;
+ private final I18nServiceAsync i18nService;
+ private final I18nUITranslationService i18n;
- public I18nTranslatorPresenter(final Session session) {
- this.session = session;
+ public I18nTranslatorPresenter(final Session session, final I18nServiceAsync i18nService,
+ final I18nUITranslationService i18n) {
+ this.session = session;
+ this.i18nService = i18nService;
+ this.i18n = i18n;
}
- public void init(final I18nTranslatorView view) {
- this.view = view;
+ public void attachIconToBottomBar(final View view) {
+ DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
+ new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, view));
}
- public View getView() {
- return view;
+ public void doClose() {
+ view.hide();
+ DefaultDispatcher.getInstance().fire(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
+ new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, view));
}
- public Object[][] getLanguages() {
- return session.getLanguagesArray();
+ public void doShowTranslator() {
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
}
- public void show() {
- view.show();
+ public void doTranslation(final String id, final String trKey, final String translation) {
+ Site.showProgressSaving();
+ i18nService.setTranslation(session.getUserHash(), id, translation, new AsyncCallback<String>() {
+ public void onFailure(final Throwable caught) {
+ Site.hideProgress();
+ Site.error(i18n.t("Server error saving translation"));
+ }
+
+ public void onSuccess(final String result) {
+ Site.hideProgress();
+ i18n.setTranslationAfterSave(trKey, result);
+ }
+ });
}
- public void hide() {
- view.hide();
+ public I18nLanguageDTO getLanguage() {
+ return session.getCurrentLanguage();
}
- public void doClose() {
- view.hide();
- DefaultDispatcher.getInstance().fire(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, view));
+ public Object[][] getLanguages() {
+ return session.getLanguagesArray();
}
- public void doTranslation(final String id, final String trKey, final String translation) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.DO_TRANSLATION,
- new DoTranslationActionParams(id, trKey, translation));
+ public View getView() {
+ return view;
}
- public I18nLanguageDTO getLanguage() {
- return session.getCurrentLanguage();
+ public void hide() {
+ view.hide();
}
- public void doShowTranslator() {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
+ public void init(final I18nTranslatorView view) {
+ this.view = view;
}
- public void attachIconToBottomBar(final View view) {
- DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, view));
+ public void show() {
+ view.show();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nUITranslationService.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -21,19 +21,25 @@
import java.util.HashMap;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dto.GetTranslationActionParams;
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.rpc.I18nServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.ui.KuneStringUtils;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
+import org.ourproject.kune.platf.client.ui.Location;
+import org.ourproject.kune.platf.client.ui.WindowUtils;
import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.suco.client.signal.Slot0;
+import com.google.gwt.user.client.rpc.AsyncCallback;
public class I18nUITranslationService extends I18nTranslationService {
private HashMap<String, String> lexicon;
- private String currentLanguage;
-
+ private String currentLanguageCode;
private I18nChangeListenerCollection i18nChangeListeners;
+ private I18nLanguageDTO initialLang;
+ private I18nServiceAsync i18nService;
+ private Session session;
/*
* If a UI element need to be fired when (for instance) the language changes
@@ -41,45 +47,77 @@
* direction, for instance.
*/
public void addI18nChangeListener(final I18nChangeListener listener) {
- if (i18nChangeListeners == null) {
- i18nChangeListeners = new I18nChangeListenerCollection();
- }
- i18nChangeListeners.add(listener);
+ if (i18nChangeListeners == null) {
+ i18nChangeListeners = new I18nChangeListenerCollection();
+ }
+ i18nChangeListeners.add(listener);
}
public void changeCurrentLanguage(final String newLanguage) {
- if (!newLanguage.equals(this.currentLanguage)) {
- setCurrentLanguage(newLanguage);
- changeLocale(newLanguage);
- }
+ if (!newLanguage.equals(this.currentLanguageCode)) {
+ setCurrentLanguage(newLanguage);
+ changeLocale(newLanguage);
+ }
}
public String getCurrentLanguage() {
- return currentLanguage;
+ return currentLanguageCode;
}
+ public I18nLanguageDTO getInitialLang() {
+ return initialLang;
+ }
+
public HashMap<String, String> getLexicon() {
- return lexicon;
+ return lexicon;
}
+ public void init(final I18nServiceAsync i18nService, final Session session, final Slot0 onReady) {
+ this.i18nService = i18nService;
+ this.session = session;
+ final Location loc = WindowUtils.getLocation();
+ final String locale = loc.getParameter("locale");
+ i18nService.getInitialLanguage(locale, new AsyncCallback<I18nLanguageDTO>() {
+ public void onFailure(final Throwable caught) {
+ Log.error("Workspace adaptation to your language failed");
+ }
+
+ public void onSuccess(final I18nLanguageDTO result) {
+ initialLang = result;
+ currentLanguageCode = initialLang.getCode();
+ session.setCurrentLanguage(initialLang);
+ i18nService.getLexicon(initialLang.getCode(), new AsyncCallback<HashMap<String, String>>() {
+ public void onFailure(final Throwable caught) {
+ Log.error("Workspace adaptation to your language failed");
+ }
+
+ public void onSuccess(final HashMap<String, String> result) {
+ lexicon = result;
+ onReady.onEvent();
+ }
+ });
+ }
+ });
+ }
+
public void removeI18nChangeListener(final I18nChangeListener listener) {
- if (i18nChangeListeners != null) {
- i18nChangeListeners.remove(listener);
- }
+ if (i18nChangeListeners != null) {
+ i18nChangeListeners.remove(listener);
+ }
}
public void setCurrentLanguage(final String newLanguage) {
- this.currentLanguage = newLanguage;
+ this.currentLanguageCode = newLanguage;
}
public void setLexicon(final HashMap<String, String> lexicon) {
- this.lexicon = lexicon;
- fireI18nLanguageChange();
+ this.lexicon = lexicon;
+ fireI18nLanguageChange();
}
public void setTranslationAfterSave(final String text, final String translation) {
- lexicon.put(text, translation);
- fireI18nLanguageChange();
+ lexicon.put(text, translation);
+ fireI18nLanguageChange();
}
/**
@@ -94,22 +132,27 @@
* @return text translated in the current language
*/
public String t(final String text) {
- String encodeText = KuneStringUtils.escapeHtmlLight(text);
- String translation = lexicon.get(encodeText);
- if (lexicon.containsKey(encodeText)) {
- if (translation == UNTRANSLATED_VALUE) {
- // Not translated but in db, return text
- translation = removeNT(encodeText);
- }
- } else {
- // Not translated and not in db, make a petition for translation
- DefaultDispatcher.getInstance().fireDeferred(WorkspaceEvents.GET_TRANSLATION,
- new GetTranslationActionParams(this.currentLanguage, text));
- Log.debug("Registering in db '" + text + "' as pending translation");
- translation = removeNT(encodeText);
- lexicon.put(encodeText, UNTRANSLATED_VALUE);
- }
- return decodeHtml(translation);
+ final String encodeText = KuneStringUtils.escapeHtmlLight(text);
+ String translation = lexicon.get(encodeText);
+ if (lexicon.containsKey(encodeText)) {
+ if (translation == UNTRANSLATED_VALUE) {
+ // Not translated but in db, return text
+ translation = removeNT(encodeText);
+ }
+ } else {
+ // Not translated and not in db, make a petition for translation
+ i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text, new AsyncCallback<String>() {
+ public void onFailure(final Throwable caught) {
+ }
+
+ public void onSuccess(final String result) {
+ }
+ });
+ Log.debug("Registering in db '" + text + "' as pending translation");
+ translation = removeNT(encodeText);
+ lexicon.put(encodeText, UNTRANSLATED_VALUE);
+ }
+ return decodeHtml(translation);
}
/**
@@ -158,9 +201,9 @@
}-*/;
private void fireI18nLanguageChange() {
- if (i18nChangeListeners != null) {
- i18nChangeListeners.fireI18nLanguageChange();
- }
+ if (i18nChangeListeners != null) {
+ i18nChangeListeners.fireI18nLanguageChange();
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -36,12 +36,10 @@
private final SiteBarListener listener;
private String previousToken;
private final Session session;
- private final I18nTranslationService i18n;
public SiteBarPresenter(final SiteBarListener listener, final Session session, final I18nTranslationService i18n) {
this.listener = listener;
this.session = session;
- this.i18n = i18n;
}
public void changeState(final StateToken token) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -39,12 +39,13 @@
public ParticipationSummaryPanel(final ParticipationSummaryPresenter presenter, final I18nTranslationService i18n,
final WorkspaceSkeleton ws) {
super(true);
- super.setHeaderText(i18n.t("Participates as..."));
+ // super.setHeaderText(i18n.t("Participates as..."));
+ super.setHeaderText(i18n.t("Participates in..."));
super.setHeaderTitle(i18n.t("Groups in which participates"));
super.setBorderStylePrimaryName("k-dropdownouter-part");
super.addStyleName("kune-Margin-Medium-t");
- gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This user is not member of any group"), true, false, false,
- false, false);
+ gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This user is not member of any group"), false, false,
+ false, false, false);
final EntitySummary entitySummary = ws.getEntitySummary();
entitySummary.addInSummary(this);
entitySummary.addListener(new ContainerListenerAdapter() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -31,8 +31,8 @@
private final Provider<ParticipationSummary> participationSummaryProvider;
private final Provider<GroupSummary> groupSummaryProvider;
private final SitePublicSpaceLink publicSpaceLink;
- private final RateIt rateIt;
- private final RatePresenter ratePresenter;
+ private final Provider<RateIt> rateItProvider;
+ private final Provider<RatePresenter> ratePresenterProvider;
public WorkspaceManager(final SitePublicSpaceLink publicSpaceLink, final EntityLogo entityLogo,
final EntityTitlePresenter entityTitlePresenter, final EntitySubTitlePresenter entitySubTitlePresenter,
@@ -40,7 +40,7 @@
final Provider<GroupMembersSummary> groupMembersSummaryProvider,
final Provider<ParticipationSummary> participationSummaryProvider,
final Provider<TagsSummary> tagsSummaryProvider, final Provider<GroupSummary> groupSummaryProvider,
- final RateIt rateIt, final RatePresenter ratePresenter) {
+ final Provider<RateIt> rateItProvider, final Provider<RatePresenter> rateProvider) {
this.publicSpaceLink = publicSpaceLink;
this.entityLogo = entityLogo;
this.entityTitlePresenter = entityTitlePresenter;
@@ -51,8 +51,8 @@
this.participationSummaryProvider = participationSummaryProvider;
this.tagsProvider = tagsSummaryProvider;
this.groupSummaryProvider = groupSummaryProvider;
- this.rateIt = rateIt;
- this.ratePresenter = ratePresenter;
+ this.rateItProvider = rateItProvider;
+ this.ratePresenterProvider = rateProvider;
wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
entityLogo.setTheme(oldTheme, newTheme);
@@ -82,8 +82,8 @@
groupSummaryProvider.get().setState(state);
tagsProvider.get().setState(state);
wsThemePresenter.setState(state);
- rateIt.setState(state);
- ratePresenter.setState(state);
+ rateItProvider.get().setState(state);
+ ratePresenterProvider.get().setState(state);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -15,5 +15,7 @@
newGroupHyperlink.setTargetHistoryToken(SiteToken.newgroup.toString());
ws.getSiteBar().addSeparator();
ws.getSiteBar().add(newGroupHyperlink);
+ ws.getSiteBar().addSpacer();
+ ws.getSiteBar().addSpacer();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitepublic/SitePublicSpaceLinkPanel.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -39,7 +39,8 @@
});
gotoPublic.setTitle(i18n.t("Leave the workspace and go to the public space of this group")
+ Site.IN_DEVELOPMENT);
- gotoPublic.addStyleName("kune-SiteBarPanel-LabelLink");
+ gotoPublic.addStyleName("k-sitebar-labellink");
+ contentNoPublic.addStyleName("k-sitebar-labellink");
}
public void setContentGotoPublicUrl(final String publicUrl) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -5,10 +5,8 @@
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Hyperlink;
-import com.gwtext.client.widgets.ToolbarButton;
public class SiteSignInLinkPanel implements SiteSignInLinkView {
- private final ToolbarButton loggedUserMenu;
private final Hyperlink signInHyperlink;
public SiteSignInLinkPanel(final SiteSignInLinkPresenter presenter, final I18nUITranslationService i18n,
@@ -16,22 +14,10 @@
signInHyperlink = new Hyperlink();
signInHyperlink.setText(i18n.t("Sign in to collaborate"));
signInHyperlink.setTargetHistoryToken(SiteToken.signin.toString());
- loggedUserMenu = new ToolbarButton("user");
ws.getSiteBar().add(signInHyperlink);
- // ws.getEntityWorkspace().setContainer(loggedUserMenu);
- // loggedUserMenu.render(loggedUserMenu.getElement());
}
- public void setLoggedUserMenuVisible(final boolean visible) {
- loggedUserMenu.setVisible(visible);
- }
-
- public void setLoggedUserName(final String name, final String homePage) {
- loggedUserMenu.setText(name);
- }
-
- public void setVisibleSignInLink(final boolean visible) {
+ public void setVisible(final boolean visible) {
signInHyperlink.setVisible(visible);
}
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -13,13 +13,12 @@
public SiteSignInLinkPresenter(final Session session) {
session.onUserSignIn(new Slot<UserInfoDTO>() {
public void onEvent(final UserInfoDTO user) {
- doAfterSignIn(user);
+ view.setVisible(false);
}
});
session.onUserSignOut(new Slot<Object>() {
public void onEvent(final Object parameter) {
- setLogged(false);
- view.setLoggedUserName("", "");
+ view.setVisible(true);
}
});
}
@@ -30,21 +29,7 @@
public void init(final SiteSignInLinkView view) {
this.view = view;
- setLogged(false);
+ view.setVisible(false);
}
- private void doAfterSignIn(final UserInfoDTO user) {
- if (user == null) {
- setLogged(false);
- } else {
- setLogged(true);
- view.setLoggedUserName(user.getShortName(), user.getHomePage());
- }
- }
-
- private void setLogged(boolean logged) {
- view.setVisibleSignInLink(!logged);
- view.setLoggedUserMenuVisible(logged);
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkView.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkView.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -4,10 +4,6 @@
public interface SiteSignInLinkView extends View {
- void setLoggedUserMenuVisible(boolean visible);
+ void setVisible(boolean visible);
- void setLoggedUserName(String shortName, String homePage);
-
- void setVisibleSignInLink(boolean visible);
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPanel.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPanel.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -16,7 +16,7 @@
final WorkspaceSkeleton ws) {
signOutLabel = new Label();
signOutLabel.setText(i18n.t("Sign out"));
- signOutLabel.addStyleName("kune-SiteBarPanel-LabelLink");
+ signOutLabel.addStyleName("k-sitebar-labellink");
ws.getSiteBar().add(signOutLabel);
signOutLabel.addClickListener(new ClickListener() {
public void onClick(final Widget arg0) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -28,7 +28,7 @@
this.session = session;
this.userServiceProvider = userServiceProvider;
session.onUserSignIn(new Slot<UserInfoDTO>() {
- public void onEvent(final UserInfoDTO parameter) {
+ public void onEvent(final UserInfoDTO userInfoDTO) {
view.setVisible(true);
}
});
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenu.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenu.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenu.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu;
+
+public interface SiteUserMenu {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPanel.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -0,0 +1,43 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu;
+
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.PushButton;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.menu.Menu;
+
+public class SiteUserMenuPanel implements SiteUserMenuView {
+
+ private final PushButton loggedUserMenu;
+ private final Widget separator;
+ private final Menu userMenu;
+
+ public SiteUserMenuPanel(final SiteUserMenuPresenter presenter, final WorkspaceSkeleton ws) {
+ loggedUserMenu = new PushButton("");
+ ws.getSiteBar().add(loggedUserMenu);
+ separator = ws.getSiteBar().addSeparator();
+ userMenu = new Menu();
+ loggedUserMenu.addClickListener(new ClickListener() {
+ public void onClick(final Widget sender) {
+ userMenu.showAt(sender.getAbsoluteLeft(), sender.getAbsoluteTop());
+ }
+ });
+ }
+
+ public void setLoggedUserName(final String name) {
+ loggedUserMenu.setText(name);
+ }
+
+ public void setUseGroupsIsMember(final List<LinkDTO> groupsIsAdmin, final List<LinkDTO> groupsIsCollab) {
+ // TODO Auto-generated method stub
+ }
+
+ public void setVisible(final boolean visible) {
+ loggedUserMenu.setVisible(visible);
+ separator.setVisible(visible);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuPresenter.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -0,0 +1,37 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.state.Session;
+
+import com.calclab.suco.client.signal.Slot;
+
+public class SiteUserMenuPresenter implements SiteUserMenu {
+
+ private SiteUserMenuView view;
+
+ public SiteUserMenuPresenter(final Session session) {
+ session.onUserSignIn(new Slot<UserInfoDTO>() {
+ public void onEvent(final UserInfoDTO userInfoDTO) {
+ view.setVisible(true);
+ view.setLoggedUserName(userInfoDTO.getShortName());
+ view.setUseGroupsIsMember(userInfoDTO.getGroupsIsAdmin(), userInfoDTO.getGroupsIsCollab());
+ }
+ });
+ session.onUserSignOut(new Slot<Object>() {
+ public void onEvent(final Object parameter) {
+ view.setVisible(false);
+ view.setLoggedUserName("");
+ }
+ });
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final SiteUserMenuView view) {
+ this.view = view;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuView.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteusermenu/SiteUserMenuView.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -0,0 +1,16 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteusermenu;
+
+import java.util.List;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.LinkDTO;
+
+public interface SiteUserMenuView extends View {
+
+ void setLoggedUserName(String name);
+
+ void setUseGroupsIsMember(List<LinkDTO> groupsIsAdmin, List<LinkDTO> groupsIsCollab);
+
+ void setVisible(boolean visible);
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -65,10 +65,10 @@
contentBottomBar = new Toolbar();
containerTopBar = new Toolbar();
containerBottomBar = new Toolbar();
- contentTopBar.addClass("k-toolbar-bottom-line");
- contentBottomBar.addClass("k-toolbar-top-line");
- containerTopBar.addClass("k-toolbar-bottom-line");
- containerBottomBar.addClass("k-toolbar-top-line");
+ contentTopBar.addStyleName("k-toolbar-bottom-line");
+ contentBottomBar.addStyleName("k-toolbar-top-line");
+ containerTopBar.addStyleName("k-toolbar-bottom-line");
+ containerBottomBar.addStyleName("k-toolbar-top-line");
contentWrap.add(contentTopBar.getPanel(), Position.NORTH, false, DEF_TOOLBAR_HEIGHT);
containerWrap.add(containerTopBar.getPanel(), Position.NORTH, false, DEF_TOOLBAR_HEIGHT);
contentWrap.add(content, Position.CENTER);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -18,16 +18,16 @@
titleBar.add(widget);
}
- public void addFill() {
- titleBar.addFill();
+ public Widget addFill() {
+ return titleBar.addFill();
}
- public void addSeparator() {
- titleBar.addSeparator();
+ public Widget addSeparator() {
+ return titleBar.addSeparator();
}
- public void addSpacer() {
- titleBar.addSpacer();
+ public Widget addSpacer() {
+ return titleBar.addSpacer();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -1,5 +1,48 @@
package org.ourproject.kune.workspace.client.ui.newtmp.skel;
-public class TitleBar extends AbstractBar {
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
-}
+public class TitleBar extends Composite {
+
+ private final HorizontalPanel childPanel;
+ private final HorizontalPanel mainPanel;
+
+ public TitleBar() {
+ mainPanel = new HorizontalPanel();
+ childPanel = new HorizontalPanel();
+ mainPanel.add(childPanel);
+ initWidget(mainPanel);
+ mainPanel.setWidth("100%");
+ }
+
+ public void add(final Widget widget) {
+ childPanel.add(widget);
+ childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
+ }
+
+ public Widget addFill() {
+ final Label emptyLabel = new Label("");
+ this.add(emptyLabel);
+ childPanel.setCellWidth(emptyLabel, "100%");
+ return emptyLabel;
+ }
+
+ public Widget addSeparator() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-sep");
+ emptyLabel.addStyleName("k-toolbar-sep");
+ this.add(emptyLabel);
+ return emptyLabel;
+ }
+
+ public Widget addSpacer() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-spacer");
+ this.add(emptyLabel);
+ return emptyLabel;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -2,12 +2,14 @@
import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.widgets.Panel;
public class Toolbar {
private final Panel container;
- private final AbstractBar horPanel;
+ private final HorizontalPanel childPanel;
public Toolbar() {
container = new Panel();
@@ -18,31 +20,41 @@
container.setHeader(false);
container.setBaseCls("x-toolbar");
container.addClass("x-panel");
- horPanel = new AbstractBar();
- container.add(horPanel);
+ childPanel = new HorizontalPanel();
+ container.add(childPanel);
}
public void add(final Widget widget) {
- horPanel.add(widget);
+ childPanel.add(widget);
if (container.isRendered()) {
container.doLayout(false);
}
}
- public void addClass(final String cls) {
- container.addClass(cls);
+ public Widget addFill() {
+ final Label emptyLabel = new Label("");
+ this.add(emptyLabel);
+ childPanel.setCellWidth(emptyLabel, "100%");
+ return emptyLabel;
}
- public void addFill() {
- horPanel.addFill();
+ public Widget addSeparator() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-sep");
+ emptyLabel.addStyleName("k-toolbar-sep");
+ this.add(emptyLabel);
+ return emptyLabel;
}
- public void addSeparator() {
- horPanel.addSeparator();
+ public Widget addSpacer() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-spacer");
+ this.add(emptyLabel);
+ return emptyLabel;
}
- public void addSpacer() {
- horPanel.addSpacer();
+ public void addStyleName(final String cls) {
+ container.addClass(cls);
}
public Panel getPanel() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -3,6 +3,7 @@
import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.gwtext.client.core.ExtElement;
import com.gwtext.client.widgets.MessageBox;
@@ -30,6 +31,8 @@
mainPanel.add(sitebar, DefaultBorderLayout.Position.NORTH, DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
mainPanel.add(entity.getPanel(), DefaultBorderLayout.Position.CENTER);
container.add(mainPanel.getPanel());
+ getEntityWorkspace().getContentTopBar().add(new Label("Sorry, kune workspace under heavy refactorization"));
+ new Viewport(container);
}
public Panel getEntityMainHeader() {
@@ -64,10 +67,6 @@
entity.setTheme(oldTheme, newTheme);
}
- public void show() {
- new Viewport(container);
- }
-
public void showAlertMessage(final String title, final String message) {
MessageBox.alert(title, message, new MessageBox.AlertCallback() {
public void execute() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -26,7 +26,6 @@
import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
import org.ourproject.kune.platf.client.tool.ClientTool;
import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-import org.ourproject.kune.workspace.client.i18n.I18nTranslatorComponent;
import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
public interface Workspace extends Component {
@@ -53,8 +52,6 @@
public ContentTitleComponent getContentTitleComponent();
- public I18nTranslatorComponent getI18nTranslatorComponent();
-
public LicenseComponent getLicenseComponent();
public void setContent(WorkspaceComponent contentComponent);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -32,7 +32,6 @@
import org.ourproject.kune.platf.client.tool.ClientTool;
import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.component.WorkspaceComponent;
-import org.ourproject.kune.workspace.client.i18n.I18nTranslatorComponent;
import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
import com.google.gwt.user.client.ui.Widget;
@@ -96,10 +95,6 @@
return components.getContentTitleComponent();
}
- public I18nTranslatorComponent getI18nTranslatorComponent() {
- return components.getI18nTranslatorComponent();
- }
-
public LicenseComponent getLicenseComponent() {
return components.getLicenseComponent();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -21,7 +21,6 @@
package org.ourproject.kune.workspace.client.workspace;
import org.ourproject.kune.workspace.client.WorkspaceFactory;
-import org.ourproject.kune.workspace.client.i18n.I18nTranslatorComponent;
import org.ourproject.kune.workspace.client.licensefoot.LicenseComponent;
public class WorkspaceUIComponents {
@@ -29,7 +28,6 @@
private ContentTitleComponent contentTitle;
private ContentSubTitleComponent contentSubTitle;
private ContentToolBarComponent contentToolBar;
- private I18nTranslatorComponent i18nTranslatorSearch;
public WorkspaceUIComponents(final WorkspacePresenter presenter) {
}
@@ -55,13 +53,6 @@
return contentToolBar;
}
- public I18nTranslatorComponent getI18nTranslatorComponent() {
- if (i18nTranslatorSearch == null) {
- i18nTranslatorSearch = WorkspaceFactory.createI18nTranslatorComponent();
- }
- return i18nTranslatorSearch;
- }
-
public LicenseComponent getLicenseComponent() {
if (license == null) {
license = WorkspaceFactory.createLicenseComponent();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -25,7 +25,6 @@
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.tool.ToolTrigger;
-import org.ourproject.kune.platf.client.ui.DropDownPanel;
import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
import org.ourproject.kune.platf.client.ui.SplitterListener;
import org.ourproject.kune.platf.client.ui.gwtcustom.CustomHorizontalSplitPanel;
@@ -60,9 +59,6 @@
private final VerticalPanel groupDropDownsVP;
private final RoundedBorderDecorator contentTitleBarBorderDec;
private final RoundedBorderDecorator bottomBorderDecorator;
- private DropDownPanel groupMembersPanel;
- private DropDownPanel participationPanel;
- private DropDownPanel groupSummaryPanel;
private final VerticalPanel cntcxtVP;
private final ScrollPanel groupDropDownsSP;
private final BottomIconsTrayPanel bottomIconsTrayPanel;
@@ -74,7 +70,6 @@
private final HorizontalPanel contentBottomToolBarHP;
private ContentBottomToolBarPanel contentBottomToolBarPanel;
private LicensePanel bottomPanel;
- private DropDownPanel tagsPanel;
private int previousRightWidgetWidth;
private final WorkspacePresenter presenter;
@@ -276,12 +271,12 @@
}
public void setGroupMembers(final View view) {
- groupMembersPanel = (DropDownPanel) view;
+ // groupMembersPanel = (DropDownPanel) view;
// AddDropDown(groupMembersPanel, colorTheme.getGroupMembersDD());
}
public void setParticipation(final View view) {
- participationPanel = (DropDownPanel) view;
+ // participationPanel = (DropDownPanel) view;
// AddDropDown(participationPanel, colorTheme.getParticipationDD());
}
@@ -290,12 +285,12 @@
}
public void setSummary(final View view) {
- groupSummaryPanel = (DropDownPanel) view;
+ // groupSummaryPanel = (DropDownPanel) view;
// AddDropDown(groupSummaryPanel, colorTheme.getSummaryDD());
}
public void setTags(final View view) {
- tagsPanel = (DropDownPanel) view;
+ // tagsPanel = (DropDownPanel) view;
// AddDropDown(tagsPanel, colorTheme.getTagsDD());
}
@@ -343,12 +338,6 @@
super.setVisible(visible);
}
- private void AddDropDown(final DropDownPanel panel, final String color) {
- groupDropDownsVP.add(panel);
- panel.setWidth("145px");
- // panel.setColor(color);
- }
-
private void adjustSizeContentSP() {
final int width = cntcxtHSP.getLeftWidgetAvailableWidth() - 2;
final int height = cntcxtHSP.getOffsetHeight() - 29 - contentToolBarHP.getOffsetHeight();
Modified: trunk/src/main/resources/dozerBeanMapping.xml
===================================================================
--- trunk/src/main/resources/dozerBeanMapping.xml 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/main/resources/dozerBeanMapping.xml 2008-07-31 13:28:16 UTC (rev 822)
@@ -307,5 +307,14 @@
<b>abuseInformersCount</b>
</field>
</mapping>
+
+ <mapping>
+ <class-a>org.ourproject.kune.platf.client.dto.LinkDTO</class-a>
+ <class-b>org.ourproject.kune.platf.server.domain.User</class-b>
+ <field>
+ <a>longName</a>
+ <b>name</b>
+ </field>
+ </mapping>
</mappings>
\ No newline at end of file
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-07-28 02:23:02 UTC (rev 821)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-07-31 13:28:16 UTC (rev 822)
@@ -44,199 +44,207 @@
@Before
public void inject() {
- TestHelper.inject(this);
+ TestHelper.inject(this);
}
@Test
public void testCommentMapper() {
- final Content d = createTestContent();
- Comment comment = new Comment();
- comment.setContent(d);
- comment.setText("Some text");
- User user = new User();
- comment.addPositiveVoter(user);
- comment.addPositiveVoter(user);
- CommentDTO commentDTO = mapper.map(comment, CommentDTO.class);
- assertEquals(0, commentDTO.getNegativeVotersCount());
- assertEquals(0, commentDTO.getAbuseInformersCount());
- assertEquals(1, commentDTO.getPositiveVotersCount());
- comment.addNegativeVoter(user);
- comment.addNegativeVoter(user);
- commentDTO = mapper.map(comment, CommentDTO.class);
- assertEquals(1, commentDTO.getNegativeVotersCount());
- assertEquals(0, commentDTO.getAbuseInformersCount());
- assertEquals(0, commentDTO.getPositiveVotersCount());
- comment.addAbuseInformer(user);
- comment.addAbuseInformer(user);
- commentDTO = mapper.map(comment, CommentDTO.class);
- assertEquals(1, commentDTO.getNegativeVotersCount());
- assertEquals(1, commentDTO.getAbuseInformersCount());
- assertEquals(0, commentDTO.getPositiveVotersCount());
- Comment childComment = new Comment();
- childComment.setContent(d);
- childComment.setParent(comment);
- comment.getChilds().add(childComment);
- commentDTO = mapper.map(comment, CommentDTO.class);
- CommentDTO childCommentDTO = mapper.map(childComment, CommentDTO.class);
- assertEquals(1, comment.getChilds().size());
- assertEquals(commentDTO, childCommentDTO.getParent());
+ final Content d = createTestContent();
+ final Comment comment = new Comment();
+ comment.setContent(d);
+ comment.setText("Some text");
+ final User user = new User();
+ comment.addPositiveVoter(user);
+ comment.addPositiveVoter(user);
+ CommentDTO commentDTO = mapper.map(comment, CommentDTO.class);
+ assertEquals(0, commentDTO.getNegativeVotersCount());
+ assertEquals(0, commentDTO.getAbuseInformersCount());
+ assertEquals(1, commentDTO.getPositiveVotersCount());
+ comment.addNegativeVoter(user);
+ comment.addNegativeVoter(user);
+ commentDTO = mapper.map(comment, CommentDTO.class);
+ assertEquals(1, commentDTO.getNegativeVotersCount());
+ assertEquals(0, commentDTO.getAbuseInformersCount());
+ assertEquals(0, commentDTO.getPositiveVotersCount());
+ comment.addAbuseInformer(user);
+ comment.addAbuseInformer(user);
+ commentDTO = mapper.map(comment, CommentDTO.class);
+ assertEquals(1, commentDTO.getNegativeVotersCount());
+ assertEquals(1, commentDTO.getAbuseInformersCount());
+ assertEquals(0, commentDTO.getPositiveVotersCount());
+ final Comment childComment = new Comment();
+ childComment.setContent(d);
+ childComment.setParent(comment);
+ comment.getChilds().add(childComment);
+ commentDTO = mapper.map(comment, CommentDTO.class);
+ final CommentDTO childCommentDTO = mapper.map(childComment, CommentDTO.class);
+ assertEquals(1, comment.getChilds().size());
+ assertEquals(commentDTO, childCommentDTO.getParent());
}
@Test
public void testContentDescriptorMapping() {
- final Content d = new Content();
- d.setId(1l);
- final Revision revision = new Revision(d);
- revision.setTitle("title");
- d.addRevision(revision);
+ final Content d = new Content();
+ d.setId(1l);
+ final Revision revision = new Revision(d);
+ revision.setTitle("title");
+ d.addRevision(revision);
- final ContentDTO dto = mapper.map(d, ContentDTO.class);
- assertEquals(1, (long) dto.getId());
- assertEquals("title", dto.getTitle());
+ final ContentDTO dto = mapper.map(d, ContentDTO.class);
+ assertEquals(1, (long) dto.getId());
+ assertEquals("title", dto.getTitle());
}
@Test
public void testContentDescriptorToLinkMapping() {
- final Content d = createTestContent();
+ final Content d = createTestContent();
- final LinkDTO dto = mapper.map(d, LinkDTO.class);
- assertEquals("title", dto.getLongName());
- assertEquals("grouptest", dto.getShortName());
- assertEquals("grouptest.docs.1.1", dto.getLink());
+ final LinkDTO dto = mapper.map(d, LinkDTO.class);
+ assertEquals("title", dto.getLongName());
+ assertEquals("grouptest", dto.getShortName());
+ assertEquals("grouptest.docs.1.1", dto.getLink());
}
@Test
public void testContentMapping() {
- final State c = new State();
- c.setContentRights(new AccessRights(true, true, true));
- final Group groupAdmins = TestDomainHelper.createGroup(1);
- final Group groupEdit = TestDomainHelper.createGroup(2);
- final Group groupView = TestDomainHelper.createGroup(3);
- c.setAccessLists(TestDomainHelper.createAccessLists(groupAdmins, groupEdit, groupView));
- c.setRate(10.2d);
- c.setRateByUsers(3l);
- c.setCurrentUserRate(null);
+ final State c = new State();
+ c.setContentRights(new AccessRights(true, true, true));
+ final Group groupAdmins = TestDomainHelper.createGroup(1);
+ final Group groupEdit = TestDomainHelper.createGroup(2);
+ final Group groupView = TestDomainHelper.createGroup(3);
+ c.setAccessLists(TestDomainHelper.createAccessLists(groupAdmins, groupEdit, groupView));
+ c.setRate(10.2d);
+ c.setRateByUsers(3l);
+ c.setCurrentUserRate(null);
- final StateDTO dto = mapper.map(c, StateDTO.class);
- assertEquals(c.getContentRights().isAdministrable(), dto.getContentRights().isAdministrable());
+ final StateDTO dto = mapper.map(c, StateDTO.class);
+ assertEquals(c.getContentRights().isAdministrable(), dto.getContentRights().isAdministrable());
- assertValidAccessListsMapping(c.getAccessLists().getAdmins(), dto.getAccessLists().getAdmins());
- assertValidAccessListsMapping(c.getAccessLists().getEditors(), dto.getAccessLists().getEditors());
- assertValidAccessListsMapping(c.getAccessLists().getViewers(), dto.getAccessLists().getViewers());
+ assertValidAccessListsMapping(c.getAccessLists().getAdmins(), dto.getAccessLists().getAdmins());
+ assertValidAccessListsMapping(c.getAccessLists().getEditors(), dto.getAccessLists().getEditors());
+ assertValidAccessListsMapping(c.getAccessLists().getViewers(), dto.getAccessLists().getViewers());
- assertEquals(dto.getRate(), c.getRate());
- assertEquals(dto.getRateByUsers(), c.getRateByUsers());
- assertEquals(dto.getCurrentUserRate(), c.getCurrentUserRate());
+ assertEquals(dto.getRate(), c.getRate());
+ assertEquals(dto.getRateByUsers(), c.getRateByUsers());
+ assertEquals(dto.getCurrentUserRate(), c.getCurrentUserRate());
}
@Test
public void testFolderMapping() {
- final Container container = new Container();
- container.addChild(new Container());
- container.addChild(new Container());
- container.addContent(new Content());
- container.addContent(new Content());
- container.addContent(new Content());
- final Container containerChild = new Container();
- container.addChild(containerChild);
- List<Container> absolutePathChild = new ArrayList<Container>();
- absolutePathChild.add(container);
- containerChild.setAbsolutePath(absolutePathChild);
+ final Container container = new Container();
+ container.addChild(new Container());
+ container.addChild(new Container());
+ container.addContent(new Content());
+ container.addContent(new Content());
+ container.addContent(new Content());
+ final Container containerChild = new Container();
+ container.addChild(containerChild);
+ final List<Container> absolutePathChild = new ArrayList<Container>();
+ absolutePathChild.add(container);
+ containerChild.setAbsolutePath(absolutePathChild);
- final ContainerDTO dto = mapper.map(container, ContainerDTO.class);
- assertEquals(3, dto.getChilds().size());
- assertEquals(3, dto.getContents().size());
- assertTrue(dto.getContents().get(0) instanceof ContentDTO);
- assertTrue(dto.getChilds().get(0) instanceof ContainerDTO);
+ final ContainerDTO dto = mapper.map(container, ContainerDTO.class);
+ assertEquals(3, dto.getChilds().size());
+ assertEquals(3, dto.getContents().size());
+ assertTrue(dto.getContents().get(0) instanceof ContentDTO);
+ assertTrue(dto.getChilds().get(0) instanceof ContainerDTO);
- final ContainerDTO dtoChild = mapper.map(containerChild, ContainerDTO.class);
- assertTrue(dtoChild.getAbsolutePath()[0] instanceof ContainerSimpleDTO);
+ final ContainerDTO dtoChild = mapper.map(containerChild, ContainerDTO.class);
+ assertTrue(dtoChild.getAbsolutePath()[0] instanceof ContainerSimpleDTO);
}
@Test
public void testGroupListMapping() {
- assertMapping(GroupListMode.EVERYONE, GroupListDTO.EVERYONE);
- assertMapping(GroupListMode.NOBODY, GroupListDTO.NOBODY);
- assertMapping(GroupListMode.NORMAL, GroupListDTO.NORMAL);
+ assertMapping(GroupListMode.EVERYONE, GroupListDTO.EVERYONE);
+ assertMapping(GroupListMode.NOBODY, GroupListDTO.NOBODY);
+ assertMapping(GroupListMode.NORMAL, GroupListDTO.NORMAL);
}
@Test
public void testGroupMapping() {
- final Group group = new Group("shortName", "name");
- final GroupDTO dto = mapper.map(group, GroupDTO.class);
- assertEquals(group.getLongName(), dto.getLongName());
- assertEquals(group.getShortName(), dto.getShortName());
+ final Group group = new Group("shortName", "name");
+ final GroupDTO dto = mapper.map(group, GroupDTO.class);
+ assertEquals(group.getLongName(), dto.getLongName());
+ assertEquals(group.getShortName(), dto.getShortName());
}
@Test
public void testLicenseMapping() {
- final License licenseCC = new License("by-nc-nd", "Creative Commons Attribution-NonCommercial-NoDerivs", "cc1",
- "http://creativecommons.org/licenses/by-nc-nd/3.0/", true, false, false, "cc2", "cc3");
+ final License licenseCC = new License("by-nc-nd", "Creative Commons Attribution-NonCommercial-NoDerivs", "cc1",
+ "http://creativecommons.org/licenses/by-nc-nd/3.0/", true, false, false, "cc2", "cc3");
- final License licenseNotCC = new License("gfdl", "GNU Free Documentation License", "nocc1",
- "http://www.gnu.org/copyleft/fdl.html", false, true, false, "nocc2", "nocc3");
+ final License licenseNotCC = new License("gfdl", "GNU Free Documentation License", "nocc1",
+ "http://www.gnu.org/copyleft/fdl.html", false, true, false, "nocc2", "nocc3");
- final LicenseDTO dtoCC = mapper.map(licenseCC, LicenseDTO.class);
- final LicenseDTO dtoNotCC = mapper.map(licenseNotCC, LicenseDTO.class);
+ final LicenseDTO dtoCC = mapper.map(licenseCC, LicenseDTO.class);
+ final LicenseDTO dtoNotCC = mapper.map(licenseNotCC, LicenseDTO.class);
- assertEquals("by-nc-nd", dtoCC.getShortName());
- assertEquals("gfdl", dtoNotCC.getShortName());
- assertEquals("Creative Commons Attribution-NonCommercial-NoDerivs", dtoCC.getLongName());
- assertEquals("GNU Free Documentation License", dtoNotCC.getLongName());
- assertEquals("http://creativecommons.org/licenses/by-nc-nd/3.0/", dtoCC.getUrl());
- assertEquals("http://www.gnu.org/copyleft/fdl.html", dtoNotCC.getUrl());
- assertTrue(dtoCC.isCC());
- assertFalse(dtoNotCC.isCC());
- assertFalse(dtoCC.isCopyleft());
- assertTrue(dtoNotCC.isCopyleft());
- assertFalse(dtoCC.isDeprecated());
- assertFalse(dtoNotCC.isDeprecated());
- assertEquals("cc1", dtoCC.getDescription());
- assertEquals("cc2", dtoCC.getRdf());
- assertEquals("cc3", dtoCC.getImageUrl());
- assertEquals("nocc1", dtoNotCC.getDescription());
- assertEquals("nocc2", dtoNotCC.getRdf());
- assertEquals("nocc3", dtoNotCC.getImageUrl());
+ assertEquals("by-nc-nd", dtoCC.getShortName());
+ assertEquals("gfdl", dtoNotCC.getShortName());
+ assertEquals("Creative Commons Attribution-NonCommercial-NoDerivs", dtoCC.getLongName());
+ assertEquals("GNU Free Documentation License", dtoNotCC.getLongName());
+ assertEquals("http://creativecommons.org/licenses/by-nc-nd/3.0/", dtoCC.getUrl());
+ assertEquals("http://www.gnu.org/copyleft/fdl.html", dtoNotCC.getUrl());
+ assertTrue(dtoCC.isCC());
+ assertFalse(dtoNotCC.isCC());
+ assertFalse(dtoCC.isCopyleft());
+ assertTrue(dtoNotCC.isCopyleft());
+ assertFalse(dtoCC.isDeprecated());
+ assertFalse(dtoNotCC.isDeprecated());
+ assertEquals("cc1", dtoCC.getDescription());
+ assertEquals("cc2", dtoCC.getRdf());
+ assertEquals("cc3", dtoCC.getImageUrl());
+ assertEquals("nocc1", dtoNotCC.getDescription());
+ assertEquals("nocc2", dtoNotCC.getRdf());
+ assertEquals("nocc3", dtoNotCC.getImageUrl());
}
+ @Test
+ public void testUserToLinkMappping() {
+ final User user = new User("shortName", "longName", "", "", null, null, null);
+ final LinkDTO dto = mapper.map(user, LinkDTO.class);
+ assertEquals("shortName", dto.getShortName());
+ assertEquals("longName", dto.getLongName());
+ }
+
private void assertMapping(final GroupListMode mode, final String modeName) {
- final GroupList list = new GroupList();
- list.setMode(mode);
- final GroupListDTO dto = mapper.map(list, GroupListDTO.class);
- assertEquals(modeName, dto.getMode());
- final GroupList listBack = mapper.map(dto, GroupList.class);
- assertEquals(mode, listBack.getMode());
+ final GroupList list = new GroupList();
+ list.setMode(mode);
+ final GroupListDTO dto = mapper.map(list, GroupListDTO.class);
+ assertEquals(modeName, dto.getMode());
+ final GroupList listBack = mapper.map(dto, GroupList.class);
+ assertEquals(mode, listBack.getMode());
}
private void assertValidAccessListsMapping(final GroupList groupList, final GroupListDTO groupListDTO) {
- final List<Group> listOrig = groupList.getList();
- final List<GroupDTO> listDto = groupListDTO.getList();
- assertEquals(listDto.size(), listOrig.size());
- for (int i = 0; i < listDto.size(); i++) {
- final Object object = listDto.get(i);
- assertEquals(GroupDTO.class, object.getClass());
- final GroupDTO d = (GroupDTO) object;
- final Group g = listOrig.get(i);
- assertNotNull(d);
- assertNotNull(g);
- final GroupDTO map = mapper.map(g, GroupDTO.class);
- assertEquals(map, d);
- }
+ final List<Group> listOrig = groupList.getList();
+ final List<GroupDTO> listDto = groupListDTO.getList();
+ assertEquals(listDto.size(), listOrig.size());
+ for (int i = 0; i < listDto.size(); i++) {
+ final Object object = listDto.get(i);
+ assertEquals(GroupDTO.class, object.getClass());
+ final GroupDTO d = (GroupDTO) object;
+ final Group g = listOrig.get(i);
+ assertNotNull(d);
+ assertNotNull(g);
+ final GroupDTO map = mapper.map(g, GroupDTO.class);
+ assertEquals(map, d);
+ }
}
private Content createTestContent() {
- final Group group = new Group("grouptest", "This is a group Test");
- final Container container = new Container();
- container.setId(1l);
- container.setToolName("docs");
- container.setOwner(group);
- container.setName("folder");
- final Content d = new Content();
- d.setId(1l);
- final Revision revision = new Revision(d);
- revision.setTitle("title");
- d.addRevision(revision);
- d.setContainer(container);
- return d;
+ final Group group = new Group("grouptest", "This is a group Test");
+ final Container container = new Container();
+ container.setId(1l);
+ container.setToolName("docs");
+ container.setOwner(group);
+ container.setName("folder");
+ final Content d = new Content();
+ d.setId(1l);
+ final Revision revision = new Revision(d);
+ revision.setTitle("title");
+ d.addRevision(revision);
+ d.setContainer(container);
+ return d;
}
}
1
0
Author: vjrj
Date: 2008-07-28 04:23:02 +0200 (Mon, 28 Jul 2008)
New Revision: 821
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipHelper.java
Modified:
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackedDropDownPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
trunk/src/main/resources/kune.properties
trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java
Log:
Complete - task 25: Make a Quicktip initialization class (for both emite and kune)
Complete - task 17: Theme menus with colors and other themes
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/pom.xml 2008-07-28 02:23:02 UTC (rev 821)
@@ -213,7 +213,6 @@
</dependency>
<!-- jetty dependencies -->
- <!-- for jetty:continuations: -->
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-07-28 02:23:02 UTC (rev 821)
@@ -1787,6 +1787,18 @@
margin-top: 3px;
}
+.kune-Margin-Small-l {
+ margin-left: 3px;
+}
+
+.kune-Margin-Small-r {
+ margin-right: 3px;
+}
+
+.kune-Margin-Small-b {
+ margin-bottom: 3px;
+}
+
.kune-Margin-Mini-trbl {
margin: 1px;
}
@@ -1814,6 +1826,10 @@
margin-right: 1px;
}
+.kune-Margin-Mini-b {
+ margin-bottom: 1px;
+}
+
.kune-Margin-Mini-l {
margin-left: 1px;
}
@@ -2929,7 +2945,7 @@
height: 27px;
}
-.k-entitytextlogo-def .gwt-Label {
+.k-entitytextlogo-default .gwt-Label {
color: #69312F;
}
@@ -2962,7 +2978,7 @@
background-color: #FFF;
}
-.k-entity-def .x-layout-split {
+.k-entity-default .x-layout-split {
background: #DD8A3D none repeat scroll 0% 50%;
}
@@ -2990,7 +3006,7 @@
background: transparent none repeat scroll 0% 50%;
}
-.k-entityworkspace-def .x-layout-split {
+.k-entityworkspace-default .x-layout-split {
background: #DEAA87 none repeat scroll 0% 50%;
}
@@ -3032,7 +3048,7 @@
white-space: nowrap;
}
-.k-entity-title-rd-def {
+.k-entity-title-rd-default {
background: #DD8A3D;
}
@@ -3056,7 +3072,7 @@
background: #D40000;
}
-.k-entity-title-def {
+.k-entity-title-default {
background: #F1BB59 none repeat scroll 0% 50%;
border-left-color: #DD8A3D;
}
@@ -3086,7 +3102,7 @@
border-left-color: #D40000;
}
-.k-entity-title-def div {
+.k-entity-title-default div {
color: #69312F;
}
@@ -3110,7 +3126,7 @@
color: #800000;
}
-.k-entity-subtitle-def {
+.k-entity-subtitle-default {
background: #DD8A3D none repeat scroll 0% 50%;
}
@@ -3134,7 +3150,7 @@
background: #D40000 none repeat scroll 0% 50%;
}
-.k-entity-subtitle-def div {
+.k-entity-subtitle-default div {
color: #FFF;
}
@@ -3158,7 +3174,7 @@
color: #FFF;
}
-.k-entity-bottom-rd-def, .k-entity-bottom-def {
+.k-entity-bottom-rd-default, .k-entity-bottom-default {
background: #DD8A3D;
}
@@ -3188,7 +3204,7 @@
text-decoration: underline;
}
-.k-entity-container-def div {
+.k-entity-container-default div {
background: #FFD09D none repeat scroll 0% 50%;
}
@@ -3270,7 +3286,7 @@
.k-dropdownouter-members {
}
-.k-dropdownouter-members-def {
+.k-dropdownouter-members-default {
background-color: #DF5244;
}
@@ -3297,7 +3313,7 @@
.k-dropdownouter-part {
}
-.k-dropdownouter-part-def {
+.k-dropdownouter-part-default {
background-color: #CA5842;
}
@@ -3324,7 +3340,7 @@
.k-dropdownouter-tags {
}
-.k-dropdownouter-tags-def {
+.k-dropdownouter-tags-default {
background-color: #87501E;
}
@@ -3351,7 +3367,7 @@
.k-dropdownouter-summary {
}
-.k-dropdownouter-summary-def {
+.k-dropdownouter-summary-default {
background-color: #9F734B;
}
@@ -3396,7 +3412,7 @@
margin: 0 3px 0 1px;
}
/* WsTheme */
-.k-wstheme-icon-def {
+.k-wstheme-icon-default {
background: #FF8C00;
}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-28 02:23:02 UTC (rev 821)
@@ -71,7 +71,7 @@
height: 27px;
}
-.k-entitytextlogo-def .gwt-Label {
+.k-entitytextlogo-default .gwt-Label {
color: #69312F;
}
@@ -104,7 +104,7 @@
background-color: #FFF;
}
-.k-entity-def .x-layout-split {
+.k-entity-default .x-layout-split {
background: #DD8A3D none repeat scroll 0% 50%;
}
@@ -132,7 +132,7 @@
background: transparent none repeat scroll 0% 50%;
}
-.k-entityworkspace-def .x-layout-split {
+.k-entityworkspace-default .x-layout-split {
background: #DEAA87 none repeat scroll 0% 50%;
}
@@ -174,7 +174,7 @@
white-space: nowrap;
}
-.k-entity-title-rd-def {
+.k-entity-title-rd-default {
background: #DD8A3D;
}
@@ -198,7 +198,7 @@
background: #D40000;
}
-.k-entity-title-def {
+.k-entity-title-default {
background: #F1BB59 none repeat scroll 0% 50%;
border-left-color: #DD8A3D;
}
@@ -228,7 +228,7 @@
border-left-color: #D40000;
}
-.k-entity-title-def div {
+.k-entity-title-default div {
color: #69312F;
}
@@ -252,7 +252,7 @@
color: #800000;
}
-.k-entity-subtitle-def {
+.k-entity-subtitle-default {
background: #DD8A3D none repeat scroll 0% 50%;
}
@@ -276,7 +276,7 @@
background: #D40000 none repeat scroll 0% 50%;
}
-.k-entity-subtitle-def div {
+.k-entity-subtitle-default div {
color: #FFF;
}
@@ -300,7 +300,7 @@
color: #FFF;
}
-.k-entity-bottom-rd-def, .k-entity-bottom-def {
+.k-entity-bottom-rd-default, .k-entity-bottom-default {
background: #DD8A3D;
}
@@ -330,7 +330,7 @@
text-decoration: underline;
}
-.k-entity-container-def div {
+.k-entity-container-default div {
background: #FFD09D none repeat scroll 0% 50%;
}
@@ -412,7 +412,7 @@
.k-dropdownouter-members {
}
-.k-dropdownouter-members-def {
+.k-dropdownouter-members-default {
background-color: #DF5244;
}
@@ -439,7 +439,7 @@
.k-dropdownouter-part {
}
-.k-dropdownouter-part-def {
+.k-dropdownouter-part-default {
background-color: #CA5842;
}
@@ -466,7 +466,7 @@
.k-dropdownouter-tags {
}
-.k-dropdownouter-tags-def {
+.k-dropdownouter-tags-default {
background-color: #87501E;
}
@@ -493,7 +493,7 @@
.k-dropdownouter-summary {
}
-.k-dropdownouter-summary-def {
+.k-dropdownouter-summary-default {
background-color: #9F734B;
}
@@ -538,7 +538,7 @@
margin: 0 3px 0 1px;
}
/* WsTheme */
-.k-wstheme-icon-def {
+.k-wstheme-icon-default {
background: #FF8C00;
}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css 2008-07-28 02:23:02 UTC (rev 821)
@@ -469,6 +469,18 @@
margin-top: 3px;
}
+.kune-Margin-Small-l {
+ margin-left: 3px;
+}
+
+.kune-Margin-Small-r {
+ margin-right: 3px;
+}
+
+.kune-Margin-Small-b {
+ margin-bottom: 3px;
+}
+
.kune-Margin-Mini-trbl {
margin: 1px;
}
@@ -496,6 +508,10 @@
margin-right: 1px;
}
+.kune-Margin-Mini-b {
+ margin-bottom: 1px;
+}
+
.kune-Margin-Mini-l {
margin-left: 1px;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -102,7 +102,6 @@
logException(e, true);
Site.error(i18n.t("Error performing operation"));
GWT.log("Other kind of exception in StateManagerDefault/processErrorException", null);
- throw new RuntimeException();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -21,6 +21,7 @@
import org.ourproject.kune.platf.client.state.SessionImpl;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.state.StateManagerDefault;
+import org.ourproject.kune.platf.client.ui.QuickTipHelper;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.platf.client.ui.rate.RateItPanel;
import org.ourproject.kune.platf.client.ui.rate.RateItPresenter;
@@ -149,6 +150,14 @@
}
}, SingletonScope.class);
+ builder.registerProvider(QuickTipHelper.class, new Provider<QuickTipHelper>() {
+ public QuickTipHelper get() {
+ return new QuickTipHelper();
+ }
+ }, SingletonScope.class);
+
+ i(QuickTipHelper.class);
+
builder.registerProvider(UserServiceAsync.class, new Provider<UserServiceAsync>() {
public UserServiceAsync get() {
final UserServiceAsync service = (UserServiceAsync) GWT.create(UserService.class);
@@ -479,7 +488,7 @@
public GroupMembersSummary get() {
final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(i18n,
p(StateManager.class), i(ImageUtils.class), i(Session.class),
- p(SocialNetworkServiceAsync.class), p(GroupLiveSearcher.class));
+ p(SocialNetworkServiceAsync.class), p(UserLiveSearcher.class));
final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -105,22 +105,16 @@
vp.setStylePrimaryName(stylePrimaryName);
}
- @Deprecated
- public void setColor(final String color) {
- // outerBorder.setColor(color);
- // DOM.setStyleAttribute(arrowImage.getElement(), "backgroundColor",
- // color);
- // DOM.setStyleAttribute(vp.getElement(), "backgroundColor", color);
- // DOM.setStyleAttribute(titleLabel.getElement(), "backgroundColor",
- // color);
- }
-
public void setContent(final Widget widget) {
contentPanel.setWidget(widget);
// refresh panel
setContentVisible(isContentVisible());
}
+ public void setContentHeight(final String height) {
+ contentPanel.setHeight(height);
+ }
+
public void setContentVisible(final boolean visible) {
if (visible) {
img.arrowDownWhite().applyTo(arrowImage);
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipHelper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipHelper.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipHelper.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -0,0 +1,15 @@
+package org.ourproject.kune.platf.client.ui;
+
+import com.gwtext.client.widgets.QuickTip;
+import com.gwtext.client.widgets.QuickTips;
+
+public class QuickTipHelper {
+
+ public QuickTipHelper() {
+ QuickTips.init();
+ final QuickTip quickTipInstance = QuickTips.getQuickTip();
+ quickTipInstance.setDismissDelay(8000);
+ quickTipInstance.setHideDelay(500);
+ quickTipInstance.setInterceptTitles(true);
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -5,7 +5,6 @@
import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.signal.Signal;
import com.calclab.suco.client.signal.Slot;
-import com.google.gwt.user.client.ui.Composite;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.core.SortDir;
import com.gwtext.client.data.ArrayReader;
@@ -36,7 +35,7 @@
import com.gwtext.client.widgets.grid.event.GridRowListener;
import com.gwtext.client.widgets.layout.FitLayout;
-public class GridMenuPanel<T> extends Composite {
+public class GridMenuPanel<T> extends Panel {
public static final String GRID_MENU_PANEL_DD = "gridMenuPanelDD";
public static final int DEFAULT_INITIAL_WIDTH = 150;
private static final String GROUP = "groupField";
@@ -55,7 +54,6 @@
private RecordDef recordDef;
private GroupingStore store;
private GridPanel grid;
- private final Panel panel;
private final boolean grouped;
private final boolean withCounters;
private final Signal<String> onClick;
@@ -101,20 +99,19 @@
this.grouped = grouped;
this.withCounters = withCounters;
this.withEndIcon = withEndIcon;
- panel = new Panel();
- panel.setBorder(false);
- panel.setLayout(new FitLayout());
+ super.setBorder(false);
+ super.setLayout(new FitLayout());
+ //super.setAutoScroll(true);
if (withTopBar) {
topBar = new Toolbar();
- panel.setTopToolbar(topBar);
+ super.setTopToolbar(topBar);
}
if (withBottomBar) {
bottomBar = new Toolbar();
- panel.setBottomToolbar(bottomBar);
+ super.setBottomToolbar(bottomBar);
}
menuMap = new HashMap<String, GridMenu<T>>();
recordMap = new HashMap<T, Record>();
- initWidget(panel);
}
public GridMenuPanel(final String emptyText, final GridDropConfiguration gridDropConfiguration) {
@@ -172,6 +169,12 @@
};
}
+ public void doLayoutIfNeeded() {
+ if (super.isRendered()) {
+ super.doLayout();
+ }
+ }
+
public Toolbar getBottomBar() {
assert bottomBar != null;
return bottomBar;
@@ -210,9 +213,19 @@
}
}
+ @Override
+ public void setHeight(final int height) {
+ super.setHeight(height);
+ // grid.setHeight(height);
+ doLayoutIfNeeded();
+ }
+
+ @Override
public void setWidth(final int width) {
if (grid != null) {
+ // grid.setWidth(width - 27);
grid.setWidth(width - 27);
+ //super.setWidth(width - 11);
doLayoutIfNeeded();
}
}
@@ -420,7 +433,7 @@
} else {
grid.setDraggable(false);
}
- panel.add(grid);
+ super.add(grid);
}
private void createGridIfNeeded() {
@@ -429,12 +442,6 @@
}
}
- private void doLayoutIfNeeded() {
- if (panel.isRendered()) {
- panel.doLayout();
- }
- }
-
private void onClick(final int rowIndex) {
final Record record = store.getRecordAt(rowIndex);
onClick.fire(record.getAsString(ID));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPanel.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rate/RateItPanel.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -120,7 +120,7 @@
rateGrid.setCellSpacing(0);
rateGrid.setBorderWidth(0);
rateItLabel.addStyleName("kune-Margin-Medium-r");
- rateItLabel.addStyleName("kune-Margin-Medium-l");
+ // rateItLabel.addStyleName("kune-Margin-Medium-l");
rateItLabel.addStyleName("kune-RatePanel-Label");
rateGrid.addStyleName("kune-RatePanel-Stars");
rateGrid.addStyleName("kune-RatePanel-Stars-RateIt");
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackedDropDownPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackedDropDownPanel.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/stacks/StackedDropDownPanel.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -66,7 +66,7 @@
setContent(generalVP);
// Set properties
- super.setColor(borderColor);
+ // super.setColor(borderColor);
setContentVisible(false); // DropDown
setHeaderText(headerText);
setHeaderTitle(headerTitle);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -25,6 +25,7 @@
import com.gwtext.client.widgets.event.ContainerListenerAdapter;
public class GroupMembersSummaryPanel extends DropDownPanel implements GroupMembersSummaryView {
+ // private static final int MAX_HEIGHT = 110;
private final GridMenuPanel<GroupDTO> gridMenuPanel;
private final I18nUITranslationService i18n;
private final GroupMembersSummaryPresenter presenter;
@@ -39,6 +40,7 @@
super.setHeaderTitle(i18n.t("People and groups collaborating in this group"));
super.setBorderStylePrimaryName("k-dropdownouter-members");
super.addStyleName("kune-Margin-Medium-t");
+ // super.addStyleName("kune-Margin-Small-r");
final GridDragConfiguration dragConf = new GridDragConfiguration(UserGridPanel.USER_GROUP_DD, i18n
.t("Drop in the chat area to start a chat.")
@@ -85,6 +87,10 @@
gridMenuPanel.addItem(gridItem);
}
+ public void addToolbarFill() {
+ gridMenuPanel.getBottomBar().addFill();
+ }
+
public void clear() {
gridMenuPanel.removeAll();
for (final ToolbarButton button : buttonsCache.values()) {
@@ -111,12 +117,19 @@
});
}
+ public void setDefaultHeigth() {
+ // super.setContentHeight("");
+ // gridMenuPanel.setHeight("auto");
+ // gridMenuPanel.doLayoutIfNeeded();
+ }
+
public void setDraggable(final boolean draggable) {
// gridMenuPanel.setDraggable(draggable);
}
- public void setDropDownContentVisible(final boolean visible) {
- super.setContentVisible(visible);
+ public void setMaxHeigth() {
+ // super.setContentHeight("" + MAX_HEIGHT);
+ // gridMenuPanel.setHeight(MAX_HEIGHT - 26);
}
public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -20,8 +20,8 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-import org.ourproject.kune.workspace.client.workspace.GroupLiveSearcher;
import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
+import org.ourproject.kune.workspace.client.workspace.UserLiveSearcher;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
@@ -40,7 +40,7 @@
public GroupMembersSummaryPresenter(final I18nUITranslationService i18n,
final Provider<StateManager> stateManagerProvider, final ImageUtils imageUtils, final Session session,
final Provider<SocialNetworkServiceAsync> snServiceProvider,
- final Provider<GroupLiveSearcher> groupLiveSearcherProvider) {
+ final Provider<UserLiveSearcher> userLiveSearcherProvider) {
super(i18n, stateManagerProvider, imageUtils, session, snServiceProvider);
this.i18n = i18n;
this.session = session;
@@ -54,15 +54,16 @@
pendigCategory = new GridGroup(pendingTitle, pendingTitle, i18n
.t("People pending to be accepted in this group by the admins"), imageUtils
.getImageHtml(ImageDescriptor.alert), true);
- addMember = new GridButton("images/add-green.gif", i18n.t("Add member"), i18n
+ // i18n.t("Add member")
+ addMember = new GridButton("images/add-green.gif", "", i18n
.t("Add a group or a person as member of this group"), new Slot<String>() {
public void onEvent(final String parameter) {
- groupLiveSearcherProvider.get().onSelection(new Slot<LinkDTO>() {
+ userLiveSearcherProvider.get().onSelection(new Slot<LinkDTO>() {
public void onEvent(final LinkDTO link) {
view.confirmAddCollab(link.getShortName(), link.getLongName());
}
});
- groupLiveSearcherProvider.get().show();
+ userLiveSearcherProvider.get().show();
}
});
super.addGroupOperation(gotoMemberMenuItem, false);
@@ -117,11 +118,11 @@
final boolean userCanView = rights.isVisible();
boolean userIsMember = isMember(userIsAdmin, userIsCollab);
- view.setDropDownContentVisible(false);
view.clear();
if (userIsAdmin) {
view.addButton(addMember);
+ view.addToolbarFill();
}
view.setDraggable(session.isLogged());
@@ -143,13 +144,24 @@
.addItem(createGridItem(collabCategory, collab, rights, changeToAdminMenuItem,
removeMemberMenuItem));
}
- for (final GroupDTO pendingCollab : pendingCollabsList) {
- view.addItem(createGridItem(pendigCategory, pendingCollab, rights, acceptJoinGroupMenuItem,
- denyJoinGroupMenuItem));
+ if (userIsAdmin) {
+ for (final GroupDTO pendingCollab : pendingCollabsList) {
+ view.addItem(createGridItem(pendigCategory, pendingCollab, rights, acceptJoinGroupMenuItem,
+ denyJoinGroupMenuItem));
+ }
}
}
- view.setDropDownContentVisible(true);
+ setMaxSize(adminsList.size(), collabList.size(), pendingCollabsList.size(), userIsAdmin);
view.setVisible(true);
}
+ private void setMaxSize(final int admins, final int collabs, final int pendingCollabs, final boolean isAdmin) {
+ final int members = admins + collabs + (isAdmin ? pendingCollabs : 0);
+ if (members > 2) {
+ view.setMaxHeigth();
+ } else {
+ view.setDefaultHeigth();
+ }
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -11,13 +11,19 @@
void addItem(GridItem<GroupDTO> gridItem);
+ void addToolbarFill();
+
void clear();
void confirmAddCollab(String groupShortName, String groupLongName);
+ void setContentVisible(boolean visible);
+
+ void setDefaultHeigth();
+
void setDraggable(boolean draggable);
- void setDropDownContentVisible(boolean visible);
+ void setMaxHeigth();
void setTheme(WsTheme oldTheme, WsTheme newTheme);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -65,7 +65,6 @@
public void setState(final StateDTO state) {
final ParticipationDataDTO participation = state.getParticipation();
final AccessRightsDTO rights = state.getGroupRights();
- view.setContentVisible(false);
view.clear();
final List<LinkDTO> groupsIsAdmin = participation.getGroupsIsAdmin();
final List<LinkDTO> groupsIsCollab = participation.getGroupsIsCollab();
@@ -89,7 +88,6 @@
view.addItem(createGridItem(collabCategory, group, rights, unJoinMenuItem));
}
if (numAdmins > 0 || numCollaborators > 0) {
- view.setContentVisible(true);
view.show();
} else {
hide();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -32,6 +32,7 @@
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
@@ -59,7 +60,7 @@
addStyleName("kune-Margin-Medium-t");
flowPanel.addStyleName("kune-Margin-Small-trbl");
ws.getEntitySummary().addInSummary(this);
- ws.unMask();
+ RootPanel.get("kuneinitialcurtain").setVisible(false);
}
public void setTags(final List<TagResultDTO> groupTags) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignInLinkPanel.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -18,7 +18,8 @@
signInHyperlink.setTargetHistoryToken(SiteToken.signin.toString());
loggedUserMenu = new ToolbarButton("user");
ws.getSiteBar().add(signInHyperlink);
- // ws.getSiteBar().add(loggedUserMenu);
+ // ws.getEntityWorkspace().setContainer(loggedUserMenu);
+ // loggedUserMenu.render(loggedUserMenu.getElement());
}
public void setLoggedUserMenuVisible(final boolean visible) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -1,6 +1,5 @@
package org.ourproject.kune.workspace.client.ui.newtmp.skel;
-import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
import org.ourproject.kune.platf.client.ui.RoundedPanel;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
@@ -31,7 +30,6 @@
final Panel bottomPanel = new Panel();
bottomPanel.setBorder(false);
bottomPanel.setLayout(new AnchorLayout());
- ;
title = new TitleBar();
title.setHeight("" + (DEF_TOOLBAR_HEIGHT - 2));
@@ -81,7 +79,7 @@
add(titles, DefaultBorderLayout.Position.NORTH, DEF_TOOLBAR_HEIGHT * 2);
add(contentWrap.getPanel(), DefaultBorderLayout.Position.CENTER);
add(containerWrap.getPanel(), DefaultBorderLayout.Position.EAST, true, 175);
- add(bottomPanel, DefaultBorderLayout.Position.SOUTH, DEF_TOOLBAR_HEIGHT);
+ add(bottomPanel, DefaultBorderLayout.Position.SOUTH, DEF_TOOLBAR_HEIGHT + 2);
}
public TitleBar getBottomTitle() {
@@ -112,12 +110,12 @@
return title;
}
- public void setContainer(final View view) {
- setPanel(container, (Widget) view);
+ public void setContainer(final Widget widget) {
+ setPanel(container, widget);
}
- public void setContent(final View view) {
- setPanel(content, (Widget) view);
+ public void setContent(final Widget widget) {
+ setPanel(content, widget);
}
public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -7,8 +7,6 @@
import com.gwtext.client.core.ExtElement;
import com.gwtext.client.widgets.MessageBox;
import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.QuickTip;
-import com.gwtext.client.widgets.QuickTips;
import com.gwtext.client.widgets.Toolbar;
import com.gwtext.client.widgets.Viewport;
import com.gwtext.client.widgets.layout.FitLayout;
@@ -22,12 +20,6 @@
public WorkspaceSkeleton() {
extRootBody = new ExtElement(RootPanel.getBodyElement());
- mask();
- QuickTips.init(); // extgwt tips
- final QuickTip quickTipInstance = QuickTips.getQuickTip();
- quickTipInstance.setDismissDelay(8000);
- quickTipInstance.setHideDelay(500);
- quickTipInstance.setInterceptTitles(true);
container = new Panel();
container.setLayout(new FitLayout());
container.setBorder(false);
@@ -85,7 +77,6 @@
public void unMask() {
extRootBody.unmask();
- RootPanel.get("kuneinitialcurtain").setVisible(false);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -40,9 +40,8 @@
final WsTheme theme = new WsTheme(themes[i]);
final MenuItem item = new MenuItem();
final String name = theme.getName();
- final String itemText = name.equals("def") ? i18n.t("default") : i18n.t(name);
item.setIconCls("k-wstheme-icon-" + name);
- item.setText(itemText);
+ item.setText(i18n.t(name));
menu.addItem(item);
item.addListener(new BaseItemListenerAdapter() {
@Override
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/main/resources/kune.properties 2008-07-28 02:23:02 UTC (rev 821)
@@ -18,7 +18,8 @@
kune.chat.roomHost = rooms.localhost
# Workspace enabled themes
-kune.wsthemes = def,green,blue,grey,purple,red
-kune.wsthemes.default = def
+# This names are also the name of the items in the theme menu and there are translated
+kune.wsthemes = default,green,blue,grey,purple,red
+kune.wsthemes.default = default
kune.sitelogourl = images/kune-logo-16px.png
\ No newline at end of file
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java 2008-07-27 03:03:11 UTC (rev 820)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/SocialNetworkManagerTest.java 2008-07-28 02:23:02 UTC (rev 821)
@@ -32,7 +32,6 @@
@Test
public void acceptJoinGroup() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.acceptJoinGroup(admin, userGroup, group);
@@ -42,82 +41,75 @@
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getList().size(), 1);
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getMode(), GroupListMode.NORMAL);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
+ closeTransaction();
}
@Test(expected = Exception.class)
public void acceptJoinNotPendingGroupFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.acceptJoinGroup(admin, userGroup, group);
}
@Test(expected = AlreadyGroupMemberException.class)
public void addAdminAsAdminFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.addGroupToAdmins(admin, admin.getUserGroup(), group);
}
@Test(expected = AlreadyGroupMemberException.class)
public void addAdminAsCollabFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.addGroupToCollabs(admin, admin.getUserGroup(), group);
}
@Test(expected = AlreadyGroupMemberException.class)
public void addAdminAsViewerFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.addGroupToViewers(admin, admin.getUserGroup(), group);
}
@Test(expected = Exception.class)
public void addAdminNotAdminFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addGroupToAdmins(otherUser, userGroup, group);
}
@Test(expected = Exception.class)
public void addCollabNotAdminFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addGroupToCollabs(otherUser, userGroup, group);
}
@Test
public void addPendingAsCollabDirectly() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.addGroupToCollabs(admin, userGroup, group);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
+ closeTransaction();
}
@Test
public void addPendingAsCollabDirectlyAsAdmin() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.addGroupToAdmins(admin, userGroup, group);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
+ closeTransaction();
}
@Test(expected = Exception.class)
public void addViewerNotAdminFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addGroupToViewers(otherUser, userGroup, group);
}
@After
public void close() {
if (getTransaction().isActive()) {
- getTransaction().rollback();
+ rollbackTransaction();
}
}
@Test
public void deleteMember() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.acceptJoinGroup(admin, userGroup, group);
@@ -128,18 +120,17 @@
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getMode(), GroupListMode.NOBODY);
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getList().size(), 0);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
+ closeTransaction();
}
@Test(expected = Exception.class)
public void deleteNotMemberFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.deleteMember(admin, userGroup, group);
}
@Test
public void denyJoinGroup() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.denyJoinGroup(admin, userGroup, group);
@@ -148,18 +139,17 @@
assertFalse(group.getSocialNetwork().getAccessLists().getEditors().getList().contains(userGroup));
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getList().size(), 0);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
+ closeTransaction();
}
@Test(expected = AccessViolationException.class)
public void denyJoinGroupNotAdminFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.denyJoinGroup(otherUser, userGroup, group);
}
@Test(expected = Exception.class)
public void denyNotPendingFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.denyJoinGroup(admin, userGroup, group);
}
@@ -167,7 +157,6 @@
@Test(expected = RuntimeException.class)
public void ilegalAdmissionType() throws Exception {
group.setAdmissionType(null);
-
socialNetworkManager.requestToJoin(user, group);
}
@@ -186,18 +175,17 @@
userGroup = user.getUserGroup();
admin = ctx.getUser("admin");
otherUser = ctx.getUser("otheruser");
+ assertSocialNetworkIsEmpty();
}
@Test(expected = LastAdminInGroupException.class)
public void lastAdminUnjoinGroupFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.unJoinGroup(admin.getUserGroup(), group);
}
@Test(expected = AccessViolationException.class)
public void notAdminTryDeleteMember() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.acceptJoinGroup(admin, userGroup, group);
@@ -206,37 +194,36 @@
@Test
public void requestJoinAClosedGroupDeny() throws Exception {
- assertSocialNetworkIsEmpty();
group.setAdmissionType(AdmissionType.Closed);
final String result = socialNetworkManager.requestToJoin(user, group);
assertEquals(result, SocialNetworkDTO.REQ_JOIN_DENIED);
+ closeTransaction();
}
@Test
public void requestJoinAModeratedGroupAddUserGroupToPending() throws Exception {
- assertSocialNetworkIsEmpty();
group.setAdmissionType(AdmissionType.Moderated);
final String result = socialNetworkManager.requestToJoin(user, group);
assertEquals(result, SocialNetworkDTO.REQ_JOIN_WAITING_MODERATION);
assertTrue(group.getSocialNetwork().getPendingCollaborators().getList().contains(userGroup));
+ closeTransaction();
}
@Test
public void requestJoinAOpenGroupAddUserGroupToEditors() throws Exception {
- assertSocialNetworkIsEmpty();
group.setAdmissionType(AdmissionType.Open);
final String result = socialNetworkManager.requestToJoin(user, group);
assertEquals(result, SocialNetworkDTO.REQ_JOIN_ACEPTED);
assertTrue(group.getSocialNetwork().getAccessLists().getEditors().getList().contains(userGroup));
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getMode(), GroupListMode.NORMAL);
+ closeTransaction();
}
@Test
public void requestJoinAOrphanedGroupAddUserGroupToAdmins() throws Exception {
- assertSocialNetworkIsEmpty();
orphanedGroup.setAdmissionType(AdmissionType.Open);
final String result = socialNetworkManager.requestToJoin(user, orphanedGroup);
@@ -245,11 +232,11 @@
assertEquals(orphanedGroup.getSocialNetwork().getAccessLists().getAdmins().getMode(), GroupListMode.NORMAL);
// FIXME Check change group type to PROJECT
+ closeTransaction();
}
@Test(expected = AlreadyGroupMemberException.class)
public void requestJoinTwiceAOrphanedGroupAddUserGroupToAdmins() throws Exception {
- assertSocialNetworkIsEmpty();
orphanedGroup.setAdmissionType(AdmissionType.Open);
final String result = socialNetworkManager.requestToJoin(user, orphanedGroup);
@@ -259,17 +246,16 @@
@Test
public void requestToJoinTwiceDontDuplicatePending() throws Exception {
- assertSocialNetworkIsEmpty();
group.setAdmissionType(AdmissionType.Moderated);
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.requestToJoin(user, group);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 1);
+ closeTransaction();
}
@Test(expected = Exception.class)
public void setAdminAnonMemberFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.setAdminAsCollab(admin, userGroup, group);
@@ -277,7 +263,6 @@
@Test
public void setAdminAsCollab() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.acceptJoinGroup(admin, userGroup, group);
@@ -292,11 +277,11 @@
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getList().size(), 1);
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getMode(), GroupListMode.NORMAL);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
+ closeTransaction();
}
@Test(expected = AccessViolationException.class)
public void setAdminAsCollabNotAdminFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.acceptJoinGroup(admin, userGroup, group);
@@ -305,7 +290,6 @@
@Test(expected = Exception.class)
public void setAdminNotCollabFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.setCollabAsAdmin(admin, userGroup, group);
@@ -313,7 +297,6 @@
@Test
public void setCollabAsAdmin() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.acceptJoinGroup(admin, userGroup, group);
@@ -327,11 +310,11 @@
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getList().size(), 0);
assertEquals(group.getSocialNetwork().getAccessLists().getEditors().getMode(), GroupListMode.NOBODY);
assertEquals(group.getSocialNetwork().getPendingCollaborators().getList().size(), 0);
+ closeTransaction();
}
@Test(expected = AccessViolationException.class)
public void setCollabAsAdminNotAdminFails() throws Exception {
- assertSocialNetworkIsEmpty();
socialNetworkManager.requestToJoin(user, group);
socialNetworkManager.addAdmin(admin, group);
socialNetworkManager.acceptJoinGroup(admin, userGroup, group);
1
0
27 Jul '08
Author: vjrj
Date: 2008-07-27 05:03:11 +0200 (Sun, 27 Jul 2008)
New Revision: 820
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java
Log:
Complete - task 20: EntityLive not show...
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-07-27 03:03:11 UTC (rev 820)
@@ -69,7 +69,7 @@
logException(e);
Site.error(i18n.t("You don't have rights to do that"));
} catch (final SessionExpiredException e) {
- logException(e);
+ logException(e, true);
doSessionExpired();
} catch (final UserMustBeLoggedException e) {
logException(e);
@@ -99,7 +99,7 @@
logException(e);
Site.error(i18n.t("This user is already a member of this group"));
} catch (final Throwable e) {
- logException(e);
+ logException(e, true);
Site.error(i18n.t("Error performing operation"));
GWT.log("Other kind of exception in StateManagerDefault/processErrorException", null);
throw new RuntimeException();
@@ -113,7 +113,15 @@
}
private void logException(final Throwable e) {
- Log.debug("Exception in KuneErrorHandler", e);
+ logException(e, false);
}
+ private void logException(final Throwable e, final boolean showException) {
+ if (showException) {
+ Log.debug("Exception in KuneErrorHandler", e);
+ } else {
+ Log.debug(e.getMessage());
+ }
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-07-27 03:03:11 UTC (rev 820)
@@ -33,6 +33,7 @@
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
+import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Signal;
import com.calclab.suco.client.signal.Slot;
@@ -63,6 +64,7 @@
}
public void check(final AsyncCallbackSimple<?> callback) {
+ Log.debug("Checking session (userhash: " + getUserHash() + ")");
userServiceProvider.get().onlyCheckSession(getUserHash(), callback);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java 2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java 2008-07-27 03:03:11 UTC (rev 820)
@@ -23,16 +23,14 @@
import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.workspace.client.workspace.EntityLiveSearcher;
-import com.calclab.suco.client.signal.Signal;
import com.calclab.suco.client.signal.Slot;
public class EntityLiveSearcherPresenter implements EntityLiveSearcher {
private EntityLiveSearcherView view;
- private Signal<LinkDTO> onSelection;
+ private Slot<LinkDTO> slot;
- public void addListener(final EntityLiveSearchListener listener) {
- this.onSelection = new Signal<LinkDTO>("onSelection");
+ public EntityLiveSearcherPresenter() {
}
public View getView() {
@@ -44,20 +42,15 @@
}
public void onSelection(final LinkDTO link) {
- onSelection.fire(link);
+ slot.onEvent(link);
view.hide();
}
- public void onSelectionAdd(final Slot<LinkDTO> slot) {
- onSelection.add(slot);
+ public void onSelection(final Slot<LinkDTO> slot) {
+ this.slot = slot;
}
- public void onSelectionRemove(final Slot<LinkDTO> slot) {
- onSelection.remove(slot);
- }
-
public void show() {
view.show();
}
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java 2008-07-27 03:03:11 UTC (rev 820)
@@ -14,6 +14,8 @@
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import com.calclab.emiteuimodule.client.users.UserGridPanel;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.BoxComponent;
import com.gwtext.client.widgets.Button;
@@ -65,7 +67,11 @@
button.setTooltip(gridButton.getTooltip());
button.addListener(new ButtonListenerAdapter() {
public void onClick(final Button button, final EventObject e) {
- gridButton.getSlot().onEvent("");
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ gridButton.getSlot().onEvent("");
+ }
+ });
}
});
buttonsCache.put(gridButton, button);
@@ -95,7 +101,11 @@
new MessageBox.ConfirmCallback() {
public void execute(final String btnID) {
if (btnID.equals("yes")) {
- presenter.addCollab(groupShortName);
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ presenter.addCollab(groupShortName);
+ }
+ });
}
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-07-27 03:03:11 UTC (rev 820)
@@ -57,10 +57,9 @@
addMember = new GridButton("images/add-green.gif", i18n.t("Add member"), i18n
.t("Add a group or a person as member of this group"), new Slot<String>() {
public void onEvent(final String parameter) {
- groupLiveSearcherProvider.get().onSelectionAdd(new Slot<LinkDTO>() {
+ groupLiveSearcherProvider.get().onSelection(new Slot<LinkDTO>() {
public void onEvent(final LinkDTO link) {
view.confirmAddCollab(link.getShortName(), link.getLongName());
- groupLiveSearcherProvider.get().onSelectionRemove(this);
}
});
groupLiveSearcherProvider.get().show();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-07-27 03:03:11 UTC (rev 820)
@@ -155,7 +155,7 @@
.t("Change to collaborator"), new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
- snServiceProvider.get().setCollabAsAdmin(session.getUserHash(),
+ snServiceProvider.get().setAdminAsCollab(session.getUserHash(),
session.getCurrentState().getGroup().getShortName(), group.getShortName(),
new AsyncCallbackSimple<SocialNetworkResultDTO>() {
public void onSuccess(final SocialNetworkResultDTO result) {
@@ -189,12 +189,12 @@
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
- snServiceProvider.get().addAdminMember(session.getUserHash(),
+ snServiceProvider.get().setCollabAsAdmin(session.getUserHash(),
session.getCurrentState().getGroup().getShortName(), group.getShortName(),
new AsyncCallbackSimple<SocialNetworkResultDTO>() {
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
- Site.info(i18n.t("Member added as admin"));
+ Site.info(i18n.t("Type of member changed"));
getStateManager().setSocialNetwork(result);
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java 2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java 2008-07-27 03:03:11 UTC (rev 820)
@@ -22,9 +22,11 @@
import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherPresenter;
import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherView;
-import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherPresenter;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
import com.gwtext.client.core.Connection;
import com.gwtext.client.core.Template;
import com.gwtext.client.core.UrlParam;
@@ -138,10 +140,14 @@
cb.addListener(new ComboBoxListenerAdapter() {
public void onSelect(final ComboBox comboBox, final Record record, final int index) {
- final LinkDTO link = new LinkDTO(record.getAsString(SHORT_NAME_FIELD), record
- .getAsString(LONG_NAME_FIELD), record.getAsString(ICON_URL_FIELD), record
- .getAsString(LINK_FIELD));
- presenter.onSelection(link);
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ final LinkDTO link = new LinkDTO(record.getAsString(SHORT_NAME_FIELD), record
+ .getAsString(LONG_NAME_FIELD), record.getAsString(ICON_URL_FIELD), record
+ .getAsString(LINK_FIELD));
+ presenter.onSelection(link);
+ }
+ });
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java 2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java 2008-07-27 03:03:11 UTC (rev 820)
@@ -25,10 +25,8 @@
public interface EntityLiveSearcher {
- void onSelectionAdd(Slot<LinkDTO> slot);
+ void onSelection(Slot<LinkDTO> slot);
- void onSelectionRemove(Slot<LinkDTO> slot);
-
void show();
}
1
0