[kune-commits] r1129 - in trunk/src: main/java/org/ourproject/kune/platf/client/actions main/java/org/ourproject/kune/platf/client/actions/common main/java/org/ourproject/kune/platf/client/actions/ui main/java/org/ourproject/kune/platf/client/ui/img main/java/org/ourproject/kune/platf/client/ui/rte/basic main/java/org/ourproject/kune/workspace/client main/java/org/ourproject/kune/workspace/client/options main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu test/java/org/ourproject/kune/platf/integration/selenium

vjrj vjrj at ourproject.org
Sun Jun 14 22:00:57 CEST 2009


Author: vjrj
Date: 2009-06-14 22:00:52 +0200 (Sun, 14 Jun 2009)
New Revision: 1129

Added:
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/common/
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/common/GotoGroupAction.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/group-home.png
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/prefs.png
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/AbstractSiteOptionsPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsView.java
Removed:
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiVisibleCondition.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiVisibleConditionAdapter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenu.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuView.java
Modified:
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractButtonGui.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractComposedGuiItem.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractGuiItem.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuGui.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuItemGui.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/BaseAction.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/ComplexToolbar.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiActionDescrip.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuDescriptor.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuGui.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/SubMenuGui.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgConstants.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgResources.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
   trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java
   trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/SignInSeleniumTest.java
Log:
Complete - task SiteUserOptions extensible 

Incomplete - task EntityHeaderButtons table problems (100% width better to use flowpanel)

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -1,6 +1,5 @@
 package org.ourproject.kune.platf.client.actions;
 
-
 import com.google.gwt.libideas.resources.client.ImageResource;
 
 public abstract class AbstractExtendedAction extends AbstractAction {

Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/common/GotoGroupAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/common/GotoGroupAction.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/common/GotoGroupAction.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -0,0 +1,23 @@
+package org.ourproject.kune.platf.client.actions.common;
+
+import org.ourproject.kune.platf.client.actions.AbstractExtendedAction;
+import org.ourproject.kune.platf.client.actions.Action;
+import org.ourproject.kune.platf.client.actions.ActionEvent;
+import org.ourproject.kune.platf.client.state.StateManager;
+
+public class GotoGroupAction extends AbstractExtendedAction {
+    private final String name;
+    private final StateManager stateManager;
+
+    public GotoGroupAction(final String logoImageUrl, final String name, final StateManager stateManager) {
+        super();
+        this.name = name;
+        this.stateManager = stateManager;
+        putValue(Action.SMALL_ICON, logoImageUrl);
+        putValue(Action.NAME, name);
+    }
+
+    public void actionPerformed(final ActionEvent event) {
+        this.stateManager.gotoToken(name);
+    }
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractButtonGui.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractButtonGui.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractButtonGui.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -66,13 +66,12 @@
 
     @Override
     protected void setIcon(final ImageResource imageResource) {
-        if (imageResource != null) {
-            if (action.getValue(Action.NAME) == null) {
-                button.setIconCls(ImgConstants.CSS_SUFFIX + imageResource.getName());
-            } else {
-                button.setIcon(ImgConstants.PATH_PREFIX + imageResource.getName() + ".png");
-            }
-        }
+        button.setIconCls(ImgConstants.CSS_SUFFIX + imageResource.getName());
     }
 
+    @Override
+    protected void setIconUrl(final String imageUrl) {
+        button.setIcon(imageUrl);
+    }
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractComposedGuiItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractComposedGuiItem.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractComposedGuiItem.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -45,7 +45,7 @@
         return guiItems;
     }
 
-    protected abstract void addWidget(AbstractGuiItem item, int position, boolean visible);
+    protected abstract void add(AbstractGuiItem item);
 
     protected void beforeAddWidget(final GuiActionDescrip descrip) {
         if (descrip.mustBeAdded()) {
@@ -55,9 +55,15 @@
             } else {
                 final AbstractGuiItem item = binding.create(descrip);
                 if (binding.isAttachable()) {
-                    addWidget(item, descrip.getPosition(), descrip.mustBeVisible());
+                    if (descrip.getPosition() == GuiActionDescrip.NO_POSITION) {
+                        add(item);
+                    } else {
+                        insert(item, descrip.getPosition());
+                    }
                 }
             }
         }
     }
+
+    protected abstract void insert(AbstractGuiItem item, int position);
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractGuiItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractGuiItem.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractGuiItem.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -1,6 +1,7 @@
 package org.ourproject.kune.platf.client.actions.ui;
 
 import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.AbstractAction;
 import org.ourproject.kune.platf.client.actions.Action;
 import org.ourproject.kune.platf.client.actions.PropertyChangeEvent;
 import org.ourproject.kune.platf.client.actions.PropertyChangeListener;
@@ -10,14 +11,14 @@
 
 public abstract class AbstractGuiItem extends Composite implements View {
 
-    protected Action action;
+    protected AbstractAction action;
 
     /**
      * Listener the button uses to receive PropertyChangeEvents from its Action.
      */
     protected PropertyChangeListener changeListener;
 
-    public void setAction(final Action newaction) {
+    public void setAction(final AbstractAction newaction) {
         if (action != null) {
             action.removePropertyChangeListener(changeListener);
             // removeActionListener(action);
@@ -50,9 +51,11 @@
                 } else if (event.getPropertyName().equals(Action.NAME)) {
                     setText((String) (act.getValue(Action.NAME)));
                 } else if (event.getPropertyName().equals(Action.SMALL_ICON)) {
-                    setIcon((ImageResource) (act.getValue(Action.SMALL_ICON)));
+                    setIcon(action.getValue(Action.SMALL_ICON));
                 } else if (event.getPropertyName().equals(Action.SHORT_DESCRIPTION)) {
                     setToolTipText((String) (act.getValue(Action.SHORT_DESCRIPTION)));
+                } else if (event.getPropertyName().equals(GuiActionDescrip.VISIBLE)) {
+                    setVisible(act);
                 }
                 // else if (e.getPropertyName().equals(Action.MNEMONIC_KEY)) {
                 // if (act.getValue(Action.MNEMONIC_KEY) != null) {
@@ -72,6 +75,8 @@
 
     protected abstract void setIcon(ImageResource imageResource);
 
+    protected abstract void setIconUrl(String iconUrl);
+
     protected abstract void setText(String text);
 
     protected abstract void setToolTipText(String text);
@@ -84,9 +89,10 @@
             setToolTipText(null);
         } else {
             setText((String) (action.getValue(Action.NAME)));
-            setIcon((ImageResource) (action.getValue(Action.SMALL_ICON)));
+            setIcon(action.getValue(Action.SMALL_ICON));
             setEnabled(action.isEnabled());
             setToolTipText((String) (action.getValue(Action.SHORT_DESCRIPTION)));
+            setVisible(action);
             // if (a.getValue(Action.MNEMONIC_KEY) != null) {
             // setMnemonic(((Integer)
             // (a.getValue(Action.MNEMONIC_KEY))).intValue());
@@ -105,4 +111,16 @@
         }
     }
 
+    private void setIcon(final Object icon) {
+        if (icon instanceof ImageResource) {
+            setIcon((ImageResource) icon);
+        } else if (icon instanceof String) {
+            setIconUrl((String) icon);
+        }
+    }
+
+    private void setVisible(final Action action) {
+        final Boolean visible = (Boolean) action.getValue(GuiActionDescrip.VISIBLE);
+        setVisible(visible == null ? true : visible);
+    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuGui.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuGui.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuGui.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -1,5 +1,9 @@
 package org.ourproject.kune.platf.client.actions.ui;
 
+import org.ourproject.kune.platf.client.actions.AbstractAction;
+import org.ourproject.kune.platf.client.actions.PropertyChangeEvent;
+import org.ourproject.kune.platf.client.actions.PropertyChangeListener;
+
 import com.gwtext.client.widgets.menu.BaseItem;
 import com.gwtext.client.widgets.menu.Menu;
 
@@ -25,6 +29,18 @@
         menu.insert(position, item);
     }
 
+    @Override
+    public void setAction(final AbstractAction newaction) {
+        super.setAction(newaction);
+        action.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(final PropertyChangeEvent event) {
+                if (event.getPropertyName().equals(MenuDescriptor.MENU_CLEAR)) {
+                    menu.removeAll();
+                }
+            }
+        });
+    }
+
     public void show(final int x, final int y) {
         menu.showAt(x, y);
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuItemGui.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuItemGui.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuItemGui.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -49,6 +49,11 @@
     }
 
     @Override
+    public void setIconUrl(final String imageUrl) {
+        item.setIcon(imageUrl);
+    }
+
+    @Override
     public void setVisible(final boolean visible) {
         item.setVisible(visible);
     }
@@ -69,9 +74,7 @@
 
     @Override
     protected void setIcon(final ImageResource imageResource) {
-        if (imageResource != null) {
-            item.setIconCls(ImgConstants.CSS_SUFFIX + imageResource.getName());
-        }
+        item.setIconCls(ImgConstants.CSS_SUFFIX + imageResource.getName());
     }
 
     @Override

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/BaseAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/BaseAction.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/BaseAction.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -7,6 +7,12 @@
 import com.google.gwt.libideas.resources.client.ImageResource;
 
 public class BaseAction extends AbstractAction {
+    public BaseAction(final String text, final String tooltip) {
+        super();
+        super.putValue(Action.NAME, text);
+        super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+    }
+
     public BaseAction(final String text, final String tooltip, final ImageResource icon) {
         super();
         super.putValue(Action.NAME, text);
@@ -14,6 +20,13 @@
         super.putValue(Action.SMALL_ICON, icon);
     }
 
+    public BaseAction(final String text, final String tooltip, final String icon) {
+        super();
+        super.putValue(Action.NAME, text);
+        super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+        super.putValue(Action.SMALL_ICON, icon);
+    }
+
     public void actionPerformed(final ActionEvent actionEvent) {
         // Nothing to do
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/ComplexToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/ComplexToolbar.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/ComplexToolbar.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -34,14 +34,15 @@
     }
 
     @Override
-    protected void addWidget(final AbstractGuiItem item, final int position, final boolean visible) {
+    protected void add(final AbstractGuiItem item) {
         item.addStyleName("kune-floatleft");
-        if (position == GuiActionDescrip.NO_POSITION) {
-            toolbar.add(item);
-        } else {
-            toolbar.insert(item, position);
-        }
-        item.setVisible(visible);
+        toolbar.add(item);
     }
 
+    @Override
+    protected void insert(final AbstractGuiItem item, final int position) {
+        item.addStyleName("kune-floatleft");
+        toolbar.insert(item, position);
+    }
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiActionDescrip.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiActionDescrip.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiActionDescrip.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -9,13 +9,13 @@
  * The Class AbstractUIActionDescriptor.
  */
 public abstract class GuiActionDescrip { // NOPMD by vjrj on 9/06/09 2:00
+    public static final String VISIBLE = "visibleprop";
 
     protected static final int NO_POSITION = -1;
     protected static final View NO_VIEW = null;
     protected static final GuiActionDescrip NO_PARENT = null;
 
     private GuiAddCondition addCondition = new GuiAddConditionAdapter();
-    private GuiVisibleCondition visibleCondition = new GuiVisibleConditionAdapter();
 
     protected GuiActionDescrip parent;
 
@@ -89,10 +89,6 @@
         return action.getValue(key);
     }
 
-    public GuiVisibleCondition getVisibleCondition() {
-        return visibleCondition;
-    }
-
     public boolean isChild() {
         // @PMD:REVIEWED:CompareObjectsWithEquals: by vjrj on 26/05/09 20:57
         return parent != NO_PARENT;
@@ -106,14 +102,6 @@
         return result;
     }
 
-    public boolean mustBeVisible() {
-        boolean result = false;
-        if (visibleCondition != null) {
-            result = visibleCondition.mustBeVisible();
-        }
-        return result;
-    }
-
     /**
      * Sets the value associated with the specified key.
      * 
@@ -132,6 +120,10 @@
         this.addCondition = addCondition;
     }
 
+    public void setEnabled(final boolean enabled) {
+        action.setEnabled(enabled);
+    }
+
     /**
      * If we have several toolbars, we can group with the "location" string key
      * actions that must be in the same location (ex: top bar, bottom bar, and
@@ -159,8 +151,8 @@
         this.position = position;
     }
 
-    public void setVisibleCondition(final GuiVisibleCondition visibleCondition) {
-        this.visibleCondition = visibleCondition;
+    public void setVisible(final boolean visible) {
+        action.putValue(VISIBLE, visible);
     }
 
     @Override

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiVisibleCondition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiVisibleCondition.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiVisibleCondition.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -1,7 +0,0 @@
-package org.ourproject.kune.platf.client.actions.ui;
-
-public interface GuiVisibleCondition {
-
-    boolean mustBeVisible();
-
-}

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiVisibleConditionAdapter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiVisibleConditionAdapter.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiVisibleConditionAdapter.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -1,9 +0,0 @@
-package org.ourproject.kune.platf.client.actions.ui;
-
-public class GuiVisibleConditionAdapter implements GuiVisibleCondition {
-
-    public boolean mustBeVisible() {
-        return true;
-    }
-
-}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuDescriptor.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuDescriptor.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -8,11 +8,14 @@
 public class MenuDescriptor extends GuiActionDescrip {
 
     public static final String MENU_HIDE = "hidemenu";
+    public static final String MENU_SHOW = "showmenu";
+    public static final String MENU_SHOW_ID = "showmenuid";
+    public static final String MENU_CLEAR = "menuclear";
 
     private boolean standalone;
 
     public MenuDescriptor() {
-        this(new BaseAction(null, null, null));
+        this(new BaseAction(null, null));
     }
 
     public MenuDescriptor(final AbstractAction action) {
@@ -23,11 +26,13 @@
         super(action);
         setParent(parent);
         action.putValue(MENU_HIDE, false);
+        action.putValue(MENU_SHOW, false);
+        action.putValue(MENU_CLEAR, false);
         standalone = false;
     }
 
     public MenuDescriptor(final String text) {
-        this(new BaseAction(text, null, null));
+        this(new BaseAction(text, null));
     }
 
     public MenuDescriptor(final String text, final ImageResource icon) {
@@ -35,13 +40,23 @@
     }
 
     public MenuDescriptor(final String text, final String tooltip) {
-        this(new BaseAction(text, tooltip, null));
+        this(new BaseAction(text, tooltip));
     }
 
     public MenuDescriptor(final String text, final String tooltip, final ImageResource icon) {
         this(new BaseAction(text, tooltip, icon));
     }
 
+    public MenuDescriptor(final String text, final String tooltip, final String icon) {
+        this(new BaseAction(text, tooltip, icon));
+    }
+
+    public void clear() {
+        // Action detects changes in values, then we fire a change (whatever) to
+        // fire this method in the UI
+        action.putValue(MENU_CLEAR, !((Boolean) action.getValue(MENU_CLEAR)));
+    }
+
     @Override
     public Class<?> getType() {
         return MenuDescriptor.class;
@@ -70,4 +85,14 @@
         action.putValue(Action.NAME, text);
     }
 
+    /**
+     * Show the menu near the Element id specified
+     * 
+     * @param id
+     *            the element id to show menu near of it
+     */
+    public void show(final String id) {
+        action.putValue(MENU_SHOW_ID, id);
+        action.putValue(MENU_SHOW, !((Boolean) action.getValue(MENU_SHOW)));
+    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuGui.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuGui.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuGui.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -1,10 +1,12 @@
 package org.ourproject.kune.platf.client.actions.ui;
 
+import org.ourproject.kune.platf.client.actions.Action;
 import org.ourproject.kune.platf.client.actions.PropertyChangeEvent;
 import org.ourproject.kune.platf.client.actions.PropertyChangeListener;
 import org.ourproject.kune.platf.client.ui.img.ImgConstants;
 
 import com.google.gwt.libideas.resources.client.ImageResource;
+import com.google.gwt.user.client.ui.UIObject;
 import com.gwtext.client.widgets.ToolbarButton;
 
 public class MenuGui extends AbstractMenuGui {
@@ -14,7 +16,6 @@
 
     public MenuGui(final MenuDescriptor descriptor) {
         super();
-        setAction(descriptor.action);
         // Standalone menus are menus without and associated button in a toolbar
         // (sometimes, a menu showed in a grid, or other special widgets)
         notStandAlone = !descriptor.isStandalone();
@@ -22,7 +23,10 @@
             button = new ToolbarButton();
             button.setMenu(menu);
             initWidget(button);
+        } else {
+            initWidget(menu);
         }
+        setAction(descriptor.action);
         descriptor.action.addPropertyChangeListener(new PropertyChangeListener() {
             public void propertyChange(final PropertyChangeEvent event) {
                 if (event.getPropertyName().equals(MenuDescriptor.MENU_HIDE)) {
@@ -30,6 +34,13 @@
                 }
             }
         });
+        descriptor.action.addPropertyChangeListener(new PropertyChangeListener() {
+            public void propertyChange(final PropertyChangeEvent event) {
+                if (event.getPropertyName().equals(MenuDescriptor.MENU_SHOW)) {
+                    menu.show(UIObject.DEBUG_ID_PREFIX + (String) descriptor.getValue(MenuDescriptor.MENU_SHOW_ID));
+                }
+            }
+        });
     }
 
     @Override
@@ -46,8 +57,16 @@
     @Override
     public void setIcon(final ImageResource imageResource) {
         if (notStandAlone) {
-            if (imageResource != null) {
-                button.setIcon(ImgConstants.PATH_PREFIX + imageResource.getName() + ".png");
+            button.setIconCls(ImgConstants.CSS_SUFFIX + imageResource.getName());
+        }
+    }
+
+    @Override
+    public void setIconUrl(final String imageUrl) {
+        if (notStandAlone) {
+            button.setIcon(imageUrl);
+            if (action.getValue(Action.NAME) != null) {
+                button.setCls("x-btn-text-icon");
             }
         }
     }
@@ -65,4 +84,13 @@
             button.setTooltip(tooltip);
         }
     }
+
+    @Override
+    public void setVisible(final boolean visible) {
+        if (notStandAlone) {
+            button.setVisible(visible);
+        } else {
+            menu.setVisible(visible);
+        }
+    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/SubMenuGui.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/SubMenuGui.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/SubMenuGui.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -14,7 +14,7 @@
         item = new MenuItem();
         item.setMenu(menu);
         setAction(descriptor.action);
-        initWidget(item);
+        // initWidget(item);
     }
 
     public MenuItem getMenuItem() {
@@ -32,12 +32,15 @@
 
     @Override
     public void setIcon(final ImageResource imageResource) {
-        if (imageResource != null) {
-            item.setIconCls(ImgConstants.CSS_SUFFIX + imageResource.getName());
-        }
+        item.setIconCls(ImgConstants.CSS_SUFFIX + imageResource.getName());
     }
 
     @Override
+    public void setIconUrl(final String imageUrl) {
+        item.setIcon(imageUrl);
+    }
+
+    @Override
     public void setText(final String text) {
         item.setText(text);
     }
@@ -46,4 +49,9 @@
     public void setToolTipText(final String tooltip) {
         item.setTitle(tooltip);
     }
+
+    @Override
+    public void setVisible(final boolean visible) {
+        item.setVisible(visible);
+    }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgConstants.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgConstants.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgConstants.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -1,12 +1,17 @@
 package org.ourproject.kune.platf.client.ui.img;
 
+import com.google.gwt.libideas.resources.client.ImageResource;
+
 public final class ImgConstants {
 
     public static final String CSS_SUFFIX = "k-icon-";
 
     public static final String PATH_PREFIX = "images/";
 
+    public static String toPath(final ImageResource img) {
+        return PATH_PREFIX + img.getName() + ".png";
+    }
+
     private ImgConstants() {
     }
-
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgResources.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgResources.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgResources.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -9,6 +9,9 @@
     @Resource("kimg.css")
     CssResource css();
 
+    @Resource("group-home.png")
+    ImageResource groupHome();
+
     @Resource("info.png")
     ImageResource info();
 
@@ -18,4 +21,6 @@
     @Resource("language.png")
     ImageResource language();
 
+    @Resource("prefs.png")
+    ImageResource prefs();
 }
\ No newline at end of file

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/group-home.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/group-home.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/prefs.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/prefs.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

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	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -31,6 +31,7 @@
 import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
 import org.ourproject.kune.platf.client.shortcuts.Keyboard;
 import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.img.ImgConstants;
 import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
 import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
 import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
@@ -682,6 +683,7 @@
             final Provider<InsertImageDialog> insertImageDialog, final Provider<InsertMediaDialog> insertMediaDialog,
             final Provider<InsertTableDialog> insertTableDialog, final Provider<InsertSpecialCharDialog> insCharDialog,
             final DeferredCommandWrapper deferred) {
+        super();
         this.i18n = i18n;
         this.session = session;
         this.insLinkDialogPv = insLinkDialog;
@@ -734,6 +736,7 @@
     }
 
     public void detach() {
+        // Nothing at the moment
     }
 
     public void fireOnEdit() {
@@ -1148,8 +1151,10 @@
         menus.add(insertMenu = new MenuDescriptor(i18n.t("Insert")));
         menus.add(formatMenu = new MenuDescriptor(i18n.t("Format")));
         menus.add(linkCtxMenu = new MenuDescriptor(i18n.t("Change Link")));
-        menus.add(fontMenu = new MenuDescriptor(NO_TEXT, i18n.t("Font"), imgResources.charfontname()));
-        menus.add(fontSizeMenu = new MenuDescriptor(NO_TEXT, i18n.t("Font size"), imgResources.fontheight()));
+        menus.add(fontMenu = new MenuDescriptor(NO_TEXT, i18n.t("Font"),
+                ImgConstants.toPath(imgResources.charfontname())));
+        menus.add(fontSizeMenu = new MenuDescriptor(NO_TEXT, i18n.t("Font size"),
+                ImgConstants.toPath(imgResources.fontheight())));
         insertMenu.setAddCondition(extendedAddCond);
     }
 
@@ -1181,15 +1186,15 @@
     private void updateFont() {
         final String currentFont = view.getFont();
         final MenuCheckItemDescriptor item = fontActions.get(currentFont);
-        if (currentFontItem != null && item != currentFontItem) {
+        if (currentFontItem != null && !currentFontItem.equals(item)) {
             currentFontItem.setChecked(false);
         }
-        if (item != null) {
+        if (item == null) {
+            fontMenu.setText("&nbsp;");
+        } else {
             item.setChecked(true);
             currentFontItem = item;
             fontMenu.setText((String) item.getValue(FontAction.FONT_NAME));
-        } else {
-            fontMenu.setText("&nbsp;");
         }
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -128,6 +128,8 @@
 import org.ourproject.kune.workspace.client.options.EntityOptions;
 import org.ourproject.kune.workspace.client.options.EntityOptionsPanel;
 import org.ourproject.kune.workspace.client.options.EntityOptionsPresenter;
+import org.ourproject.kune.workspace.client.options.GroupOptions;
+import org.ourproject.kune.workspace.client.options.UserOptions;
 import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicense;
 import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicensePanel;
 import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicensePresenter;
@@ -193,9 +195,9 @@
 import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
 import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLinkPanel;
 import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLinkPresenter;
-import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenu;
-import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPanel;
-import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPresenter;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserOptions;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserOptionsPanel;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserOptionsPresenter;
 import org.ourproject.kune.workspace.client.skel.ActionCntCtxToolbarPanel;
 import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
 import org.ourproject.kune.workspace.client.socialnet.BuddiesSummary;
@@ -327,13 +329,14 @@
             }
         });
 
-        register(ApplicationComponentGroup.class, new Factory<SiteUserMenu>(SiteUserMenu.class) {
+        register(ApplicationComponentGroup.class, new Factory<SiteUserOptions>(SiteUserOptions.class) {
             @Override
-            public SiteUserMenu create() {
-                final SiteUserMenuPresenter presenter = new SiteUserMenuPresenter(i(Session.class),
-                        i(StateManager.class), p(EntityOptions.class), p(FileDownloadUtils.class));
-                final SiteUserMenuPanel panel = new SiteUserMenuPanel(presenter, i(WorkspaceSkeleton.class),
-                        i(I18nUITranslationService.class));
+            public SiteUserOptions create() {
+                final SiteUserOptionsPresenter presenter = new SiteUserOptionsPresenter(i(Session.class),
+                        i(StateManager.class), p(UserOptions.class), p(FileDownloadUtils.class),
+                        $(I18nTranslationService.class), $(ImgResources.class));
+                final SiteUserOptionsPanel panel = new SiteUserOptionsPanel(presenter, i(WorkspaceSkeleton.class),
+                        $(GuiBindingsRegister.class));
                 presenter.init(panel);
                 return presenter;
             }
@@ -616,6 +619,20 @@
             }
         });
 
+        register(Singleton.class, new Factory<GroupOptions>(GroupOptions.class) {
+            @Override
+            public GroupOptions create() {
+                return (GroupOptions) i(EntityOptions.class);
+            }
+        });
+
+        register(Singleton.class, new Factory<UserOptions>(UserOptions.class) {
+            @Override
+            public UserOptions create() {
+                return (UserOptions) i(EntityOptions.class);
+            }
+        });
+
         register(EntityOptionsGroup.class, new Factory<EntityOptionsToolsConf>(EntityOptionsToolsConf.class) {
             @Override
             public EntityOptionsToolsConf create() {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -25,9 +25,9 @@
 
 import com.calclab.suco.client.events.Listener;
 
-public class EntityOptionsPresenter extends AbstractTabbedDialogPresenter implements EntityOptions {
+public class EntityOptionsPresenter extends AbstractTabbedDialogPresenter implements GroupOptions, UserOptions {
 
-    EntityOptionsView view;
+    private EntityOptionsView view;
 
     public EntityOptionsPresenter(final StateManager stateManager) {
         stateManager.onStateChanged(new Listener<StateAbstractDTO>() {

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptions.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptions.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -0,0 +1,4 @@
+package org.ourproject.kune.workspace.client.options;
+
+public interface GroupOptions extends EntityOptions {
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptions.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptions.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -0,0 +1,4 @@
+package org.ourproject.kune.workspace.client.options;
+
+public interface UserOptions extends EntityOptions {
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/AbstractSiteOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/AbstractSiteOptionsPanel.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/AbstractSiteOptionsPanel.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -0,0 +1,52 @@
+package org.ourproject.kune.workspace.client.sitebar.siteoptions;
+
+import org.ourproject.kune.platf.client.actions.ui.AbstractComposedGuiItem;
+import org.ourproject.kune.platf.client.actions.ui.AbstractGuiItem;
+import org.ourproject.kune.platf.client.actions.ui.GuiBindingsRegister;
+import org.ourproject.kune.platf.client.actions.ui.MenuDescriptor;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.PushButton;
+
+public abstract class AbstractSiteOptionsPanel extends AbstractComposedGuiItem {
+
+    protected final PushButton btn;
+    private MenuDescriptor menuDescriptor;
+
+    public AbstractSiteOptionsPanel(final GuiBindingsRegister bindings, final String id) {
+        super(bindings);
+        btn = new PushButton("");
+        btn.ensureDebugId(id);
+        btn.addClickHandler(new ClickHandler() {
+            public void onClick(final ClickEvent event) {
+                menuDescriptor.show(id);
+            }
+        });
+        btn.setStyleName("k-sitebar-labellink");
+    }
+
+    public void setBtnText(final String title) {
+        btn.setHTML(title + "<img style=\"vertical-align: middle;\" src=\"images/arrowdown.png\" />");
+    }
+
+    public void setMenu(final MenuDescriptor menuDescriptor) {
+        this.menuDescriptor = menuDescriptor;
+    }
+
+    @Override
+    protected void add(final AbstractGuiItem item) { // NOPMD by vjrj on
+        // 14/06/09 0:15
+        // Do nothing (menu items are attached automatically to its menu
+    }
+
+    @Override
+    protected void insert(final AbstractGuiItem item, final int position) { // NOPMD
+        // by
+        // vjrj
+        // on
+        // 14/06/09
+        // 0:15
+        // Do nothing (menu items are attached automatically to its menu
+    }
+}

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPanel.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -19,52 +19,23 @@
  \*/
 package org.ourproject.kune.workspace.client.sitebar.siteoptions;
 
-import org.ourproject.kune.platf.client.actions.ui.AbstractComposedGuiItem;
-import org.ourproject.kune.platf.client.actions.ui.AbstractGuiItem;
-import org.ourproject.kune.platf.client.actions.ui.AbstractMenuGui;
 import org.ourproject.kune.platf.client.actions.ui.GuiBindingsRegister;
-import org.ourproject.kune.platf.client.actions.ui.MenuBinding;
-import org.ourproject.kune.platf.client.actions.ui.MenuDescriptor;
 import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
 import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
 
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.ui.PushButton;
+public class SiteOptionsPanel extends AbstractSiteOptionsPanel implements SiteOptionsView {
 
-public class SiteOptionsPanel extends AbstractComposedGuiItem implements SiteOptionsView {
+    public static final String SITE_OPTIONS_MENU = "kune-sop-om";
 
-    private static final String BTN_ID = "k-sopts-btn-id";
-    private AbstractMenuGui menu;
-
     public SiteOptionsPanel(final WorkspaceSkeleton wspace, final I18nUITranslationService i18n,
             final GuiBindingsRegister bindings) {
-        super(bindings);
-        final PushButton optionsButton = new PushButton("");
-        // optionsButton.setText(i18n.t("Options"));
-        optionsButton.setHTML(i18n.t("Options")
-                + "<img style=\"vertical-align: middle;\" src=\"images/arrowdown.png\" />");
-        optionsButton.setStyleName("k-sitebar-labellink");
-        optionsButton.ensureDebugId(BTN_ID);
-        wspace.getSiteBar().addSeparator();
-        wspace.getSiteBar().add(optionsButton);
-        wspace.getSiteBar().addSpacer();
-        wspace.getSiteBar().addSpacer();
-
-        optionsButton.addClickHandler(new ClickHandler() {
-            public void onClick(final ClickEvent event) {
-                menu.show(optionsButton.getElement().getId());
-            }
-        });
+        super(bindings, SITE_OPTIONS_MENU);
+        setBtnText(i18n.t("Options"));
+        final AbstractToolbar siteBar = wspace.getSiteBar();
+        siteBar.addSeparator();
+        siteBar.add(btn);
+        siteBar.addSpacer();
+        siteBar.addSpacer();
     }
-
-    public void setMenu(final MenuDescriptor menuDescriptor) {
-        menu = (AbstractMenuGui) menuDescriptor.getValue(MenuBinding.UI_MENU);
-    }
-
-    @Override
-    protected void addWidget(final AbstractGuiItem item, final int position, final boolean visible) {
-        // Do nothing (menu items are attached automatically to its menu
-    }
-
 }

Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenu.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenu.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenu.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -1,24 +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.workspace.client.sitebar.siteusermenu;
-
-public interface SiteUserMenu {
-
-}

Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -1,119 +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.workspace.client.sitebar.siteusermenu;
-
-import org.ourproject.kune.platf.client.PlatfMessages;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.platf.client.ui.AbstractToolbar;
-import org.ourproject.kune.platf.client.ui.MenuItemCollection;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.ui.PushButton;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.menu.BaseItem;
-import com.gwtext.client.widgets.menu.Item;
-import com.gwtext.client.widgets.menu.Menu;
-import com.gwtext.client.widgets.menu.MenuItem;
-import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
-
-public class SiteUserMenuPanel implements SiteUserMenuView {
-
-    public static final String LOGGED_USER_MENU = "kune-sump-lum";
-    public static final String USER_PREFERENCES_MENU_ITEM = "kune-sump-uprmi";
-    public static final String USER_HOME_PAGE_MENU_ITEM = "kune-sump-hpmi";
-    public static final String USER_PARTICIPATION_MENU_ITEM = "kune-sump-upami";
-    private final PushButton loggedUserMenu;
-    private final Widget separator;
-    private final Menu userMenu;
-    private final Menu userParticipation;
-
-    public SiteUserMenuPanel(final SiteUserMenuPresenter presenter, final WorkspaceSkeleton ws,
-            final I18nUITranslationService i18n) {
-        loggedUserMenu = new PushButton("");
-        loggedUserMenu.ensureDebugId(LOGGED_USER_MENU);
-        loggedUserMenu.setStyleName("k-sitebar-labellink");
-        final AbstractToolbar siteBar = ws.getSiteBar();
-        siteBar.add(loggedUserMenu);
-        separator = siteBar.addSeparator();
-        userMenu = new Menu();
-        loggedUserMenu.addClickHandler(new ClickHandler() {
-            public void onClick(final ClickEvent event) {
-                final Element sender = event.getRelativeElement();
-                userMenu.showAt(sender.getAbsoluteLeft(), sender.getAbsoluteTop() + 10);
-            }
-        });
-        final Item userHomePage = new Item(i18n.t(PlatfMessages.YOUR_HOMEPAGE));
-        userHomePage.setId(USER_HOME_PAGE_MENU_ITEM);
-        userHomePage.setIcon("images/group-home.gif");
-        userHomePage.addListener(new BaseItemListenerAdapter() {
-            @Override
-            public void onClick(final BaseItem item, final EventObject e) {
-                super.onClick(item, e);
-                presenter.onUserHomePage();
-            }
-        });
-        userMenu.addItem(userHomePage);
-        final Item userPreferences = new Item(i18n.t("Your preferences"));
-        userPreferences.setId(USER_PREFERENCES_MENU_ITEM);
-        userPreferences.setIcon("images/emblem-system.png");
-        userPreferences.addListener(new BaseItemListenerAdapter() {
-            @Override
-            public void onClick(final BaseItem item, final EventObject e) {
-                super.onClick(item, e);
-                presenter.onUserPreferences();
-            }
-        });
-        userMenu.addItem(userPreferences);
-        userParticipation = new Menu();
-        userParticipation.setId(USER_PARTICIPATION_MENU_ITEM);
-        final MenuItem userParticipationItem = new MenuItem(i18n.t("Your groups"), userParticipation);
-        userParticipationItem.setIcon("");
-        userMenu.addItem(userParticipationItem);
-    }
-
-    public void setLoggedUserName(final String name) {
-        loggedUserMenu.setHTML(name + "<img style=\"vertical-align: middle;\" src=\"images/arrowdown.png\" />");
-    }
-
-    public void setParticipation(final MenuItemCollection<GroupDTO> participateInGroups) {
-        userParticipation.removeAll();
-        for (final org.ourproject.kune.platf.client.ui.MenuItem<GroupDTO> groupItem : participateInGroups) {
-            final Item item = new Item(groupItem.getTitle(), new BaseItemListenerAdapter() {
-                @Override
-                public void onClick(final BaseItem item, final EventObject e) {
-                    super.onClick(item, e);
-                    groupItem.fire(null);
-                }
-            });
-            item.setIcon(groupItem.getIcon());
-            userParticipation.addItem(item);
-        }
-    }
-
-    public void setVisible(final boolean visible) {
-        loggedUserMenu.setVisible(visible);
-        separator.setVisible(visible);
-    }
-}

Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPresenter.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPresenter.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -1,106 +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.workspace.client.sitebar.siteusermenu;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.dto.UserInfoDTO;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.ui.MenuItem;
-import org.ourproject.kune.platf.client.ui.MenuItemCollection;
-import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.workspace.client.options.EntityOptions;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-import com.calclab.suco.client.ioc.Provider;
-
-public class SiteUserMenuPresenter implements SiteUserMenu {
-
-    private SiteUserMenuView view;
-    private final MenuItemCollection<GroupDTO> participateInGroups;
-    private final StateManager stateManager;
-    private final Session session;
-    private final Provider<EntityOptions> entityOptions;
-    private final Provider<FileDownloadUtils> downloadProvider;
-
-    public SiteUserMenuPresenter(final Session session, final StateManager stateManager,
-            final Provider<EntityOptions> entityOptions, final Provider<FileDownloadUtils> downloadProvider) {
-        this.session = session;
-        this.stateManager = stateManager;
-        this.entityOptions = entityOptions;
-        this.downloadProvider = downloadProvider;
-        participateInGroups = new MenuItemCollection<GroupDTO>();
-        session.onUserSignIn(new Listener<UserInfoDTO>() {
-            public void onEvent(final UserInfoDTO userInfoDTO) {
-                onUserSignIn(userInfoDTO);
-            }
-
-        });
-        session.onUserSignOut(new Listener0() {
-            public void onEvent() {
-                view.setVisible(false);
-                view.setLoggedUserName("");
-            }
-        });
-    }
-
-    public View getView() {
-        return view;
-    }
-
-    public void init(final SiteUserMenuView view) {
-        this.view = view;
-    }
-
-    public void onUserHomePage() {
-        stateManager.gotoToken(session.getCurrentUserInfo().getShortName());
-    }
-
-    public void onUserPreferences() {
-        onUserHomePage();
-        entityOptions.get().show();
-    }
-
-    private void addPartipation(final GroupDTO group) {
-        String logoImageUrl = group.hasLogo() ? downloadProvider.get().getLogoImageUrl(group.getStateToken())
-                : "images/group-def-icon.gif";
-        participateInGroups.add(new MenuItem<GroupDTO>(logoImageUrl, group.getShortName(), new Listener<GroupDTO>() {
-            public void onEvent(final GroupDTO param) {
-                stateManager.gotoToken(group.getShortName());
-            }
-        }));
-    }
-
-    private void onUserSignIn(final UserInfoDTO userInfoDTO) {
-        view.setVisible(true);
-        view.setLoggedUserName(userInfoDTO.getShortName());
-        participateInGroups.clear();
-        for (final GroupDTO group : userInfoDTO.getGroupsIsAdmin()) {
-            addPartipation(group);
-        }
-        for (final GroupDTO group : userInfoDTO.getGroupsIsCollab()) {
-            addPartipation(group);
-        }
-        view.setParticipation(participateInGroups);
-    }
-
-}

Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuView.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuView.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -1,34 +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.workspace.client.sitebar.siteusermenu;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.ui.MenuItemCollection;
-
-public interface SiteUserMenuView extends View {
-
-    void setLoggedUserName(String name);
-
-    void setParticipation(MenuItemCollection<GroupDTO> participateInGroups);
-
-    void setVisible(boolean visible);
-
-}

Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptions.java (from rev 1121, trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenu.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenu.java	2009-06-08 14:18:03 UTC (rev 1121)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptions.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -0,0 +1,25 @@
+/*
+ *
+ * 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.workspace.client.sitebar.siteusermenu;
+
+import org.ourproject.kune.platf.client.actions.ui.IsActionExtensible;
+
+public interface SiteUserOptions extends IsActionExtensible {
+}

Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsPanel.java (from rev 1121, trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPanel.java	2009-06-08 14:18:03 UTC (rev 1121)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsPanel.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -0,0 +1,52 @@
+/*
+ *
+ * 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.workspace.client.sitebar.siteusermenu;
+
+import org.ourproject.kune.platf.client.actions.ui.GuiBindingsRegister;
+import org.ourproject.kune.platf.client.ui.AbstractToolbar;
+import org.ourproject.kune.workspace.client.sitebar.siteoptions.AbstractSiteOptionsPanel;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Widget;
+
+public class SiteUserOptionsPanel extends AbstractSiteOptionsPanel implements SiteUserOptionsView {
+
+    public static final String LOGGED_USER_MENU = "kune-sump-lum";
+
+    private final Widget separator;
+
+    public SiteUserOptionsPanel(final SiteUserOptionsPresenter presenter, final WorkspaceSkeleton wspace,
+            final GuiBindingsRegister bindings) {
+        super(bindings, LOGGED_USER_MENU);
+        final AbstractToolbar siteBar = wspace.getSiteBar();
+        siteBar.add(btn);
+        separator = siteBar.addSeparator();
+    }
+
+    public void setLoggedUserName(final String name) {
+        setBtnText(name);
+    }
+
+    @Override
+    public void setVisible(final boolean visible) {
+        btn.setVisible(visible);
+        separator.setVisible(visible);
+    }
+}

Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsPresenter.java (from rev 1121, trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuPresenter.java	2009-06-08 14:18:03 UTC (rev 1121)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsPresenter.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -0,0 +1,158 @@
+/*
+ *
+ * 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.workspace.client.sitebar.siteusermenu;
+
+import java.util.List;
+
+import org.ourproject.kune.platf.client.PlatfMessages;
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.AbstractExtendedAction;
+import org.ourproject.kune.platf.client.actions.Action;
+import org.ourproject.kune.platf.client.actions.ActionEvent;
+import org.ourproject.kune.platf.client.actions.common.GotoGroupAction;
+import org.ourproject.kune.platf.client.actions.ui.AbstractActionExtensiblePresenter;
+import org.ourproject.kune.platf.client.actions.ui.GuiActionDescrip;
+import org.ourproject.kune.platf.client.actions.ui.MenuDescriptor;
+import org.ourproject.kune.platf.client.actions.ui.MenuItemDescriptor;
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.img.ImgResources;
+import org.ourproject.kune.workspace.client.options.UserOptions;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.events.Listener0;
+import com.calclab.suco.client.ioc.Provider;
+
+public class SiteUserOptionsPresenter extends AbstractActionExtensiblePresenter implements SiteUserOptions {
+
+    private SiteUserOptionsView view;
+    private final StateManager stateManager;
+    private final Session session;
+    private final Provider<UserOptions> userOptions;
+    private final Provider<FileDownloadUtils> downloadProvider;
+    private MenuDescriptor menuDescriptor;
+    private final I18nTranslationService i18n;
+    private final ImgResources img;
+
+    private MenuDescriptor partiMenu;;
+
+    public SiteUserOptionsPresenter(final Session session, final StateManager stateManager,
+            final Provider<UserOptions> userOptions, final Provider<FileDownloadUtils> downloadProvider,
+            final I18nTranslationService i18n, final ImgResources img) {
+        super();
+        this.session = session;
+        this.stateManager = stateManager;
+        this.userOptions = userOptions;
+        this.downloadProvider = downloadProvider;
+        this.i18n = i18n;
+        this.img = img;
+        session.onUserSignIn(new Listener<UserInfoDTO>() {
+            public void onEvent(final UserInfoDTO userInfoDTO) {
+                onUserSignIn(userInfoDTO);
+            }
+
+        });
+        session.onUserSignOut(new Listener0() {
+            public void onEvent() {
+                view.setVisible(false);
+                view.setLoggedUserName("");
+            }
+        });
+    }
+
+    @Override
+    public void addAction(final GuiActionDescrip descriptor) {
+        descriptor.setParent(menuDescriptor);
+        view.addAction(descriptor);
+    }
+
+    public View getView() {
+        return view;
+    }
+
+    public void init(final SiteUserOptionsView view) {
+        this.view = view;
+        createActions();
+    }
+
+    private void addPartipation(final GroupDTO group) {
+        final String logoImageUrl = group.hasLogo() ? downloadProvider.get().getLogoImageUrl(group.getStateToken())
+                : "images/group-def-icon.gif";
+        final GotoGroupAction gotoGroupAction = new GotoGroupAction(logoImageUrl, group.getLongName(), stateManager);
+        view.addAction(new MenuItemDescriptor(partiMenu, gotoGroupAction));
+    }
+
+    private void createActions() {
+        menuDescriptor = new MenuDescriptor();
+        menuDescriptor.setStandalone(true);
+        view.addAction(menuDescriptor);
+        view.setMenu(menuDescriptor);
+
+        partiMenu = new MenuDescriptor(i18n.t("Your groups"));
+        addAction(partiMenu);
+
+        final AbstractExtendedAction userHomeAction = new AbstractExtendedAction() {
+            public void actionPerformed(final ActionEvent event) {
+                goUserHome();
+            }
+        };
+        userHomeAction.putValue(Action.NAME, i18n.t(PlatfMessages.YOUR_HOMEPAGE));
+        userHomeAction.putValue(Action.SMALL_ICON, img.groupHome());
+        final MenuItemDescriptor item = new MenuItemDescriptor(userHomeAction);
+        item.setPosition(0);
+        addAction(item);
+
+        final AbstractExtendedAction userPrefsAction = new AbstractExtendedAction() {
+            public void actionPerformed(final ActionEvent event) {
+                goUserHome();
+                userOptions.get().show();
+            }
+        };
+        userPrefsAction.putValue(Action.NAME, i18n.t("Your preferences"));
+        userPrefsAction.putValue(Action.SMALL_ICON, img.prefs());
+        final MenuItemDescriptor prefsItem = new MenuItemDescriptor(userPrefsAction);
+        prefsItem.setPosition(1);
+        addAction(prefsItem);
+    }
+
+    private void goUserHome() {
+        stateManager.gotoToken(session.getCurrentUserInfo().getShortName());
+    }
+
+    private void onUserSignIn(final UserInfoDTO userInfoDTO) {
+        view.setVisible(true);
+        view.setLoggedUserName(userInfoDTO.getShortName());
+        partiMenu.clear();
+        final List<GroupDTO> groupsIsAdmin = userInfoDTO.getGroupsIsAdmin();
+        final List<GroupDTO> groupsIsCollab = userInfoDTO.getGroupsIsCollab();
+        for (final GroupDTO group : groupsIsAdmin) {
+            addPartipation(group);
+        }
+        for (final GroupDTO group : groupsIsCollab) {
+            addPartipation(group);
+        }
+        partiMenu.setVisible(!groupsIsAdmin.isEmpty() || !groupsIsCollab.isEmpty());
+    }
+
+}

Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsView.java (from rev 1121, trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserMenuView.java	2009-06-08 14:18:03 UTC (rev 1121)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsView.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -0,0 +1,33 @@
+/*
+ *
+ * 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.workspace.client.sitebar.siteusermenu;
+
+import org.ourproject.kune.platf.client.actions.ui.AbstractActionExtensibleView;
+import org.ourproject.kune.platf.client.actions.ui.MenuDescriptor;
+
+public interface SiteUserOptionsView extends AbstractActionExtensibleView {
+
+    void setLoggedUserName(String name);
+
+    void setMenu(MenuDescriptor menuDescriptor);
+
+    void setVisible(boolean visible);
+
+}

Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/KuneSeleniumTestHelper.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -19,7 +19,7 @@
 import org.ourproject.kune.workspace.client.site.SiteToken;
 import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLinkPanel;
 import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLinkPanel;
-import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPanel;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserOptionsPanel;
 import org.ourproject.kune.workspace.client.title.EntityTitlePanel;
 
 import com.thoughtworks.selenium.SeleniumException;
@@ -192,6 +192,6 @@
     }
 
     protected void verifyLoggedUserShorName(final String userShortName) throws Exception {
-        waitForTextInside(gid(SiteUserMenuPanel.LOGGED_USER_MENU), userShortName);
+        waitForTextInside(gid(SiteUserOptionsPanel.LOGGED_USER_MENU), userShortName);
     }
 }

Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/SignInSeleniumTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/SignInSeleniumTest.java	2009-06-13 00:43:29 UTC (rev 1128)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/SignInSeleniumTest.java	2009-06-14 20:00:52 UTC (rev 1129)
@@ -13,7 +13,7 @@
 import org.ourproject.kune.workspace.client.signin.SignInPanel;
 import org.ourproject.kune.workspace.client.site.SiteToken;
 import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignInLinkPanel;
-import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserMenuPanel;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserOptionsPanel;
 import org.ourproject.kune.workspace.client.title.EntityTitlePanel;
 
 public class SignInSeleniumTest extends KuneSeleniumTestHelper {
@@ -49,7 +49,7 @@
         registerValidUser(false);
         selenium.isTextPresent("Welcome");
         click(RegisterPanel.WELCOME_OK_BUTTON);
-        clickOnPushButton(gid(SiteUserMenuPanel.LOGGED_USER_MENU));
+        clickOnPushButton(gid(SiteUserOptionsPanel.LOGGED_USER_MENU));
         click(linkId(PlatfMessages.YOUR_HOMEPAGE));
         waitForTextInside(gid(NoHomePagePanel.NO_HOME_PAGE_LABEL), PlatfMessages.USER_DOESN_T_HAVE_A_HOMEPAGE);
     }




More information about the kune-commits mailing list