[kune-commits] r1333 - in trunk/src/main/java/cc/kune: blogs/client/actions common/client/ui/dialogs common/client/ui/dialogs/tabbed docs/client/actions gspace/client/actions gspace/client/options
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Fri Apr 29 16:42:12 CEST 2011
Author: vjrj_
Date: 2011-04-29 16:42:12 +0200 (Fri, 29 Apr 2011)
New Revision: 1333
Added:
trunk/src/main/java/cc/kune/gspace/client/actions/RefreshContentBtn.java
trunk/src/main/java/cc/kune/gspace/client/actions/SetAsHomePageMenuItem.java
Modified:
trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPanel.java
Log:
Some more content actions
Modified: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2011-04-29 13:26:13 UTC (rev 1332)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2011-04-29 14:42:12 UTC (rev 1333)
@@ -30,36 +30,42 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.gspace.client.actions.AbstractFoldableToolActions;
import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.actions.RefreshContentBtn;
+import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class BlogsClientActions extends AbstractFoldableToolActions {
- final String[] all = { TYPE_ROOT, TYPE_BLOG, TYPE_POST, TYPE_UPLOADEDFILE };
- final String[] containers = { TYPE_ROOT, TYPE_BLOG };
- final String[] containersNoRoot = { TYPE_BLOG };
- final String[] contents = { TYPE_POST, TYPE_UPLOADEDFILE };
- final String[] contentsModerated = { TYPE_POST, TYPE_UPLOADEDFILE };
+ final String[] all = { TYPE_ROOT, TYPE_BLOG, TYPE_POST, TYPE_UPLOADEDFILE };
+ final String[] containers = { TYPE_ROOT, TYPE_BLOG };
+ final String[] containersNoRoot = { TYPE_BLOG };
+ final String[] contents = { TYPE_POST, TYPE_UPLOADEDFILE };
+ final String[] contentsModerated = { TYPE_POST, TYPE_UPLOADEDFILE };
- @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<NewBlogBtn> newFolderBtn, final Provider<OpenBlogMenuItem> openContentMenuItem,
- final Provider<DelPostMenuItem> delContentMenuItem, final Provider<DelBlogMenuItem> delFolderMenuItem) {
- super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, newDocBtn, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, TYPE_ROOT);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, openContentMenuItem, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delContentMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.MENUITEM, delFolderMenuItem, containersNoRoot);
- }
+ @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<NewBlogBtn> newFolderBtn, final Provider<OpenBlogMenuItem> openContentMenuItem,
+ final Provider<DelPostMenuItem> delContentMenuItem, final Provider<RefreshContentBtn> refresh,
+ final Provider<DelBlogMenuItem> delFolderMenuItem,
+ final Provider<SetAsHomePageMenuItem> setAsHomePage) {
+ super(session, stateManager, i18n, registry);
+ actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.VIEW, newDocBtn, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, TYPE_ROOT);
+ actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
+ 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, delFolderMenuItem, contents);
+ }
- @Override
- protected void createPostSessionInitActions() {
- }
+ @Override
+ protected void createPostSessionInitActions() {
+ }
}
Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java 2011-04-29 13:26:13 UTC (rev 1332)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java 2011-04-29 14:42:12 UTC (rev 1333)
@@ -114,6 +114,7 @@
this.width = width;
return this;
}
+
}
private final PopupTopPanel popup;
@@ -132,6 +133,7 @@
super.setSecondBtnText(builder.sndButtonTitle);
super.setSecondBtnId(builder.sndButtonId);
super.setSecondBtnTabIndex(builder.tabIndexStart + 1);
+ super.getTitleText().setText(builder.title);
super.setSize(builder.width, builder.height);
}
Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2011-04-29 13:26:13 UTC (rev 1332)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2011-04-29 14:42:12 UTC (rev 1333)
@@ -91,7 +91,7 @@
private void createDialog() {
dialog = new BasicTopDialog.Builder(dialogId, true, modal).autoscroll(true).width(width).height(
height).icon(iconCls).firstButtonId(firstBtnId).firstButtonTitle(firstBtnTitle).sndButtonId(
- dialogId).sndButtonTitle(sndBtnTitle).build();
+ dialogId).sndButtonTitle(sndBtnTitle).title(title).build();
messageErrorBar = new MessageToolbar(images, errorLabelId);
tabPanel = new DecoratedTabPanel();
dialog.getInnerPanel().add(tabPanel);
@@ -181,7 +181,7 @@
public void setTitle(final String title) {
this.title = title;
if (dialog != null) {
- dialog.setTitle(title);
+ dialog.getTitleText().setText(title);
}
}
Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2011-04-29 13:26:13 UTC (rev 1332)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2011-04-29 14:42:12 UTC (rev 1333)
@@ -30,36 +30,42 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.gspace.client.actions.AbstractFoldableToolActions;
import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.actions.RefreshContentBtn;
+import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class DocsClientActions extends AbstractFoldableToolActions {
- final String[] all = { TYPE_ROOT, TYPE_FOLDER, TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
- final String[] containers = { TYPE_ROOT, TYPE_FOLDER };
- final String[] containersNoRoot = { TYPE_FOLDER };
- final String[] contents = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
- final String[] contentsModerated = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
+ final String[] all = { TYPE_ROOT, TYPE_FOLDER, TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
+ final String[] containers = { TYPE_ROOT, TYPE_FOLDER };
+ final String[] containersNoRoot = { TYPE_FOLDER };
+ final String[] contents = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
+ final String[] contentsModerated = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
- @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<DelDocMenuItem> delContentMenuItem, final Provider<DelFolderMenuItem> delFolderMenuItem) {
- super(session, stateManager, i18n, registry);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
- actionsRegistry.addAction(ActionGroups.VIEW, newDocBtn, containers);
- 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);
- }
+ @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<DelDocMenuItem> delContentMenuItem,
+ final Provider<DelFolderMenuItem> delFolderMenuItem, final Provider<RefreshContentBtn> refresh,
+ final Provider<SetAsHomePageMenuItem> setAsHomePage) {
+ super(session, stateManager, i18n, registry);
+ actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.VIEW, folderGoUp, containersNoRoot);
+ actionsRegistry.addAction(ActionGroups.VIEW, newDocBtn, containers);
+ actionsRegistry.addAction(ActionGroups.VIEW, newFolderBtn, containers);
+ actionsRegistry.addAction(ActionGroups.VIEW, refresh, all);
+ 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);
+ }
- @Override
- protected void createPostSessionInitActions() {
- }
+ @Override
+ protected void createPostSessionInitActions() {
+ }
}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/RefreshContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/RefreshContentBtn.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/RefreshContentBtn.java 2011-04-29 14:42:12 UTC (rev 1333)
@@ -0,0 +1,37 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.AbstractExtendedAction;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class RefreshContentBtn extends ButtonDescriptor {
+
+ public static class GoParentContainerAction extends AbstractExtendedAction {
+
+ private final StateManager stateManager;
+
+ @Inject
+ public GoParentContainerAction(final StateManager stateManager) {
+ this.stateManager = stateManager;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ stateManager.refreshCurrentGroupState();
+ }
+
+ }
+
+ @Inject
+ public RefreshContentBtn(final I18nTranslationService i18n, final GoParentContainerAction action,
+ final NavResources res) {
+ super(action);
+ this.withToolTip(i18n.t("Reload current page")).withIcon(res.refresh());
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/actions/RefreshContentBtn.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/gspace/client/actions/SetAsHomePageMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/SetAsHomePageMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/SetAsHomePageMenuItem.java 2011-04-29 14:42:12 UTC (rev 1333)
@@ -0,0 +1,60 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+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.resources.CoreResources;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.core.shared.dto.ContentSimpleDTO;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class SetAsHomePageMenuItem extends MenuItemDescriptor {
+
+ public static class SetAsHomePageAction extends RolAction {
+
+ private final Provider<ContentServiceAsync> contentService;
+ private final I18nTranslationService i18n;
+ private final Session session;
+
+ @Inject
+ public SetAsHomePageAction(final Session session,
+ final Provider<ContentServiceAsync> contentService, final I18nTranslationService i18n) {
+ super(AccessRolDTO.Administrator, true);
+ this.session = session;
+ this.contentService = contentService;
+ this.i18n = i18n;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ final StateToken token = (StateToken) event.getTarget();
+ NotifyUser.showProgressProcessing();
+ contentService.get().setAsDefaultContent(session.getUserHash(), token,
+ new AsyncCallbackSimple<ContentSimpleDTO>() {
+ @Override
+ public void onSuccess(final ContentSimpleDTO defContent) {
+ session.getCurrentState().getGroup().setDefaultContent(defContent);
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Selected as the homepage"));
+ }
+ });
+ }
+
+ }
+
+ @Inject
+ public SetAsHomePageMenuItem(final I18nTranslationService i18n, final SetAsHomePageAction action,
+ final CoreResources res) {
+ super(action);
+ this.withText(i18n.t("Delete")).withIcon(res.groupHome()).withText(i18n.t("Select as the homepage"));
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/gspace/client/actions/SetAsHomePageMenuItem.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java 2011-04-29 13:26:13 UTC (rev 1332)
+++ trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPanel.java 2011-04-29 14:42:12 UTC (rev 1333)
@@ -22,6 +22,7 @@
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
import cc.kune.common.client.notify.NotifyLevelImages;
import cc.kune.common.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
+import cc.kune.common.client.utils.TextUtils;
import cc.kune.core.client.resources.CoreMessages;
import cc.kune.core.client.ws.entheader.EntityHeader;
import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -46,7 +47,7 @@
this.entityHeader = entityHeader;
this.entityPreferencesGroup = entityOptionsGroup;
super.setIconCls("k-options-icon");
- super.setTitle(i18n.t(CoreMessages.GROUP_OPTIONS_DIALOG_TITLE));
+ super.setTitle(i18n.t(CoreMessages.GROUP_OPTIONS_DIALOG_TITLE) + TextUtils.IN_DEVELOPMENT_P);
}
@Override
Modified: trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPanel.java 2011-04-29 13:26:13 UTC (rev 1332)
+++ trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPanel.java 2011-04-29 14:42:12 UTC (rev 1333)
@@ -21,6 +21,7 @@
import cc.kune.common.client.notify.NotifyLevelImages;
import cc.kune.common.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
+import cc.kune.common.client.utils.TextUtils;
import cc.kune.core.client.resources.CoreMessages;
import cc.kune.core.client.ws.entheader.EntityHeader;
import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -44,7 +45,7 @@
USER_OPTIONS_ERROR_ID, i18n.t("Close"), null, null, null);
this.userPreferencesGroup = userOptionsGroup;
super.setIconCls("k-options-icon");
- super.setTitle(i18n.t(CoreMessages.USER_OPTIONS_DIALOG_TITLE));
+ super.setTitle(i18n.t(CoreMessages.USER_OPTIONS_DIALOG_TITLE) + TextUtils.IN_DEVELOPMENT_P);
}
@Override
More information about the kune-commits
mailing list