[kune-commits] r957 - in trunk/src/main/java/org/ourproject/kune: app/public platf/client/actions platf/client/actions/toolbar platf/client/services platf/client/ui/gridmenu workspace/client/skel workspace/client/socialnet workspace/client/title

vjrj vjrj at ourproject.org
Wed Nov 19 23:51:51 CET 2008


Author: vjrj
Date: 2008-11-19 23:51:48 +0100 (Wed, 19 Nov 2008)
New Revision: 957

Removed:
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridButton.java
Modified:
   trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/GroupActionRegistry.java
   trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
   trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SummaryPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
Log:
Incomplete - task Use of new ActionDescriptionClass in SocialNetwork 


Modified: trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/Kune.html	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/app/public/Kune.html	2008-11-19 22:51:48 UTC (rev 957)
@@ -72,7 +72,7 @@
     background: white;
     color: #444;
     font: bold 13px tahoma, arial, helvetica;
-    padding: 5px;
+    padding: 5px 5px 10px 5px;
     margin: 0;
     height: auto;
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/GroupActionRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/GroupActionRegistry.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/GroupActionRegistry.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -18,12 +18,13 @@
  *
  */package org.ourproject.kune.platf.client.actions;
 
-import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
 
 /**
  * The Class GroupActionRegistry stores actions over groups (mainly used in SN)
  */
-public class GroupActionRegistry extends ActionRegistry<GroupDTO> {
+public class GroupActionRegistry extends ActionRegistry<StateToken> {
 
+    @Deprecated
     public static final String GENERAL = "genActions";
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -119,6 +119,16 @@
         }
     }
 
+    public SimpleToolbar getToolbar(final ActionToolbarPosition pos) {
+        switch (pos) {
+        case bottombar:
+            return bottombar;
+        case topbar:
+        default:
+            return topbar;
+        }
+    }
+
     public void setButtonEnable(final ActionDescriptor<T> action, final boolean enable) {
         final ActionToolbarPosition pos = ((ActionToolbarDescriptor<T>) action).getActionPosition();
         final ToolbarButton button = toolbarButtons.get(genButtonKey(pos, action.getText()));
@@ -226,16 +236,6 @@
         return basePart + subMenuPart + itemPart;
     }
 
-    private SimpleToolbar getToolbar(final ActionToolbarPosition pos) {
-        switch (pos) {
-        case bottombar:
-            return bottombar;
-        case topbar:
-        default:
-            return topbar;
-        }
-    }
-
     private void setEnableButton(final ToolbarButton button, final boolean enable) {
         if (enable) {
             button.enable();

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -339,7 +339,8 @@
                         $(WsThemePresenter.class), $$(ChatEngine.class), $(GroupActionRegistry.class),
                         $(ActionGroupSummaryToolbar.class));
                 final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter,
-                        $(I18nUITranslationService.class), $(WorkspaceSkeleton.class));
+                        $(I18nUITranslationService.class), $(WorkspaceSkeleton.class), $(
+                                ActionGroupSummaryToolbar.class).getView());
                 presenter.init(view);
                 return presenter;
             }

Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridButton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridButton.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridButton.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -1,53 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */package org.ourproject.kune.platf.client.ui.gridmenu;
-
-import com.calclab.suco.client.listener.Listener;
-
-public class GridButton {
-
-    private final String title;
-    private final String icon;
-    private final String tooltip;
-    private final Listener<String> listener;
-
-    public GridButton(final String icon, final String title, final String tooltip, final Listener<String> listener) {
-        this.icon = icon;
-        this.title = title;
-        this.tooltip = tooltip;
-        this.listener = listener;
-    }
-
-    public String getIcon() {
-        return icon;
-    }
-
-    public Listener<String> getListener() {
-        return listener;
-    }
-
-    public String getTitle() {
-        return title;
-    }
-
-    public String getTooltip() {
-        return tooltip;
-    }
-
-}

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -56,9 +56,10 @@
         entityTools.setId(ENTITY_TOOLS);
 
         entitySummary = new Panel();
-        entitySummary.setBorder(false);
+        entitySummary.setBorder(true);
         accordionLayout = new AccordionLayout(true);
         accordionLayout.setTitleCollapse(true);
+        accordionLayout.setHideCollapseTool(true);
         // accordionLayout.setHideCollapseTool(true);
         // accordionLayout.setAnimate(true);
         // accordionLayout.setActiveOnTop(false);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SummaryPanel.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SummaryPanel.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -18,19 +18,44 @@
  *
  */package org.ourproject.kune.workspace.client.skel;
 
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.KuneUiUtils;
+import org.ourproject.kune.platf.client.ui.KuneUiUtils.IconPosition;
+
 import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.event.PanelListenerAdapter;
 
 public class SummaryPanel extends Panel {
 
     private final WorkspaceSkeleton ws;
 
-    public SummaryPanel(String title, String titleTooltip, WorkspaceSkeleton ws) {
+    public SummaryPanel(final String title, final String titleTooltip, WorkspaceSkeleton ws) {
         this.ws = ws;
         super.setBorder(false);
-        super.setTitle("<span ext:qtip=\"" + titleTooltip + "\">" + title + "</span>");
         super.setAutoScroll(true);
+        final String collapsedTitle = KuneUiUtils.genQuickTipLabel(title, null, titleTooltip,
+                Images.App.getInstance().arrowRightWhite(), IconPosition.left);
+        final String expandedTitle = KuneUiUtils.genQuickTipLabel(title, null, titleTooltip,
+                Images.App.getInstance().arrowDownWhite(), IconPosition.left);
+        setTitle(collapsedTitle);
+        super.addListener(new PanelListenerAdapter() {
+            @Override
+            public void onCollapse(Panel panel) {
+                setTitle(collapsedTitle);
+            }
+
+            @Override
+            public void onExpand(Panel panel) {
+                setTitle(expandedTitle);
+            }
+        });
     }
 
+    public void addInSummary() {
+        ws.addInSummary(this);
+        this.expand();
+    }
+
     public void doLayoutIfNeeded() {
         if (super.isRendered()) {
             super.doLayout();

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPanel.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -88,7 +88,7 @@
         vp.add(flowPanel);
         vp.add(otherBuddiesLabel);
         super.add(vp);
-        ws.addInSummary(this);
+        addInSummary();
         clear();
     }
 

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -18,14 +18,16 @@
  *
  */package org.ourproject.kune.workspace.client.socialnet;
 
-import java.util.HashMap;
-
+import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
 import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridButton;
+import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.ui.gridmenu.GridDragConfiguration;
 import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
 import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuPanel;
 import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
 import org.ourproject.kune.workspace.client.skel.SummaryPanel;
 import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
 import org.ourproject.kune.workspace.client.themes.WsTheme;
@@ -34,12 +36,8 @@
 import com.calclab.suco.client.listener.Listener;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.DeferredCommand;
-import com.gwtext.client.core.EventObject;
 import com.gwtext.client.widgets.BoxComponent;
-import com.gwtext.client.widgets.Button;
 import com.gwtext.client.widgets.MessageBox;
-import com.gwtext.client.widgets.ToolbarButton;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
 import com.gwtext.client.widgets.event.ContainerListenerAdapter;
 
 public class GroupMembersSummaryPanel extends SummaryPanel implements GroupMembersSummaryView {
@@ -47,10 +45,10 @@
     private final GridMenuPanel<GroupDTO> gridMenuPanel;
     private final I18nUITranslationService i18n;
     private final GroupMembersSummaryPresenter presenter;
-    private final HashMap<GridButton, ToolbarButton> buttonsCache;
+    private final SimpleToolbar toolbar;
 
     public GroupMembersSummaryPanel(final GroupMembersSummaryPresenter presenter, final I18nUITranslationService i18n,
-            final WorkspaceSkeleton ws) {
+            final WorkspaceSkeleton ws, ActionToolbarView<StateToken> actionToolbarView) {
         super(i18n.t("Group members"), i18n.t("People and groups collaborating in this group"), ws);
         this.presenter = presenter;
         this.i18n = i18n;
@@ -60,7 +58,6 @@
                         + i18n.t("Drop into a room to invite the user to join the chat room"));
         gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This is an orphaned project, if you are interested "
                 + "please request to join to work on it"), dragConf, true, true, false, true, false);
-        gridMenuPanel.addStyleName("k-border-openbox");
         Listener<String> go = new Listener<String>() {
             public void onEvent(final String groupShortName) {
                 presenter.onDoubleClick(groupShortName);
@@ -68,9 +65,14 @@
         };
         // gridMenuPanel.onClick(go);
         gridMenuPanel.onDoubleClick(go);
-        gridMenuPanel.getBottomBar().setCls("k-blank-toolbar");
         super.add(gridMenuPanel);
-        ws.addInSummary(this);
+        toolbar = ((ActionToolbarPanel<StateToken>) actionToolbarView).getToolbar(ActionToolbarPosition.bottombar);
+        toolbar.setStyleName("x-toolbar");
+        toolbar.addStyleName("x-panel");
+        toolbar.addStyleName("k-blank-toolbar");
+        // toolbar.addStyleName("k-site-traybar");
+        super.add(toolbar);
+        super.addInSummary();
         ws.addListenerInEntitySummary(new ContainerListenerAdapter() {
             @Override
             public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,
@@ -78,52 +80,17 @@
                 gridMenuPanel.setWidth(adjWidth);
             }
         });
-        buttonsCache = new HashMap<GridButton, ToolbarButton>();
     }
 
-    public void addButton(final GridButton gridButton) {
-        // Workaround: gwt-ext don't have toolbar.removeItem method ...
-        ToolbarButton button = buttonsCache.get(gridButton);
-        if (button == null) {
-            button = new ToolbarButton(gridButton.getTitle());
-            button.setIcon(gridButton.getIcon());
-            button.setTooltip(gridButton.getTooltip());
-            button.addListener(new ButtonListenerAdapter() {
-                @Override
-                public void onClick(final Button button, final EventObject e) {
-                    DeferredCommand.addCommand(new Command() {
-                        public void execute() {
-                            gridButton.getListener().onEvent("");
-                        }
-                    });
-                }
-            });
-            buttonsCache.put(gridButton, button);
-        } else {
-            button.setVisible(true);
-        }
-        gridMenuPanel.getBottomBar().addButton(button);
-    }
-
     public void addItem(final GridItem<GroupDTO> gridItem) {
         gridMenuPanel.addItem(gridItem);
         doLayoutIfNeeded();
     }
 
-    public void addToolbarFill() {
-        gridMenuPanel.getBottomBar().addFill();
-    }
-
     @Override
     public void clear() {
         gridMenuPanel.removeAll();
-        for (final ToolbarButton button : buttonsCache.values()) {
-            // Workaround: gwt-ext don't have toolbar.removeItem method ...
-            // gridMenuPanel.getBottomBar().getEl().removeChild(button.getElement());
-            button.setVisible(false);
-            button.removeFromParent();
-        }
-        buttonsCache.clear();
+        toolbar.removeAll();
         doLayoutIfNeeded();
     }
 

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -21,10 +21,13 @@
 import java.util.List;
 
 import org.ourproject.kune.chat.client.ChatEngine;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
 import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
 import org.ourproject.kune.platf.client.actions.toolbar.ActionGroupSummaryToolbar;
 import org.ourproject.kune.platf.client.dto.AccessListsDTO;
 import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
+import org.ourproject.kune.platf.client.dto.AccessRolDTO;
 import org.ourproject.kune.platf.client.dto.GroupDTO;
 import org.ourproject.kune.platf.client.dto.GroupType;
 import org.ourproject.kune.platf.client.dto.InitDataDTO;
@@ -32,6 +35,7 @@
 import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
 import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
 import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
 import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
 import org.ourproject.kune.platf.client.services.ImageDescriptor;
@@ -39,7 +43,6 @@
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 import org.ourproject.kune.platf.client.ui.MenuItem;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridButton;
 import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
 import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
 import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
@@ -54,7 +57,6 @@
 
 public class GroupMembersSummaryPresenter extends SocialNetworkPresenter implements GroupMembersSummary {
 
-    protected GridButton addMember;
     private GroupMembersSummaryView view;
     private final I18nUITranslationService i18n;
     private final GridGroup adminCategory;
@@ -68,8 +70,8 @@
             final ImageUtils imageUtils, final Session session,
             final Provider<SocialNetworkServiceAsync> snServiceProvider,
             final Provider<GroupLiveSearcher> liveSearcherProvider, final WsThemePresenter wsThemePresenter,
-            final Provider<ChatEngine> chatEngineProvider, GroupActionRegistry groupActionRegistry,
-            ActionGroupSummaryToolbar actionGroupSummaryToolbar) {
+            final Provider<ChatEngine> chatEngineProvider, final GroupActionRegistry groupActionRegistry,
+            final ActionGroupSummaryToolbar toolbar) {
         super(i18n, stateManager, imageUtils, session, snServiceProvider, groupActionRegistry);
         this.i18n = i18n;
         this.stateManager = stateManager;
@@ -78,6 +80,10 @@
         final Listener<StateAbstractDTO> setStateListener = new Listener<StateAbstractDTO>() {
             public void onEvent(StateAbstractDTO state) {
                 setState(state);
+                toolbar.disableMenusAndClearButtons();
+                toolbar.setActions(groupActionRegistry.getCurrentActions(state.getGroup().getStateToken(),
+                        GroupActionRegistry.GENERAL, session.isLogged(), state.getGroupRights(), true));
+                toolbar.attach();
             }
         };
         stateManager.onStateChanged(setStateListener);
@@ -112,10 +118,11 @@
         pendigCategory = new GridGroup(pendingTitle, pendingTitle,
                 i18n.t("People pending to be accepted in this group by the admins"),
                 imageUtils.getImageHtml(ImageDescriptor.alert), true);
-        // i18n.t("Add member")
-        addMember = new GridButton("images/add-green.gif", "",
-                i18n.t("Add a group or a person as member of this group"), new Listener<String>() {
-                    public void onEvent(final String parameter) {
+        super.addGroupOperation(gotoGroupMenuItem, false);
+        super.addUserOperation(gotoMemberMenuItem, false);
+        ActionToolbarMenuDescriptor<StateToken> addMember = new ActionToolbarMenuDescriptor<StateToken>(
+                AccessRolDTO.Administrator, ActionToolbarPosition.bottombar, new Listener<StateToken>() {
+                    public void onEvent(StateToken parameter) {
                         liveSearcherProvider.get().onSelection(new Listener<LinkDTO>() {
                             public void onEvent(final LinkDTO link) {
                                 view.confirmAddCollab(link.getShortName(), link.getLongName());
@@ -124,8 +131,11 @@
                         liveSearcherProvider.get().show();
                     }
                 });
-        super.addGroupOperation(gotoGroupMenuItem, false);
-        super.addUserOperation(gotoMemberMenuItem, false);
+        addMember.setIconUrl("images/add-green.gif");
+        addMember.setTextDescription(i18n.t("Add member"));
+        // addMemberButton.setToolTip(i18n.t("Add a group or a person as member of this group"));
+        addMember.setParentMenuTitle(i18n.t("Options"));
+        groupActionRegistry.addAction(addMember, GroupActionRegistry.GENERAL);
     }
 
     public void addCollab(final String groupShortName) {
@@ -166,17 +176,12 @@
 
         view.clear();
 
-        if (userIsAdmin) {
-            view.addButton(addMember);
-            view.addToolbarFill();
-        }
-
         view.setDraggable(session.isLogged());
 
         if (!userIsMember) {
-            view.addButton(requestJoin);
+
         } else if (userIsAdmin && numAdmins > 1 || userIsCollab) {
-            view.addButton(unJoinButton);
+            // FIXME: view.addButton(unJoinButton);
         }
 
         if (userCanView) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -19,18 +19,13 @@
  */package org.ourproject.kune.workspace.client.socialnet;
 
 import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridButton;
 import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
 import org.ourproject.kune.workspace.client.themes.WsTheme;
 
 public interface GroupMembersSummaryView {
 
-    void addButton(GridButton gridButton);
-
     void addItem(GridItem<GroupDTO> gridItem);
 
-    void addToolbarFill();
-
     void clear();
 
     void confirmAddCollab(String groupShortName, String groupLongName);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPanel.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -19,6 +19,8 @@
  */
 package org.ourproject.kune.workspace.client.socialnet;
 
+import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
 import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarView;
 import org.ourproject.kune.platf.client.dto.GroupDTO;
 import org.ourproject.kune.platf.client.dto.StateToken;
@@ -40,11 +42,8 @@
     public ParticipationSummaryPanel(final ParticipationSummaryPresenter presenter, final I18nTranslationService i18n,
             final WorkspaceSkeleton ws, ActionToolbarView<StateToken> actionToolbarView) {
         super(i18n.t("Participates in"), i18n.t("Groups in which participates"), ws);
-        // super.setBorderStylePrimaryName("k-dropdownouter-part"); //
-        // super.addStyleName("kune-Margin-Medium-t");
         gridMenuPanel = new GridMenuPanel<GroupDTO>(i18n.t("This user is not member of any group"), false, false,
                 false, false, false);
-        gridMenuPanel.addStyleName("k-border-openbox");
         Listener<String> go = new Listener<String>() {
             public void onEvent(final String groupShortName) {
                 presenter.onDoubleClick(groupShortName);
@@ -53,7 +52,8 @@
         // gridMenuPanel.onClick(go);
         gridMenuPanel.onDoubleClick(go);
         super.add(gridMenuPanel);
-        ws.addInSummary(this);
+        super.add(((ActionToolbarPanel<StateToken>) actionToolbarView).getToolbar(ActionToolbarPosition.bottombar));
+        addInSummary();
         ws.addListenerInEntitySummary(new ContainerListenerAdapter() {
             @Override
             public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -18,8 +18,12 @@
  *
  */package org.ourproject.kune.workspace.client.socialnet;
 
+import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
 import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
 import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
+import org.ourproject.kune.platf.client.dto.AccessRolDTO;
 import org.ourproject.kune.platf.client.dto.GroupDTO;
 import org.ourproject.kune.platf.client.dto.GroupType;
 import org.ourproject.kune.platf.client.dto.SocialNetworkRequestResult;
@@ -34,7 +38,6 @@
 import org.ourproject.kune.platf.client.ui.MenuItem;
 import org.ourproject.kune.platf.client.ui.MenuItemCollection;
 import org.ourproject.kune.platf.client.ui.gridmenu.CustomMenu;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridButton;
 import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
 import org.ourproject.kune.platf.client.ui.gridmenu.GridItem;
 import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
@@ -45,8 +48,6 @@
 
 public class SocialNetworkPresenter {
 
-    protected GridButton requestJoin;
-    protected GridButton unJoinButton;
     protected MenuItem<GroupDTO> changeToCollabMenuItem;
     protected MenuItem<GroupDTO> removeMemberMenuItem;
     protected MenuItem<GroupDTO> changeToAdminMenuItem;
@@ -125,9 +126,9 @@
     }
 
     private void createButtons() {
-        requestJoin = new GridButton("images/add-green.gif", i18n.t("Participate"),
-                i18n.t("Request to participate in this group"), new Listener<String>() {
-                    public void onEvent(final String parameter) {
+        ActionToolbarButtonDescriptor<StateToken> participate = new ActionToolbarButtonDescriptor<StateToken>(
+                AccessRolDTO.Viewer, ActionToolbarPosition.bottombar, new Listener<StateToken>() {
+                    public void onEvent(StateToken parameter) {
                         Site.showProgressProcessing();
                         snServiceProvider.get().requestJoinGroup(session.getUserHash(),
                                 session.getCurrentState().getStateToken(), new AsyncCallbackSimple<Object>() {
@@ -150,13 +151,23 @@
                                 });
                     }
                 });
+        participate.setIconUrl("images/add-green.gif");
+        participate.setTextDescription(i18n.t("Participate"));
+        participate.setToolTip(i18n.t("Request to participate in this group"));
+        participate.setMustBeAuthenticated(false);
 
-        unJoinButton = new GridButton("images/del.gif", i18n.t("Unjoin"),
-                i18n.t("Don't participate more in this group"), new Listener<String>() {
-                    public void onEvent(final String parameter) {
+        ActionToolbarMenuDescriptor<StateToken> unJoin = new ActionToolbarMenuDescriptor<StateToken>(
+                AccessRolDTO.Editor, ActionToolbarPosition.bottombar, new Listener<StateToken>() {
+                    public void onEvent(StateToken parameter) {
                         removeMemberAction();
                     }
                 });
+        unJoin.setIconUrl("images/del.gif");
+        unJoin.setTextDescription(i18n.t("Unjoin"));
+        unJoin.setToolTip(i18n.t("Don't participate more in this group"));
+        unJoin.setParentMenuTitle(i18n.t("Options"));
+        groupActionRegistry.addAction(participate, GroupActionRegistry.GENERAL);
+        groupActionRegistry.addAction(unJoin, GroupActionRegistry.GENERAL);
     }
 
     private GridItem<GroupDTO> createDefMemberMenu(final GroupDTO group, final GridGroup gridGroup) {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java	2008-11-19 17:55:46 UTC (rev 956)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java	2008-11-19 22:51:48 UTC (rev 957)
@@ -91,12 +91,12 @@
         String dateFormat = session.getCurrentLanguage().getDateFormat();
         final DateTimeFormat fmt;
         if (dateFormat == null) {
-            fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm vvvv");
+            fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm a");
         } else {
             String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(publishedOn);
             String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
             dateFormat = dateFormat.replaceFirst("MMM", "'" + i18n.t(monthToTranslate) + "'");
-            fmt = DateTimeFormat.getFormat(dateFormat + " h:mm vvvv");
+            fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
         }
         view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
     }




More information about the kune-commits mailing list