[kune-commits] r828 - in trunk: .
src/main/java/org/ourproject/kune/app/public
src/main/java/org/ourproject/kune/chat/client
src/main/java/org/ourproject/kune/chat/client/cnt
src/main/java/org/ourproject/kune/chat/client/cnt/info
src/main/java/org/ourproject/kune/chat/client/cnt/info/ui
src/main/java/org/ourproject/kune/chat/client/cnt/room
src/main/java/org/ourproject/kune/chat/client/cnt/room/ui
src/main/java/org/ourproject/kune/chat/client/ctx
src/main/java/org/ourproject/kune/docs/client
src/main/java/org/ourproject/kune/docs/client/actions
src/main/java/org/ourproject/kune/docs/client/cnt
src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/ui
src/main/java/org/ourproject/kune/docs/client/cnt/reader
src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui
src/main/java/org/ourproject/kune/docs/client/ctx
src/main/java/org/ourproject/kune/docs/client/ctx/admin
src/main/java/org/ourproject/kune/docs/client/ctx/admin/ui
src/main/java/org/ourproject/kune/docs/client/ui
src/main/java/org/ourproject/kune/platf/client
src/main/java/org/ourproject/kune/platf/client/app
src/main/java/org/ourproject/kune/platf/client/extend
src/main/java/org/ourproject/kune/platf/client/services
src/main/java/org/ourproject/kune/platf/client/tool
src/main/java/org/ourproject/kune/platf/client/ui
src/main/java/org/ourproject/kune/platf/client/ui/gridmenu
src/test/java/org/ourproject/kune/sitebar/client/msg
src/test/java/org/ourproject/kune/workspace/client
src/test/java/org/ourproject/kune/workspace/client/tags
vjrj
vjrj at ourproject.org
Tue Aug 5 03:29:48 CEST 2008
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 at 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);
+ }
+}
More information about the kune-commits
mailing list