[kune-commits] r1415 - in trunk: . src/main/java/cc/kune/barters/client/actions src/main/java/cc/kune/blogs/client src/main/java/cc/kune/blogs/client/actions src/main/java/cc/kune/chat/client/actions src/main/java/cc/kune/common/client/actions/gwtui src/main/java/cc/kune/common/client/actions/ui src/main/java/cc/kune/common/public src/main/java/cc/kune/core/client/actions src/main/java/cc/kune/core/client/sn/actions/registry src/main/java/cc/kune/docs/client src/main/java/cc/kune/docs/client/actions src/main/java/cc/kune/gspace/client/actions src/main/java/cc/kune/gspace/client/viewers src/main/java/cc/kune/meets/client/actions src/main/java/cc/kune/wiki/client src/main/java/cc/kune/wiki/client/actions
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Fri Jun 24 03:51:24 CEST 2011
Author: vjrj_
Date: 2011-06-24 03:51:23 +0200 (Fri, 24 Jun 2011)
New Revision: 1415
Added:
trunk/src/main/java/cc/kune/blogs/client/actions/NewPostMenuItem.java
trunk/src/main/java/cc/kune/docs/client/actions/NewDocMenuItem.java
trunk/src/main/java/cc/kune/docs/client/actions/NewFolderMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java
trunk/src/main/java/cc/kune/wiki/client/actions/WikiFolderNewMenu.java
Removed:
trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java
trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java
trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java
Modified:
trunk/.project
trunk/TODO
trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java
trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java
trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java
trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java
trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java
trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java
trunk/src/main/java/cc/kune/common/public/kune-common.css
trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java
trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java
trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsMenu.java
trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java
trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
trunk/src/main/java/cc/kune/meets/client/actions/MeetingsClientActions.java
trunk/src/main/java/cc/kune/wiki/client/WikiGinModule.java
trunk/src/main/java/cc/kune/wiki/client/actions/NewFolderBtn.java
trunk/src/main/java/cc/kune/wiki/client/actions/NewWikiBtn.java
trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
Log:
New menus updated, and menu items created only under demand
Modified: trunk/.project
===================================================================
--- trunk/.project 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/.project 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,42 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>kune</name>
- <comment>kune free/open/libre collaboration platform. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
- <projects/>
- <buildSpec>
- <buildCommand>
- <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
- </buildCommand>
- <buildCommand>
- <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.wst.validation.validationbuilder</name>
- </buildCommand>
- <buildCommand>
- <name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
- </buildCommand>
- <buildCommand>
- <name>com.instantiations.assist.eclipse.coverage.instrumentationBuilder</name>
- </buildCommand>
- <buildCommand>
- <name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
- <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
- <nature>org.eclipse.ajdt.ui.ajnature</nature>
- <nature>com.google.gwt.eclipse.core.gwtNature</nature>
- <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
- <nature>com.instantiations.assist.eclipse.coverage.codeCoverageNature</nature>
- <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
- </natures>
-</projectDescription>
\ No newline at end of file
+ <name>kune</name>
+ <comment>kune free/open/libre collaboration platform. NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.wst.validation.validationbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>com.instantiations.assist.eclipse.coverage.instrumentationBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sourceforge.pmd.eclipse.plugin.pmdBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.recommenders.rcp.analysis.RecommendersBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
+ <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
+ <nature>org.eclipse.ajdt.ui.ajnature</nature>
+ <nature>com.google.gwt.eclipse.core.gwtNature</nature>
+ <nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
+ <nature>com.instantiations.assist.eclipse.coverage.codeCoverageNature</nature>
+ <nature>net.sourceforge.pmd.eclipse.plugin.pmdNature</nature>
+ <nature>org.eclipse.recommenders.rcp.analysis.RecommendersNature</nature>
+ </natures>
+</projectDescription>
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/TODO 2011-06-24 01:51:23 UTC (rev 1415)
@@ -371,6 +371,17 @@
** vjrj <v> IconHyperlink.java and IconLabel.java to gwt1.5
* MID-TERM
+** Template system for new waves with legal free/open procedures
+New
+ Templates
+ In English
+ In Spanish
+ Legal
+ Procedimiento A
+ Procedimiento B
+ Borrador de Estutos de Asociación
+ (...)
+
** Archive of xmpp conversations
*** http://community.igniterealtime.org/docs/DOC-1094 (for openfire)
** Enable two Waves per doc: 1 for the doc (no comments enabled), other for comments. Similar to docs.google.com comments approach.
Modified: trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -53,17 +53,17 @@
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem, final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, newBartersBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, containers);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newBartersBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, containers);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
}
@Override
Modified: trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/blogs/client/BlogsGinModule.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -20,16 +20,16 @@
package cc.kune.blogs.client;
import cc.kune.blogs.client.actions.BlogsClientActions;
+import cc.kune.blogs.client.actions.BlogsNewMenu;
+import cc.kune.common.client.ExtendedGinModule;
-import com.google.inject.Singleton;
-import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+public class BlogsGinModule extends ExtendedGinModule {
-public class BlogsGinModule extends AbstractPresenterModule {
+ @Override
+ protected void configure() {
+ s(BlogsNewMenu.class);
+ s(BlogsClientTool.class);
+ s(BlogsClientActions.class);
+ }
- @Override
- protected void configure() {
- bind(BlogsClientTool.class).in(Singleton.class);
- bind(BlogsClientActions.class).in(Singleton.class);
- }
-
}
Modified: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -51,7 +51,7 @@
@Inject
public BlogsClientActions(final I18nUITranslationService i18n, final Session session,
final StateManager stateManager, final ActionRegistryByType registry, final CoreResources res,
- final Provider<GoParentBlogBtn> folderGoUp, final Provider<NewPostBtn> newDocBtn,
+ final Provider<GoParentBlogBtn> folderGoUp, final Provider<NewPostMenuItem> newDocBtn,
final Provider<NewBlogBtn> newFolderBtn, final Provider<OpenBlogMenuItem> openContentMenuItem,
final Provider<DelPostMenuItem> delContentMenuItem,
final Provider<RefreshContentMenuItem> refresh,
@@ -61,20 +61,20 @@
final Provider<DelBlogMenuItem> delFolderMenuItem,
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, newDocBtn, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, TYPE_ROOT);
- actionsRegistry.addAction(ActionGroups.VIEW, chatAbout, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, blogNewMenu, TYPE_BLOG);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newDocBtn, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, TYPE_ROOT);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, chatAbout, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
newMenusRegistry.register(TYPE_BLOG, blogNewMenu.get());
- actionsRegistry.addAction(ActionGroups.VIEW, blogNewMenu, TYPE_BLOG);
}
@Override
Modified: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsNewMenu.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,11 +1,11 @@
package cc.kune.blogs.client.actions;
import cc.kune.gspace.client.actions.AbstractNewMenu;
-import cc.kune.gspace.client.actions.NewMenusProvider;
+import cc.kune.gspace.client.actions.NewMenuProvider;
import com.google.inject.Inject;
-public class BlogsNewMenu extends NewMenusProvider {
+public class BlogsNewMenu extends NewMenuProvider {
@Inject
public BlogsNewMenu(final AbstractNewMenu menu) {
Deleted: trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.blogs.client.actions;
-
-import cc.kune.blogs.shared.BlogsConstants;
-import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
-import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.actions.NewContentBtn;
-
-import com.google.inject.Inject;
-
-public class NewPostBtn extends NewContentBtn {
-
- @Inject
- public NewPostBtn(final I18nTranslationService i18n, final NewContentAction action,
- final NavResources res, final GlobalShortcutRegister shorcutReg) {
- super(i18n, action, res.blogAdd(), shorcutReg, i18n.t("New post"), i18n.t("Create a new blog post"),
- i18n.t("New post"), BlogsConstants.TYPE_POST);
- }
-
-}
Copied: trunk/src/main/java/cc/kune/blogs/client/actions/NewPostMenuItem.java (from rev 1409, trunk/src/main/java/cc/kune/blogs/client/actions/NewPostBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/NewPostMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/NewPostMenuItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,39 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.blogs.client.actions;
+
+import cc.kune.blogs.shared.BlogsConstants;
+import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.NewContentMenuItem;
+
+import com.google.inject.Inject;
+
+public class NewPostMenuItem extends NewContentMenuItem {
+
+ @Inject
+ public NewPostMenuItem(final I18nTranslationService i18n, final NewContentAction action,
+ final NavResources res, final GlobalShortcutRegister shorcutReg, final BlogsNewMenu blogsNewMenu) {
+ super(i18n, action, res.blogAdd(), shorcutReg, i18n.t("New post"), i18n.t("Create a new blog post"),
+ i18n.t("New post"), BlogsConstants.TYPE_POST, blogsNewMenu.get());
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/blogs/client/actions/NewPostMenuItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/chat/client/actions/ChatClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -50,13 +50,13 @@
final Provider<OpenRoomBtn> openRoomBtn,
final Provider<ContentViewerOptionsMenu> optionsMenuContent) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, newRoomBtn, TYPE_ROOT);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, openRoomBtn, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openRoomMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openRoomArchiveMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newRoomBtn, TYPE_ROOT);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, openRoomBtn, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openRoomMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openRoomArchiveMenuItem, containersNoRoot);
}
@Override
Modified: trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/common/client/actions/gwtui/AbstractGwtMenuItemGui.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -132,6 +132,9 @@
final int position = descriptor.getPosition();
final AbstractGwtMenuGui menu = getParentMenu(descriptor);
if (menu == null) {
+ // Note: Be careful if you have two menus (not a singleton) and you add
+ // one but
+ // no the other that it associated with this menuitem
throw new UIException("Warning: To add a menu item you need to add the menu before. Item: "
+ descriptor);
}
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -30,77 +30,77 @@
import com.google.gwt.user.client.ui.Composite;
public abstract class AbstractComposedGuiItem extends Composite implements IsActionExtensible {
- private final GuiProvider bindings;
- private GuiActionDescCollection guiItems;
+ private final GuiProvider bindings;
+ private GuiActionDescCollection guiItems;
- public AbstractComposedGuiItem(final GuiProvider bindings) {
- super();
- this.bindings = bindings;
- }
+ public AbstractComposedGuiItem(final GuiProvider bindings) {
+ super();
+ this.bindings = bindings;
+ }
- public void add(final GuiActionDescCollection descriptors) {
- for (final GuiActionDescrip descriptor : descriptors) {
- add(descriptor);
- }
+ public void add(final GuiActionDescCollection descriptors) {
+ for (final GuiActionDescrip descriptor : descriptors) {
+ add(descriptor);
}
+ }
- @Override
- public void add(final GuiActionDescrip... descriptors) {
- for (final GuiActionDescrip descriptor : descriptors) {
- add(descriptor);
- }
+ @Override
+ public void add(final GuiActionDescrip... descriptors) {
+ for (final GuiActionDescrip descriptor : descriptors) {
+ add(descriptor);
}
+ }
- @Override
- public void add(final GuiActionDescrip descriptor) {
- getGuiItems().add(descriptor);
- beforeAddWidget(descriptor);
- }
+ @Override
+ public void add(final GuiActionDescrip descriptor) {
+ getGuiItems().add(descriptor);
+ beforeAddWidget(descriptor);
+ }
- public void addActions(final List<GuiActionDescrip> descriptors) {
- for (final GuiActionDescrip descriptor : descriptors) {
- add(descriptor);
- }
+ public void addActions(final List<GuiActionDescrip> descriptors) {
+ for (final GuiActionDescrip descriptor : descriptors) {
+ add(descriptor);
}
+ }
- @Override
- public void addAll(final GuiActionDescCollection descriptors) {
- for (final GuiActionDescrip descriptor : descriptors) {
- add(descriptor);
- }
+ @Override
+ public void addAll(final GuiActionDescCollection descriptors) {
+ for (final GuiActionDescrip descriptor : descriptors) {
+ add(descriptor);
}
+ }
- protected abstract void addWidget(AbstractGuiItem item);
+ protected abstract void addWidget(AbstractGuiItem item);
- protected void beforeAddWidget(final GuiActionDescrip descrip) {
- if (descrip.mustBeAdded()) {
- final GuiBinding binding = bindings.get(descrip.getType());
- if (binding == null) {
- throw new UIException("Unknown binding for: " + descrip);
- } else {
- final AbstractGuiItem item = binding.create(descrip);
- if (binding.shouldBeAdded()) {
- if (descrip.getPosition() == GuiActionDescrip.NO_POSITION) {
- addWidget(item);
- } else {
- insertWidget(item, descrip.getPosition());
- }
- }
- }
+ protected void beforeAddWidget(final GuiActionDescrip descrip) {
+ if (descrip.mustBeAdded()) {
+ final GuiBinding binding = bindings.get(descrip.getType());
+ if (binding == null) {
+ throw new UIException("Unknown binding for: " + descrip);
+ } else {
+ final AbstractGuiItem item = binding.create(descrip);
+ if (binding.shouldBeAdded()) {
+ if (descrip.getPosition() == GuiActionDescrip.NO_POSITION) {
+ addWidget(item);
+ } else {
+ insertWidget(item, descrip.getPosition());
+ }
}
+ }
}
+ }
- @Override
- public void clear() {
- getGuiItems().clear();
- }
+ @Override
+ public void clear() {
+ getGuiItems().clear();
+ }
- public GuiActionDescCollection getGuiItems() {
- if (guiItems == null) {
- guiItems = new GuiActionDescCollection();
- }
- return guiItems;
+ public GuiActionDescCollection getGuiItems() {
+ if (guiItems == null) {
+ guiItems = new GuiActionDescCollection();
}
+ return guiItems;
+ }
- protected abstract void insertWidget(AbstractGuiItem item, int position);
+ protected abstract void insertWidget(AbstractGuiItem item, int position);
}
Modified: trunk/src/main/java/cc/kune/common/public/kune-common.css
===================================================================
--- trunk/src/main/java/cc/kune/common/public/kune-common.css 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/common/public/kune-common.css 2011-06-24 01:51:23 UTC (rev 1415)
@@ -441,7 +441,7 @@
}
.k-no-backimage,.k-no-backimage td {
- background-image: none;
+ background-image: none !important;
}
.k-nobackcolor {
Modified: trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -39,98 +39,100 @@
*
*/
public class ActionRegistryByType {
- private static final String GENERIC_GROUP_ACTION = "kgengroup";
- private static final String GENERIC_TYPE_ID = "kgentype";
- private static final String KEY_SEPARATOR = "-";
+ private static final String GENERIC_GROUP_ACTION = "kgengroup";
+ private static final String GENERIC_TYPE_ID = "kgentype";
+ private static final String KEY_SEPARATOR = "-";
- private final Map<String, GuiActionDescProviderCollection> actions;
+ private final Map<String, GuiActionDescProviderCollection> actions;
- public ActionRegistryByType() {
- actions = new HashMap<String, GuiActionDescProviderCollection>();
- }
+ public ActionRegistryByType() {
+ actions = new HashMap<String, GuiActionDescProviderCollection>();
+ }
- private void add(final GuiActionDescCollection collection, final GuiActionDescrip descrip, final Object targetItem) {
- descrip.setTarget(targetItem);
- collection.add(descrip);
- }
+ private void add(final GuiActionDescCollection collection, final GuiActionDescrip descrip,
+ final Object targetItem) {
+ descrip.setTarget(targetItem);
+ collection.add(descrip);
+ }
- public void addAction(final Provider<? extends GuiActionDescrip> action) {
- addAction(GENERIC_GROUP_ACTION, action, GENERIC_TYPE_ID);
- }
+ public void addAction(final Provider<? extends GuiActionDescrip> action) {
+ addAction(GENERIC_GROUP_ACTION, action, GENERIC_TYPE_ID);
+ }
- public void addAction(@Nonnull final String actionsGroupId, final Provider<? extends GuiActionDescrip> action) {
- addAction(actionsGroupId, action, GENERIC_TYPE_ID);
- }
+ public void addAction(@Nonnull final String actionsGroupId,
+ final Provider<? extends GuiActionDescrip> action) {
+ addAction(actionsGroupId, action, GENERIC_TYPE_ID);
+ }
- public void addAction(@Nonnull final String actionsGroupId,
- final @Nonnull Provider<? extends GuiActionDescrip> action, @Nonnull final String... typeIds) {
- for (final String typeId : typeIds) {
- final GuiActionDescProviderCollection actionColl = getActions(actionsGroupId, typeId);
- actionColl.add(action);
- actions.put(genKey(actionsGroupId, typeId), actionColl);
- }
+ public void addAction(@Nonnull final String actionsGroupId,
+ final @Nonnull Provider<? extends GuiActionDescrip> action, @Nonnull final String... typeIds) {
+ for (final String typeId : typeIds) {
+ final GuiActionDescProviderCollection actionColl = getActions(actionsGroupId, typeId);
+ actionColl.add(action);
+ actions.put(genKey(actionsGroupId, typeId), actionColl);
}
+ }
- private String genKey(final String actionsGroupId, final String typeId) {
- return actionsGroupId + KEY_SEPARATOR + typeId;
- }
+ private String genKey(final String actionsGroupId, final String typeId) {
+ return actionsGroupId + KEY_SEPARATOR + typeId;
+ }
- private GuiActionDescProviderCollection getActions(final String actionsGroupId, final String typeId) {
- final String key = genKey(actionsGroupId, typeId);
- GuiActionDescProviderCollection actionColl = actions.get(key);
- if (actionColl == null) {
- actionColl = new GuiActionDescProviderCollection();
- actions.put(key, actionColl);
- }
- return actionColl;
+ private GuiActionDescProviderCollection getActions(final String actionsGroupId, final String typeId) {
+ final String key = genKey(actionsGroupId, typeId);
+ GuiActionDescProviderCollection actionColl = actions.get(key);
+ if (actionColl == null) {
+ actionColl = new GuiActionDescProviderCollection();
+ actions.put(key, actionColl);
}
+ return actionColl;
+ }
- public GuiActionDescCollection getCurrentActions(final Object targetItem, final boolean isLogged,
- final AccessRights rights) {
- return getCurrentActions(targetItem, GENERIC_TYPE_ID, isLogged, rights, null);
- }
+ public GuiActionDescCollection getCurrentActions(final Object targetItem, final boolean isLogged,
+ final AccessRights rights) {
+ return getCurrentActions(targetItem, GENERIC_TYPE_ID, isLogged, rights, null);
+ }
- public GuiActionDescCollection getCurrentActions(final Object targetItem, final boolean isLogged,
- final AccessRights rights, @Nullable final String actionsGroup) {
- return getCurrentActions(targetItem, GENERIC_TYPE_ID, isLogged, rights, actionsGroup);
- }
+ public GuiActionDescCollection getCurrentActions(final Object targetItem, final boolean isLogged,
+ final AccessRights rights, @Nullable final String actionsGroup) {
+ return getCurrentActions(targetItem, GENERIC_TYPE_ID, isLogged, rights, actionsGroup);
+ }
- public GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
- final boolean isLogged, final AccessRights rights) {
- return getCurrentActions(targetItem, typeId, isLogged, rights, null);
- }
+ public GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
+ final boolean isLogged, final AccessRights rights) {
+ return getCurrentActions(targetItem, typeId, isLogged, rights, null);
+ }
- public <T> GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
- final boolean isLogged, final AccessRights rights, @Nullable final String actionsGroupId) {
- final GuiActionDescCollection collection = new GuiActionDescCollection();
- for (final Provider<? extends GuiActionDescrip> descripProv : getActions(actionsGroupId, typeId)) {
- final GuiActionDescrip descrip = descripProv.get();
- final AbstractAction action = descrip.getAction();
- if (action instanceof RolAction) {
- if (mustAdd((RolAction) action, isLogged, rights)) {
- add(collection, descrip, targetItem);
- }
- } else {
- add(collection, descrip, targetItem);
- }
+ public <T> GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
+ final boolean isLogged, final AccessRights rights, @Nullable final String actionsGroupId) {
+ final GuiActionDescCollection collection = new GuiActionDescCollection();
+ for (final Provider<? extends GuiActionDescrip> descripProv : getActions(actionsGroupId, typeId)) {
+ final GuiActionDescrip descrip = descripProv.get();
+ final AbstractAction action = descrip.getAction();
+ if (action instanceof RolAction) {
+ if (mustAdd((RolAction) action, isLogged, rights)) {
+ add(collection, descrip, targetItem);
}
- return collection;
+ } else {
+ add(collection, descrip, targetItem);
+ }
}
+ return collection;
+ }
- private boolean mustAdd(final RolAction action, final boolean isLogged, final AccessRights rights) {
- if (action.isAuthNeed()) {
- if (!isLogged) {
- return false;
- }
- }
- switch (action.getRolRequired()) {
- case Administrator:
- return rights.isAdministrable();
- case Editor:
- return rights.isEditable();
- case Viewer:
- default:
- return rights.isVisible();
- }
+ private boolean mustAdd(final RolAction action, final boolean isLogged, final AccessRights rights) {
+ if (action.isAuthNeed()) {
+ if (!isLogged) {
+ return false;
+ }
}
+ switch (action.getRolRequired()) {
+ case Administrator:
+ return rights.isAdministrable();
+ case Editor:
+ return rights.isEditable();
+ case Viewer:
+ default:
+ return rights.isVisible();
+ }
+ }
}
Modified: trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/core/client/actions/XMLActionsParser.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -143,7 +143,7 @@
return menuItem;
}
};
- actionRegistry.addAction(ActionGroups.VIEW, menuItemProvider, typeId);
+ actionRegistry.addAction(ActionGroups.TOOLBAR, menuItemProvider, typeId);
}
}
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -50,7 +50,7 @@
public static final SubMenuDescriptor MODERATION_SUBMENU = new SubMenuDescriptor();
public static final MenuDescriptor OPTIONS_MENU = new MenuDescriptor();
- public static final String OPTIONS_STYLES = "k-sn-options-menu, k-noborder, k-nobackcolor, k-btn-min";
+ public static final String OPTIONS_STYLES = "k-sn-options-menu, k-noborder, k-nobackcolor, k-no-backimage, k-btn-min";
public static final SubMenuDescriptor VISIBILITY_SUBMENU = new SubMenuDescriptor();
@Inject
Modified: trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/DocsGinModule.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -19,17 +19,17 @@
*/
package cc.kune.docs.client;
+import cc.kune.common.client.ExtendedGinModule;
import cc.kune.docs.client.actions.DocsClientActions;
+import cc.kune.docs.client.actions.DocsFolderNewMenu;
-import com.google.inject.Singleton;
-import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+public class DocsGinModule extends ExtendedGinModule {
-public class DocsGinModule extends AbstractPresenterModule {
+ @Override
+ protected void configure() {
+ s(DocsClientTool.class);
+ s(DocsClientActions.class);
+ s(DocsFolderNewMenu.class);
+ }
- @Override
- protected void configure() {
- bind(DocsClientTool.class).in(Singleton.class);
- bind(DocsClientActions.class).in(Singleton.class);
- }
-
}
Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -52,33 +52,33 @@
@Inject
public DocsClientActions(final I18nUITranslationService i18n, final Session session,
final StateManager stateManager, final ActionRegistryByType registry, final CoreResources res,
- final Provider<GoParentFolderBtn> folderGoUp, final Provider<NewDocBtn> newDocBtn,
- final Provider<NewFolderBtn> newFolderBtn, final Provider<OpenDocMenuItem> openContentMenuItem,
+ final Provider<GoParentFolderBtn> folderGoUp, final Provider<NewDocMenuItem> newDocBtn,
+ final Provider<NewFolderMenuItem> newFolderBtn,
+ final Provider<OpenDocMenuItem> openContentMenuItem,
final Provider<DelDocMenuItem> delContentMenuItem,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<RefreshContentMenuItem> refresh,
- final Provider<SetAsHomePageMenuItem> setAsHomePage, final DocsRootNewMenu rootNewMenu,
+ final Provider<SetAsHomePageMenuItem> setAsHomePage,
final NewMenusForTypeIdsRegistry newMenusRegistry, final DocsFolderNewMenu folderNewMenu) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, newDocBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, chatAbout, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, setAsHomePage, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderNewMenu, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newDocBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, chatAbout, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, setAsHomePage, contents);
newMenusRegistry.register(TYPE_FOLDER, folderNewMenu.get());
- newMenusRegistry.register(TYPE_ROOT, rootNewMenu.get());
- actionsRegistry.addAction(ActionGroups.VIEW, folderNewMenu, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, rootNewMenu, root);
+ newMenusRegistry.register(TYPE_ROOT, folderNewMenu.get());
}
@Override
Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsFolderNewMenu.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,14 +1,16 @@
package cc.kune.docs.client.actions;
+import javax.annotation.Nonnull;
+
import cc.kune.gspace.client.actions.AbstractNewMenu;
-import cc.kune.gspace.client.actions.NewMenusProvider;
+import cc.kune.gspace.client.actions.NewMenuProvider;
import com.google.inject.Inject;
-public class DocsFolderNewMenu extends NewMenusProvider {
+public class DocsFolderNewMenu extends NewMenuProvider {
@Inject
- public DocsFolderNewMenu(final AbstractNewMenu menu) {
+ public DocsFolderNewMenu(final @Nonnull AbstractNewMenu menu) {
super(menu);
}
Deleted: trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsRootNewMenu.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,15 +0,0 @@
-package cc.kune.docs.client.actions;
-
-import cc.kune.gspace.client.actions.AbstractNewMenu;
-import cc.kune.gspace.client.actions.NewMenusProvider;
-
-import com.google.inject.Inject;
-
-public class DocsRootNewMenu extends NewMenusProvider {
-
- @Inject
- public DocsRootNewMenu(final AbstractNewMenu menu) {
- super(menu);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.docs.client.actions;
-
-import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
-import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.docs.shared.DocsConstants;
-import cc.kune.gspace.client.actions.NewContentBtn;
-
-import com.google.inject.Inject;
-
-public class NewDocBtn extends NewContentBtn {
-
- @Inject
- public NewDocBtn(final I18nTranslationService i18n, final NewContentAction action,
- final NavResources res, final GlobalShortcutRegister shorcutReg) {
- super(i18n, action, res.pageAdd(), shorcutReg, i18n.t("New document"),
- i18n.t("Create a New Document here. "
- + "This document will be a new 'Page' in the public web if you publish it"),
- i18n.t("New document"), DocsConstants.TYPE_DOCUMENT);
- }
-
-}
Copied: trunk/src/main/java/cc/kune/docs/client/actions/NewDocMenuItem.java (from rev 1409, trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/NewDocMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/NewDocMenuItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,42 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.docs.client.actions;
+
+import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.docs.shared.DocsConstants;
+import cc.kune.gspace.client.actions.NewContentMenuItem;
+
+import com.google.inject.Inject;
+
+public class NewDocMenuItem extends NewContentMenuItem {
+
+ @Inject
+ public NewDocMenuItem(final I18nTranslationService i18n, final NewContentAction action,
+ final NavResources res, final GlobalShortcutRegister shorcutReg,
+ final DocsFolderNewMenu docsFolderNewMenu) {
+ super(i18n, action, res.pageAdd(), shorcutReg, i18n.t("New document"),
+ i18n.t("Create a New Document here. "
+ + "This document will be a new 'Page' in the public web if you publish it"),
+ i18n.t("New document"), DocsConstants.TYPE_DOCUMENT, docsFolderNewMenu.get());
+ }
+
+}
Deleted: trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.docs.client.actions;
-
-import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.docs.shared.DocsConstants;
-import cc.kune.gspace.client.actions.NewContainerBtn;
-
-import com.google.inject.Inject;
-
-public class NewFolderBtn extends NewContainerBtn {
-
- @Inject
- public NewFolderBtn(final I18nTranslationService i18n, final NewContainerAction action,
- final NavResources res) {
- super(i18n, action, res.folderAdd(), i18n.t("New folder"),
- i18n.t("Create a new folder here. A folder will be a 'section' in the public web"),
- i18n.t("New folder"), DocsConstants.TYPE_FOLDER);
- }
-
-}
Copied: trunk/src/main/java/cc/kune/docs/client/actions/NewFolderMenuItem.java (from rev 1409, trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/NewFolderMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/actions/NewFolderMenuItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,39 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.docs.client.actions;
+
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.docs.shared.DocsConstants;
+import cc.kune.gspace.client.actions.NewContainerMenuItem;
+
+import com.google.inject.Inject;
+
+public class NewFolderMenuItem extends NewContainerMenuItem {
+
+ @Inject
+ public NewFolderMenuItem(final I18nTranslationService i18n, final NewContainerAction action,
+ final NavResources res, final DocsFolderNewMenu docsFolderNewMenu) {
+ super(i18n, action, res.folderAdd(), i18n.t("New folder"),
+ i18n.t("Create a new folder here. A folder will be a 'section' in the public web"),
+ i18n.t("New folder"), DocsConstants.TYPE_FOLDER, docsFolderNewMenu.get());
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/ActionGroups.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -25,8 +25,8 @@
*/
public final class ActionGroups {
public final static String EDIT = "edit";
- public final static String MENUITEM = "menu-item";
- public final static String VIEW = "view";
+ public final static String ITEM_MENU = "menu-item";
+ public final static String TOOLBAR = "view";
private ActionGroups() {
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsMenu.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerOptionsMenu.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -26,10 +26,11 @@
public class ContentViewerOptionsMenu extends MenuDescriptor {
- @Inject
- public ContentViewerOptionsMenu(final CoreResources res) {
- super();
- this.withIcon(res.arrowdownsitebar()).withStyles("k-def-docbtn, k-fr, k-noborder, k-nobackcolor");
- }
+ @Inject
+ public ContentViewerOptionsMenu(final CoreResources res) {
+ super();
+ this.withIcon(res.arrowdownsitebar()).withStyles(
+ "k-def-docbtn, k-fr, k-noborder, k-no-backimage, k-nobackcolor");
+ }
}
Copied: trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java (from rev 1409, trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,102 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.actions;
+
+import javax.annotation.Nonnull;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.ContentCache;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.dto.HasContent;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter;
+
+import com.google.gwt.resources.client.ImageResource;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class NewContainerMenuItem extends MenuItemDescriptor {
+
+ public static class NewContainerAction extends RolAction {
+
+ private final ContentCache cache;
+ private final Provider<ContentServiceAsync> contentService;
+ private final FolderViewerPresenter folderViewer;
+ private final I18nTranslationService i18n;
+ private final Session session;
+ private final StateManager stateManager;
+
+ @Inject
+ public NewContainerAction(final Session session, final StateManager stateManager,
+ final I18nTranslationService i18n, final Provider<ContentServiceAsync> contentService,
+ final ContentCache cache, final FolderViewerPresenter folderViewer) {
+ super(AccessRolDTO.Editor, true);
+ this.session = session;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ this.contentService = contentService;
+ this.cache = cache;
+ this.folderViewer = folderViewer;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ NotifyUser.showProgressProcessing();
+ stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
+ final String newName = (String) getValue(NEW_NAME);
+ contentService.get().addFolder(session.getUserHash(), session.getCurrentStateToken(), newName,
+ (String) getValue(ID), new AsyncCallbackSimple<StateContainerDTO>() {
+ @Override
+ public void onSuccess(final StateContainerDTO state) {
+ // contextNavigator.setEditOnNextStateChange(true);
+ stateManager.setRetrievedStateAndGo(state);
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.tWithNT("[%s] created", "New folder created, for instance", newName));
+ folderViewer.blinkTitle();
+ }
+ });
+ cache.removeContent(session.getCurrentStateToken());
+ }
+
+ }
+
+ private static final String ID = "ctnernewid";
+ private static final String NEW_NAME = "ctnernewname";
+
+ public NewContainerMenuItem(final I18nTranslationService i18n, final NewContainerAction action,
+ final ImageResource icon, final String title, final String tooltip, final String newName,
+ final String id, final @Nonnull MenuDescriptor parent) {
+ super(action);
+ setParent(parent);
+ // The name given to this new content
+ action.putValue(NEW_NAME, newName);
+ action.putValue(ID, id);
+ this.withText(title).withToolTip(tooltip).withIcon(icon).withStyles("k-def-docbtn, k-fr");
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/actions/NewContainerMenuItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -39,7 +39,7 @@
import com.google.inject.Inject;
import com.google.inject.Provider;
-public class NewContentBtn extends ButtonDescriptor {
+public abstract class NewContentBtn extends ButtonDescriptor {
public static class NewContentAction extends RolAction {
Copied: trunk/src/main/java/cc/kune/gspace/client/actions/NewContentMenuItem.java (from rev 1414, trunk/src/main/java/cc/kune/gspace/client/actions/NewContentBtn.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewContentMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewContentMenuItem.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,106 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.actions;
+
+import javax.annotation.Nonnull;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.ContentCache;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.dto.HasContent;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.viewers.ContentViewerPresenter;
+
+import com.google.gwt.resources.client.ImageResource;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class NewContentMenuItem extends MenuItemDescriptor {
+
+ public static class NewContentAction extends RolAction {
+
+ private final ContentCache cache;
+ private final Provider<ContentServiceAsync> contentService;
+ private final ContentViewerPresenter contentViewer;
+ private final I18nTranslationService i18n;
+ private final Session session;
+ private final StateManager stateManager;
+
+ @Inject
+ public NewContentAction(final Session session, final StateManager stateManager,
+ final I18nTranslationService i18n, final Provider<ContentServiceAsync> contentService,
+ final ContentViewerPresenter contentViewerPresenter, final ContentCache cache) {
+ super(AccessRolDTO.Editor, true);
+ this.session = session;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ this.contentService = contentService;
+ this.contentViewer = contentViewerPresenter;
+ this.cache = cache;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ NotifyUser.showProgressProcessing();
+ stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken());
+ final String newName = (String) getValue(NEW_NAME);
+ contentService.get().addContent(session.getUserHash(), session.getCurrentStateToken(), newName,
+ (String) getValue(ID), new AsyncCallbackSimple<StateContentDTO>() {
+ @Override
+ public void onSuccess(final StateContentDTO state) {
+ stateManager.setRetrievedStateAndGo(state);
+ NotifyUser.hideProgress();
+ // stateManager.refreshCurrentGroupState();
+ // contextNavigator.setEditOnNextStateChange(true);
+ NotifyUser.info(i18n.tWithNT("[%s] created", "New content created, for instance", newName));
+ contentViewer.blinkTitle();
+ }
+ });
+ cache.removeContent(session.getCurrentStateToken());
+ }
+ }
+
+ private static final String ID = "ctnnewid";
+ private static final String NEW_NAME = "ctnnewname";
+
+ public NewContentMenuItem(final I18nTranslationService i18n, final NewContentAction action,
+ final ImageResource icon, final GlobalShortcutRegister shorcutReg, final String title,
+ final String tooltip, final String newName, final String id, @Nonnull final MenuDescriptor parent) {
+ super(parent, action);
+ // The name given to this new content
+ action.putValue(NEW_NAME, newName);
+ action.putValue(ID, id);
+ // final KeyStroke shortcut = Shortcut.getShortcut(false, true, false,
+ // false, Character.valueOf('N'));
+ // shorcutReg.put(shortcut, action);
+ this.withText(title).withToolTip(tooltip).withIcon(icon).withStyles("k-def-docbtn, k-fr");
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/actions/NewContentMenuItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java (from rev 1414, trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,26 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+
+import com.google.inject.Provider;
+
+/**
+ * The Class NewMenusProvider ins a way to create a kind of singeltons for menu
+ * entries. This can be register in a list of Providers<GuiDescriptor> but in
+ * fact only references one item and can be used to select the parent of some
+ * menu items
+ */
+public abstract class NewMenuProvider implements Provider<MenuDescriptor> {
+
+ private final AbstractNewMenu menu;
+
+ public NewMenuProvider(final AbstractNewMenu menu) {
+ this.menu = menu;
+ }
+
+ @Override
+ public MenuDescriptor get() {
+ return menu;
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/actions/NewMenuProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/NewMenusProvider.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -1,20 +0,0 @@
-package cc.kune.gspace.client.actions;
-
-import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
-
-import com.google.inject.Provider;
-
-public abstract class NewMenusProvider implements Provider<MenuDescriptor> {
-
- private final AbstractNewMenu menu;
-
- public NewMenusProvider(final AbstractNewMenu menu) {
- this.menu = menu;
- }
-
- @Override
- public MenuDescriptor get() {
- return menu;
- }
-
-}
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -187,7 +187,7 @@
}
}
final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContent.getGroup(),
- stateContent.getTypeId(), session.isLogged(), rights, ActionGroups.VIEW);
+ stateContent.getTypeId(), session.isLogged(), rights, ActionGroups.TOOLBAR);
getView().setActions(actions);
}
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -87,17 +87,7 @@
}
itemWidget.setMenu(toolbar);
// Tooltip.to(itemWidget, item.getTooltip());
- final MenuDescriptor menu = new MenuDescriptor(i18n.t("Actions"));
- menu.withIcon(res.arrowdown()).withStyles("k-def-docbtn, k-btn, k-button");
- menu.setStandalone(false);
- itemWidget.setMenuVisible(false);
- toolbar.add(menu);
- final GuiActionDescCollection actions = item.getActionCollection();
- toolbar.setVisible(actions.size() > 0);
- for (final GuiActionDescrip menuItem : actions) {
- menuItem.setParent(menu);
- toolbar.add(menuItem);
- }
+ // FIXME make this under demand
itemWidget.getRowClick().addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
@@ -119,8 +109,30 @@
}
});
itemWidget.getRowMouse().addMouseOverHandler(new MouseOverHandler() {
+ MenuDescriptor menu;
+
+ private MenuDescriptor createMenu(final FolderItemDescriptor item,
+ final FolderItemWidget itemWidget, final ActionSimplePanel toolbar) {
+ MenuDescriptor menu;
+ menu = new MenuDescriptor(i18n.t("Actions"));
+ menu.withIcon(res.arrowdown()).withStyles("k-def-docbtn, k-btn, k-button");
+ menu.setStandalone(false);
+ itemWidget.setMenuVisible(false);
+ toolbar.add(menu);
+ final GuiActionDescCollection actions = item.getActionCollection();
+ toolbar.setVisible(actions.size() > 0);
+ for (final GuiActionDescrip menuItem : actions) {
+ menuItem.setParent(menu);
+ toolbar.add(menuItem);
+ }
+ return menu;
+ }
+
@Override
public void onMouseOver(final MouseOverEvent event) {
+ if (menu == null) {
+ menu = createMenu(item, itemWidget, toolbar);
+ }
// menu.setVisible(true);
itemWidget.setMenuVisible(true);
}
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerPresenter.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -149,7 +149,7 @@
capabilitiesRegistry.isDragable(typeId) && rights.isAdministrable(),
capabilitiesRegistry.isDropable(typeId) && rights.isAdministrable(),
actionsRegistry.getCurrentActions(content, typeId, session.isLogged(), rights,
- ActionGroups.MENUITEM));
+ ActionGroups.ITEM_MENU));
if (status.equals(ContentStatus.inTheDustbin) && !session.getShowDeletedContent()) {
// Don't show
// NotifyUser.info("Deleted, don't show");
@@ -300,7 +300,7 @@
getView().setContainer(stateContainer);
final AccessRights rights = stateContainer.getContainerRights();
final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContainer.getGroup(),
- stateContainer.getTypeId(), session.isLogged(), rights, ActionGroups.VIEW);
+ stateContainer.getTypeId(), session.isLogged(), rights, ActionGroups.TOOLBAR);
final ContainerDTO container = stateContainer.getContainer();
createPath(container, actions);
getView().setActions(actions);
Modified: trunk/src/main/java/cc/kune/meets/client/actions/MeetingsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/meets/client/actions/MeetingsClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/meets/client/actions/MeetingsClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -51,14 +51,14 @@
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, newMeetingsBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newMeetingsBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
}
@Override
Modified: trunk/src/main/java/cc/kune/wiki/client/WikiGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/WikiGinModule.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/wiki/client/WikiGinModule.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -19,17 +19,17 @@
*/
package cc.kune.wiki.client;
+import cc.kune.common.client.ExtendedGinModule;
import cc.kune.wiki.client.actions.WikiClientActions;
+import cc.kune.wiki.client.actions.WikiFolderNewMenu;
-import com.google.inject.Singleton;
-import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+public class WikiGinModule extends ExtendedGinModule {
-public class WikiGinModule extends AbstractPresenterModule {
-
@Override
protected void configure() {
- bind(WikiClientTool.class).in(Singleton.class);
- bind(WikiClientActions.class).in(Singleton.class);
+ s(WikiClientTool.class);
+ s(WikiClientActions.class);
+ s(WikiFolderNewMenu.class);
}
}
Modified: trunk/src/main/java/cc/kune/wiki/client/actions/NewFolderBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/NewFolderBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/NewFolderBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -21,19 +21,19 @@
import cc.kune.core.client.resources.nav.NavResources;
import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.actions.NewContainerBtn;
+import cc.kune.gspace.client.actions.NewContainerMenuItem;
import cc.kune.wiki.shared.WikiConstants;
import com.google.inject.Inject;
-public class NewFolderBtn extends NewContainerBtn {
+public class NewFolderBtn extends NewContainerMenuItem {
@Inject
public NewFolderBtn(final I18nTranslationService i18n, final NewContainerAction action,
- final NavResources res) {
+ final NavResources res, final WikiFolderNewMenu wikiFolderNewMenu) {
super(i18n, action, res.wikiAdd(), i18n.t("New folder"),
i18n.t("Create a new folder here. A folder will be a 'section' in the public web"),
- i18n.t("New folder"), WikiConstants.TYPE_FOLDER);
+ i18n.t("New folder"), WikiConstants.TYPE_FOLDER, wikiFolderNewMenu.get());
}
}
Modified: trunk/src/main/java/cc/kune/wiki/client/actions/NewWikiBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/NewWikiBtn.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/NewWikiBtn.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -22,20 +22,21 @@
import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
import cc.kune.core.client.resources.nav.NavResources;
import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.actions.NewContentBtn;
+import cc.kune.gspace.client.actions.NewContentMenuItem;
import cc.kune.wiki.shared.WikiConstants;
import com.google.inject.Inject;
-public class NewWikiBtn extends NewContentBtn {
+public class NewWikiBtn extends NewContentMenuItem {
@Inject
public NewWikiBtn(final I18nTranslationService i18n, final NewContentAction action,
- final NavResources res, final GlobalShortcutRegister shorcutReg) {
+ final NavResources res, final GlobalShortcutRegister shorcutReg,
+ final WikiFolderNewMenu wikiFolderNewMenu) {
super(i18n, action, res.wikipageAdd(), shorcutReg, i18n.t("New wikipage"),
i18n.t("Create a New Wikipage here. "
+ "This document will be a new 'Page' in the public web if you publish it"),
- i18n.t("New wikipage"), WikiConstants.TYPE_WIKIPAGE);
+ i18n.t("New wikipage"), WikiConstants.TYPE_WIKIPAGE, wikiFolderNewMenu.get());
}
}
Modified: trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java 2011-06-22 16:39:13 UTC (rev 1414)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -26,6 +26,7 @@
import cc.kune.chat.client.actions.ChatAboutContentBtn;
import cc.kune.core.client.actions.ActionRegistryByType;
import cc.kune.core.client.i18n.I18nUITranslationService;
+import cc.kune.core.client.registry.NewMenusForTypeIdsRegistry;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
@@ -44,6 +45,7 @@
final String[] containers = { TYPE_ROOT, TYPE_FOLDER };
final String[] containersNoRoot = { TYPE_FOLDER };
final String[] contents = { TYPE_WIKIPAGE, TYPE_UPLOADEDFILE };
+ final String[] root = { TYPE_ROOT };
@Inject
public WikiClientActions(final I18nUITranslationService i18n, final Session session,
@@ -55,21 +57,25 @@
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<RefreshContentMenuItem> refresh,
- final Provider<SetAsHomePageMenuItem> setAsHomePage) {
+ final Provider<SetAsHomePageMenuItem> setAsHomePage,
+ final NewMenusForTypeIdsRegistry newMenusRegistry, final WikiFolderNewMenu folderNewMenu) {
super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, newWikiBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, participateBtn, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, containers);
- actionsRegistry.addAction(ActionGroups.VIEW, chatAbout, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, setAsHomePage, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderNewMenu, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newWikiBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, chatAbout, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delContentMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, delFolderMenuItem, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, setAsHomePage, contents);
+ newMenusRegistry.register(TYPE_FOLDER, folderNewMenu.get());
+ newMenusRegistry.register(TYPE_ROOT, folderNewMenu.get());
}
@Override
Added: trunk/src/main/java/cc/kune/wiki/client/actions/WikiFolderNewMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/WikiFolderNewMenu.java (rev 0)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/WikiFolderNewMenu.java 2011-06-24 01:51:23 UTC (rev 1415)
@@ -0,0 +1,15 @@
+package cc.kune.wiki.client.actions;
+
+import cc.kune.gspace.client.actions.AbstractNewMenu;
+import cc.kune.gspace.client.actions.NewMenuProvider;
+
+import com.google.inject.Inject;
+
+public class WikiFolderNewMenu extends NewMenuProvider {
+
+ @Inject
+ public WikiFolderNewMenu(final AbstractNewMenu menu) {
+ super(menu);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/wiki/client/actions/WikiFolderNewMenu.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
More information about the kune-commits
mailing list