[kune-commits] r810 - in trunk/src/main/java/org/ourproject/kune: docs/client docs/client/cnt/reader/ui docs/client/ui platf/client/app platf/client/app/ui platf/client/services platf/client/state workspace/client workspace/client/actions workspace/client/newgroup/ui workspace/client/presence/ui workspace/client/search workspace/client/sitebar workspace/client/sitebar/msg workspace/client/ui/newtmp/sitebar workspace/client/ui/newtmp/sitebar/siteprogress workspace/client/ui/newtmp/skel

vjrj vjrj at ourproject.org
Mon Jul 21 04:05:46 CEST 2008


Author: vjrj
Date: 2008-07-21 04:05:26 +0200 (Mon, 21 Jul 2008)
New Revision: 810

Added:
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgress.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressView.java
Modified:
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
   trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java
   trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
   trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
   trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
   trunk/src/main/java/org/ourproject/kune/platf/client/app/ui/DesktopPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
   trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
   trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/actions/LoggedInAction.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/actions/LoggedOutAction.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/actions/RecalculateWorkspaceAction.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
Log:
Workspace refactorization

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -6,6 +6,7 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
 import org.ourproject.kune.workspace.client.workspace.TagsSummary;
 
 import com.calclab.suco.client.container.Container;
@@ -27,7 +28,8 @@
 	builder.registerProvider(DocumentFactory.class, new Provider<DocumentFactory>() {
 	    public DocumentFactory get() {
 		return new DocumentFactory(builder.getInstance(I18nUITranslationService.class), builder
-			.getInstance(Session.class), builder.getInstance(TagsSummary.class));
+			.getInstance(Session.class), builder.getInstance(TagsSummary.class), builder
+			.getInstance(WorkspaceSkeleton.class));
 	    }
 	}, SingletonScope.class);
 

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-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/ui/DocumentReaderControlPanel.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -24,7 +24,7 @@
 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.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
 
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.HorizontalPanel;
@@ -35,49 +35,50 @@
     private final CustomPushButton deleteBtn;
     private final CustomPushButton translateBtn;
 
-    public DocumentReaderControlPanel(final DocumentReaderListener listener, final I18nTranslationService i18n) {
-        editBtn = new CustomPushButton(i18n.tWithNT("Edit", "used in button"), new ClickListener() {
-            public void onClick(final Widget sender) {
-                listener.onEdit();
-                editBtn.removeStyleDependentName("up-hovering");
-            }
-        });
+    public DocumentReaderControlPanel(final DocumentReaderListener listener, final I18nTranslationService i18n,
+	    final WorkspaceSkeleton ws) {
+	editBtn = new CustomPushButton(i18n.tWithNT("Edit", "used in button"), new ClickListener() {
+	    public void onClick(final Widget sender) {
+		listener.onEdit();
+		editBtn.removeStyleDependentName("up-hovering");
+	    }
+	});
 
-        deleteBtn = new CustomPushButton(i18n.tWithNT("Delete", "used in button"), new ClickListener() {
-            public void onClick(final Widget sender) {
-                listener.onDelete();
-                deleteBtn.removeStyleDependentName("up-hovering");
-            }
-        });
+	deleteBtn = new CustomPushButton(i18n.tWithNT("Delete", "used in button"), new ClickListener() {
+	    public void onClick(final Widget sender) {
+		listener.onDelete();
+		deleteBtn.removeStyleDependentName("up-hovering");
+	    }
+	});
 
-        translateBtn = new CustomPushButton(i18n.tWithNT("Translate", "used in button"), new ClickListener() {
-            public void onClick(final Widget sender) {
-                listener.onTranslate();
-                translateBtn.removeStyleDependentName("up-hovering");
-                Site.showAlertMessage(i18n.t("Sorry, this functionality is currently in development"));
-            }
-        });
+	translateBtn = new CustomPushButton(i18n.tWithNT("Translate", "used in button"), new ClickListener() {
+	    public void onClick(final Widget sender) {
+		listener.onTranslate();
+		translateBtn.removeStyleDependentName("up-hovering");
+		ws.showAlertMessage(i18n.t("Alert"), i18n.t("Sorry, this functionality is currently in development"));
+	    }
+	});
 
-        add(editBtn);
-        add(deleteBtn);
-        add(translateBtn);
-        deleteBtn.addStyleName("kune-Button-Small-lSpace");
-        translateBtn.addStyleName("kune-Button-Small-lSpace");
-        setEditEnabled(false);
-        setDeleteEnabled(false);
-        setTranslateEnabled(false);
+	add(editBtn);
+	add(deleteBtn);
+	add(translateBtn);
+	deleteBtn.addStyleName("kune-Button-Small-lSpace");
+	translateBtn.addStyleName("kune-Button-Small-lSpace");
+	setEditEnabled(false);
+	setDeleteEnabled(false);
+	setTranslateEnabled(false);
     }
 
     public void setDeleteEnabled(final boolean isEnabled) {
-        deleteBtn.setVisible(isEnabled);
+	deleteBtn.setVisible(isEnabled);
     }
 
     public void setEditEnabled(final boolean isEnabled) {
-        editBtn.setVisible(isEnabled);
+	editBtn.setVisible(isEnabled);
     }
 
     public void setTranslateEnabled(final boolean isEnabled) {
-        translateBtn.setVisible(isEnabled);
+	translateBtn.setVisible(isEnabled);
     }
 
 }

Modified: 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-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -52,6 +52,7 @@
 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;
 
 public class DocumentFactory {
@@ -59,11 +60,14 @@
     private final I18nTranslationService i18n;
     private final Session session;
     private final TagsSummary tags;
+    private final WorkspaceSkeleton ws;
 
-    public DocumentFactory(final I18nTranslationService i18n, final Session session, final TagsSummary tags) {
+    public DocumentFactory(final I18nTranslationService i18n, final Session session, final TagsSummary tags,
+	    final WorkspaceSkeleton ws) {
 	this.i18n = i18n;
 	this.session = session;
 	this.tags = tags;
+	this.ws = ws;
     }
 
     public AdminContext createAdminContext() {
@@ -92,7 +96,7 @@
     }
 
     public DocumentReaderControl createDocumentReaderControl(final DocumentReaderListener listener) {
-	final DocumentReaderControlView view = new DocumentReaderControlPanel(listener, i18n);
+	final DocumentReaderControlView view = new DocumentReaderControlPanel(listener, i18n, ws);
 	final DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter(view);
 	return presenter;
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -57,7 +57,6 @@
 	final Session session = kune.getSession();
 
 	Site.showProgressLoading();
-	Site.mask();
 
 	final KunePlatform platform = kune.getPlatform();
 	final StateManager stateManager = kune.getStateManager();
@@ -66,6 +65,7 @@
 
 	// Temporary new ws
 	final WorkspaceSkeleton ws = kune.getInstance(WorkspaceSkeleton.class);
+	ws.mask();
 
 	ws.show();
 	ws.getEntityWorkspace().getContentTopBar().add(new Label("Sorry, kune workspace under heavy refactorization"));

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationDefault.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -26,7 +26,6 @@
 
 import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
 import org.ourproject.kune.platf.client.dispatch.Dispatcher;
-import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
 import org.ourproject.kune.platf.client.services.ColorTheme;
 import org.ourproject.kune.platf.client.services.I18nTranslationService;
@@ -36,7 +35,6 @@
 import org.ourproject.kune.platf.client.tool.ClientTool;
 import org.ourproject.kune.workspace.client.WorkspaceEvents;
 import org.ourproject.kune.workspace.client.WorkspaceFactory;
-import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarListener;
 import org.ourproject.kune.workspace.client.workspace.Workspace;
 
 public class ApplicationDefault implements Application {
@@ -46,51 +44,52 @@
     private StateManager stateManager;
 
     public ApplicationDefault(final Session session, final ExtensibleWidgetsManager extensionPointManager,
-            final I18nTranslationService i18n, final ColorTheme colorTheme, final KuneErrorHandler errorHandler) {
-        workspace = WorkspaceFactory.createWorkspace(session, extensionPointManager, i18n, colorTheme, errorHandler);
-        tools = new HashMap<String, ClientTool>();
-        DesktopView desktop = WorkspaceFactory.createDesktop(workspace, new SiteBarListener() {
-            public void onChangeState(StateToken token) {
-                stateManager.setState(token);
-            }
+	    final I18nTranslationService i18n, final ColorTheme colorTheme, final KuneErrorHandler errorHandler) {
+	workspace = WorkspaceFactory.createWorkspace(session, extensionPointManager, i18n, colorTheme, errorHandler);
+	tools = new HashMap<String, ClientTool>();
+	// DesktopView desktop = WorkspaceFactory.createDesktop(workspace, new
+	// SiteBarListener() {
+	// public void onChangeState(StateToken token) {
+	// stateManager.setState(token);
+	// }
+	//
+	// public void onUserLoggedOut() {
+	// dispatcher.fire(WorkspaceEvents.USER_LOGGED_OUT, null);
+	// }
+	// }, session);
+	// desktop.attach();
 
-            public void onUserLoggedOut() {
-                dispatcher.fire(WorkspaceEvents.USER_LOGGED_OUT, null);
-            }
-        }, session);
-        desktop.attach();
-
     }
 
     public ClientTool getTool(final String toolName) {
-        return tools.get(toolName);
+	return tools.get(toolName);
     }
 
     public Workspace getWorkspace() {
-        return workspace;
+	return workspace;
     }
 
     public void init(final DefaultDispatcher dispatcher, final StateManager stateManager,
-            final HashMap<String, ClientTool> tools) {
-        this.dispatcher = dispatcher;
-        this.stateManager = stateManager;
-        this.tools = tools;
-        workspace.attachTools(tools.values().iterator());
+	    final HashMap<String, ClientTool> tools) {
+	this.dispatcher = dispatcher;
+	this.stateManager = stateManager;
+	this.tools = tools;
+	workspace.attachTools(tools.values().iterator());
     }
 
     public void setGroupState(final String groupShortName) {
-        Iterator<ClientTool> iterator = tools.values().iterator();
-        while (iterator.hasNext()) {
-            ClientTool tool = iterator.next();
-            tool.setGroupState(groupShortName);
-        }
+	final Iterator<ClientTool> iterator = tools.values().iterator();
+	while (iterator.hasNext()) {
+	    final ClientTool tool = iterator.next();
+	    tool.setGroupState(groupShortName);
+	}
     }
 
     public void start() {
-        dispatcher.fireDeferred(WorkspaceEvents.START_APP, null);
+	dispatcher.fireDeferred(WorkspaceEvents.START_APP, null);
     }
 
     public void stop() {
-        dispatcher.fire(WorkspaceEvents.STOP_APP, null);
+	dispatcher.fire(WorkspaceEvents.STOP_APP, null);
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ui/DesktopPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ui/DesktopPanel.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ui/DesktopPanel.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -23,8 +23,6 @@
 import org.ourproject.kune.platf.client.app.DesktopView;
 import org.ourproject.kune.platf.client.services.I18nTranslationService;
 import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.sitebar.SiteBarFactory;
-import org.ourproject.kune.workspace.client.sitebar.bar.SiteBar;
 import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarListener;
 import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessage;
 import org.ourproject.kune.workspace.client.workspace.Workspace;
@@ -34,65 +32,68 @@
 import com.google.gwt.user.client.ui.AbsolutePanel;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.widgets.QuickTip;
-import com.gwtext.client.widgets.QuickTips;
 
+ at Deprecated
 public class DesktopPanel extends AbsolutePanel implements DesktopView {
 
     public DesktopPanel(final Workspace workspace, final SiteBarListener listener, final Session session,
-            final I18nTranslationService i18n) {
-        QuickTips.init(); // extgwt tips
-        QuickTip quickTipInstance = QuickTips.getQuickTip();
-        quickTipInstance.setDismissDelay(8000);
-        quickTipInstance.setHideDelay(500);
-        quickTipInstance.setInterceptTitles(true);
-        SiteBar siteBar = SiteBarFactory.createSiteBar(listener, session, i18n);
-        SiteMessage siteMessage = SiteBarFactory.getSiteMessage();
-        this.add((Widget) siteMessage.getView(), calculateMessageWidth(Window.getClientWidth()),
-                calculateMessageHeight());
-        this.add((Widget) siteBar.getView(), 0, 0);
-        this.add((Widget) workspace.getView(), 0, 20);
-        this.addStyleName("kunebody");
-        initResizeListener(this, workspace, siteMessage);
-        resizeDesktop(this, workspace, siteMessage, Window.getClientWidth(), Window.getClientHeight());
+	    final I18nTranslationService i18n) {
+	// QuickTips.init(); // extgwt tips
+	// final QuickTip quickTipInstance = QuickTips.getQuickTip();
+	// quickTipInstance.setDismissDelay(8000);
+	// quickTipInstance.setHideDelay(500);
+	// quickTipInstance.setInterceptTitles(true);
+	// SiteBar siteBar = SiteBarFactory.createSiteBar(listener, session,
+	// i18n);
+	// final SiteMessage siteMessage = SiteBarFactory.getSiteMessage();
+	// this.add((Widget) siteMessage.getView(),
+	// calculateMessageWidth(Window.getClientWidth()),
+	// calculateMessageHeight());
+	// this.add((Widget) siteBar.getView(), 0, 0);
+	this.add((Widget) workspace.getView(), 0, 20);
+	this.addStyleName("kunebody");
+	// initResizeListener(this, workspace, siteMessage);
+	// resizeDesktop(this, workspace, siteMessage, Window.getClientWidth(),
+	// Window.getClientHeight());
     }
 
     public void attach() {
-        RootPanel.get().add(this);
+	RootPanel.get().add(this);
     }
 
     private int calculateMessageHeight() {
-        return 2;
+	return 2;
     }
 
     private int calculateMessageWidth(final int width) {
-        return width * 20 / 100 - 10;
+	return width * 20 / 100 - 10;
     }
 
     private void initResizeListener(final AbsolutePanel desktop, final Workspace workspace,
-            final SiteMessage siteMessage) {
-        Window.addWindowResizeListener(new WindowResizeListener() {
-            public void onWindowResized(final int width, final int height) {
-                resizeDesktop(desktop, workspace, siteMessage, width, height);
-            }
-        });
+	    final SiteMessage siteMessage) {
+	Window.addWindowResizeListener(new WindowResizeListener() {
+	    public void onWindowResized(final int width, final int height) {
+		resizeDesktop(desktop, workspace, siteMessage, width, height);
+	    }
+	});
     }
 
     private void resizeDesktop(final AbsolutePanel desktop, final Workspace workspace, final SiteMessage siteMessage,
-            final int clientWidth, final int clientHeight) {
-        int width = workspace.calculateWidth(clientWidth);
-        int height = workspace.calculateHeight(clientHeight);
-        final boolean scroll = width <= Workspace.MIN_WIDTH || height <= Workspace.MIN_HEIGHT ? true : false;
-        Window.enableScrolling(scroll);
-        if (scroll) {
-            desktop.setSize("" + width, "" + height);
-        } else {
-            desktop.setSize("100%", "100%");
-        }
-        workspace.adjustSize(width, height);
-        siteMessage.adjustWidth(width);
-        desktop.setWidgetPosition((Widget) siteMessage.getView(), calculateMessageWidth(width),
-                calculateMessageHeight());
+	    final int clientWidth, final int clientHeight) {
+	final int width = workspace.calculateWidth(clientWidth);
+	final int height = workspace.calculateHeight(clientHeight);
+	final boolean scroll = width <= Workspace.MIN_WIDTH || height <= Workspace.MIN_HEIGHT ? true : false;
+	Window.enableScrolling(scroll);
+	if (scroll) {
+	    desktop.setSize("" + width, "" + height);
+	} else {
+	    desktop.setSize("100%", "100%");
+	}
+	workspace.adjustSize(width, height);
+	// siteMessage.adjustWidth(width);
+	// desktop.setWidgetPosition((Widget) siteMessage.getView(),
+	// calculateMessageWidth(width),
+	// calculateMessageHeight());
     }
 
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -31,18 +31,27 @@
 import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
 
+import com.calclab.suco.client.container.Provider;
 import com.google.gwt.core.client.GWT;
 
 public class KuneErrorHandler {
     private final Session session;
     private final I18nTranslationService i18n;
+    private final Provider<WorkspaceSkeleton> wsProvider;
 
-    public KuneErrorHandler(final Session session, final I18nTranslationService i18n) {
+    public KuneErrorHandler(final Session session, final I18nTranslationService i18n,
+	    final Provider<WorkspaceSkeleton> wsProvider) {
 	this.session = session;
 	this.i18n = i18n;
+	this.wsProvider = wsProvider;
     }
 
+    public WorkspaceSkeleton getWorkspaceSkeleton() {
+	return wsProvider.get();
+    }
+
     public void process(final Throwable caught) {
 	Site.hideProgress();
 	try {
@@ -64,8 +73,10 @@
 	    Site.error(i18n.t("Content not found"));
 	    DefaultDispatcher.getInstance().fire(PlatformEvents.GOTO, "");
 	} catch (final LastAdminInGroupException e) {
-	    Site.showAlertMessage(i18n.t("Sorry, you are the last admin of this group."
-		    + " Look for someone to substitute you appropriately as admin before unjoin this group."));
+	    getWorkspaceSkeleton().showAlertMessage(
+		    i18n.t("Warning"),
+		    i18n.t("Sorry, you are the last admin of this group."
+			    + " Look for someone to substitute you appropriately as admin before unjoin this group."));
 	} catch (final AlreadyGroupMemberException e) {
 	    Site.error(i18n.t("This group is already a group member"));
 	} catch (final AlreadyUserMemberException e) {
@@ -79,7 +90,8 @@
 
     private void doSessionExpired() {
 	Site.doLogout();
-	Site.showAlertMessage(i18n.t("Your session has expired. Please login again."));
+	getWorkspaceSkeleton().showAlertMessage(i18n.t("Session expired"),
+		i18n.t("Your session has expired. Please login again."));
     }
 
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -24,6 +24,10 @@
 import org.ourproject.kune.workspace.client.search.SiteSearcherPresenter;
 import org.ourproject.kune.workspace.client.search.SiteSearcherView;
 import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessage;
+import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePanel;
+import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePresenter;
+import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessageView;
 import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPanelNew;
 import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenterNew;
 import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryViewNew;
@@ -46,6 +50,9 @@
 import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteoptions.SiteOptions;
 import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteoptions.SiteOptionsPanel;
 import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteoptions.SiteOptionsPresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress.SiteProgress;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress.SiteProgressPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress.SiteProgressPresenter;
 import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLink;
 import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLinkPanel;
 import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLinkPresenter;
@@ -129,13 +136,19 @@
 	final I18nUITranslationService i18n = builder.getInstance(I18nUITranslationService.class);
 	builder.registerProvider(KuneErrorHandler.class, new Provider<KuneErrorHandler>() {
 	    public KuneErrorHandler get() {
-		return new KuneErrorHandler(builder.getInstance(Session.class), i18n);
+		return new KuneErrorHandler(builder.getInstance(Session.class), i18n, builder
+			.getProvider(WorkspaceSkeleton.class));
 	    }
 	}, SingletonScope.class);
 
+	builder.registerProvider(WorkspaceSkeleton.class, new Provider<WorkspaceSkeleton>() {
+	    public WorkspaceSkeleton get() {
+		return new WorkspaceSkeleton();
+	    }
+	}, SingletonScope.class);
+
 	final KuneErrorHandler errorHandler = builder.getInstance(KuneErrorHandler.class);
 	AsyncCallbackSimple.init(errorHandler);
-	Site.init(i18n);
 
 	builder.registerProvider(ColorTheme.class, new Provider<ColorTheme>() {
 	    public ColorTheme get() {
@@ -165,12 +178,6 @@
 	    }
 	}, SingletonScope.class);
 
-	builder.registerProvider(WorkspaceSkeleton.class, new Provider<WorkspaceSkeleton>() {
-	    public WorkspaceSkeleton get() {
-		return new WorkspaceSkeleton();
-	    }
-	}, SingletonScope.class);
-
 	final WorkspaceSkeleton ws = builder.getInstance(WorkspaceSkeleton.class);
 
 	builder.registerProvider(SitePublicSpaceLink.class, new Provider<SitePublicSpaceLink>() {
@@ -183,6 +190,34 @@
 	    }
 	}, SingletonScope.class);
 
+	builder.registerProvider(SiteProgress.class, new Provider<SiteProgress>() {
+	    public SiteProgress get() {
+		final SiteProgressPresenter presenter = new SiteProgressPresenter();
+		final SiteProgressPanel panel = new SiteProgressPanel(presenter, builder
+			.getProvider(SitePublicSpaceLink.class));
+		presenter.init(panel);
+		return presenter;
+	    }
+	}, SingletonScope.class);
+
+	builder.registerProvider(Site.class, new Provider<Site>() {
+	    public Site get() {
+		return new Site(i18n, builder.getInstance(SiteProgress.class), builder.getProvider(SiteMessage.class));
+	    }
+	}, SingletonScope.class);
+
+	builder.registerProvider(SiteMessage.class, new Provider<SiteMessage>() {
+	    public SiteMessage get() {
+		final SiteMessagePresenter siteMessagePresenter = new SiteMessagePresenter();
+		final SiteMessageView siteMessageView = new SiteMessagePanel(siteMessagePresenter, true, i18n);
+		siteMessagePresenter.init(siteMessageView);
+		return siteMessagePresenter;
+	    }
+	}, SingletonScope.class);
+
+	builder.getInstance(SiteProgress.class);
+	builder.getInstance(Site.class);
+
 	builder.registerProvider(SiteSignInLink.class, new Provider<SiteSignInLink>() {
 	    public SiteSignInLink get() {
 		final SiteSignInLinkPresenter presenter = new SiteSignInLinkPresenter();
@@ -248,6 +283,7 @@
 
 	builder.getInstance(SitePublicSpaceLink.class);
 	builder.getInstance(SiteSignInLink.class);
+
 	builder.getInstance(SiteSignOutLink.class);
 	builder.getInstance(SiteNewGroupLink.class);
 	builder.getInstance(SiteSearch.class);

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -143,7 +143,6 @@
 	final String toolName = state.getToolName();
 	workspace.setTool(toolName);
 
-	Site.sitebar.setState(state);
 	final ClientTool clientTool = app.getTool(toolName);
 	clientTool.setContent(state);
 	clientTool.setContext(state);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -120,6 +120,7 @@
 	return presenter;
     }
 
+    @Deprecated
     public static DesktopView createDesktop(final Workspace workspace, final SiteBarListener listener,
 	    final Session session) {
 	return new DesktopPanel(workspace, listener, session, i18n);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -36,7 +36,6 @@
 import com.allen_sauer.gwt.log.client.Log;
 import com.google.gwt.user.client.Timer;
 import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.ui.RootPanel;
 
 public class InitAction implements Action<Object> {
     private final Session session;
@@ -80,9 +79,6 @@
 		} else {
 		    dispatcher.fire(WorkspaceEvents.USER_LOGGED_IN, currentUser);
 		}
-		RootPanel.get("kuneinitialcurtain").setVisible(false);
-
-		Site.unMask();
 	    }
 
 	    private void checkChatDomain(final String chatDomain) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/LoggedInAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/LoggedInAction.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/LoggedInAction.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -27,7 +27,6 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.sitebar.Site;
 
 import com.google.gwt.user.client.Cookies;
 
@@ -37,30 +36,30 @@
     private final I18nUITranslationService i18n;
 
     public LoggedInAction(final Session session, final StateManager stateManager, final I18nUITranslationService i18n) {
-        this.session = session;
-        this.stateManager = stateManager;
-        this.i18n = i18n;
+	this.session = session;
+	this.stateManager = stateManager;
+	this.i18n = i18n;
     }
 
     public void execute(final UserInfoDTO value) {
-        onLoggedIn(value);
+	onLoggedIn(value);
     }
 
     private void onLoggedIn(final UserInfoDTO userInfoDTO) {
-        setCookie(userInfoDTO);
-        session.setUserHash(userInfoDTO.getUserHash());
-        Site.sitebar.showLoggedUser(userInfoDTO);
-        I18nLanguageDTO language = userInfoDTO.getLanguage();
-        stateManager.reload();
-        i18n.changeCurrentLanguage(language.getCode());
-        session.setCurrentLanguage(language);
+	setCookie(userInfoDTO);
+	session.setUserHash(userInfoDTO.getUserHash());
+	// FIXME ite.sitebar.showLoggedUser(userInfoDTO);
+	final I18nLanguageDTO language = userInfoDTO.getLanguage();
+	stateManager.reload();
+	i18n.changeCurrentLanguage(language.getCode());
+	session.setCurrentLanguage(language);
     }
 
     private void setCookie(final UserInfoDTO userInfoDTO) {
-        // http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ
-        String sessionId = userInfoDTO.getUserHash();
-        final long duration = Session.SESSION_DURATION;
-        Date expires = new Date(System.currentTimeMillis() + duration);
-        Cookies.setCookie("userHash", sessionId, expires, null, "/", false);
+	// http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ
+	final String sessionId = userInfoDTO.getUserHash();
+	final long duration = Session.SESSION_DURATION;
+	final Date expires = new Date(System.currentTimeMillis() + duration);
+	Cookies.setCookie("userHash", sessionId, expires, null, "/", false);
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/LoggedOutAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/LoggedOutAction.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/LoggedOutAction.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -24,7 +24,6 @@
 import org.ourproject.kune.platf.client.dispatch.Action;
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.sitebar.Site;
 
 import com.google.gwt.user.client.Cookies;
 
@@ -35,19 +34,19 @@
     private final StateManager stateManager;
 
     public LoggedOutAction(final Session session, final StateManager stateManager) {
-        this.session = session;
-        this.stateManager = stateManager;
+	this.session = session;
+	this.stateManager = stateManager;
     }
 
     public void execute(final Object value) {
-        // FIXME: Remove cookie doesn't works in all browsers, know issue:
-        // http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/ded86778ee56690/515dc513c7d085eb?lnk=st&q=remove+cookie#515dc513c7d085eb
-        // http://code.google.com/p/google-web-toolkit/issues/detail?id=1735&q=removeCookie
-        Cookies.removeCookie("userHash");
-        // Workaround:
-        Cookies.setCookie("userHash", null, new Date(0), null, "/", false);
-        session.setUserHash(null);
-        Site.sitebar.showLoggedUser(null);
-        stateManager.reload();
+	// FIXME: Remove cookie doesn't works in all browsers, know issue:
+	// http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/ded86778ee56690/515dc513c7d085eb?lnk=st&q=remove+cookie#515dc513c7d085eb
+	// http://code.google.com/p/google-web-toolkit/issues/detail?id=1735&q=removeCookie
+	Cookies.removeCookie("userHash");
+	// Workaround:
+	Cookies.setCookie("userHash", null, new Date(0), null, "/", false);
+	session.setUserHash(null);
+	// FIXME Site.sitebar.showLoggedUser(null);
+	stateManager.reload();
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/RecalculateWorkspaceAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/RecalculateWorkspaceAction.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/RecalculateWorkspaceAction.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -20,28 +20,28 @@
 package org.ourproject.kune.workspace.client.actions;
 
 import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.workspace.client.sitebar.SiteBarFactory;
 import org.ourproject.kune.workspace.client.workspace.Workspace;
 
 import com.google.gwt.user.client.Window;
 
+ at Deprecated
 @SuppressWarnings("unchecked")
 public class RecalculateWorkspaceAction implements Action {
 
     private final Workspace workspace;
 
     public RecalculateWorkspaceAction(final Workspace workspace) {
-        this.workspace = workspace;
+	this.workspace = workspace;
     }
 
     public void execute(final Object value) {
-        onRecalculateWorkspaceAction();
+	onRecalculateWorkspaceAction();
     }
 
     private void onRecalculateWorkspaceAction() {
-        int width = workspace.calculateWidth(Window.getClientWidth());
-        int height = workspace.calculateHeight(Window.getClientHeight());
-        workspace.adjustSize(width, height);
-        SiteBarFactory.getSiteMessage().adjustWidth(width);
+	final int width = workspace.calculateWidth(Window.getClientWidth());
+	final int height = workspace.calculateHeight(Window.getClientHeight());
+	workspace.adjustSize(width, height);
+	// SiteBarFactory.getSiteMessage().adjustWidth(width);
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -20,12 +20,12 @@
 package org.ourproject.kune.workspace.client.newgroup.ui;
 
 import org.ourproject.kune.platf.client.dto.LicenseDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
 import org.ourproject.kune.platf.client.services.Images;
 import org.ourproject.kune.platf.client.ui.KuneStringUtils;
 import org.ourproject.kune.platf.client.ui.KuneUiUtils;
 import org.ourproject.kune.platf.client.ui.dialogs.WizardDialog;
 import org.ourproject.kune.platf.client.ui.dialogs.WizardListener;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
 import org.ourproject.kune.workspace.client.licensechoose.LicenseChoose;
 import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
 import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
@@ -72,10 +72,10 @@
     private final DeckPanel deck;
     private LicenseChoose licenseChoosePanel;
     private final SiteMessagePanel messagesPanel;
-    private final I18nTranslationService i18n;
+    private final I18nUITranslationService i18n;
     private TextField tags;
 
-    public NewGroupPanel(final NewGroupPresenter presenter, final I18nTranslationService i18n) {
+    public NewGroupPanel(final NewGroupPresenter presenter, final I18nUITranslationService i18n) {
 	super(i18n.t("Register a new Group"), true, false, 460, 480, new WizardListener() {
 	    public void onBack() {
 		presenter.onBack();
@@ -130,7 +130,7 @@
 	step1Label.addStyleName("kune-Margin-Medium-b");
 	step2Label.addStyleName("kune-Margin-Medium-b");
 
-	messagesPanel = new SiteMessagePanel(null, false);
+	messagesPanel = new SiteMessagePanel(null, false, i18n);
 	messagesPanel.setWidth("425");
 	messagesPanel.setMessage("", SiteErrorType.info, SiteErrorType.error);
 	newGroupInitialDataVP.add(messagesPanel);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -44,6 +44,7 @@
 	super.setBorderStylePrimaryName("k-dropdownouter-summary");
 	addStyleName("kune-Margin-Medium-tl");
 	ws.getEntitySummary().addInSummary(this);
+	ws.unMask();
     }
 
     public void setComment(final String comment) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -66,6 +66,7 @@
     private GridPanel groupsGrid;
     private GridPanel contentGrid;
     private final WorkspaceSkeleton ws;
+    private ToolbarButton traybarButton;
 
     public SiteSearcherPanel(final SiteSearcherPresenter initPresenter, final I18nTranslationService i18n,
 	    final WorkspaceSkeleton ws) {
@@ -101,21 +102,23 @@
 	dialog.show();
 	dialog.expand();
 	dialog.center();
-	final ToolbarButton toolbarButton = new ToolbarButton();
-	toolbarButton.setTooltip(i18n.t("Show/hide searcher"));
-	toolbarButton.setIcon("images/kune-search-ico-push.gif");
-	toolbarButton.addListener(new ButtonListenerAdapter() {
-	    @Override
-	    public void onClick(final Button button, final EventObject e) {
-		if (dialog.isVisible()) {
-		    dialog.hide();
-		} else {
-		    dialog.show();
+	if (traybarButton == null) {
+	    traybarButton = new ToolbarButton();
+	    traybarButton.setTooltip(i18n.t("Show/hide searcher"));
+	    traybarButton.setIcon("images/kune-search-ico-push.gif");
+	    traybarButton.addListener(new ButtonListenerAdapter() {
+		@Override
+		public void onClick(final Button button, final EventObject e) {
+		    if (dialog.isVisible()) {
+			dialog.hide();
+		    } else {
+			dialog.show();
+		    }
 		}
-	    }
 
-	});
-	ws.getSiteTraybar().addButton(toolbarButton);
+	    });
+	    ws.getSiteTraybar().addButton(traybarButton);
+	}
     }
 
     private Window createDialog() {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -20,94 +20,83 @@
 package org.ourproject.kune.workspace.client.sitebar;
 
 import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
 import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
-import org.ourproject.kune.workspace.client.sitebar.bar.SiteBar;
 import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessage;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress.SiteProgress;
 
-public class Site {
+import com.calclab.suco.client.container.Provider;
 
-    public static SiteMessage siteUserMessage;
-
-    public static SiteBar sitebar;
-
+public class Site {
     public static final String LOGIN_TOKEN = "login";
-
     public static final String NEWGROUP_TOKEN = "newgroup";
-
     public static final String FIXME_TOKEN = "fixme";
-
     public static final String TRANSLATE_TOKEN = "translate";
-
     public static final String IN_DEVELOPMENT = " (in development)";
-
     private static I18nTranslationService i18n;
+    private static SiteProgress progress;
+    private static Provider<SiteMessage> siteMessageProvider;
 
+    @Deprecated
     public static void doLogin(final String returnToken) {
-        sitebar.doLogin(returnToken);
+	// sitebar.doLogin(returnToken);
     }
 
+    @Deprecated
     public static void doLogout() {
-        sitebar.doLogout();
+	// sitebar.doLogout();
     }
 
+    @Deprecated
     public static void doNewGroup(final String returnToken) {
-        sitebar.doNewGroup(returnToken);
+	// sitebar.doNewGroup(returnToken);
     }
 
     public static void error(final String value) {
-        siteUserMessage.setMessage(value, SiteErrorType.error);
+	getSiteMessage().setMessage(value, SiteErrorType.error);
     }
 
     public static void hideProgress() {
-        sitebar.hideProgress();
+	progress.hideProgress();
     }
 
     public static void important(final String value) {
-        siteUserMessage.setMessage(value, SiteErrorType.imp);
+	getSiteMessage().setMessage(value, SiteErrorType.imp);
     }
 
     public static void info(final String value) {
-        siteUserMessage.setMessage(value, SiteErrorType.info);
+	getSiteMessage().setMessage(value, SiteErrorType.info);
     }
 
-    public static void init(final I18nTranslationService i18n) {
-        Site.i18n = i18n;
-    }
-
-    public static void mask() {
-        sitebar.mask();
-    }
-
-    public static void mask(final String message) {
-        sitebar.mask(message);
-    }
-
-    public static void showAlertMessage(final String message) {
-        sitebar.showAlertMessage(message);
-    }
-
     public static void showProgress(final String text) {
-        sitebar.showProgress(text);
+	progress.showProgress(text);
     }
 
     public static void showProgressLoading() {
-        sitebar.showProgress(i18n.t("Loading"));
+	progress.showProgress(i18n.t("Loading"));
     }
 
     public static void showProgressProcessing() {
-        sitebar.showProgress(i18n.t("Processing"));
+	progress.showProgress(i18n.t("Processing"));
     }
 
     public static void showProgressSaving() {
-        sitebar.showProgress(i18n.t("Saving"));
+	progress.showProgress(i18n.t("Saving"));
     }
 
-    public static void unMask() {
-        sitebar.unMask();
+    public static void veryImportant(final String value) {
+	getSiteMessage().setMessage(value, SiteErrorType.veryimp);
     }
 
-    public static void veryImportant(final String value) {
-        siteUserMessage.setMessage(value, SiteErrorType.veryimp);
+    private static SiteMessage getSiteMessage() {
+	return siteMessageProvider.get();
     }
 
+    public Site(final I18nUITranslationService i18n, final SiteProgress progress,
+	    final Provider<SiteMessage> siteMessageProvider) {
+	Site.i18n = i18n;
+	Site.progress = progress;
+	Site.siteMessageProvider = siteMessageProvider;
+    }
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -24,8 +24,8 @@
 import java.util.List;
 
 import org.ourproject.kune.platf.client.dto.LicenseDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
 import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
 import org.ourproject.kune.workspace.client.licensechoose.LicenseChoose;
 import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
 import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePresenter;
@@ -33,25 +33,16 @@
 import org.ourproject.kune.workspace.client.newgroup.NewGroupListener;
 import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
 import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
-import org.ourproject.kune.workspace.client.sitebar.bar.SiteBar;
-import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarListener;
-import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarPanel;
-import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarPresenter;
 import org.ourproject.kune.workspace.client.sitebar.login.Login;
 import org.ourproject.kune.workspace.client.sitebar.login.LoginListener;
 import org.ourproject.kune.workspace.client.sitebar.login.LoginPanel;
 import org.ourproject.kune.workspace.client.sitebar.login.LoginPresenter;
-import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessage;
-import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePanel;
-import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePresenter;
-import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessageView;
 
 public class SiteBarFactory {
-    private static SiteMessage siteMessage;
     private static Login login;
     private static NewGroup newGroup;
     private static Session session;
-    private static I18nTranslationService i18n;
+    private static I18nUITranslationService i18n;
 
     public static LicenseChoose createLicenseChoose() {
 	final List<LicenseDTO> licensesList = session.getLicenses();
@@ -69,17 +60,6 @@
 	return presenter;
     }
 
-    public static SiteBar createSiteBar(final SiteBarListener listener, final Session session,
-	    final I18nTranslationService i18n) {
-	SiteBarFactory.session = session;
-	SiteBarFactory.i18n = i18n;
-	final SiteBarPresenter siteBarPresenter = new SiteBarPresenter(listener, session, i18n);
-	final SiteBarPanel siteBarView = new SiteBarPanel(siteBarPresenter, i18n);
-	siteBarPresenter.init(siteBarView);
-	Site.sitebar = siteBarPresenter;
-	return siteBarPresenter;
-    }
-
     public static Login getLoginForm(final LoginListener listener) {
 	if (login == null) {
 	    final LoginPresenter presenter = new LoginPresenter(session, listener, i18n);
@@ -100,14 +80,4 @@
 	return newGroup;
     }
 
-    public static SiteMessage getSiteMessage() {
-	if (siteMessage == null) {
-	    final SiteMessagePresenter siteMessagePresenter = new SiteMessagePresenter();
-	    final SiteMessageView siteMessageView = new SiteMessagePanel(siteMessagePresenter, true);
-	    siteMessagePresenter.init(siteMessageView);
-	    siteMessage = siteMessagePresenter;
-	    Site.siteUserMessage = siteMessagePresenter;
-	}
-	return siteMessage;
-    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SimpleMessagePanel.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -39,6 +39,10 @@
 	this.setVisible(false);
     }
 
+    public void reset() {
+	message.setText("");
+    }
+
     public void setMessage(final String text) {
 	this.message.setHTML(text);
     }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessage.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -24,9 +24,6 @@
 
 public interface SiteMessage extends View {
 
-    void adjustWidth(int width);
-
-    View getView();
-
     void setMessage(String message, SiteErrorType type);
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePanel.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePanel.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -20,19 +20,28 @@
 package org.ourproject.kune.workspace.client.sitebar.msg;
 
 import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.KuneUiUtils;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
 
 import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.WindowResizeListener;
 import com.google.gwt.user.client.ui.ClickListener;
 import com.google.gwt.user.client.ui.PushButton;
+import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.VerticalPanel;
 import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.core.ExtElement;
 
 public class SiteMessagePanel extends SimpleMessagePanel implements SiteMessageView {
     private static final int TIMEVISIBLE = 4000;
 
     private final Timer timer;
 
-    public SiteMessagePanel(final MessagePresenter presenter, final boolean closable) {
+    private final ExtElement extElem;
+
+    public SiteMessagePanel(final MessagePresenter presenter, final boolean closable,
+	    final I18nUITranslationService i18n) {
 	final Images images = Images.App.getInstance();
 	timer = new Timer() {
 	    public void run() {
@@ -45,6 +54,7 @@
 
 	if (closable) {
 	    final PushButton closeIcon = new PushButton(images.cross().createImage(), images.crossDark().createImage());
+	    KuneUiUtils.setQuickTip(closeIcon, i18n.t("Click to close"));
 	    add(closeIcon);
 	    closeIcon.addClickListener(new ClickListener() {
 		public void onClick(final Widget sender) {
@@ -59,15 +69,52 @@
 	    });
 	    setCellVerticalAlignment(closeIcon, VerticalPanel.ALIGN_BOTTOM);
 	}
+	extElem = new ExtElement(this.getElement());
+	final int clientWidth = Window.getClientWidth();
+	adjustWidth(clientWidth);
+	Window.addWindowResizeListener(new WindowResizeListener() {
+	    public void onWindowResized(final int width, final int height) {
+		// Log.debug("Window width: " + width + ", height: " + height);
+		setXY(width);
+		adjustWidth(width);
+	    }
+	});
+	extElem.setVisible(false, false);
+	hide();
+	RootPanel.get().add(this, calculateX(clientWidth), calculateY());
     }
 
+    @Override
+    public void adjustWidth(final int windowWidth) {
+	super.adjustWidth(windowWidth);
+    }
+
     public void hide() {
-	super.hide();
+	extElem.hide(true);
+	super.reset();
 	timer.cancel();
     }
 
     public void show() {
-	super.show();
+	if (!extElem.isVisible()) {
+	    extElem.show(true);
+	}
+	// super.show();
 	timer.schedule(TIMEVISIBLE);
     }
+
+    private int calculateX(final int clientWidth) {
+	final int x = clientWidth * 20 / 100 - 10;
+	// Log.debug("X: " + x);
+	return x;
+    }
+
+    private int calculateY() {
+	return 2;
+    }
+
+    private void setXY(final int clientWidth) {
+	extElem.setXY(calculateX(clientWidth), calculateY(), false);
+    }
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/msg/SiteMessagePresenter.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -31,6 +31,7 @@
     public SiteMessagePresenter() {
     }
 
+    @Deprecated
     public void adjustWidth(final int windowWidth) {
 	view.adjustWidth(windowWidth);
     }

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgress.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgress.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgress.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress;
+
+public interface SiteProgress {
+
+    void hideProgress();
+
+    void showProgress(String text);
+
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPanel.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPanel.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -0,0 +1,46 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitepublic.SitePublicSpaceLink;
+
+import com.calclab.suco.client.container.Provider;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class SiteProgressPanel implements SiteProgressView {
+    private static final int MAX_TIME_PROGRESS_BAR = 20000;
+
+    private final Widget progressPanel;
+    private final Widget progressText;
+    private Timer timeProgressMaxTime;
+
+    private final Provider<SitePublicSpaceLink> publicLinkProvider;
+
+    public SiteProgressPanel(final SiteProgressPresenter presenter,
+	    final Provider<SitePublicSpaceLink> publicLinkProvider) {
+	this.publicLinkProvider = publicLinkProvider;
+	progressPanel = RootPanel.get("kuneprogresspanel");
+	progressText = RootPanel.get("kuneprogresstext");
+    }
+
+    public void hideProgress() {
+	timeProgressMaxTime.cancel();
+	progressPanel.setVisible(false);
+	publicLinkProvider.get().setVisible(true);
+    }
+
+    public void showProgress(final String text) {
+	if (timeProgressMaxTime == null) {
+	    timeProgressMaxTime = new Timer() {
+		public void run() {
+		    hideProgress();
+		}
+	    };
+	}
+	timeProgressMaxTime.schedule(MAX_TIME_PROGRESS_BAR);
+	publicLinkProvider.get().setVisible(false);
+	progressPanel.setVisible(true);
+	DOM.setInnerText(progressText.getElement(), text);
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPresenter.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressPresenter.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -0,0 +1,28 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress;
+
+import org.ourproject.kune.platf.client.View;
+
+public class SiteProgressPresenter implements SiteProgress {
+
+    private SiteProgressView view;
+
+    public SiteProgressPresenter() {
+    }
+
+    public View getView() {
+	return view;
+    }
+
+    public void hideProgress() {
+	view.hideProgress();
+    }
+
+    public void init(final SiteProgressView view) {
+	this.view = view;
+    }
+
+    public void showProgress(final String text) {
+	view.showProgress(text);
+    }
+
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressView.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/siteprogress/SiteProgressView.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -0,0 +1,10 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.siteprogress;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface SiteProgressView extends View {
+
+    void hideProgress();
+
+    void showProgress(String text);
+}

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java	2008-07-20 22:13:16 UTC (rev 809)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java	2008-07-21 02:05:26 UTC (rev 810)
@@ -3,7 +3,12 @@
 import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
 import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
 
+import com.google.gwt.user.client.ui.RootPanel;
+import com.gwtext.client.core.ExtElement;
+import com.gwtext.client.widgets.MessageBox;
 import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.QuickTip;
+import com.gwtext.client.widgets.QuickTips;
 import com.gwtext.client.widgets.Toolbar;
 import com.gwtext.client.widgets.Viewport;
 import com.gwtext.client.widgets.layout.FitLayout;
@@ -13,8 +18,14 @@
     private final SiteBar sitebar;
     private final DefaultBorderLayout mainPanel;
     private final Panel container;
+    private final ExtElement extRootBody;
 
     public WorkspaceSkeleton() {
+	QuickTips.init(); // extgwt tips
+	final QuickTip quickTipInstance = QuickTips.getQuickTip();
+	quickTipInstance.setDismissDelay(8000);
+	quickTipInstance.setHideDelay(500);
+	quickTipInstance.setInterceptTitles(true);
 	container = new Panel();
 	container.setLayout(new FitLayout());
 	container.setBorder(false);
@@ -25,6 +36,7 @@
 	mainPanel.add(sitebar, DefaultBorderLayout.Position.NORTH, DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
 	mainPanel.add(entity.getPanel(), DefaultBorderLayout.Position.CENTER);
 	container.add(mainPanel.getPanel());
+	extRootBody = new ExtElement(RootPanel.getBodyElement());
     }
 
     public Panel getEntityMainHeader() {
@@ -47,6 +59,14 @@
 	return entity.getEntitySummary().getSiteTraybar();
     }
 
+    public void mask() {
+	extRootBody.mask();
+    }
+
+    public void mask(final String message) {
+	extRootBody.mask(message, "x-mask-loading");
+    }
+
     public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
 	entity.setTheme(oldTheme, newTheme);
     }
@@ -55,4 +75,16 @@
 	new Viewport(container);
     }
 
+    public void showAlertMessage(final String title, final String message) {
+	MessageBox.alert(title, message, new MessageBox.AlertCallback() {
+	    public void execute() {
+	    }
+	});
+    }
+
+    public void unMask() {
+	extRootBody.unmask();
+	RootPanel.get("kuneinitialcurtain").setVisible(false);
+    }
+
 }




More information about the kune-commits mailing list