[kune-commits] r1226 - in trunk/src: main/java/cc/kune/common/client/ui main/java/cc/kune/common/client/utils main/java/cc/kune/core/client/auth main/java/cc/kune/core/client/sitebar/spaces main/java/cc/kune/core/client/ui main/java/cc/kune/core/client/ui/dialogs main/java/cc/kune/core/public main/java/org/ourproject/kune/app/public/css main/java/org/ourproject/kune/blogs/client main/java/org/ourproject/kune/chat/client main/java/org/ourproject/kune/docs/client main/java/org/ourproject/kune/gallery/client main/java/org/ourproject/kune/platf/client/services main/java/org/ourproject/kune/platf/client/ui main/java/org/ourproject/kune/platf/client/ui/download main/java/org/ourproject/kune/platf/client/ui/rte/basic main/java/org/ourproject/kune/platf/client/ui/rte/saving main/java/org/ourproject/kune/platf/client/utils main/java/org/ourproject/kune/wiki/client main/java/org/ourproject/kune/workspace/client main/java/org/ourproject/kune/workspace/client/editor test/java/org/ourproject/kune/platf/client/ui/rte/saving test/java/org/ourproject/kune/platf/client/utils

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Fri Jan 28 02:41:25 CET 2011


Author: vjrj_
Date: 2011-01-28 02:41:24 +0100 (Fri, 28 Jan 2011)
New Revision: 1226

Added:
   trunk/src/main/java/cc/kune/common/client/utils/Convert.java
   trunk/src/main/java/cc/kune/common/client/utils/SchedulerManager.java
   trunk/src/main/java/cc/kune/common/client/utils/TimerWrapper.java
   trunk/src/main/java/cc/kune/common/client/utils/Url.java
   trunk/src/main/java/cc/kune/common/client/utils/UrlParam.java
   trunk/src/main/java/cc/kune/core/client/ui/KuneUiUtils.java
Removed:
   trunk/src/main/java/org/ourproject/kune/platf/client/utils/Convert.java
   trunk/src/main/java/org/ourproject/kune/platf/client/utils/DeferredCommandWrapper.java
   trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java
   trunk/src/main/java/org/ourproject/kune/platf/client/utils/Url.java
   trunk/src/main/java/org/ourproject/kune/platf/client/utils/UrlParam.java
Modified:
   trunk/src/main/java/cc/kune/common/client/ui/PopupPanelTopCentered.java
   trunk/src/main/java/cc/kune/core/client/auth/RegisterPanel.java
   trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
   trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPanel.java
   trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java
   trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java
   trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
   trunk/src/main/java/cc/kune/core/client/ui/dialogs/BasicTopDialog.java
   trunk/src/main/java/cc/kune/core/client/ui/dialogs/MessageToolbar.java
   trunk/src/main/java/cc/kune/core/public/ws.css
   trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css
   trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
   trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
   trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
   trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
   trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
   trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
   trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
   trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
   trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java
   trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenterTest.java
   trunk/src/test/java/org/ourproject/kune/platf/client/utils/UrlTest.java
Log:
NEW - # 14: Site bar update 
http://kune.ourproject.org/issues/ticket/14

Modified: trunk/src/main/java/cc/kune/common/client/ui/PopupPanelTopCentered.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/PopupPanelTopCentered.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/cc/kune/common/client/ui/PopupPanelTopCentered.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -18,6 +18,9 @@
 
     public PopupPanelTopCentered(final boolean autohide, final boolean modal) {
         super(autohide, modal);
+        if (modal) {
+            super.setGlassEnabled(true);
+        }
         init();
     }
 

Copied: trunk/src/main/java/cc/kune/common/client/utils/Convert.java (from rev 1223, trunk/src/main/java/org/ourproject/kune/platf/client/utils/Convert.java)
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/Convert.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/utils/Convert.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -0,0 +1,29 @@
+/*
+ *
+ * Copyright (C) 2007-2009 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 cc.kune.common.client.utils;
+
+public final class Convert {
+    public static int toInt(final String value) {
+        return Integer.valueOf(value);
+    }
+
+    private Convert() {
+    };
+}

Copied: trunk/src/main/java/cc/kune/common/client/utils/SchedulerManager.java (from rev 1223, trunk/src/main/java/org/ourproject/kune/platf/client/utils/DeferredCommandWrapper.java)
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/SchedulerManager.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/utils/SchedulerManager.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -0,0 +1,39 @@
+/*
+ *
+ * Copyright (C) 2007-2009 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 cc.kune.common.client.utils;
+
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+
+/**
+ * The Class {@link #SchedulerManager} is a wrapper of the GWT
+ * {@link #Scheduler} (used for testing classes without GWT dependencies).
+ */
+public class SchedulerManager {
+    /**
+     * Adds the command.
+     * 
+     * @param command
+     *            the listener
+     */
+    public void addCommand(final ScheduledCommand command) {
+        Scheduler.get().scheduleDeferred(command);
+    }
+}

Copied: trunk/src/main/java/cc/kune/common/client/utils/TimerWrapper.java (from rev 1223, trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java)
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/TimerWrapper.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/utils/TimerWrapper.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -0,0 +1,42 @@
+package cc.kune.common.client.utils;
+
+import com.google.gwt.user.client.Timer;
+
+public class TimerWrapper {
+    public interface Executer {
+        /**
+         * Invokes the execute.
+         */
+        void execute();
+    }
+
+    private Timer timer;
+
+    public TimerWrapper() {
+    }
+
+    public void cancel() {
+        timer.cancel();
+    }
+
+    public void configure(final Executer onTime) {
+        timer = new Timer() {
+            @Override
+            public void run() {
+                onTime.execute();
+            }
+        };
+    }
+
+    public void run() {
+        timer.run();
+    }
+
+    public void schedule(final int delayMillis) {
+        timer.schedule(delayMillis);
+    }
+
+    public void scheduleRepeating(final int delayMillis) {
+        timer.scheduleRepeating(delayMillis);
+    }
+}

Copied: trunk/src/main/java/cc/kune/common/client/utils/Url.java (from rev 1223, trunk/src/main/java/org/ourproject/kune/platf/client/utils/Url.java)
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/Url.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/utils/Url.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -0,0 +1,63 @@
+/*
+ *
+ * Copyright (C) 2007-2009 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 cc.kune.common.client.utils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Url {
+    private final String base;
+    private final List<UrlParam> params;
+
+    public Url(final String base) {
+        this.base = base;
+        params = new ArrayList<UrlParam>();
+    }
+
+    public Url(final String base, final UrlParam... iniParams) {
+        this(base);
+        for (UrlParam param : iniParams) {
+            addImpl(param);
+        }
+    }
+
+    public void add(final UrlParam param) {
+        addImpl(param);
+    }
+
+    @Override
+    public String toString() {
+        String paramPart = "";
+        boolean first = true;
+        for (UrlParam param : params) {
+            if (first) {
+                paramPart = "?" + param;
+                first = false;
+            } else {
+                paramPart += "&" + param;
+            }
+        }
+        return base + paramPart;
+    }
+
+    private void addImpl(final UrlParam param) {
+        params.add(param);
+    }
+}

Copied: trunk/src/main/java/cc/kune/common/client/utils/UrlParam.java (from rev 1223, trunk/src/main/java/org/ourproject/kune/platf/client/utils/UrlParam.java)
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/UrlParam.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/utils/UrlParam.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -0,0 +1,48 @@
+/*
+ *
+ * Copyright (C) 2007-2009 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 cc.kune.common.client.utils;
+
+public class UrlParam {
+    private final String value;
+    private final String name;
+
+    public UrlParam(String name, boolean value) {
+        this.name = name;
+        this.value = value ? "true" : "false";
+    }
+
+    public UrlParam(String name, String value) {
+        this.name = name;
+        this.value = value;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    @Override
+    public String toString() {
+        return name + "=" + value;
+    }
+}

Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/RegisterPanel.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/cc/kune/core/client/auth/RegisterPanel.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -22,6 +22,7 @@
 import cc.kune.common.client.noti.NotifyLevelImages;
 import cc.kune.core.client.resources.CoreMessages;
 import cc.kune.core.client.state.Session;
+import cc.kune.core.client.ui.KuneUiUtils;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
 import com.extjs.gxt.ui.client.widget.VerticalPanel;
@@ -47,18 +48,6 @@
         super(REGISTER_DIALOG, i18n, i18n.t(CoreMessages.REGISTER_TITLE), true, true, true, 400, 420, "",
                 i18n.t(CoreMessages.REGISTER_TITLE), REGISTER_BUTTON_ID, i18n.tWithNT("Cancel", "used in button"),
                 CANCEL_BUTTON_ID, images, ERRMSG, 11);
-        // super.addListener(new WindowListenerAdapter() {
-        // @Override
-        // public void onActivate(final Panel panel) {
-        // KuneUiUtils.focusOnField(registerForm.getShortNameField());
-        // }
-        //
-        // @Override
-        // public void onShow(final Component component) {
-        // KuneUiUtils.focusOnField(registerForm.getShortNameField());
-        // }
-        // });
-
         final VerticalPanel panel = new VerticalPanel();
         // panel.setBorder(false);
         registerForm = new RegisterForm(i18n, session);
@@ -109,6 +98,12 @@
     }
 
     @Override
+    public void show() {
+        super.show();
+        KuneUiUtils.focusOnField(registerForm.getShortNameField());
+    }
+
+    @Override
     public void showWelcolmeDialog() {
         // final InfoDialog welcomeDialog = new InfoDialog(WELCOME_DIALOG,
         // i18n.t("Welcome"),

Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -88,6 +88,34 @@
         return (RegisterView) super.getView();
     }
 
+    @Override
+    protected void onBind() {
+        super.onBind();
+        getView().getFirstBtn().addClickHandler(new ClickHandler() {
+            @Override
+            public void onClick(final ClickEvent event) {
+                getView().validate();
+                if (getView().isValid()) {
+                    onFormRegister();
+                }
+            }
+        });
+        getView().getSecondBtn().addClickHandler(new ClickHandler() {
+
+            @Override
+            public void onClick(final ClickEvent event) {
+                onCancel();
+            }
+        });
+        getView().getClose().addCloseHandler(new CloseHandler<PopupPanel>() {
+
+            @Override
+            public void onClose(final CloseEvent<PopupPanel> event) {
+                RegisterPresenter.this.onClose();
+            }
+        });
+    }
+
     public void onFormRegister() {
         if (getView().isRegisterFormValid()) {
             getView().maskProcessing();
@@ -117,7 +145,6 @@
                     } else {
                         getView().setErrorMessage(i18n.t("Error during registration."), NotifyLevel.error);
                         throw new UIException("Other kind of exception in user registration", caught);
-
                     }
                 }
 
@@ -139,34 +166,6 @@
     }
 
     @Override
-    protected void onReveal() {
-        super.onReveal();
-        getView().getFirstBtn().addClickHandler(new ClickHandler() {
-            @Override
-            public void onClick(final ClickEvent event) {
-                getView().validate();
-                if (getView().isValid()) {
-                    onFormRegister();
-                }
-            }
-        });
-        getView().getSecondBtn().addClickHandler(new ClickHandler() {
-
-            @Override
-            public void onClick(final ClickEvent event) {
-                onCancel();
-            }
-        });
-        getView().getClose().addCloseHandler(new CloseHandler<PopupPanel>() {
-
-            @Override
-            public void onClose(final CloseEvent<PopupPanel> event) {
-                RegisterPresenter.this.onClose();
-            }
-        });
-    }
-
-    @Override
     protected void revealInParent() {
         RevealRootContentEvent.fire(this, this);
     }

Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPanel.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPanel.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -61,6 +61,7 @@
     private void createMessageErrorIfNeeded() {
         if (messageErrorBar == null) {
             messageErrorBar = new MessageToolbar(images, errorLabelId);
+            dialog.getBottomPanel().add(messageErrorBar);
         }
     }
 

Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInPanel.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -21,6 +21,7 @@
 
 import cc.kune.common.client.noti.NotifyLevelImages;
 import cc.kune.core.client.resources.CoreMessages;
+import cc.kune.core.client.ui.KuneUiUtils;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
 import com.extjs.gxt.ui.client.widget.VerticalPanel;
@@ -42,19 +43,19 @@
 
     @Inject
     public SignInPanel(final I18nTranslationService i18n, final NotifyLevelImages images) {
-        super(SIGNIN_DIALOG, i18n, i18n.t(CoreMessages.SIGN_IN_TITLE), true, true, true, 360, 360, "",
+        super(SIGNIN_DIALOG, i18n, i18n.t(CoreMessages.SIGN_IN_TITLE), true, true, true, 360, 430, "",
                 i18n.t(CoreMessages.SIGN_IN_TITLE), SIGN_IN_BUTTON_ID, i18n.tWithNT("Cancel", "used in button"),
                 CANCEL_BUTTON_ID, images, ERROR_MSG, 102);
 
         // @Override
         // public void onShow(final Component component) {
-        // KuneUiUtils.focusOnField(getNickname());
+        //
         // }
 
         final VerticalPanel panel = new VerticalPanel();
         // panel.setBorder(false);
         signInForm = new SignInForm(i18n);
-        signInForm.setWidth(310);
+        signInForm.setWidth(370);
         panel.add(signInForm.getFormPanel());
         panel.add(createNoAccountRegister());
         super.getInnerPanel().add(panel);
@@ -69,7 +70,8 @@
         registerLabel = new Label(i18n.t("Create one."));
         registerLabel.ensureDebugId(CREATE_ONE);
         registerLabel.addStyleName("kune-Margin-Medium-l");
-        registerLabel.addStyleName("kune-link");
+        registerLabel.addStyleName("k-link");
+        registerLabel.addStyleName("k-cursor");
         hpanel.add(dontHaveAccount);
         hpanel.add(registerLabel);
         noAccRegisterPanel.add(hpanel);
@@ -111,6 +113,12 @@
     }
 
     @Override
+    public void show() {
+        super.show();
+        KuneUiUtils.focusOnField(getNickname());
+    }
+
+    @Override
     public void validate() {
         signInForm.validate();
     }

Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -94,6 +94,38 @@
         stateManager.gotoToken(SiteCommonTokens.REGISTER);
     }
 
+    @Override
+    protected void onBind() {
+        super.onBind();
+        getView().getFirstBtn().addClickHandler(new ClickHandler() {
+            @Override
+            public void onClick(final ClickEvent event) {
+                onFormSignIn();
+            }
+        });
+        getView().getSecondBtn().addClickHandler(new ClickHandler() {
+
+            @Override
+            public void onClick(final ClickEvent event) {
+                onCancel();
+            }
+        });
+        getView().getClose().addCloseHandler(new CloseHandler<PopupPanel>() {
+
+            @Override
+            public void onClose(final CloseEvent<PopupPanel> event) {
+                SignInPresenter.this.onClose();
+            }
+        });
+        getView().getAccountRegister().addClickHandler(new ClickHandler() {
+
+            @Override
+            public void onClick(final ClickEvent event) {
+                onAccountRegister();
+            }
+        });
+    }
+
     public void onFormSignIn() {
         getView().validate();
         if (getView().isSignInFormValid()) {
@@ -133,38 +165,6 @@
     }
 
     @Override
-    protected void onReveal() {
-        super.onReveal();
-        getView().getFirstBtn().addClickHandler(new ClickHandler() {
-            @Override
-            public void onClick(final ClickEvent event) {
-                onFormSignIn();
-            }
-        });
-        getView().getSecondBtn().addClickHandler(new ClickHandler() {
-
-            @Override
-            public void onClick(final ClickEvent event) {
-                onCancel();
-            }
-        });
-        getView().getClose().addCloseHandler(new CloseHandler<PopupPanel>() {
-
-            @Override
-            public void onClose(final CloseEvent<PopupPanel> event) {
-                SignInPresenter.this.onClose();
-            }
-        });
-        getView().getAccountRegister().addClickHandler(new ClickHandler() {
-
-            @Override
-            public void onClick(final ClickEvent event) {
-                onAccountRegister();
-            }
-        });
-    }
-
-    @Override
     protected void revealInParent() {
         RevealRootContentEvent.fire(this, this);
     }

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -1,10 +1,15 @@
 package cc.kune.core.client.sitebar.spaces;
 
+import cc.kune.common.client.noti.NotifyUser;
+import cc.kune.core.client.auth.SignIn;
 import cc.kune.core.client.init.AppStartEvent;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.wspace.client.WsArmor;
 
 import com.google.gwt.event.shared.EventBus;
 import com.google.inject.Inject;
+import com.google.inject.Provider;
 import com.gwtplatform.mvp.client.HasUiHandlers;
 import com.gwtplatform.mvp.client.Presenter;
 import com.gwtplatform.mvp.client.View;
@@ -33,12 +38,19 @@
     }
 
     private final WsArmor armor;
+    private final I18nTranslationService i18n;
+    private final Session session;
+    private final Provider<SignIn> signIn;
 
     @Inject
     public SpaceSelectorPresenter(final EventBus eventBus, final SpaceSelectorView view,
-            final SpaceSelectorProxy proxy, final WsArmor armor) {
+            final SpaceSelectorProxy proxy, final WsArmor armor, final Session session, final Provider<SignIn> sigIn,
+            final I18nTranslationService i18n) {
         super(eventBus, view, proxy);
         this.armor = armor;
+        this.session = session;
+        this.signIn = sigIn;
+        this.i18n = i18n;
         getView().setUiHandlers(this);
     }
 
@@ -80,11 +92,17 @@
 
     @Override
     public void onUserSpaceSelect() {
-        armor.selectUserSpace();
-        getView().setHomeBtnDown(false);
-        getView().setUserBtnDown(true);
-        getView().setGroupBtnDown(false);
-        getView().setPublicBtnDown(false);
+        if (session.isLogged()) {
+            armor.selectUserSpace();
+            getView().setHomeBtnDown(false);
+            getView().setUserBtnDown(true);
+            getView().setGroupBtnDown(false);
+            getView().setPublicBtnDown(false);
+        } else {
+            signIn.get().doSignIn();
+            getView().setUserBtnDown(false);
+            NotifyUser.info(i18n.t("Sign in to access to your workspace"));
+        }
     }
 
     @Override

Added: trunk/src/main/java/cc/kune/core/client/ui/KuneUiUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ui/KuneUiUtils.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/ui/KuneUiUtils.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -0,0 +1,15 @@
+package cc.kune.core.client.ui;
+
+import com.extjs.gxt.ui.client.widget.form.Field;
+import com.google.gwt.user.client.Timer;
+
+public class KuneUiUtils {
+    public static void focusOnField(final Field<?> field) {
+        new Timer() {
+            @Override
+            public void run() {
+                field.focus();
+            }
+        }.schedule(50);
+    }
+}


Property changes on: trunk/src/main/java/cc/kune/core/client/ui/KuneUiUtils.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: trunk/src/main/java/cc/kune/core/client/ui/dialogs/BasicTopDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ui/dialogs/BasicTopDialog.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/cc/kune/core/client/ui/dialogs/BasicTopDialog.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -2,6 +2,7 @@
 
 import cc.kune.common.client.ui.PopupPanelTopCentered;
 
+import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.logical.shared.HasCloseHandlers;
 import com.google.gwt.user.client.ui.PopupPanel;
 
@@ -19,6 +20,7 @@
         super.getTitleText().setText(title);
         // super.setAutoscroll(autoscroll);
         // super.setSize(String.valueOf(width), String.valueOf(height));
+        GWT.log("Not setting size of dialog to: " + String.valueOf(width) + "/" + String.valueOf(height));
         super.setTitleIcon(icon);
         super.getFirstBtnText().setText(firstButtonTitle);
         super.getSecondBtnText().setText(cancelButtonTitle);

Modified: trunk/src/main/java/cc/kune/core/client/ui/dialogs/MessageToolbar.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ui/dialogs/MessageToolbar.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/cc/kune/core/client/ui/dialogs/MessageToolbar.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -27,9 +27,10 @@
 import com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem;
 import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
 import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.user.client.ui.Composite;
 import com.google.gwt.user.client.ui.Image;
 
-public class MessageToolbar {
+public class MessageToolbar extends Composite {
     private final Image errorIcon;
     private final Label errorLabel;
     private final NotifyLevelImages images;
@@ -51,6 +52,7 @@
         toolbar.add(errorLabel);
         errorIcon.setVisible(false);
         toolbar.setVisible(false);
+        initWidget(toolbar);
     }
 
     public ToolBar getToolbar() {

Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/cc/kune/core/public/ws.css	2011-01-28 01:41:24 UTC (rev 1226)
@@ -382,4 +382,246 @@
 
 .k-sitebar { 
   margin-top: -30px;
-}
\ No newline at end of file
+}
+
+.k-link {
+  text-decoration: underline;
+  color: green;
+  cursor: pointer;
+}
+
+
+/* Margins */
+
+.kune-Margin-40-trbl {
+  margin: 40px;
+}
+
+.kune-Margin-40-lr {
+  margin-left: 40px;
+  margin-right: 40px;
+}
+
+.kune-Margin-40-tl {
+  margin-top: 40px;
+  margin-left: 40px;
+}
+
+.kune-Margin-40-tb {
+  margin-top: 40px;
+  margin-bottom: 40px;
+}
+
+.kune-Margin-40-t {
+  margin-top: 40px;
+}
+
+.kune-Margin-40-r {
+  margin-right: 40px;
+}
+
+.kune-Margin-40-l {
+  margin-left: 40px;
+}
+
+.kune-Margin-20-trbl {
+  margin: 20px;
+}
+
+.kune-Margin-20-lr {
+  margin-left: 20px;
+  margin-right: 20px;
+}
+
+.kune-Margin-20-tl {
+  margin-top: 20px;
+  margin-left: 20px;
+}
+
+.kune-Margin-20-tb {
+  margin-top: 20px;
+  margin-bottom: 20px;
+}
+
+.kune-Margin-20-t {
+  margin-top: 20px;
+}
+
+.kune-Margin-20-r {
+  margin-right: 20px;
+}
+
+.kune-Margin-20-l {
+  margin-left: 20px;
+}
+
+.kune-Margin-Large-trbl {
+  margin: 10px;
+}
+
+.kune-Margin-Large-lr {
+  margin-left: 10px;
+  margin-right: 10px;
+}
+
+.kune-Margin-Large-tl {
+  margin-top: 10px;
+  margin-left: 10px;
+}
+
+.kune-Margin-Large-tb {
+  margin-top: 10px;
+  margin-bottom: 10px;
+}
+
+.kune-Margin-Large-t {
+  margin-top: 10px;
+}
+
+.kune-Margin-Large-r {
+  margin-right: 10px;
+}
+
+.kune-Margin-Large-l {
+  margin-left: 10px;
+}
+
+.kune-Margin-7-trbl {
+  margin: 7px;
+}
+
+.kune-Margin-7-lr {
+  margin-left: 7px;
+  margin-right: 7px;
+}
+
+.kune-Margin-7-tl {
+  margin-top: 7px;
+  margin-left: 7px;
+}
+
+.kune-Margin-7-tb {
+  margin-top: 7px;
+  margin-bottom: 7px;
+}
+
+.kune-Margin-7-t {
+  margin-top: 7px;
+}
+
+.kune-Margin-7-r {
+  margin-right: 7px;
+}
+
+.kune-Margin-7-b {
+  margin-bottom: 7px;
+}
+
+.kune-Margin-7-l {
+  margin-left: 7px;
+}
+
+.kune-Margin-Medium-trbl {
+  margin: 5px;
+}
+
+.kune-Margin-Medium-lr {
+  margin-left: 5px;
+  margin-right: 5px;
+}
+
+.kune-Margin-Medium-tl {
+  margin-top: 5px;
+  margin-left: 5px;
+}
+
+.kune-Margin-Medium-tb {
+  margin-top: 5px;
+  margin-bottom: 5px;
+}
+
+.kune-Margin-Medium-t {
+  margin-top: 5px;
+}
+
+.kune-Margin-Medium-r {
+  margin-right: 5px;
+}
+
+.kune-Margin-Medium-b {
+  margin-bottom: 5px;
+}
+
+.kune-Margin-Medium-l {
+  margin-left: 5px;
+}
+
+.kune-Margin-Small-trbl {
+  margin: 3px;
+}
+
+.kune-Margin-Small-lr {
+  margin-left: 3px;
+  margin-right: 3px;
+}
+
+.kune-Margin-Small-tl {
+  margin-top: 3px;
+  margin-left: 3px;
+}
+
+.kune-Margin-Small-tb {
+  margin-top: 3px;
+  margin-bottom: 3px;
+}
+
+.kune-Margin-Small-t {
+  margin-top: 3px;
+}
+
+.kune-Margin-Small-l {
+  margin-left: 3px;
+}
+
+.kune-Margin-Small-r {
+  margin-right: 3px;
+}
+
+.kune-Margin-Small-b {
+  margin-bottom: 3px;
+}
+
+.kune-Margin-Mini-trbl {
+  margin: 1px;
+}
+
+.kune-Margin-Mini-lr {
+  margin-left: 1px;
+  margin-right: 1px;
+}
+
+.kune-Margin-Mini-tl {
+  margin-top: 1px;
+  margin-left: 1px;
+}
+
+.kune-Margin-Mini-tb {
+  margin-top: 1px;
+  margin-bottom: 1px;
+}
+
+.kune-Margin-Mini-t {
+  margin-top: 1px;
+}
+
+.kune-Margin-Mini-r {
+  margin-right: 1px;
+}
+
+.kune-Margin-Mini-b {
+  margin-bottom: 1px;
+}
+
+.kune-Margin-Mini-l {
+  margin-left: 1px;
+}

Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css	2011-01-28 01:41:24 UTC (rev 1226)
@@ -266,12 +266,6 @@
 }
 
 
-.kune-link {
-  text-decoration: underline;
-  color: green;
-  cursor: pointer;
-}
-
 /* DropDowns */
 
 .kune-DropDownOuter {
@@ -305,241 +299,6 @@
   vertical-align: middle;
 }
 
-/* Margins */
-
-.kune-Margin-40-trbl {
-  margin: 40px;
-}
-
-.kune-Margin-40-lr {
-  margin-left: 40px;
-  margin-right: 40px;
-}
-
-.kune-Margin-40-tl {
-  margin-top: 40px;
-  margin-left: 40px;
-}
-
-.kune-Margin-40-tb {
-  margin-top: 40px;
-  margin-bottom: 40px;
-}
-
-.kune-Margin-40-t {
-  margin-top: 40px;
-}
-
-.kune-Margin-40-r {
-  margin-right: 40px;
-}
-
-.kune-Margin-40-l {
-  margin-left: 40px;
-}
-
-.kune-Margin-20-trbl {
-  margin: 20px;
-}
-
-.kune-Margin-20-lr {
-  margin-left: 20px;
-  margin-right: 20px;
-}
-
-.kune-Margin-20-tl {
-  margin-top: 20px;
-  margin-left: 20px;
-}
-
-.kune-Margin-20-tb {
-  margin-top: 20px;
-  margin-bottom: 20px;
-}
-
-.kune-Margin-20-t {
-  margin-top: 20px;
-}
-
-.kune-Margin-20-r {
-  margin-right: 20px;
-}
-
-.kune-Margin-20-l {
-  margin-left: 20px;
-}
-
-.kune-Margin-Large-trbl {
-  margin: 10px;
-}
-
-.kune-Margin-Large-lr {
-  margin-left: 10px;
-  margin-right: 10px;
-}
-
-.kune-Margin-Large-tl {
-  margin-top: 10px;
-  margin-left: 10px;
-}
-
-.kune-Margin-Large-tb {
-  margin-top: 10px;
-  margin-bottom: 10px;
-}
-
-.kune-Margin-Large-t {
-  margin-top: 10px;
-}
-
-.kune-Margin-Large-r {
-  margin-right: 10px;
-}
-
-.kune-Margin-Large-l {
-  margin-left: 10px;
-}
-
-.kune-Margin-7-trbl {
-  margin: 7px;
-}
-
-.kune-Margin-7-lr {
-  margin-left: 7px;
-  margin-right: 7px;
-}
-
-.kune-Margin-7-tl {
-  margin-top: 7px;
-  margin-left: 7px;
-}
-
-.kune-Margin-7-tb {
-  margin-top: 7px;
-  margin-bottom: 7px;
-}
-
-.kune-Margin-7-t {
-  margin-top: 7px;
-}
-
-.kune-Margin-7-r {
-  margin-right: 7px;
-}
-
-.kune-Margin-7-b {
-  margin-bottom: 7px;
-}
-
-.kune-Margin-7-l {
-  margin-left: 7px;
-}
-
-.kune-Margin-Medium-trbl {
-  margin: 5px;
-}
-
-.kune-Margin-Medium-lr {
-  margin-left: 5px;
-  margin-right: 5px;
-}
-
-.kune-Margin-Medium-tl {
-  margin-top: 5px;
-  margin-left: 5px;
-}
-
-.kune-Margin-Medium-tb {
-  margin-top: 5px;
-  margin-bottom: 5px;
-}
-
-.kune-Margin-Medium-t {
-  margin-top: 5px;
-}
-
-.kune-Margin-Medium-r {
-  margin-right: 5px;
-}
-
-.kune-Margin-Medium-b {
-  margin-bottom: 5px;
-}
-
-.kune-Margin-Medium-l {
-  margin-left: 5px;
-}
-
-.kune-Margin-Small-trbl {
-  margin: 3px;
-}
-
-.kune-Margin-Small-lr {
-  margin-left: 3px;
-  margin-right: 3px;
-}
-
-.kune-Margin-Small-tl {
-  margin-top: 3px;
-  margin-left: 3px;
-}
-
-.kune-Margin-Small-tb {
-  margin-top: 3px;
-  margin-bottom: 3px;
-}
-
-.kune-Margin-Small-t {
-  margin-top: 3px;
-}
-
-.kune-Margin-Small-l {
-  margin-left: 3px;
-}
-
-.kune-Margin-Small-r {
-  margin-right: 3px;
-}
-
-.kune-Margin-Small-b {
-  margin-bottom: 3px;
-}
-
-.kune-Margin-Mini-trbl {
-  margin: 1px;
-}
-
-.kune-Margin-Mini-lr {
-  margin-left: 1px;
-  margin-right: 1px;
-}
-
-.kune-Margin-Mini-tl {
-  margin-top: 1px;
-  margin-left: 1px;
-}
-
-.kune-Margin-Mini-tb {
-  margin-top: 1px;
-  margin-bottom: 1px;
-}
-
-.kune-Margin-Mini-t {
-  margin-top: 1px;
-}
-
-.kune-Margin-Mini-r {
-  margin-right: 1px;
-}
-
-.kune-Margin-Mini-b {
-  margin-bottom: 1px;
-}
-
-.kune-Margin-Mini-l {
-  margin-left: 1px;
-}
-
 /* Fonts
 see: http://developer.yahoo.com/yui/fonts/ */
 

Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -26,7 +26,6 @@
 
 import org.ourproject.kune.blogs.client.cnt.BlogViewer;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -39,6 +38,7 @@
 import org.ourproject.kune.workspace.client.upload.FileUploader;
 import org.ourproject.kune.workspace.client.wave.WaveInsert;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.errors.ErrorHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.rpcservices.ContentServiceAsync;
@@ -51,7 +51,7 @@
 public class BlogClientActions extends AbstractFoldableContentActions {
     public BlogClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
             final Session session, final StateManager stateManager,
-            final DeferredCommandWrapper deferredCommandWrapper,
+            final SchedulerManager deferredCommandWrapper,
             final Provider<ContentServiceAsync> contentServiceProvider,
             final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider,
             final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,

Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -34,7 +34,6 @@
 import org.ourproject.kune.platf.client.services.AbstractExtendedModule;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -50,6 +49,7 @@
 import org.ourproject.kune.workspace.client.upload.FileUploader;
 import org.ourproject.kune.workspace.client.wave.WaveInsert;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.errors.ErrorHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.rpcservices.ContentServiceAsync;
@@ -79,7 +79,7 @@
             @Override
             public BlogClientActions create() {
                 return new BlogClientActions(i(I18nUITranslationService.class), i(ContextNavigator.class),
-                        i(Session.class), i(StateManager.class), i(DeferredCommandWrapper.class),
+                        i(Session.class), i(StateManager.class), i(SchedulerManager.class),
                         p(ContentServiceAsync.class), p(GroupServiceAsync.class), p(FileUploader.class),
                         i(ContentActionRegistry.class), i(ContextActionRegistry.class), p(FileDownloadUtils.class),
                         i(EntityHeader.class), p(ContentEditor.class), i(ErrorHandler.class), i(BlogViewer.class),

Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -26,12 +26,12 @@
 import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
 import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
 import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.wiki.client.WikiClientTool;
 import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.shared.domain.ContentStatus;
@@ -39,23 +39,23 @@
 import cc.kune.core.shared.dto.AccessRolDTO;
 
 import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
 import com.calclab.suco.client.ioc.Provider;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
 
 public class ChatClientActions {
 
-    private final Session session;
+    private final Provider<AddRoom> addRoomProvider;
     private final Provider<ChatEngine> chatEngineProvider;
     private final ContentActionRegistry contentActionRegistry;
+    private final ContextActionRegistry contextActionRegistry;
+    private final Provider<SchedulerManager> deferredWrapper;
     private final I18nUITranslationService i18n;
-    private final ContextActionRegistry contextActionRegistry;
-    private final Provider<AddRoom> addRoomProvider;
-    private final Provider<DeferredCommandWrapper> deferredWrapper;
+    private final Session session;
 
     public ChatClientActions(final I18nUITranslationService i18n, final Session session,
             final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
             final Provider<ChatEngine> chatEngine, final Provider<AddRoom> addRoomProvider,
-            final Provider<DeferredCommandWrapper> deferredWrapper) {
+            final Provider<SchedulerManager> deferredWrapper) {
         this.i18n = i18n;
         this.session = session;
         this.contentActionRegistry = contentActionRegistry;
@@ -69,9 +69,11 @@
     private void createActions() {
         final ActionToolbarButtonDescriptor<StateToken> chatAbout = new ActionToolbarButtonDescriptor<StateToken>(
                 AccessRolDTO.Viewer, AbstractFoldableContentActions.CONTENT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken token) {
-                        deferredWrapper.get().addCommand(new Listener0() {
-                            public void onEvent() {
+                        deferredWrapper.get().addCommand(new ScheduledCommand() {
+                            @Override
+                            public void execute() {
                                 final String subject = i18n.t("Chat about: [%s]", session.getContentState().getTitle());
                                 chatEngineProvider.get().joinRoom(token.toString().replaceAll("\\.", "-"), subject,
                                         session.getCurrentUserInfo().getShortName());
@@ -88,6 +90,7 @@
 
         final ActionToolbarButtonDescriptor<StateToken> joinRoom = new ActionToolbarButtonDescriptor<StateToken>(
                 AccessRolDTO.Viewer, AbstractFoldableContentActions.CONTENT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken token) {
                         final ChatEngine chatEngine = chatEngineProvider.get();
                         chatEngine.joinRoom(session.getContainerState().getContainer().getName(),
@@ -101,6 +104,7 @@
 
         final ActionToolbarButtonDescriptor<StateToken> addRoom = new ActionToolbarButtonDescriptor<StateToken>(
                 AccessRolDTO.Administrator, AbstractFoldableContentActions.CONTEXT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken token) {
                         addRoomProvider.get().show();
                     }
@@ -123,6 +127,7 @@
 
     private ActionEnableCondition<StateToken> notDeleted() {
         return new ActionEnableCondition<StateToken>() {
+            @Override
             public boolean mustBeEnabled(final StateToken token) {
                 final boolean isNotDeleted = !(session.isCurrentStateAContent() && session.getContentState().getStatus().equals(
                         ContentStatus.inTheDustbin));

Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -33,7 +33,6 @@
 import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -42,6 +41,7 @@
 import org.ourproject.kune.workspace.client.themes.WsThemeManager;
 import org.ourproject.kune.workspace.client.tool.ToolSelector;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.init.AppStarter;
 import cc.kune.core.client.rpcservices.ContentServiceAsync;
@@ -63,7 +63,7 @@
             public ChatClientActions create() {
                 return new ChatClientActions(i(I18nUITranslationService.class), i(Session.class),
                         i(ContentActionRegistry.class), i(ContextActionRegistry.class), p(ChatEngine.class),
-                        p(AddRoom.class), p(DeferredCommandWrapper.class));
+                        p(AddRoom.class), p(SchedulerManager.class));
             }
         });
 

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -27,7 +27,6 @@
 
 import org.ourproject.kune.docs.client.cnt.DocumentViewer;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -40,6 +39,7 @@
 import org.ourproject.kune.workspace.client.upload.FileUploader;
 import org.ourproject.kune.workspace.client.wave.WaveInsert;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.errors.ErrorHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.rpcservices.ContentServiceAsync;
@@ -52,7 +52,7 @@
 public class DocumentClientActions extends AbstractFoldableContentActions {
     public DocumentClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
             final Session session, final StateManager stateManager,
-            final DeferredCommandWrapper deferredCommandWrapper,
+            final SchedulerManager deferredCommandWrapper,
             final Provider<ContentServiceAsync> contentServiceProvider,
             final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider,
             final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,

Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -34,7 +34,6 @@
 import org.ourproject.kune.platf.client.services.AbstractExtendedModule;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -50,6 +49,7 @@
 import org.ourproject.kune.workspace.client.upload.FileUploader;
 import org.ourproject.kune.workspace.client.wave.WaveInsert;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.errors.ErrorHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.rpcservices.ContentServiceAsync;
@@ -79,7 +79,7 @@
             @Override
             public DocumentClientActions create() {
                 return new DocumentClientActions(i(I18nUITranslationService.class), i(ContextNavigator.class),
-                        i(Session.class), i(StateManager.class), i(DeferredCommandWrapper.class),
+                        i(Session.class), i(StateManager.class), i(SchedulerManager.class),
                         p(ContentServiceAsync.class), p(GroupServiceAsync.class), p(FileUploader.class),
                         i(ContentActionRegistry.class), i(ContextActionRegistry.class), p(FileDownloadUtils.class),
                         i(EntityHeader.class), p(ContentEditor.class), i(ErrorHandler.class), i(DocumentViewer.class),

Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -25,7 +25,6 @@
 
 import org.ourproject.kune.gallery.client.cnt.GalleryViewer;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -38,6 +37,7 @@
 import org.ourproject.kune.workspace.client.upload.FileUploader;
 import org.ourproject.kune.workspace.client.wave.WaveInsert;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.errors.ErrorHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.rpcservices.ContentServiceAsync;
@@ -50,7 +50,7 @@
 public class GalleryClientActions extends AbstractFoldableContentActions {
     public GalleryClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
             final Session session, final StateManager stateManager,
-            final DeferredCommandWrapper deferredCommandWrapper,
+            final SchedulerManager deferredCommandWrapper,
             final Provider<ContentServiceAsync> contentServiceProvider,
             final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider,
             final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,

Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientModule.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -34,7 +34,6 @@
 import org.ourproject.kune.platf.client.services.AbstractExtendedModule;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -50,6 +49,7 @@
 import org.ourproject.kune.workspace.client.upload.FileUploader;
 import org.ourproject.kune.workspace.client.wave.WaveInsert;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.errors.ErrorHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.rpcservices.ContentServiceAsync;
@@ -79,7 +79,7 @@
             @Override
             public GalleryClientActions create() {
                 return new GalleryClientActions(i(I18nUITranslationService.class), i(ContextNavigator.class),
-                        i(Session.class), i(StateManager.class), i(DeferredCommandWrapper.class),
+                        i(Session.class), i(StateManager.class), i(SchedulerManager.class),
                         p(ContentServiceAsync.class), p(GroupServiceAsync.class), p(FileUploader.class),
                         i(ContentActionRegistry.class), i(ContextActionRegistry.class), p(FileDownloadUtils.class),
                         i(EntityHeader.class), p(ContentEditor.class), i(ErrorHandler.class), i(GalleryViewer.class),

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -94,10 +94,10 @@
 import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditor;
 import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorPanel;
 import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorPresenter;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
-import org.ourproject.kune.platf.client.utils.TimerWrapper;
 
 import cc.kune.common.client.noti.NotifyLevelImages;
+import cc.kune.common.client.utils.SchedulerManager;
+import cc.kune.common.client.utils.TimerWrapper;
 import cc.kune.core.client.errors.ErrorHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.state.AccessRightsClientManager;
@@ -183,10 +183,10 @@
 //            }
 //        });
 
-        register(Singleton.class, new Factory<DeferredCommandWrapper>(DeferredCommandWrapper.class) {
+        register(Singleton.class, new Factory<SchedulerManager>(SchedulerManager.class) {
             @Override
-            public DeferredCommandWrapper create() {
-                return new DeferredCommandWrapper();
+            public SchedulerManager create() {
+                return new SchedulerManager();
             }
         });
 
@@ -262,7 +262,7 @@
                 final RTEditorPresenter presenter = new RTEditorPresenter(i(I18nTranslationService.class),
                         i(Session.class),  i(RTEImgResources.class), p(InsertLinkDialog.class),
                         p(ColorWebSafePalette.class), p(EditHtmlDialog.class), p(InsertImageDialog.class),
-                        p(InsertMediaDialog.class),   p(InsertTableDialog.class), p(InsertSpecialCharDialog.class), i(DeferredCommandWrapper.class));
+                        p(InsertMediaDialog.class),   p(InsertTableDialog.class), p(InsertSpecialCharDialog.class), i(SchedulerManager.class));
                 final RTEditorPanel panel = new RTEditorPanel(presenter, i(I18nUITranslationService.class),
                          i(GlobalShortcutRegister.class), i(GuiBindingsRegister.class));
                 presenter.init(panel);
@@ -274,7 +274,7 @@
                 final RTESavingEditorPresenter presenter = new RTESavingEditorPresenter(i(I18nTranslationService.class),
                         i(Session.class),  i(RTEImgResources.class), p(InsertLinkDialog.class),
                         p(ColorWebSafePalette.class), p(EditHtmlDialog.class), p(InsertImageDialog.class),
-                        p(InsertMediaDialog.class),   p(InsertTableDialog.class), p(InsertSpecialCharDialog.class), i(DeferredCommandWrapper.class), true,
+                        p(InsertMediaDialog.class),   p(InsertTableDialog.class), p(InsertSpecialCharDialog.class), i(SchedulerManager.class), true,
                          i(StateManager.class),
                         i(TimerWrapper.class));
                 final RTESavingEditorPanel panel = new RTESavingEditorPanel(presenter, i(I18nUITranslationService.class),

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -29,6 +29,7 @@
 import com.gwtext.client.widgets.ToolTip;
 import com.gwtext.client.widgets.form.Field;
 
+ at Deprecated
 public final class KuneUiUtils {
 
     public enum IconPosition {

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileDownloadUtils.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -21,9 +21,9 @@
 
 import org.ourproject.kune.platf.client.services.ImageDescriptor;
 import org.ourproject.kune.platf.client.services.ImageUtils;
-import org.ourproject.kune.platf.client.utils.Url;
-import org.ourproject.kune.platf.client.utils.UrlParam;
 
+import cc.kune.common.client.utils.Url;
+import cc.kune.common.client.utils.UrlParam;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.shared.domain.utils.StateToken;
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -41,8 +41,8 @@
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
 import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
@@ -51,6 +51,7 @@
 import com.calclab.suco.client.events.Listener;
 import com.calclab.suco.client.events.Listener0;
 import com.calclab.suco.client.ioc.Provider;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.user.client.Event;
 
@@ -62,10 +63,12 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             createPalette();
             final Event event = actionEvent.getEvent();
             palette.show(event.getClientX(), event.getClientY(), new Listener<String>() {
+                @Override
                 public void onEvent(final String color) {
                     palette.hide();
                     view.setBackColor(color);
@@ -80,6 +83,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.focus();
             view.insertBlockquote();
@@ -92,6 +96,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.toggleBold();
             fireOnEdit();
@@ -103,21 +108,25 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
-            deferred.addCommand(new Listener0() {
-                public void onEvent() {
+            deferred.addCommand(new ScheduledCommand() {
+                @Override
+                public void execute() {
                     view.focus();
                     final String author = session.isLogged() ? session.getCurrentUser().getShortName()
                             : i18n.t("anonymous user");
                     if (view.isAnythingSelected()) {
                         NotifyUser.askConfirmation(i18n.t("Insert a comment"),
                                 i18n.t("Include the selected text in the comment?"), new Listener0() {
+                                    @Override
                                     public void onEvent() {
                                         // include selection in
                                         // comment
                                         view.insertCommentUsingSelection(author);
                                     }
                                 }, new Listener0() {
+                                    @Override
                                     public void onEvent() {
                                         // not include selection in
                                         // comment;
@@ -144,6 +153,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.copy();
         }
@@ -154,13 +164,16 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
-            deferred.addCommand(new Listener0() {
+            deferred.addCommand(new ScheduledCommand() {
                 private InsertLinkDialog insLinkDialog;
 
-                public void onEvent() {
+                @Override
+                public void execute() {
                     if (insLinkListener == null) {
                         insLinkListener = new Listener<LinkInfo>() {
+                            @Override
                             public void onEvent(final LinkInfo linkInfo) {
                                 final String link = linkInfo.toString();
                                 Log.debug("Link: " + link);
@@ -197,6 +210,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.cut();
             fireOnEdit();
@@ -208,6 +222,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.leftIndent();
             fireOnEdit();
@@ -219,9 +234,11 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
-            deferred.addCommand(new Listener0() {
-                public void onEvent() {
+            deferred.addCommand(new ScheduledCommand() {
+                @Override
+                public void execute() {
                     view.getRangeInfo();
                 }
             });
@@ -235,9 +252,11 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             if (updHtmlListener == null) {
                 updHtmlListener = new Listener<String>() {
+                    @Override
                     public void onEvent(final String html) {
                         view.setHTML(html);
                         fireOnEdit();
@@ -262,6 +281,7 @@
             super.putValue(FONT_NAME, fontName);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             final String fontName = getFontName();
             view.setFontName(fontName);
@@ -279,10 +299,12 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             createPalette();
             final Event event = actionEvent.getEvent();
             palette.show(event.getClientX(), event.getClientY(), new Listener<String>() {
+                @Override
                 public void onEvent(final String color) {
                     palette.hide();
                     view.setForeColor(color);
@@ -302,6 +324,7 @@
             this.fontSize = fontSize;
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.setFontSize(FONT_SIZES[fontSize]);
             fireOnEdit();
@@ -314,6 +337,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.focus();
             view.insertHorizontalRule();
@@ -326,13 +350,16 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
-            deferred.addCommand(new Listener0() {
+            deferred.addCommand(new ScheduledCommand() {
                 private InsertImageDialog insImgDialog;
 
-                public void onEvent() {
+                @Override
+                public void execute() {
                     if (insImgListener == null) {
                         insImgListener = new Listener<ImageInfo>() {
+                            @Override
                             public void onEvent(final ImageInfo imageInfo) {
                                 Log.debug("Image: " + imageInfo);
                                 view.focus();
@@ -358,6 +385,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.rightIndent();
             fireOnEdit();
@@ -369,13 +397,16 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
-            deferred.addCommand(new Listener0() {
+            deferred.addCommand(new ScheduledCommand() {
                 private InsertMediaDialog insMediaDialog;
 
-                public void onEvent() {
+                @Override
+                public void execute() {
                     if (insMediaListener == null) {
                         insMediaListener = new Listener<String>() {
+                            @Override
                             public void onEvent(final String html) {
                                 Log.debug("Media: " + html);
                                 view.focus();
@@ -402,10 +433,12 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             NotifyUser.showProgressLoading();
             if (insCharListener == null) {
                 insCharListener = new Listener<String>() {
+                    @Override
                     public void onEvent(final String character) {
                         view.insertHtml(character);
                     }
@@ -428,9 +461,11 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             if (insTableListener == null) {
                 insTableListener = new Listener<String>() {
+                    @Override
                     public void onEvent(final String table) {
                         view.insertHtml(table);
                         fireOnEdit();
@@ -450,6 +485,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.toggleItalic();
             fireOnEdit();
@@ -461,6 +497,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.justifyCenter();
             fireOnEdit();
@@ -472,6 +509,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.justifyLeft();
             fireOnEdit();
@@ -483,6 +521,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.justifyRight();
             fireOnEdit();
@@ -494,6 +533,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.insertOrderedList();
             fireOnEdit();
@@ -505,6 +545,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.paste();
             fireOnEdit();
@@ -516,6 +557,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.redo();
             fireOnEdit();
@@ -527,6 +569,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.removeFormat();
             fireOnEdit();
@@ -538,9 +581,11 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
-            deferred.addCommand(new Listener0() {
-                public void onEvent() {
+            deferred.addCommand(new ScheduledCommand() {
+                @Override
+                public void execute() {
                     view.unlink();
                     hideLinkCtxMenu();
                     fireOnEdit();
@@ -554,6 +599,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.selectAll();
         }
@@ -564,6 +610,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.toggleStrikethrough();
             fireOnEdit();
@@ -575,6 +622,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.toggleSubscript();
             fireOnEdit();
@@ -586,6 +634,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.toggleSuperscript();
             fireOnEdit();
@@ -597,6 +646,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.insertUnorderedList();
             fireOnEdit();
@@ -608,6 +658,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.toggleUnderline();
             fireOnEdit();
@@ -619,70 +670,71 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             view.undo();
             fireOnEdit();
         }
     }
 
+    private static final String FONT_GROUP = "fontgroup";
     private static final String FONT_NAMES[] = { "Times New Roman", "Arial", "Courier New", "Georgia", "Trebuchet",
             "Verdana" };
     private static final String FONT_SIZE_NAMES[] = { "Extra small", "Very small (normal)", "Small", "Medium", "Large",
             "Very large", "Extra large" };
+    private static final String FONT_SIZEGROUP = "fontsizegroup";
     private static final RichTextArea.FontSize[] FONT_SIZES = new RichTextArea.FontSize[] {
             RichTextArea.FontSize.XX_SMALL, RichTextArea.FontSize.X_SMALL, RichTextArea.FontSize.SMALL,
             RichTextArea.FontSize.MEDIUM, RichTextArea.FontSize.LARGE, RichTextArea.FontSize.X_LARGE,
             RichTextArea.FontSize.XX_LARGE };
-    private static final String FONT_GROUP = "fontgroup";
-    private static final String FONT_SIZEGROUP = "fontsizegroup";
 
-    private RTEditorView view;
+    private GuiActionDescCollection actions;
+    protected boolean attached;
+    private final GuiAddCondition basicAddCond;
+    private PushButtonDescriptor bold;
+    private MenuCheckItemDescriptor currentFontItem;
+    private final SchedulerManager deferred;
+    private final Provider<EditHtmlDialog> editHtmlDialogPv;
+    private MenuDescriptor editMenu;
     private boolean extended;
+    private final GuiAddCondition extendedAddCond;
+    private MenuDescriptor fileMenu;
+    private final Map<String, MenuCheckItemDescriptor> fontActions;
+    private MenuDescriptor fontMenu;
+    private MenuDescriptor fontSizeMenu;
+    private MenuDescriptor formatMenu;
     private final I18nTranslationService i18n;
-    private final Session session;
     private final RTEImgResources imgResources;
-    private final Event0 onEdit;
-    private final DeferredCommandWrapper deferred;
-    private final Provider<ColorWebSafePalette> paletteProvider;
+    private final InputMap inputMap;
+    private final Provider<InsertSpecialCharDialog> insCharDialogProv;
+    protected Listener<String> insCharListener;
+    private MenuDescriptor insertMenu;
+    private final Provider<InsertImageDialog> insImgDialogProv;
+    private Listener<ImageInfo> insImgListener;
     private final Provider<InsertLinkDialog> insLinkDialogPv;
-    private final Provider<EditHtmlDialog> editHtmlDialogPv;
-    private final Provider<InsertImageDialog> insImgDialogProv;
+    private Listener<LinkInfo> insLinkListener;
+    private final Provider<InsertMediaDialog> insMediaDialogPv;
+    private Listener<String> insMediaListener;
     private final Provider<InsertTableDialog> insTableDialogPv;
-    private final Provider<InsertSpecialCharDialog> insCharDialogProv;
-    private final Provider<InsertMediaDialog> insMediaDialogPv;
     private Listener<String> insTableListener;
-    private Listener<LinkInfo> insLinkListener;
-    private Listener<ImageInfo> insImgListener;
-    private Listener<String> insMediaListener;
-    private Listener<String> updHtmlListener;
-    protected Listener<String> insCharListener;
-    protected ColorWebSafePalette palette;
-    private PushButtonDescriptor bold;
     private PushButtonDescriptor italic;
-    private PushButtonDescriptor underline;
-    private PushButtonDescriptor strikethrough;
-    private final GuiAddCondition basicAddCond;
-    private final GuiAddCondition extendedAddCond;
-    private final InputMap inputMap;
-    private MenuDescriptor editMenu;
-    private MenuDescriptor insertMenu;
-    private MenuDescriptor formatMenu;
     private MenuDescriptor linkCtxMenu;
-    private GuiActionDescCollection actions;
-    private MenuDescriptor fontMenu;
-    private MenuDescriptor fontSizeMenu;
-    private MenuDescriptor fileMenu;
     private final List<MenuDescriptor> menus;
-    protected boolean attached;
-    private final Map<String, MenuCheckItemDescriptor> fontActions;
-    private MenuCheckItemDescriptor currentFontItem;
+    private final Event0 onEdit;
+    protected ColorWebSafePalette palette;
+    private final Provider<ColorWebSafePalette> paletteProvider;
+    private final Session session;
+    private PushButtonDescriptor strikethrough;
+    private PushButtonDescriptor underline;
+    private Listener<String> updHtmlListener;
+    private RTEditorView view;
 
     public RTEditorPresenter(final I18nTranslationService i18n, final Session session,
             final RTEImgResources imgResources, final Provider<InsertLinkDialog> insLinkDialog,
             final Provider<ColorWebSafePalette> palette, final Provider<EditHtmlDialog> editHtmlDialog,
             final Provider<InsertImageDialog> insertImageDialog, final Provider<InsertMediaDialog> insertMediaDialog,
             final Provider<InsertTableDialog> insertTableDialog, final Provider<InsertSpecialCharDialog> insCharDialog,
-            final DeferredCommandWrapper deferred) {
+            final SchedulerManager deferred) {
         super();
         this.i18n = i18n;
         this.session = session;
@@ -700,11 +752,13 @@
         this.imgResources = imgResources;
         this.onEdit = new Event0("onRTEEdit");
         extendedAddCond = new GuiAddCondition() {
+            @Override
             public boolean mustBeAdded() {
                 return isAndCanBeExtended();
             }
         };
         basicAddCond = new GuiAddCondition() {
+            @Override
             public boolean mustBeAdded() {
                 return view.canBeBasic();
             }
@@ -719,6 +773,7 @@
         checkForMenus(descriptor);
     }
 
+    @Override
     public void addOnEditListener(final Listener0 listener) {
         onEdit.add(listener);
     }
@@ -727,6 +782,7 @@
         view.adjustSize(height);
     }
 
+    @Override
     public void attach() {
         if (!attached) {
             attached = true;
@@ -735,146 +791,6 @@
         }
     }
 
-    public void detach() {
-        // Nothing at the moment
-    }
-
-    public void fireOnEdit() {
-        onEdit.fire();
-    }
-
-    public GuiAddCondition getBasicAddCondition() {
-        return basicAddCond;
-    }
-
-    public MenuDescriptor getEditMenu() {
-        return editMenu;
-    }
-
-    public View getEditorArea() {
-        return view;
-    }
-
-    public GuiAddCondition getExtendedAddCondition() {
-        return extendedAddCond;
-    }
-
-    public MenuDescriptor getFileMenu() {
-        return fileMenu;
-    }
-
-    public MenuDescriptor getFormatMenu() {
-        return formatMenu;
-    }
-
-    public String getHtml() {
-        return view.getHTML();
-    }
-
-    public MenuDescriptor getInsertMenu() {
-        return insertMenu;
-    }
-
-    public MenuDescriptor getLinkCtxMenu() {
-        return linkCtxMenu;
-    }
-
-    public View getSndBar() {
-        return view.getSndBar();
-    }
-
-    public String getText() {
-        return view.getText();
-    }
-
-    public View getTopBar() {
-        return view.getTopBar();
-    }
-
-    public void init(final RTEditorView view) {
-        this.view = view;
-        createMainMenus();
-        createBasicActions();
-    }
-
-    public void onEditorFocus() {
-        hideMenus();
-    }
-
-    public void onLostFocus() {
-        // Nothing for the moment
-    }
-
-    public void reset() {
-        hideMenus();
-        hideLinkCtxMenu();
-    }
-
-    public void setActionShortcut(final KeyStroke key, final AbstractAction action) {
-        inputMap.put(key, action);
-        action.setShortcut(key);
-    }
-
-    public void setActionShortcut(final KeyStroke key, final AbstractAction mainAction, final AbstractAction... actions) {
-        setActionShortcut(key, mainAction);
-        for (final AbstractAction action : actions) {
-            action.setShortcut(key);
-        }
-    }
-
-    public void setExtended(final boolean newValue) {
-        this.extended = newValue;
-    }
-
-    public void setFocus(final boolean focus) {
-        view.setFocus(focus);
-    }
-
-    public void setHtml(final String html) {
-        view.setHTML(html);
-        view.focus();
-    }
-
-    public void setLocation(final String location, final GuiActionDescrip... descripts) {
-        for (final GuiActionDescrip descript : descripts) {
-            descript.setLocation(location);
-        }
-    }
-
-    public void setText(final String text) {
-        view.setText(text);
-        view.focus();
-    }
-
-    public void updateLinkInfo() {
-        deferred.addCommand(new Listener0() {
-            public void onEvent() {
-                if (isAndCanBeExtended() && view.isLink()) {
-                    view.showLinkCtxMenu();
-                } else {
-                    hideLinkCtxMenu();
-                }
-            }
-        });
-    }
-
-    public void updateStatus() {
-        if (view.canBeBasic()) {
-            bold.setPushed(view.isBold());
-            italic.setPushed(view.isItalic());
-            underline.setPushed(view.isUnderlined());
-            deferred.addCommand(new Listener0() {
-                public void onEvent() {
-                    updateFont();
-                    // Log.warn(view.getFontSize());
-                }
-            });
-        }
-        if (isAndCanBeExtended()) {
-            strikethrough.setPushed(view.isStrikethrough());
-        }
-    }
-
     private void attachActions() {
         for (final GuiActionDescrip descriptor : actions) {
             view.addAction(descriptor);
@@ -1160,6 +1076,75 @@
         }
     }
 
+    @Override
+    public void detach() {
+        // Nothing at the moment
+    }
+
+    public void fireOnEdit() {
+        onEdit.fire();
+    }
+
+    @Override
+    public GuiAddCondition getBasicAddCondition() {
+        return basicAddCond;
+    }
+
+    @Override
+    public MenuDescriptor getEditMenu() {
+        return editMenu;
+    }
+
+    @Override
+    public View getEditorArea() {
+        return view;
+    }
+
+    @Override
+    public GuiAddCondition getExtendedAddCondition() {
+        return extendedAddCond;
+    }
+
+    @Override
+    public MenuDescriptor getFileMenu() {
+        return fileMenu;
+    }
+
+    @Override
+    public MenuDescriptor getFormatMenu() {
+        return formatMenu;
+    }
+
+    @Override
+    public String getHtml() {
+        return view.getHTML();
+    }
+
+    @Override
+    public MenuDescriptor getInsertMenu() {
+        return insertMenu;
+    }
+
+    @Override
+    public MenuDescriptor getLinkCtxMenu() {
+        return linkCtxMenu;
+    }
+
+    @Override
+    public View getSndBar() {
+        return view.getSndBar();
+    }
+
+    @Override
+    public String getText() {
+        return view.getText();
+    }
+
+    @Override
+    public View getTopBar() {
+        return view.getTopBar();
+    }
+
     private void hideLinkCtxMenu() {
         if (view.isCtxMenuVisible()) {
             view.hideLinkCtxMenu();
@@ -1175,10 +1160,73 @@
         }
     }
 
+    public void init(final RTEditorView view) {
+        this.view = view;
+        createMainMenus();
+        createBasicActions();
+    }
+
     private boolean isAndCanBeExtended() {
         return extended && view.canBeExtended();
     }
 
+    public void onEditorFocus() {
+        hideMenus();
+    }
+
+    public void onLostFocus() {
+        // Nothing for the moment
+    }
+
+    @Override
+    public void reset() {
+        hideMenus();
+        hideLinkCtxMenu();
+    }
+
+    @Override
+    public void setActionShortcut(final KeyStroke key, final AbstractAction action) {
+        inputMap.put(key, action);
+        action.setShortcut(key);
+    }
+
+    @Override
+    public void setActionShortcut(final KeyStroke key, final AbstractAction mainAction, final AbstractAction... actions) {
+        setActionShortcut(key, mainAction);
+        for (final AbstractAction action : actions) {
+            action.setShortcut(key);
+        }
+    }
+
+    @Override
+    public void setExtended(final boolean newValue) {
+        this.extended = newValue;
+    }
+
+    @Override
+    public void setFocus(final boolean focus) {
+        view.setFocus(focus);
+    }
+
+    @Override
+    public void setHtml(final String html) {
+        view.setHTML(html);
+        view.focus();
+    }
+
+    @Override
+    public void setLocation(final String location, final GuiActionDescrip... descripts) {
+        for (final GuiActionDescrip descript : descripts) {
+            descript.setLocation(location);
+        }
+    }
+
+    @Override
+    public void setText(final String text) {
+        view.setText(text);
+        view.focus();
+    }
+
     private void updateFont() {
         final String currentFont = view.getFont();
         final MenuCheckItemDescriptor item = fontActions.get(currentFont);
@@ -1193,4 +1241,35 @@
             fontMenu.setText((String) item.getValue(FontAction.FONT_NAME));
         }
     }
+
+    public void updateLinkInfo() {
+        deferred.addCommand(new ScheduledCommand() {
+            @Override
+            public void execute() {
+                if (isAndCanBeExtended() && view.isLink()) {
+                    view.showLinkCtxMenu();
+                } else {
+                    hideLinkCtxMenu();
+                }
+            }
+        });
+    }
+
+    public void updateStatus() {
+        if (view.canBeBasic()) {
+            bold.setPushed(view.isBold());
+            italic.setPushed(view.isItalic());
+            underline.setPushed(view.isUnderlined());
+            deferred.addCommand(new ScheduledCommand() {
+                @Override
+                public void execute() {
+                    updateFont();
+                    // Log.warn(view.getFontSize());
+                }
+            });
+        }
+        if (isAndCanBeExtended()) {
+            strikethrough.setPushed(view.isStrikethrough());
+        }
+    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenter.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -20,10 +20,11 @@
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
 import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
-import org.ourproject.kune.platf.client.utils.TimerWrapper;
 
 import cc.kune.common.client.actions.BeforeActionListener;
+import cc.kune.common.client.utils.SchedulerManager;
+import cc.kune.common.client.utils.TimerWrapper;
+import cc.kune.common.client.utils.TimerWrapper.Executer;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -31,6 +32,7 @@
 import com.calclab.suco.client.events.Listener;
 import com.calclab.suco.client.events.Listener0;
 import com.calclab.suco.client.ioc.Provider;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
 import com.google.gwt.resources.client.ImageResource;
 
 
@@ -41,6 +43,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             // bitwise, similar to: autoSave = !autoSave; but fast
             autoSave ^= true;
@@ -57,6 +60,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             onCancelImpl();
         }
@@ -66,6 +70,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             onDoSaveImpl();
         }
@@ -76,6 +81,7 @@
             super(text, tooltip, icon);
         }
 
+        @Override
         public void actionPerformed(final ActionEvent actionEvent) {
             if (savePending) {
                 timer.cancel();
@@ -89,27 +95,27 @@
     public static final int AUTOSAVE_AFTER_FAIL_MILLS = 20000;
     public static final int AUTOSAVE_IN_MILLIS = 10000;
     private boolean autoSave;
+    private final BeforeActionListener beforeStateChg;
+    private final SchedulerManager deferred;
+    private final I18nTranslationService i18n;
+    private final RTEImgResources imgResources;
+    private Listener0 onEditCancelled;
+    private Listener<String> onSave;
+    SaveAction saveAction;
+    private boolean saveCloseConfirmed;
+    private SaveAction saveMenuAction;
     private boolean savePending;
-    private boolean saveCloseConfirmed;
-    private Listener<String> onSave;
-    private Listener0 onEditCancelled;
-    private final RTEImgResources imgResources;
+    private final StateManager stateManager;
+
     private final TimerWrapper timer;
-    private final DeferredCommandWrapper deferred;
-    private final I18nTranslationService i18n;
-    private final StateManager stateManager;
-    private final BeforeActionListener beforeStateChg;
     private RTESavingEditorView view;
 
-    SaveAction saveAction;
-    private SaveAction saveMenuAction;
-
     public RTESavingEditorPresenter(final I18nTranslationService i18n, final Session session,
             final RTEImgResources imgResources, final Provider<InsertLinkDialog> insLinkDialog,
             final Provider<ColorWebSafePalette> palette, final Provider<EditHtmlDialog> editHtmlDialog,
             final Provider<InsertImageDialog> insertImageDialog, final Provider<InsertMediaDialog> insertMediaDialog,
             final Provider<InsertTableDialog> insertTableDialog, final Provider<InsertSpecialCharDialog> insCharDialog,
-            final DeferredCommandWrapper deferred, final boolean autoSave,
+            final SchedulerManager deferred, final boolean autoSave,
             final StateManager stateManager,             final TimerWrapper timer) {
         super(i18n, session, imgResources, insLinkDialog, palette, editHtmlDialog, insertImageDialog, insertMediaDialog, insertTableDialog, insCharDialog, deferred);
         this.autoSave = autoSave;
@@ -120,95 +126,36 @@
         this.savePending = false;
         this.saveCloseConfirmed = false;
         this.timer =  timer;
-        timer.configure(new Listener0() {;
+        timer.configure(new Executer() {;
 
-        public void onEvent() {
+        @Override
+        public void execute() {
             onAutoSave();
         }
         });
 
         super.addOnEditListener(new Listener0() {
+            @Override
             public void onEvent() {
                 onEdit();
             }
         });
         beforeStateChg = new BeforeActionListener() {
+            @Override
             public boolean beforeAction() {
                 return beforeTokenChange();
             }
         };
     }
 
-    public void edit(final String html, final Listener<String> onSave, final Listener0 onEditCancelled) {
-        this.onSave = onSave;
-        this.onEditCancelled = onEditCancelled;
-        super.setHtml(html);
-        super.attach();
-        stateManager.addBeforeStateChangeListener(beforeStateChg);
-        enableSaveBtn(false);
-    }
-
-    public BeforeActionListener getBeforeSavingListener() {
-        return beforeStateChg;
-    }
-
-    public void init(final RTESavingEditorView view) {
-        super.init(view);
-        this.view = view;
-        createActions();
-    }
-
-    public boolean isSavePending() {
-        return savePending;
-    }
-
-    public void onDoSaveAndClose() {
-        onDoSaveAndCloseImpl();
-    }
-
-    public void onSavedSuccessful() {
-        if (saveCloseConfirmed) {
-            onCancelConfirmed();
-        } else {
-            reset();
-        }
-    }
-
-    public void onSaveFailed() {
-        timer.schedule(AUTOSAVE_AFTER_FAIL_MILLS);
-        if (saveCloseConfirmed) {
-            saveCloseConfirmed = false;
-        }
-    }
-
-    @Override
-    public void reset() {
-        timer.cancel();
-        savePending = false;
-        saveCloseConfirmed = false;
-        enableSaveBtn(false);
-        super.reset();
-    }
-
-    protected void onAutoSave() {
-        onDoSave();
-    }
-
-    protected void onCancel() {
-        onCancelImpl();
-    }
-
-    protected void onCancelConfirmed() {
-        onCancelConfirmedImpl();
-    }
-
     boolean beforeTokenChange() {
         boolean result = false;
         if (savePending) {
             onCancelImpl();
         } else {
-            deferred.addCommand(new Listener0() {
-                public void onEvent() {
+            deferred.addCommand(new ScheduledCommand() {
+                @Override
+                public void execute() {
                     onCancelConfirmed();
                 }
             });
@@ -217,20 +164,6 @@
         return result;
     }
 
-    void onDoSave() {
-        onDoSaveImpl();
-    }
-
-    void onEdit() {
-        if (!savePending) {
-            savePending = true;
-            if (autoSave) {
-                timer.schedule(AUTOSAVE_IN_MILLIS);
-            }
-            enableSaveBtn(true);
-        }
-    }
-
     private void createActions() {
         saveAction = new SaveAction(NO_TEXT, i18n.t("Save"),imgResources.save());
 
@@ -272,11 +205,49 @@
         addAction(closeItem);
     }
 
+    @Override
+    public void edit(final String html, final Listener<String> onSave, final Listener0 onEditCancelled) {
+        this.onSave = onSave;
+        this.onEditCancelled = onEditCancelled;
+        super.setHtml(html);
+        super.attach();
+        stateManager.addBeforeStateChangeListener(beforeStateChg);
+        enableSaveBtn(false);
+    }
+
     private void enableSaveBtn(final boolean enabled) {
         saveAction.setEnabled(enabled);
         saveMenuAction.setEnabled(enabled);
     }
 
+    @Override
+    public BeforeActionListener getBeforeSavingListener() {
+        return beforeStateChg;
+    }
+
+    public void init(final RTESavingEditorView view) {
+        super.init(view);
+        this.view = view;
+        createActions();
+    }
+
+    @Override
+    public boolean isSavePending() {
+        return savePending;
+    }
+
+    protected void onAutoSave() {
+        onDoSave();
+    }
+
+    protected void onCancel() {
+        onCancelImpl();
+    }
+
+    protected void onCancelConfirmed() {
+        onCancelConfirmedImpl();
+    }
+
     private void onCancelConfirmedImpl() {
         stateManager.removeBeforeStateChangeListener(beforeStateChg);
         stateManager.resumeTokenChange();
@@ -289,11 +260,13 @@
         if (savePending) {
             timer.cancel();
             final Listener0 onYes = new Listener0() {
+                @Override
                 public void onEvent() {
                     onDoSaveAndCloseImpl();
                 }
             };
             final Listener0 onCancel = new Listener0() {
+                @Override
                 public void onEvent() {
                     onCancelConfirmedImpl();
                 }
@@ -309,6 +282,14 @@
         onEditCancelled.onEvent();
     }
 
+    void onDoSave() {
+        onDoSaveImpl();
+    }
+
+    public void onDoSaveAndClose() {
+        onDoSaveAndCloseImpl();
+    }
+
     private void onDoSaveAndCloseImpl() {
         saveCloseConfirmed = true;
         onDoSaveImpl();
@@ -317,4 +298,40 @@
     private void onDoSaveImpl() {
         onSave.onEvent(super.getHtml());
     }
+
+    void onEdit() {
+        if (!savePending) {
+            savePending = true;
+            if (autoSave) {
+                timer.schedule(AUTOSAVE_IN_MILLIS);
+            }
+            enableSaveBtn(true);
+        }
+    }
+
+    @Override
+    public void onSavedSuccessful() {
+        if (saveCloseConfirmed) {
+            onCancelConfirmed();
+        } else {
+            reset();
+        }
+    }
+
+    @Override
+    public void onSaveFailed() {
+        timer.schedule(AUTOSAVE_AFTER_FAIL_MILLS);
+        if (saveCloseConfirmed) {
+            saveCloseConfirmed = false;
+        }
+    }
+
+    @Override
+    public void reset() {
+        timer.cancel();
+        savePending = false;
+        saveCloseConfirmed = false;
+        enableSaveBtn(false);
+        super.reset();
+    }
 }

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/utils/Convert.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/utils/Convert.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/utils/Convert.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 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.utils;
-
-public final class Convert {
-    public static int toInt(final String value) {
-        return Integer.valueOf(value);
-    }
-
-    private Convert() {
-    };
-}

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/utils/DeferredCommandWrapper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/utils/DeferredCommandWrapper.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/utils/DeferredCommandWrapper.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -1,45 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 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.utils;
-
-import com.calclab.suco.client.events.Listener0;
-import com.google.gwt.core.client.Scheduler;
-import com.google.gwt.core.client.Scheduler.ScheduledCommand;
-
-/**
- * The Class DeferredCommandWrapper is a wrapper of the GWT DeferredCommand
- * (used for testing classes without GWT dependencies).
- */
-public class DeferredCommandWrapper {
-
-    /**
-     * Adds the command.
-     * 
-     * @param command
-     *            the listener
-     */
-    public void addCommand(final Listener0 command) {
-        Scheduler.get().scheduleDeferred(new ScheduledCommand() {
-            public void execute() {
-                command.onEvent();
-            }
-        });
-    }
-}

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/utils/TimerWrapper.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -1,36 +0,0 @@
-package org.ourproject.kune.platf.client.utils;
-
-import com.calclab.suco.client.events.Listener0;
-import com.google.gwt.user.client.Timer;
-
-public class TimerWrapper {
-    private Timer timer;
-
-    public TimerWrapper() {
-    }
-
-    public void cancel() {
-        timer.cancel();
-    }
-
-    public void configure(final Listener0 onTime) {
-        timer = new Timer() {
-            @Override
-            public void run() {
-                onTime.onEvent();
-            }
-        };
-    }
-
-    public void run() {
-        timer.run();
-    }
-
-    public void schedule(final int delayMillis) {
-        timer.schedule(delayMillis);
-    }
-
-    public void scheduleRepeating(final int delayMillis) {
-        timer.scheduleRepeating(delayMillis);
-    }
-}

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/utils/Url.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/utils/Url.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/utils/Url.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -1,63 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 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.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Url {
-    private final String base;
-    private final List<UrlParam> params;
-
-    public Url(final String base) {
-        this.base = base;
-        params = new ArrayList<UrlParam>();
-    }
-
-    public Url(final String base, final UrlParam... iniParams) {
-        this(base);
-        for (UrlParam param : iniParams) {
-            addImpl(param);
-        }
-    }
-
-    public void add(final UrlParam param) {
-        addImpl(param);
-    }
-
-    @Override
-    public String toString() {
-        String paramPart = "";
-        boolean first = true;
-        for (UrlParam param : params) {
-            if (first) {
-                paramPart = "?" + param;
-                first = false;
-            } else {
-                paramPart += "&" + param;
-            }
-        }
-        return base + paramPart;
-    }
-
-    private void addImpl(final UrlParam param) {
-        params.add(param);
-    }
-}

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/utils/UrlParam.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/utils/UrlParam.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/utils/UrlParam.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -1,48 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 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.utils;
-
-public class UrlParam {
-    private final String value;
-    private final String name;
-
-    public UrlParam(String name, boolean value) {
-        this.name = name;
-        this.value = value ? "true" : "false";
-    }
-
-    public UrlParam(String name, String value) {
-        this.name = name;
-        this.value = value;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public String getValue() {
-        return value;
-    }
-
-    @Override
-    public String toString() {
-        return name + "=" + value;
-    }
-}

Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientActions.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -25,7 +25,6 @@
 import static org.ourproject.kune.wiki.client.WikiClientTool.TYPE_WIKIPAGE;
 
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.wiki.client.cnt.WikiViewer;
 import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
@@ -39,6 +38,7 @@
 import org.ourproject.kune.workspace.client.upload.FileUploader;
 import org.ourproject.kune.workspace.client.wave.WaveInsert;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.errors.ErrorHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.rpcservices.ContentServiceAsync;
@@ -51,7 +51,7 @@
 public class WikiClientActions extends AbstractFoldableContentActions {
     public WikiClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
             final Session session, final StateManager stateManager,
-            final DeferredCommandWrapper deferredCommandWrapper,
+            final SchedulerManager deferredCommandWrapper,
             final Provider<ContentServiceAsync> contentServiceProvider,
             final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider,
             final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,

Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientModule.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -24,7 +24,6 @@
 import org.ourproject.kune.platf.client.services.AbstractExtendedModule;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.wiki.client.cnt.WikiFolderContent;
 import org.ourproject.kune.wiki.client.cnt.WikiFolderContentPanel;
 import org.ourproject.kune.wiki.client.cnt.WikiFolderContentPresenter;
@@ -50,6 +49,7 @@
 import org.ourproject.kune.workspace.client.upload.FileUploader;
 import org.ourproject.kune.workspace.client.wave.WaveInsert;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.errors.ErrorHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.rpcservices.ContentServiceAsync;
@@ -79,7 +79,7 @@
             @Override
             public WikiClientActions create() {
                 return new WikiClientActions(i(I18nUITranslationService.class), i(ContextNavigator.class),
-                        i(Session.class), i(StateManager.class), i(DeferredCommandWrapper.class),
+                        i(Session.class), i(StateManager.class), i(SchedulerManager.class),
                         p(ContentServiceAsync.class), p(GroupServiceAsync.class), p(FileUploader.class),
                         i(ContentActionRegistry.class), i(ContextActionRegistry.class), p(FileDownloadUtils.class),
                         i(EntityHeader.class), p(ContentEditor.class), i(ErrorHandler.class), i(WikiViewer.class),

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -33,7 +33,6 @@
 import org.ourproject.kune.platf.client.actions.RadioMustBeChecked;
 import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
 import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
 import org.ourproject.kune.workspace.client.cnt.ContentActionRegistry;
 import org.ourproject.kune.workspace.client.cnt.FoldableContent;
 import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -46,6 +45,7 @@
 import org.ourproject.kune.workspace.client.upload.FileUploader;
 import org.ourproject.kune.workspace.client.wave.WaveInsert;
 
+import cc.kune.common.client.utils.SchedulerManager;
 import cc.kune.core.client.errors.ErrorHandler;
 import cc.kune.core.client.errors.SessionExpiredException;
 import cc.kune.core.client.i18n.I18nUITranslationService;
@@ -67,6 +67,7 @@
 import com.calclab.suco.client.events.Listener;
 import com.calclab.suco.client.events.Listener0;
 import com.calclab.suco.client.ioc.Provider;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 
 public abstract class AbstractFoldableContentActions {
@@ -75,39 +76,38 @@
         cnt, ctx
     }
 
-    private static final String PUBLICATION_MENU = "Publication";
+    public static final ActionToolbarPosition CONTENT_BOTTOMBAR = new ActionToolbarPosition("afca-ctn-bottom");
 
     public static final ActionToolbarPosition CONTENT_TOPBAR = new ActionToolbarPosition("afca-ctn-top");
-    public static final ActionToolbarPosition CONTENT_BOTTOMBAR = new ActionToolbarPosition("afca-ctn-bottom");
+    public static final ActionToolbarPosition CONTEXT_BOTTOMBAR = new ActionToolbarPosition("afca-ctx-bottom");
     public static final ActionToolbarPosition CONTEXT_TOPBAR = new ActionToolbarPosition("afca-ctx-top");
-    public static final ActionToolbarPosition CONTEXT_BOTTOMBAR = new ActionToolbarPosition("afca-ctx-bottom");
+    private static final String PUBLICATION_MENU = "Publication";
 
-    protected final Session session;
-    protected final StateManager stateManager;
-    protected final I18nUITranslationService i18n;
+    protected final ContentActionRegistry contentActionRegistry;
     protected final Provider<ContentServiceAsync> contentServiceProvider;
-    protected final Provider<FileUploader> fileUploaderProvider;
+    protected final ContextActionRegistry contextActionRegistry;
     protected final ContextNavigator contextNavigator;
+    protected final Provider<ContextPropEditor> contextPropEditorProvider;
+    protected final SchedulerManager deferredCommandWrapper;
+    protected final EntityHeader entityLogo;
     protected final ErrorHandler errorHandler;
-    protected final Provider<GroupServiceAsync> groupServiceProvider;
-    protected final ContentActionRegistry contentActionRegistry;
-    protected final ContextActionRegistry contextActionRegistry;
     protected final Provider<FileDownloadUtils> fileDownloadProvider;
-    protected final Provider<ContentEditor> textEditorProvider;
-    protected final Provider<ContextPropEditor> contextPropEditorProvider;
+    protected final Provider<FileUploader> fileUploaderProvider;
     protected final FoldableContent foldableContent;
-    protected final DeferredCommandWrapper deferredCommandWrapper;
-    protected final EntityHeader entityLogo;
+    protected final Provider<GroupServiceAsync> groupServiceProvider;
+    protected final I18nUITranslationService i18n;
     private final SitePublicSpaceLink publicLink;
+    protected final Session session;
+    protected final StateManager stateManager;
+    protected final Provider<ContentEditor> textEditorProvider;
 
+    private final Provider<WaveInsert> waveInsert;
+
     private final WsBackManager wsBackManager;
 
-    private final Provider<WaveInsert> waveInsert;
-
     public AbstractFoldableContentActions(final Session session, final StateManager stateManager,
             final I18nUITranslationService i18n, final ErrorHandler errorHandler,
-            final DeferredCommandWrapper deferredCommandWrapper,
-            final Provider<GroupServiceAsync> groupServiceProvider,
+            final SchedulerManager deferredCommandWrapper, final Provider<GroupServiceAsync> groupServiceProvider,
             final Provider<ContentServiceAsync> contentServiceProvider,
             final Provider<FileUploader> fileUploaderProvider, final ContextNavigator contextNavigator,
             final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
@@ -136,6 +136,7 @@
         this.waveInsert = waveInsert;
         createActions();
         session.onInitDataReceived(new Listener<InitDataDTO>() {
+            @Override
             public void onEvent(final InitDataDTO parameter) {
                 createPostSessionInitActions();
             }
@@ -160,6 +161,7 @@
             final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtn = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken stateToken) {
                         contextNavigator.editItem(stateToken);
                     }
@@ -176,6 +178,7 @@
             final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken token) {
                         NotifyUser.info("Sorry, in development");
                     }
@@ -192,9 +195,11 @@
             final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> delContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken token) {
                         contentServiceProvider.get().delContent(session.getUserHash(), token,
                                 new AsyncCallbackSimple<StateContentDTO>() {
+                                    @Override
                                     public void onSuccess(final StateContentDTO state) {
                                         session.setCurrentState(state);
                                         final StateToken parent = token.copy().clearDocument();
@@ -217,6 +222,7 @@
     protected void createDownloadActions(final String typeUploadedfile) {
         final ActionToolbarButtonDescriptor<StateToken> download = new ActionToolbarButtonDescriptor<StateToken>(
                 AccessRolDTO.Viewer, CONTENT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken token) {
                         downloadContent(token);
                     }
@@ -228,6 +234,7 @@
 
         final ActionMenuItemDescriptor<StateToken> downloadCtx = new ActionMenuItemDescriptor<StateToken>(
                 AccessRolDTO.Viewer, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken token) {
                         downloadContent(token);
                     }
@@ -244,19 +251,23 @@
             final String... registerInTypes) {
         final ActionToolbarButtonDescriptor<StateToken> editContent = new ActionToolbarButtonDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken stateToken) {
                         NotifyUser.showProgressProcessing();
                         session.check(new AsyncCallbackSimple<Void>() {
+                            @Override
                             public void onSuccess(final Void result) {
                                 final ContentEditor editor = textEditorProvider.get();
                                 foldableContent.detach();
                                 contextNavigator.detach();
                                 contextPropEditorProvider.get().attach();
                                 editor.edit(session.getContentState().getContent(), new Listener<String>() {
+                                    @Override
                                     public void onEvent(final String html) {
                                         NotifyUser.showProgressSaving();
                                         contentServiceProvider.get().save(session.getUserHash(), stateToken, html,
                                                 new AsyncCallback<Void>() {
+                                                    @Override
                                                     public void onFailure(final Throwable caught) {
                                                         NotifyUser.hideProgress();
                                                         if (caught instanceof SessionExpiredException) {
@@ -268,6 +279,7 @@
                                                         }
                                                     }
 
+                                                    @Override
                                                     public void onSuccess(final Void param) {
                                                         NotifyUser.hideProgress();
                                                         session.getContentState().setContent(html);
@@ -276,10 +288,12 @@
                                                 });
                                     }
                                 }, new Listener0() {
+                                    @Override
                                     public void onEvent() {
                                         // onClose
-                                        deferredCommandWrapper.addCommand(new Listener0() {
-                                            public void onEvent() {
+                                        deferredCommandWrapper.addCommand(new ScheduledCommand() {
+                                            @Override
+                                            public void execute() {
                                                 foldableContent.attach();
                                                 contextPropEditorProvider.get().detach();
                                                 contextNavigator.attach();
@@ -308,6 +322,7 @@
     protected ActionMenuItemDescriptor<StateToken> createGoAction(final String... registerInTypes) {
         final ActionMenuItemDescriptor<StateToken> go = new ActionMenuItemDescriptor<StateToken>(AccessRolDTO.Viewer,
                 new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken token) {
                         stateManager.gotoToken(token);
                     }
@@ -322,6 +337,7 @@
     protected ActionToolbarButtonDescriptor<StateToken> createGoHomeAction(final String... registerInTypes) {
         final ActionToolbarButtonDescriptor<StateToken> goGroupHome = new ActionToolbarButtonDescriptor<StateToken>(
                 AccessRolDTO.Viewer, CONTEXT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken token) {
                         stateManager.gotoToken(token.getGroup());
                     }
@@ -329,6 +345,7 @@
         goGroupHome.setMustBeAuthenticated(false);
         goGroupHome.setIconUrl("images/group-home.png");
         goGroupHome.setEnableCondition(new ActionEnableCondition<StateToken>() {
+            @Override
             public boolean mustBeEnabled(final StateToken token) {
                 final StateToken defContentToken = session.getCurrentState().getGroup().getDefaultContent().getStateToken();
                 return !session.getCurrentStateToken().equals(defContentToken);
@@ -345,10 +362,12 @@
         final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
         addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTEXT_TOPBAR,
                 new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken stateToken) {
                         NotifyUser.showProgressProcessing();
                         contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName,
                                 contentTypeId, new AsyncCallbackSimple<StateContainerDTO>() {
+                                    @Override
                                     public void onSuccess(final StateContainerDTO state) {
                                         contextNavigator.setEditOnNextStateChange(true);
                                         stateManager.setRetrievedState(state);
@@ -368,11 +387,13 @@
             final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> addContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
+                    @Override
                     public void onEvent() {
                         NotifyUser.showProgressProcessing();
                         contentServiceProvider.get().addContent(session.getUserHash(),
                                 session.getCurrentState().getStateToken(), description, typeId,
                                 new AsyncCallbackSimple<StateContentDTO>() {
+                                    @Override
                                     public void onSuccess(final StateContentDTO state) {
                                         contextNavigator.setEditOnNextStateChange(true);
                                         stateManager.setRetrievedState(state);
@@ -394,6 +415,7 @@
             final String... registerInTypes) {
         final ActionToolbarMenuDescriptor<StateToken> refreshCnt = new ActionToolbarMenuDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken stateToken) {
                         stateManager.reload();
                         contextNavigator.selectItem(stateToken);
@@ -411,6 +433,7 @@
             final String... registerInTypes) {
         final ActionToolbarMenuDescriptor<StateToken> refreshCtx = new ActionToolbarMenuDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken stateToken) {
                         stateManager.reload();
                         contextNavigator.selectItem(stateToken);
@@ -428,6 +451,7 @@
             final String parentMenuTitleCtx, final String textDescription, final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtx = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken stateToken) {
                         contextNavigator.editItem(stateToken);
                     }
@@ -443,10 +467,12 @@
         final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupContent;
         setAsDefGroupContent = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Administrator, CONTENT_TOPBAR,
                 new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken token) {
                         NotifyUser.showProgressProcessing();
                         contentServiceProvider.get().setAsDefaultContent(session.getUserHash(), token,
                                 new AsyncCallbackSimple<ContentSimpleDTO>() {
+                                    @Override
                                     public void onSuccess(final ContentSimpleDTO defContent) {
                                         session.getCurrentState().getGroup().setDefaultContent(defContent);
                                         NotifyUser.hideProgress();
@@ -466,9 +492,11 @@
     protected void createSetGroupBackImageAction(final String parentMenuTitle, final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> setGroupBackImage = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken token) {
                         groupServiceProvider.get().setGroupBackImage(session.getUserHash(), token,
                                 new AsyncCallbackSimple<GroupDTO>() {
+                                    @Override
                                     public void onSuccess(final GroupDTO newGroup) {
                                         if (session.getCurrentState().getGroup().getShortName().equals(
                                                 newGroup.getShortName())) {
@@ -484,6 +512,7 @@
         setGroupBackImage.setTextDescription(i18n.t("Set this as the group background image"));
         setGroupBackImage.setIconUrl("images/nav/picture.png");
         setGroupBackImage.setEnableCondition(new ActionEnableCondition<StateToken>() {
+            @Override
             public boolean mustBeEnabled(final StateToken token) {
                 return session.getContentState().getMimeType().isImage();
             }
@@ -495,10 +524,12 @@
             final ContentStatus status, final String[] contentsModerated) {
         final ActionToolbarMenuRadioDescriptor<StateToken> action = new ActionToolbarMenuRadioDescriptor<StateToken>(
                 rol, CONTENT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken stateToken) {
                         setContentStatus(status, stateToken);
                     }
                 }, "ContentRadioStatus", new RadioMustBeChecked() {
+                    @Override
                     public boolean mustBeChecked() {
                         if (session.getContainerState() instanceof StateContentDTO) {
                             final ContentStatus currentStatus = session.getContentState().getStatus();
@@ -516,6 +547,7 @@
     protected void createShowDeletedItems(final String parentMenuTitle, final String... registerInTypes) {
         final ActionToolbarMenuCheckItemDescriptor<StateToken> showDeletedItems = new ActionToolbarMenuCheckItemDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
+                    @Override
                     public void onEvent() {
                         final boolean mustShow = !session.getCurrentUserInfo().getShowDeletedContent();
                         session.getCurrentUserInfo().setShowDeletedContent(mustShow);
@@ -527,6 +559,7 @@
                         contextNavigator.refreshState();
                     }
                 }, new ActionCheckedCondition() {
+                    @Override
                     public boolean mustBeChecked() {
                         return session.getShowDeletedContent();
                     }
@@ -541,6 +574,7 @@
             final String... registerInTypes) {
         final ActionToolbarMenuDescriptor<StateToken> translateContent = new ActionToolbarMenuDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken stateToken) {
                         NotifyUser.important(i18n.t("Sorry, this functionality is currently in development"));
                     }
@@ -560,6 +594,7 @@
         final ActionToolbarButtonAndItemDescriptor<StateToken> uploadFile;
         uploadFile = new ActionToolbarButtonAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTEXT_BOTTOMBAR,
                 new Listener0() {
+                    @Override
                     public void onEvent() {
                         if (permitedExtensions != null) {
                             // FIXME: can't be reset ...
@@ -590,6 +625,7 @@
             final String parentMenuTitle, final Position position, final String... registerInTypes) {
         final ActionToolbarMenuAndItemDescriptor<StateToken> addWave = new ActionToolbarMenuAndItemDescriptor<StateToken>(
                 AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
+                    @Override
                     public void onEvent(final StateToken parentToken) {
                         waveInsert.get().show(parentToken);
                     }
@@ -609,6 +645,7 @@
 
     private ActionEnableCondition<StateToken> notDefAndNotDeleted() {
         return new ActionEnableCondition<StateToken>() {
+            @Override
             public boolean mustBeEnabled(final StateToken token) {
                 final boolean isNotDefContentToken = !session.getCurrentState().getGroup().getDefaultContent().getStateToken().equals(
                         session.getCurrentStateToken());
@@ -619,6 +656,7 @@
 
     private ActionEnableCondition<StateToken> notDeleted() {
         return new ActionEnableCondition<StateToken>() {
+            @Override
             public boolean mustBeEnabled(final StateToken token) {
                 final boolean isNotDeleted = !(session.isCurrentStateAContent() && session.getContentState().getStatus().equals(
                         ContentStatus.inTheDustbin));
@@ -638,6 +676,7 @@
 
     private void setContentStatus(final ContentStatus status, final StateToken stateToken) {
         final AsyncCallbackSimple<StateAbstractDTO> callback = new AsyncCallbackSimple<StateAbstractDTO>() {
+            @Override
             public void onSuccess(final StateAbstractDTO state) {
                 if (session.inSameToken(stateToken)) {
                     session.setCurrentState(state);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -49,8 +49,6 @@
 import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.MediaUtils;
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
 import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
-import org.ourproject.kune.platf.client.utils.TimerWrapper;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbar;
 import org.ourproject.kune.workspace.client.cnt.ActionContentToolbarPresenter;
 import org.ourproject.kune.workspace.client.cnt.ContentIconsRegistry;
@@ -229,6 +227,8 @@
 import org.ourproject.kune.workspace.client.wave.WaveInsertPresenter;
 
 import cc.kune.common.client.noti.NotifyLevelImages;
+import cc.kune.common.client.utils.SchedulerManager;
+import cc.kune.common.client.utils.TimerWrapper;
 import cc.kune.core.client.auth.Register;
 import cc.kune.core.client.auth.SignIn;
 import cc.kune.core.client.errors.ErrorHandler;
@@ -995,7 +995,7 @@
                         i(Session.class), i(RTEImgResources.class), p(InsertLinkDialog.class),
                         p(ColorWebSafePalette.class), p(EditHtmlDialog.class), p(InsertImageDialog.class),
                         p(InsertMediaDialog.class), p(InsertTableDialog.class), p(InsertSpecialCharDialog.class),
-                        i(DeferredCommandWrapper.class), true, i(StateManager.class), i(SiteSignOutLink.class),
+                        i(SchedulerManager.class), true, i(StateManager.class), i(SiteSignOutLink.class),
                         i(WorkspaceSkeleton.class), i(TimerWrapper.class), i(EntityTitle.class));
                 final ContentEditorPanel panel = new ContentEditorPanel(presenter, i(I18nUITranslationService.class),
                         i(GlobalShortcutRegister.class), i(GuiBindingsRegister.class));

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -21,13 +21,13 @@
 import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
 import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
 import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorPresenter;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
-import org.ourproject.kune.platf.client.utils.TimerWrapper;
 import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
 import org.ourproject.kune.workspace.client.skel.Toolbar;
 import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
 import org.ourproject.kune.workspace.client.title.EntityTitle;
 
+import cc.kune.common.client.utils.SchedulerManager;
+import cc.kune.common.client.utils.TimerWrapper;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -69,7 +69,7 @@
             final Provider<ColorWebSafePalette> palette, final Provider<EditHtmlDialog> editHtmlDialog,
             final Provider<InsertImageDialog> insertImageDialog, final Provider<InsertMediaDialog> insertMediaDialog,
             final Provider<InsertTableDialog> insertTableDialog, final Provider<InsertSpecialCharDialog> insCharDialog,
-            final DeferredCommandWrapper deferred, final boolean autoSave, final StateManager stateManager,
+            final SchedulerManager deferred, final boolean autoSave, final StateManager stateManager,
             final SiteSignOutLink siteSignOutLink, final WorkspaceSkeleton wspace, final TimerWrapper timer,
             final EntityTitle entityTitle) {
         super(i18n, session, imgResources, insLinkDialog, palette, editHtmlDialog, insertImageDialog,

Modified: trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenterTest.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPresenterTest.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -9,9 +9,9 @@
 import org.mockito.internal.verification.api.VerificationMode;
 import org.ourproject.kune.platf.client.i18n.Resources;
 import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
-import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
-import org.ourproject.kune.platf.client.utils.TimerWrapper;
 
+import cc.kune.common.client.utils.SchedulerManager;
+import cc.kune.common.client.utils.TimerWrapper;
 import cc.kune.core.client.i18n.I18nTranslationServiceMocked;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -19,24 +19,29 @@
 import com.calclab.suco.client.events.Listener0;
 import com.calclab.suco.testing.events.MockedListener;
 import com.calclab.suco.testing.events.MockedListener0;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
 import com.google.gwt.resources.client.ImageResource;
 
 public class RTESavingEditorPresenterTest {
 
+    private MockedListener0 cancelListener;
+    private SchedulerManager deferredCommandWrapper;
     private RTESavingEditorPresenter presenter;
     private MockedListener<String> saveListener;
-    private MockedListener0 cancelListener;
     private StateManager stateManager;
-    private DeferredCommandWrapper deferredCommandWrapper;
     private TimerWrapper timer;
     private RTESavingEditorView view;
 
+    private void checkSaveBtnDisabled() {
+        assertFalse(presenter.saveAction.isEnabled());
+    }
+
     @Before
     public void createObjects() {
         final I18nTranslationService i18n = new I18nTranslationServiceMocked();
         new Resources(i18n);
         stateManager = Mockito.mock(StateManager.class);
-        deferredCommandWrapper = Mockito.mock(DeferredCommandWrapper.class);
+        deferredCommandWrapper = Mockito.mock(SchedulerManager.class);
 
         final RTEImgResources imgResources = Mockito.mock(RTEImgResources.class);
         final ImageResource img = Mockito.mock(ImageResource.class);
@@ -54,13 +59,23 @@
         cancelListener = new MockedListener0();
     }
 
+    private String editAndChangeHistoryToken() {
+        presenter.edit("Text to edit", saveListener, cancelListener);
+        presenter.onEdit();
+        final String newToken = "somegroup";
+        final boolean change = presenter.beforeTokenChange();
+        assertFalse(change);
+        verifyAskConfirmationCalled(Mockito.times(1));
+        return newToken;
+    }
+
     @Test
     public void historyChangeWithoutPendingMustAccept() {
         presenter.edit("Text to edit", saveListener, cancelListener);
         final boolean change = presenter.beforeTokenChange();
         assertTrue(change);
         verifyAskConfirmationCalled(Mockito.never());
-        Mockito.verify(deferredCommandWrapper, Mockito.times(1)).addCommand((Listener0) Mockito.anyObject());
+        Mockito.verify(deferredCommandWrapper, Mockito.times(1)).addCommand((ScheduledCommand) Mockito.anyObject());
     }
 
     @Test
@@ -127,20 +142,6 @@
         assertTrue(saveListener.isCalled(2));
     }
 
-    private void checkSaveBtnDisabled() {
-        assertFalse(presenter.saveAction.isEnabled());
-    }
-
-    private String editAndChangeHistoryToken() {
-        presenter.edit("Text to edit", saveListener, cancelListener);
-        presenter.onEdit();
-        final String newToken = "somegroup";
-        final boolean change = presenter.beforeTokenChange();
-        assertFalse(change);
-        verifyAskConfirmationCalled(Mockito.times(1));
-        return newToken;
-    }
-
     private void verifyAskConfirmationCalled(final VerificationMode mode) {
         Mockito.verify(view, mode).askConfirmation(Mockito.anyString(), Mockito.anyString(),
                 (Listener0) Mockito.anyObject(), (Listener0) Mockito.anyObject());

Modified: trunk/src/test/java/org/ourproject/kune/platf/client/utils/UrlTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/utils/UrlTest.java	2011-01-28 00:16:03 UTC (rev 1225)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/utils/UrlTest.java	2011-01-28 01:41:24 UTC (rev 1226)
@@ -4,6 +4,9 @@
 
 import org.junit.Test;
 
+import cc.kune.common.client.utils.Url;
+import cc.kune.common.client.utils.UrlParam;
+
 public class UrlTest {
 
     @Test




More information about the kune-commits mailing list