Author: vjrj_ Date: 2011-04-26 11:28:16 +0200 (Tue, 26 Apr 2011) New Revision: 1319 Added: trunk/src/main/java/cc/kune/docs/client/actions/DelContentMenuItem.java trunk/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java trunk/src/main/java/cc/kune/docs/client/actions/OpenContentMenuItem.java trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionsGroup.java trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditActionsGroup.java trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuActionsGroup.java trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewActionsGroup.java trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/OldNotifyUser.java Removed: trunk/src/main/java/cc/kune/docs/client/actions/OpenContentBtn.java trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionPerspective.java trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditPerspective.java trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuPerspective.java trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewPerspective.java trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java trunk/src/main/java/cc/kune/core/client/state/StateManager.java trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.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/docs/client/viewers/DocViewerPresenter.java trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/other/AddAsBuddieHeaderButton.java trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessage.java trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessageView.java trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemeManager.java trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderDialog.java trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java Log: Delete actions Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java =================================================================== --- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -27,7 +27,7 @@ import cc.kune.common.client.actions.ActionEvent; import cc.kune.common.client.actions.ChangeableObject; import cc.kune.common.client.actions.KeyStroke; -import cc.kune.gspace.client.actions.perspective.ActionPerspective; +import cc.kune.gspace.client.actions.perspective.ActionsGroup; /** * The Class AbstractUIActionDescriptor. @@ -139,8 +139,8 @@ } @Override - public GuiActionDescrip in(final Class<? extends ActionPerspective> clazz) { - putValue(ActionPerspective.KEY, clazz); + public GuiActionDescrip in(final Class<? extends ActionsGroup> clazz) { + putValue(ActionsGroup.KEY, clazz); return this; } Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java =================================================================== --- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -4,7 +4,7 @@ import cc.kune.common.client.actions.ActionEvent; import cc.kune.common.client.actions.KeyStroke; import cc.kune.common.client.actions.PropertyChangeListener; -import cc.kune.gspace.client.actions.perspective.ActionPerspective; +import cc.kune.gspace.client.actions.perspective.ActionsGroup; public interface GuiActionDescrip { @@ -49,7 +49,7 @@ boolean hasTarget(); - GuiActionDescrip in(Class<? extends ActionPerspective> clazz); + GuiActionDescrip in(Class<? extends ActionsGroup> clazz); boolean isChild(); Modified: trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java =================================================================== --- trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -9,7 +9,7 @@ import cc.kune.common.client.actions.ui.descrip.GuiActionDescProviderCollection; import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip; import cc.kune.core.shared.domain.utils.AccessRights; -import cc.kune.gspace.client.actions.perspective.ActionPerspective; +import cc.kune.gspace.client.actions.perspective.ActionsGroup; import com.google.inject.Provider; @@ -67,14 +67,16 @@ return getCurrentActions(targetItem, typeId, isLogged, rights, null); } - public GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId, + public <T> GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId, final boolean isLogged, final AccessRights rights, @Nullable final Class<?> clazz) { final GuiActionDescCollection collection = new GuiActionDescCollection(); for (final Provider<? extends GuiActionDescrip> descripProv : getActions(typeId)) { final GuiActionDescrip descrip = descripProv.get(); + // Log.info("Class " + + // descripProv.getClass().getAnnotations().toString()); final AbstractAction action = descrip.getAction(); - final Object perspective = descrip.getValue(ActionPerspective.KEY); - if (clazz != null && clazz != perspective) { + final Object actionGroup = descrip.getValue(ActionsGroup.KEY); + if (clazz != null && !clazz.equals(actionGroup)) { // Not this perspective, then don't add this action } else { // Any perspective it's ok (==null) or same perspective -> add Modified: trunk/src/main/java/cc/kune/core/client/state/StateManager.java =================================================================== --- trunk/src/main/java/cc/kune/core/client/state/StateManager.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/core/client/state/StateManager.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -39,6 +39,8 @@ void gotoStateToken(StateToken newToken); + void gotoStateToken(StateToken token, boolean useCache); + void onGroupChanged(boolean fireNow, GroupChangedEvent.GroupChangedHandler handler); @Deprecated @@ -80,6 +82,8 @@ void setRetrievedState(StateAbstractDTO state); + void setRetrievedStateAndGo(StateAbstractDTO state); + void setSocialNetwork(SocialNetworkDataDTO socialNet); } Modified: trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java =================================================================== --- trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -51,7 +51,7 @@ public class StateManagerDefault implements StateManager, ValueChangeHandler<String> { private final BeforeActionCollection beforeStateChangeCollection; - private final ContentCache contentProvider; + private final ContentCache contentCache; private final EventBus eventBus; private final HistoryWrapper history; private StateToken previousToken; @@ -69,7 +69,7 @@ final TokenMatcher tokenMatcher, final EventBus eventBus, final SiteTokenListeners siteTokens) { this.tokenMatcher = tokenMatcher; this.eventBus = eventBus; - this.contentProvider = contentProvider; + this.contentCache = contentProvider; this.session = session; this.history = history; this.previousToken = null; @@ -133,7 +133,7 @@ @Override public void gotoHistoryToken(final String token) { - Log.debug("StateManager: history goto-string-token newItem (" + token + ")"); + Log.debug("StateManager: history goto-string-token :" + token); history.newItem(token); } @@ -145,11 +145,19 @@ @Override public void gotoStateToken(final StateToken newToken) { - Log.debug("StateManager: history goto-token newItem (" + newToken + ")"); + Log.debug("StateManager: history goto-token: " + newToken + ", previous: " + previousToken); history.newItem(newToken.getEncoded()); } @Override + public void gotoStateToken(final StateToken token, final boolean useCache) { + if (!useCache) { + contentCache.removeContent(token); + } + gotoStateToken(token); + } + + @Override public void onGroupChanged(final boolean fireNow, final GroupChangedHandler handler) { eventBus.addHandler(GroupChangedEvent.getType(), handler); final StateAbstractDTO currentState = session.getCurrentState(); @@ -167,7 +175,7 @@ private void onHistoryChanged(final StateToken newState) { // NotifyUser.info("loading: " + newState + " because current:" + // session.getCurrentStateToken()); - contentProvider.getContent(session.getUserHash(), newState, new AsyncCallbackSimple<StateAbstractDTO>() { + contentCache.getContent(session.getUserHash(), newState, new AsyncCallbackSimple<StateAbstractDTO>() { @Override public void onSuccess(final StateAbstractDTO newState) { setState(newState); @@ -330,7 +338,7 @@ if (currentStateToken == null) { processCurrentHistoryToken(); } else { - contentProvider.removeContent(currentStateToken); + contentCache.removeContent(currentStateToken); onHistoryChanged(currentStateToken); } } @@ -372,7 +380,12 @@ @Override public void setRetrievedState(final StateAbstractDTO newState) { - contentProvider.cache(newState.getStateToken(), newState); + contentCache.cache(newState.getStateToken(), newState); + } + + @Override + public void setRetrievedStateAndGo(final StateAbstractDTO newState) { + setRetrievedState(newState); // setState(newState); history.newItem(newState.getStateToken().toString()); } @@ -392,7 +405,7 @@ void setState(final StateAbstractDTO newState) { session.setCurrentState(newState); final StateToken newToken = newState.getStateToken(); - contentProvider.cache(newToken, newState); + contentCache.cache(newToken, newState); // history.newItem(newToken.toString(), false); StateChangedEvent.fire(eventBus, newState); checkGroupAndToolChange(newState); Added: trunk/src/main/java/cc/kune/docs/client/actions/DelContentMenuItem.java =================================================================== --- trunk/src/main/java/cc/kune/docs/client/actions/DelContentMenuItem.java (rev 0) +++ trunk/src/main/java/cc/kune/docs/client/actions/DelContentMenuItem.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -0,0 +1,88 @@ +package cc.kune.docs.client.actions; + +import cc.kune.common.client.actions.ActionEvent; +import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor; +import cc.kune.common.client.notify.ConfirmAskEvent; +import cc.kune.common.client.notify.NotifyUser; +import cc.kune.common.client.utils.OnAcceptCallback; +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.client.state.StateManager; +import cc.kune.core.shared.domain.utils.StateToken; +import cc.kune.core.shared.dto.AccessRolDTO; +import cc.kune.core.shared.dto.StateContentDTO; +import cc.kune.core.shared.i18n.I18nTranslationService; +import cc.kune.docs.client.viewers.FolderViewerPresenter; +import cc.kune.gspace.client.actions.perspective.MenuActionsGroup; + +import com.google.gwt.event.shared.EventBus; +import com.google.inject.Inject; +import com.google.inject.Provider; + +public class DelContentMenuItem extends MenuItemDescriptor { + + public static class DelContentAction extends RolAction { + + private final Provider<ContentServiceAsync> contentService; + private final EventBus eventBus; + private final I18nTranslationService i18n; + private final Provider<FolderViewerPresenter> presenter; + private final Session session; + private final StateManager stateManager; + + @Inject + public DelContentAction(final EventBus eventBus, final StateManager stateManager, final Session session, + final Provider<ContentServiceAsync> contentService, final I18nTranslationService i18n, + final Provider<FolderViewerPresenter> presenter) { + super(AccessRolDTO.Administrator, true); + this.eventBus = eventBus; + this.stateManager = stateManager; + this.session = session; + this.contentService = contentService; + this.i18n = i18n; + this.presenter = presenter; + } + + @Override + public void actionPerformed(final ActionEvent event) { + final StateToken token = (StateToken) event.getTarget(); + ConfirmAskEvent.fire(eventBus, i18n.t("Please confirm"), i18n.t("Are you sure?"), i18n.t("Yes"), + i18n.t("No"), null, null, new OnAcceptCallback() { + @Override + public void onSuccess() { + NotifyUser.showProgress(); + contentService.get().delContent(session.getUserHash(), token, + new AsyncCallbackSimple<StateContentDTO>() { + @Override + public void onSuccess(final StateContentDTO state) { + // Is this necessary? + // session.setCurrentState(state); + final StateToken parent = token.copy().clearDocument(); + if (session.getCurrentStateToken().equals(parent)) { + stateManager.refreshCurrentGroupState(); + // Warning: the previous action + // is asynchronous (it gets a + // content) + presenter.get().refreshState(); + } else { + stateManager.gotoStateToken(parent, false); + } + NotifyUser.hideProgress(); + } + }); + } + }); + } + + } + + @Inject + public DelContentMenuItem(final I18nTranslationService i18n, final DelContentAction action, final CoreResources res) { + super(action); + this.withText(i18n.t("Delete")).withIcon(res.cancel()).in(MenuActionsGroup.class); + } + +} Property changes on: trunk/src/main/java/cc/kune/docs/client/actions/DelContentMenuItem.java ___________________________________________________________________ Name: svn:mime-type + text/plain Added: trunk/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java =================================================================== --- trunk/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java (rev 0) +++ trunk/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -0,0 +1,70 @@ +package cc.kune.docs.client.actions; + +import cc.kune.common.client.actions.ActionEvent; +import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor; +import cc.kune.common.client.notify.ConfirmAskEvent; +import cc.kune.common.client.notify.NotifyUser; +import cc.kune.common.client.utils.OnAcceptCallback; +import cc.kune.core.client.actions.RolAction; +import cc.kune.core.client.resources.CoreResources; +import cc.kune.core.client.rpcservices.ContentServiceAsync; +import cc.kune.core.client.state.Session; +import cc.kune.core.client.state.StateManager; +import cc.kune.core.shared.domain.utils.StateToken; +import cc.kune.core.shared.dto.AccessRolDTO; +import cc.kune.core.shared.i18n.I18nTranslationService; +import cc.kune.docs.client.viewers.FolderViewerPresenter; +import cc.kune.gspace.client.actions.perspective.MenuActionsGroup; + +import com.google.gwt.event.shared.EventBus; +import com.google.inject.Inject; +import com.google.inject.Provider; + +public class DelFolderMenuItem extends MenuItemDescriptor { + + public static class DelFolderAction extends RolAction { + + private final Provider<ContentServiceAsync> contentService; + private final EventBus eventBus; + private final I18nTranslationService i18n; + private final Provider<FolderViewerPresenter> presenter; + private final Session session; + private final StateManager stateManager; + + @Inject + public DelFolderAction(final EventBus eventBus, final StateManager stateManager, final Session session, + final Provider<ContentServiceAsync> contentService, final I18nTranslationService i18n, + final Provider<FolderViewerPresenter> presenter) { + super(AccessRolDTO.Administrator, true); + this.eventBus = eventBus; + this.stateManager = stateManager; + this.session = session; + this.contentService = contentService; + this.i18n = i18n; + this.presenter = presenter; + } + + @Override + public void actionPerformed(final ActionEvent event) { + final StateToken token = (StateToken) event.getTarget(); + ConfirmAskEvent.fire(eventBus, i18n.t("Please confirm"), + i18n.t("You will delete it with all its contents. Are you sure?"), i18n.t("Yes"), i18n.t("No"), + null, null, new OnAcceptCallback() { + @Override + public void onSuccess() { + NotifyUser.showProgress(); + NotifyUser.info("Sorry, in development"); + NotifyUser.hideProgress(); + } + }); + } + + } + + @Inject + public DelFolderMenuItem(final I18nTranslationService i18n, final DelFolderAction action, final CoreResources res) { + super(action); + this.withText(i18n.t("Delete")).withIcon(res.cancel()).in(MenuActionsGroup.class); + } + +} Property changes on: trunk/src/main/java/cc/kune/docs/client/actions/DelFolderMenuItem.java ___________________________________________________________________ Name: svn:mime-type + text/plain 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-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -45,14 +45,18 @@ public DocsClientActions(final I18nUITranslationService i18n, final Session session, final StateManager stateManager, final ActionRegistryByType registry, final CoreResources res, final Provider<FolderGoUpBtn> folderGoUp, final Provider<NewDocBtn> newDocBtn, - final Provider<NewFolderBtn> newFolderBtn, final Provider<OpenContentBtn> openContentBtn) { + final Provider<NewFolderBtn> newFolderBtn, final Provider<OpenContentMenuItem> openContentMenuItem, + final Provider<DelContentMenuItem> delContentMenuItem, + final Provider<DelFolderMenuItem> delFolderMenuItem) { super(session, stateManager, i18n, registry); actionsRegistry.addAction(folderGoUp, contents); actionsRegistry.addAction(folderGoUp, containersNoRoot); actionsRegistry.addAction(newDocBtn, containers); actionsRegistry.addAction(newFolderBtn, containers); - actionsRegistry.addAction(openContentBtn, contents); - actionsRegistry.addAction(openContentBtn, containersNoRoot); + actionsRegistry.addAction(openContentMenuItem, contents); + actionsRegistry.addAction(openContentMenuItem, containersNoRoot); + actionsRegistry.addAction(delContentMenuItem, contents); + actionsRegistry.addAction(delFolderMenuItem, containersNoRoot); } @Override Modified: trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.java =================================================================== --- trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/docs/client/actions/FolderGoUpBtn.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -3,6 +3,7 @@ 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.common.client.notify.NotifyUser; import cc.kune.core.client.resources.CoreResources; import cc.kune.core.client.state.Session; import cc.kune.core.client.state.StateManager; @@ -12,7 +13,7 @@ import cc.kune.core.shared.dto.StateContainerDTO; import cc.kune.core.shared.dto.StateContentDTO; import cc.kune.core.shared.i18n.I18nTranslationService; -import cc.kune.gspace.client.actions.perspective.ViewPerspective; +import cc.kune.gspace.client.actions.perspective.ViewActionsGroup; import com.google.inject.Inject; @@ -31,6 +32,7 @@ @Override public void actionPerformed(final ActionEvent event) { + NotifyUser.showProgress(); StateToken stateToken; final StateAbstractDTO state = session.getCurrentState(); if (state instanceof StateContentDTO) { @@ -40,6 +42,7 @@ stateToken = container.getStateToken().copy().setFolder(container.getParentFolderId()); } stateManager.gotoStateToken(stateToken); + NotifyUser.hideProgress(); } } @@ -48,7 +51,7 @@ public FolderGoUpBtn(final I18nTranslationService i18n, final FolderGoUpAction action, final CoreResources res) { super(action); this.withToolTip(i18n.t("Go up: Open the container folder")).withIcon(res.folderGoUp()).in( - ViewPerspective.class); + ViewActionsGroup.class); } } Modified: trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java =================================================================== --- trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/docs/client/actions/NewDocBtn.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -18,12 +18,12 @@ import cc.kune.core.shared.dto.StateContentDTO; import cc.kune.core.shared.i18n.I18nTranslationService; import cc.kune.docs.client.DocsClientTool; -import cc.kune.gspace.client.actions.perspective.ViewPerspective; +import cc.kune.gspace.client.actions.perspective.ViewActionsGroup; import com.google.inject.Inject; import com.google.inject.Provider; -public class NewDocBtn extends ButtonDescriptor { +public class NewDocBtn extends ButtonDescriptor implements ViewActionsGroup { public static class NewDocAction extends RolAction { @@ -46,14 +46,16 @@ @Override public void actionPerformed(final ActionEvent event) { + NotifyUser.showProgressProcessing(); stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken()); - NotifyUser.showProgressProcessing(); contentService.get().addContent(session.getUserHash(), session.getCurrentStateToken(), i18n.t("New document"), DocsClientTool.TYPE_WAVE, new AsyncCallbackSimple<StateContentDTO>() { @Override public void onSuccess(final StateContentDTO state) { + stateManager.setRetrievedStateAndGo(state); + NotifyUser.hideProgress(); + // stateManager.refreshCurrentGroupState(); // contextNavigator.setEditOnNextStateChange(true); - stateManager.setRetrievedState(state); } }); cache.removeContent(session.getCurrentStateToken()); @@ -68,7 +70,7 @@ shorcutReg.put(shortcut, action); this.withText(i18n.t("New document")).withToolTip( "Create a New Document here. This document will be a new 'Page' in the public web if you publish it").withIcon( - res.pageAdd()).in(ViewPerspective.class).withShortcut(shortcut).withStyles("k-def-docbtn"); + res.pageAdd()).in(ViewActionsGroup.class).withShortcut(shortcut).withStyles("k-def-docbtn"); } } Modified: trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java =================================================================== --- trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/docs/client/actions/NewFolderBtn.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -15,7 +15,7 @@ import cc.kune.core.shared.dto.StateContainerDTO; import cc.kune.core.shared.i18n.I18nTranslationService; import cc.kune.docs.client.DocsClientTool; -import cc.kune.gspace.client.actions.perspective.ViewPerspective; +import cc.kune.gspace.client.actions.perspective.ViewActionsGroup; import com.google.inject.Inject; import com.google.inject.Provider; @@ -43,14 +43,15 @@ @Override public void actionPerformed(final ActionEvent event) { + NotifyUser.showProgressProcessing(); stateManager.gotoStateToken(((HasContent) session.getCurrentState()).getContainer().getStateToken()); - NotifyUser.showProgressProcessing(); contentService.get().addFolder(session.getUserHash(), session.getCurrentStateToken(), i18n.t("New folder"), DocsClientTool.TYPE_FOLDER, new AsyncCallbackSimple<StateContainerDTO>() { @Override public void onSuccess(final StateContainerDTO state) { // contextNavigator.setEditOnNextStateChange(true); - stateManager.setRetrievedState(state); + stateManager.setRetrievedStateAndGo(state); + NotifyUser.hideProgress(); } }); cache.removeContent(session.getCurrentStateToken()); @@ -63,6 +64,6 @@ super(action); this.withText(i18n.t("New folder")).withToolTip( i18n.t("Create a new folder here. A folder will be a 'section' in the public web")).withIcon( - res.folderAdd()).in(ViewPerspective.class).withStyles("k-def-docbtn"); + res.folderAdd()).in(ViewActionsGroup.class).withStyles("k-def-docbtn"); } } Deleted: trunk/src/main/java/cc/kune/docs/client/actions/OpenContentBtn.java =================================================================== --- trunk/src/main/java/cc/kune/docs/client/actions/OpenContentBtn.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/docs/client/actions/OpenContentBtn.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -1,38 +0,0 @@ -package cc.kune.docs.client.actions; - -import cc.kune.common.client.actions.AbstractExtendedAction; -import cc.kune.common.client.actions.ActionEvent; -import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor; -import cc.kune.core.client.resources.CoreResources; -import cc.kune.core.client.state.StateManager; -import cc.kune.core.shared.domain.utils.StateToken; -import cc.kune.core.shared.i18n.I18nTranslationService; -import cc.kune.gspace.client.actions.perspective.MenuPerspective; - -import com.google.inject.Inject; - -public class OpenContentBtn extends MenuItemDescriptor { - - public static class OpenContentAction extends AbstractExtendedAction { - - private final StateManager stateManager; - - @Inject - public OpenContentAction(final StateManager stateManager) { - this.stateManager = stateManager; - } - - @Override - public void actionPerformed(final ActionEvent event) { - stateManager.gotoStateToken((StateToken) event.getTarget()); - } - - } - - @Inject - public OpenContentBtn(final I18nTranslationService i18n, final OpenContentAction action, final CoreResources res) { - super(action); - this.withText(i18n.t("Open")).withIcon(res.arrowRightGreen()).in(MenuPerspective.class); - } - -} Copied: trunk/src/main/java/cc/kune/docs/client/actions/OpenContentMenuItem.java (from rev 1316, trunk/src/main/java/cc/kune/docs/client/actions/OpenContentBtn.java) =================================================================== --- trunk/src/main/java/cc/kune/docs/client/actions/OpenContentMenuItem.java (rev 0) +++ trunk/src/main/java/cc/kune/docs/client/actions/OpenContentMenuItem.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -0,0 +1,38 @@ +package cc.kune.docs.client.actions; + +import cc.kune.common.client.actions.AbstractExtendedAction; +import cc.kune.common.client.actions.ActionEvent; +import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor; +import cc.kune.core.client.resources.nav.NavResources; +import cc.kune.core.client.state.StateManager; +import cc.kune.core.shared.domain.utils.StateToken; +import cc.kune.core.shared.i18n.I18nTranslationService; +import cc.kune.gspace.client.actions.perspective.MenuActionsGroup; + +import com.google.inject.Inject; + +public class OpenContentMenuItem extends MenuItemDescriptor { + + public static class OpenContentAction extends AbstractExtendedAction { + + private final StateManager stateManager; + + @Inject + public OpenContentAction(final StateManager stateManager) { + this.stateManager = stateManager; + } + + @Override + public void actionPerformed(final ActionEvent event) { + stateManager.gotoStateToken((StateToken) event.getTarget()); + } + + } + + @Inject + public OpenContentMenuItem(final I18nTranslationService i18n, final OpenContentAction action, final NavResources res) { + super(action); + this.withText(i18n.t("Open")).withIcon(res.go()).in(MenuActionsGroup.class); + } + +} Modified: trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java =================================================================== --- trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/docs/client/viewers/DocViewerPresenter.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -10,7 +10,7 @@ import cc.kune.core.shared.dto.StateContentDTO; import cc.kune.docs.client.DocsClientTool; import cc.kune.docs.client.actions.DocsClientActions; -import cc.kune.gspace.client.actions.perspective.ViewPerspective; +import cc.kune.gspace.client.actions.perspective.ViewActionsGroup; import cc.kune.gspace.client.tool.ContentViewer; import cc.kune.gspace.client.tool.ContentViewerSelector; @@ -76,7 +76,7 @@ final StateContentDTO stateContent = (StateContentDTO) state; final AccessRights rights = stateContent.getContentRights(); final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContent.getGroup(), - stateContent.getTypeId(), session.isLogged(), rights, ViewPerspective.class); + stateContent.getTypeId(), session.isLogged(), rights, ViewActionsGroup.class); getView().setActions(actions); getView().setContent(stateContent); } Modified: trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java =================================================================== --- trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/docs/client/viewers/FolderViewerPresenter.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -3,7 +3,7 @@ import javax.annotation.Nonnull; import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection; -import cc.kune.common.client.notify.NotifyUser; +import cc.kune.common.client.log.Log; import cc.kune.core.client.actions.ActionRegistryByType; import cc.kune.core.client.registry.ContentCapabilitiesRegistry; import cc.kune.core.client.registry.IconsRegistry; @@ -23,8 +23,8 @@ import cc.kune.core.shared.i18n.I18nTranslationService; import cc.kune.docs.client.DocsClientTool; import cc.kune.docs.client.actions.DocsClientActions; -import cc.kune.gspace.client.actions.perspective.MenuPerspective; -import cc.kune.gspace.client.actions.perspective.ViewPerspective; +import cc.kune.gspace.client.actions.perspective.MenuActionsGroup; +import cc.kune.gspace.client.actions.perspective.ViewActionsGroup; import cc.kune.gspace.client.tool.ContentViewer; import cc.kune.gspace.client.tool.ContentViewerSelector; @@ -94,16 +94,17 @@ private void addItem(final String title, final String contentTypeId, final BasicMimeTypeDTO mimeType, final ContentStatus status, final StateToken stateToken, final StateToken parentStateToken, final AccessRights rights) { + Log.info("Adding item: " + title); final Object icon = getIcon(stateToken, contentTypeId, mimeType); final String tooltip = getTooltip(stateToken, mimeType); final FolderItemDescriptor item = new FolderItemDescriptor(genId(stateToken), genId(parentStateToken), icon, title, tooltip, status, stateToken, capabilitiesRegistry.isDragable(contentTypeId) && rights.isAdministrable(), capabilitiesRegistry.isDropable(contentTypeId) && rights.isAdministrable(), actionsRegistry.getCurrentActions(stateToken, contentTypeId, - session.isLogged(), rights, MenuPerspective.class)); + session.isLogged(), rights, MenuActionsGroup.class)); if (status.equals(ContentStatus.inTheDustbin) && !session.getShowDeletedContent()) { // Don't show - NotifyUser.info("Deleted, don't show"); + // NotifyUser.info("Deleted, don't show"); } else { getView().addItem(item, new ClickHandler() { @Override @@ -168,6 +169,10 @@ } } + public void refreshState() { + setContent((HasContent) session.getCurrentState()); + } + @Override protected void revealInParent() { RevealRootContentEvent.fire(this, this); @@ -175,12 +180,13 @@ @Override public void setContent(@Nonnull final HasContent state) { + Log.info("Set content in FolderViewer"); getView().clear(); final StateContainerDTO stateContainer = (StateContainerDTO) state; getView().setContainer(stateContainer); final AccessRights rights = stateContainer.getContainerRights(); final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContainer.getGroup(), - stateContainer.getTypeId(), session.isLogged(), rights, ViewPerspective.class); + stateContainer.getTypeId(), session.isLogged(), rights, ViewActionsGroup.class); getView().setActions(actions); createChildItems(stateContainer.getContainer(), stateContainer.getContainerRights()); // view.setEditable(rights.isEditable()); Deleted: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionPerspective.java =================================================================== --- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionPerspective.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionPerspective.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -1,8 +0,0 @@ -package cc.kune.gspace.client.actions.perspective; - -/** - * An action that must be showed in some perspective (on edit, etc) - */ -public interface ActionPerspective { - String KEY = "actionperskey"; -} Copied: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionsGroup.java (from rev 1314, trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionPerspective.java) =================================================================== --- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionsGroup.java (rev 0) +++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionsGroup.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -0,0 +1,9 @@ +package cc.kune.gspace.client.actions.perspective; + +/** + * A group of actions that must be grouped and showed in some perspective (on + * edit, etc) + */ +public interface ActionsGroup { + String KEY = "actiongroup"; +} Copied: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditActionsGroup.java (from rev 1314, trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditPerspective.java) =================================================================== --- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditActionsGroup.java (rev 0) +++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditActionsGroup.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -0,0 +1,7 @@ +package cc.kune.gspace.client.actions.perspective; + +/** + * An action that must be showed when editing + */ +public interface EditActionsGroup extends ActionsGroup { +} Deleted: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditPerspective.java =================================================================== --- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditPerspective.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditPerspective.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -1,7 +0,0 @@ -package cc.kune.gspace.client.actions.perspective; - -/** - * An action that must be showed when editing - */ -public interface EditPerspective extends ActionPerspective { -} Copied: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuActionsGroup.java (from rev 1315, trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuPerspective.java) =================================================================== --- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuActionsGroup.java (rev 0) +++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuActionsGroup.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -0,0 +1,7 @@ +package cc.kune.gspace.client.actions.perspective; + +/** + * An action that must be showed in menu of docs/folder, etc + */ +public interface MenuActionsGroup extends ActionsGroup { +} Property changes on: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuActionsGroup.java ___________________________________________________________________ Name: svn:mime-type + text/plain Deleted: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuPerspective.java =================================================================== --- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuPerspective.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/MenuPerspective.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -1,7 +0,0 @@ -package cc.kune.gspace.client.actions.perspective; - -/** - * An action that must be showed in menu of docs/folder, etc - */ -public interface MenuPerspective extends ActionPerspective { -} Copied: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewActionsGroup.java (from rev 1314, trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewPerspective.java) =================================================================== --- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewActionsGroup.java (rev 0) +++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewActionsGroup.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -0,0 +1,7 @@ +package cc.kune.gspace.client.actions.perspective; + +/** + * An action that must be showed when viewing + */ +public interface ViewActionsGroup extends ActionsGroup { +} Deleted: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewPerspective.java =================================================================== --- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewPerspective.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewPerspective.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -1,7 +0,0 @@ -package cc.kune.gspace.client.actions.perspective; - -/** - * An action that must be showed when editing - */ -public interface ViewPerspective extends ActionPerspective { -} Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -20,7 +20,7 @@ package org.ourproject.kune.chat.client.ctx.room; import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import cc.kune.core.client.rpcservices.AsyncCallbackSimple; import cc.kune.core.client.rpcservices.ContentServiceAsync; @@ -45,14 +45,14 @@ } public void addRoom(String roomName) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); final String groupShortName = session.getCurrentState().getGroup().getShortName(); contentServiceProvider.get().addRoom(session.getUserHash(), session.getContainerState().getRootContainer().getStateToken(), groupShortName + "-" + roomName, new AsyncCallbackSimple<StateContainerDTO>() { public void onSuccess(final StateContainerDTO state) { - stateManager.setRetrievedState(state); - NotifyUser.hideProgress(); + stateManager.setRetrievedStateAndGo(state); + OldNotifyUser.hideProgress(); } }); } Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -19,7 +19,7 @@ \*/ package org.ourproject.kune.platf.client.actions; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import com.calclab.suco.client.events.Listener0; @@ -32,7 +32,7 @@ final ActionDescriptor<?> action = actionItem.getAction(); final Object item = actionItem.getItem(); if (action.mustBeConfirmed()) { - NotifyUser.askConfirmation(action.getConfirmationTitle(), action.getConfirmationText(), new Listener0() { + OldNotifyUser.askConfirmation(action.getConfirmationTitle(), action.getConfirmationText(), new Listener0() { public void onEvent() { fire(action, item); } Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/platf/client/services/PlatformModule.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -26,7 +26,7 @@ import org.ourproject.kune.platf.client.i18n.Resources; import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister; import org.ourproject.kune.platf.client.ui.QuickTipsHelper; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette; import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalettePanel; import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalettePresenter; @@ -292,10 +292,10 @@ } }); - register(ApplicationComponentGroup.class, new Factory<NotifyUser>(NotifyUser.class) { + register(ApplicationComponentGroup.class, new Factory<OldNotifyUser>(OldNotifyUser.class) { @Override - public NotifyUser create() { - return new NotifyUser(i(I18nTranslationService.class), i(Images.class)); + public OldNotifyUser create() { + return new OldNotifyUser(i(I18nTranslationService.class), i(Images.class)); } }); Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -20,7 +20,7 @@ package org.ourproject.kune.platf.client.ui.dialogs; import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import cc.kune.core.shared.i18n.I18nTranslationService; @@ -240,7 +240,7 @@ dialog.add(mainPanel); doLayoutIfNeeded(); } else { - NotifyUser.error("Widget not found in deck of WizardDialog"); + OldNotifyUser.error("Widget not found in deck of WizardDialog"); } } @@ -272,7 +272,7 @@ } else if (view instanceof DefaultForm) { return ((DefaultForm) view).getFormPanel(); } else { - NotifyUser.error("Trying to add a unknown element in WizardDialog"); + OldNotifyUser.error("Trying to add a unknown element in WizardDialog"); return null; } } Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -1,178 +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 org.ourproject.kune.platf.client.ui.noti; - -import org.ourproject.kune.platf.client.services.Images; - -import cc.kune.core.client.notify.msgs.UserNotifyEvent; -import cc.kune.core.shared.i18n.I18nTranslationService; - -import com.calclab.suco.client.events.Listener; -import com.calclab.suco.client.events.Listener0; -import com.calclab.suco.client.events.Listener2; -import com.google.gwt.event.shared.EventBus; -import com.google.gwt.user.client.ui.AbstractImagePrototype; - -/** - * Use {@link EventBus} and {@link UserNotifyEvent} instead - * - */ -@Deprecated -public class NotifyUser { - - public enum Level { - error, important, info, veryImportant, - } - - private static I18nTranslationService i18n; - private static Images images; - - // private static final Event2<String, String> ON_ALERT = new Event2<String, - // String>("onAlert"); - // private static final Event<ConfirmationAsk> ON_CONFIRMATION_ASK = new - // Event<ConfirmationAsk>("onConfirmationAsk"); - // private static final Event0 ON_HIDE_PROGRESS = new - // Event0("onHideProgress"); - - // private static final Event2<Level, String> ON_NOTIFY = new Event2<Level, - // String>("onNotify"); - - // private static final Event<String> ON_PROGRESS = new - // Event<String>("onProgress"); - - public static void askConfirmation(final String confirmationTitle, final String confirmationText, - final Listener0 onConfirm) { - // ON_CONFIRMATION_ASK.fire(new ConfirmationAsk(confirmationTitle, - // confirmationText, onConfirm, new Listener0() { - // @Override - // public void onEvent() { - // // Do nothing - // } - // })); - } - - public static void askConfirmation(final String confirmationTitle, final String confirmationText, - final Listener0 onConfirm, final Listener0 onCancel) { - // ON_CONFIRMATION_ASK.fire(new ConfirmationAsk(confirmationTitle, - // confirmationText, onConfirm, onCancel)); - } - - public static void error(final String message) { - // ON_NOTIFY.fire(Level.error, message); - } - - public static String getCls(final Level level) { - switch (level) { - case info: - return "k-stm-info-icon"; - case important: - return "k-stm-imp-icon"; - case veryImportant: - return "k-stm-verimp-icon"; - case error: - default: - return "k-stm-error-icon"; - } - } - - public static AbstractImagePrototype getImage(final Level level) { - switch (level) { - case info: - return images.info(); - case important: - return images.important(); - case veryImportant: - return images.alert(); - case error: - default: - return images.error(); - } - } - - public static void hideProgress() { - // ON_HIDE_PROGRESS.fire(); - } - - public static void important(final String message) { - // ON_NOTIFY.fire(Level.important, message); - } - - public static void info(final String message) { - // ON_NOTIFY.fire(Level.info, message); - } - - public static void showAlertMessage(final String title, final String message) { - // ON_ALERT.fire(title, message); - } - - public static void showProgress(final String text) { - // ON_PROGRESS.fire(text); - } - - public static void showProgressLoading() { - // ON_PROGRESS.fire(i18n.t("Loading")); - } - - public static void showProgressProcessing() { - // ON_PROGRESS.fire(i18n.t("Processing")); - } - - public static void showProgressSaving() { - // ON_PROGRESS.fire(i18n.t("Saving")); - } - - public static void showProgressStarting() { - // ON_PROGRESS.fire(i18n.t("Starting")); - } - - public static void veryImportant(final String message) { - // ON_NOTIFY.fire(Level.veryImportant, message); - } - - private NotifyUser() { - } - - public NotifyUser(final I18nTranslationService i18n, final Images images) { - this(); - NotifyUser.i18n = i18n; - NotifyUser.images = images; - } - - public void addAlerter(final Listener2<String, String> listener) { - // ON_ALERT.add(listener); - } - - public void addConfirmationAsker(final Listener<ConfirmationAsk> listener) { - // ON_CONFIRMATION_ASK.add(listener); - } - - public void addHideProgressNotifier(final Listener0 listener) { - // ON_HIDE_PROGRESS.add(listener); - } - - public void addNotifier(final Listener2<Level, String> listener) { - // ON_NOTIFY.add(listener); - } - - public void addProgressNotifier(final Listener<String> listener) { - // ON_PROGRESS.add(listener); - } - -} Copied: trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/OldNotifyUser.java (from rev 1313, trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/NotifyUser.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/OldNotifyUser.java (rev 0) +++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/OldNotifyUser.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -0,0 +1,178 @@ +/* + * + * 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 org.ourproject.kune.platf.client.ui.noti; + +import org.ourproject.kune.platf.client.services.Images; + +import cc.kune.core.client.notify.msgs.UserNotifyEvent; +import cc.kune.core.shared.i18n.I18nTranslationService; + +import com.calclab.suco.client.events.Listener; +import com.calclab.suco.client.events.Listener0; +import com.calclab.suco.client.events.Listener2; +import com.google.gwt.event.shared.EventBus; +import com.google.gwt.user.client.ui.AbstractImagePrototype; + +/** + * Use {@link EventBus} and {@link UserNotifyEvent} instead + * + */ +@Deprecated +public class OldNotifyUser { + + public enum Level { + error, important, info, veryImportant, + } + + private static I18nTranslationService i18n; + private static Images images; + + // private static final Event2<String, String> ON_ALERT = new Event2<String, + // String>("onAlert"); + // private static final Event<ConfirmationAsk> ON_CONFIRMATION_ASK = new + // Event<ConfirmationAsk>("onConfirmationAsk"); + // private static final Event0 ON_HIDE_PROGRESS = new + // Event0("onHideProgress"); + + // private static final Event2<Level, String> ON_NOTIFY = new Event2<Level, + // String>("onNotify"); + + // private static final Event<String> ON_PROGRESS = new + // Event<String>("onProgress"); + + public static void askConfirmation(final String confirmationTitle, final String confirmationText, + final Listener0 onConfirm) { + // ON_CONFIRMATION_ASK.fire(new ConfirmationAsk(confirmationTitle, + // confirmationText, onConfirm, new Listener0() { + // @Override + // public void onEvent() { + // // Do nothing + // } + // })); + } + + public static void askConfirmation(final String confirmationTitle, final String confirmationText, + final Listener0 onConfirm, final Listener0 onCancel) { + // ON_CONFIRMATION_ASK.fire(new ConfirmationAsk(confirmationTitle, + // confirmationText, onConfirm, onCancel)); + } + + public static void error(final String message) { + // ON_NOTIFY.fire(Level.error, message); + } + + public static String getCls(final Level level) { + switch (level) { + case info: + return "k-stm-info-icon"; + case important: + return "k-stm-imp-icon"; + case veryImportant: + return "k-stm-verimp-icon"; + case error: + default: + return "k-stm-error-icon"; + } + } + + public static AbstractImagePrototype getImage(final Level level) { + switch (level) { + case info: + return images.info(); + case important: + return images.important(); + case veryImportant: + return images.alert(); + case error: + default: + return images.error(); + } + } + + public static void hideProgress() { + // ON_HIDE_PROGRESS.fire(); + } + + public static void important(final String message) { + // ON_NOTIFY.fire(Level.important, message); + } + + public static void info(final String message) { + // ON_NOTIFY.fire(Level.info, message); + } + + public static void showAlertMessage(final String title, final String message) { + // ON_ALERT.fire(title, message); + } + + public static void showProgress(final String text) { + // ON_PROGRESS.fire(text); + } + + public static void showProgressLoading() { + // ON_PROGRESS.fire(i18n.t("Loading")); + } + + public static void showProgressProcessing() { + // ON_PROGRESS.fire(i18n.t("Processing")); + } + + public static void showProgressSaving() { + // ON_PROGRESS.fire(i18n.t("Saving")); + } + + public static void showProgressStarting() { + // ON_PROGRESS.fire(i18n.t("Starting")); + } + + public static void veryImportant(final String message) { + // ON_NOTIFY.fire(Level.veryImportant, message); + } + + private OldNotifyUser() { + } + + public OldNotifyUser(final I18nTranslationService i18n, final Images images) { + this(); + OldNotifyUser.i18n = i18n; + OldNotifyUser.images = images; + } + + public void addAlerter(final Listener2<String, String> listener) { + // ON_ALERT.add(listener); + } + + public void addConfirmationAsker(final Listener<ConfirmationAsk> listener) { + // ON_CONFIRMATION_ASK.add(listener); + } + + public void addHideProgressNotifier(final Listener0 listener) { + // ON_HIDE_PROGRESS.add(listener); + } + + public void addNotifier(final Listener2<Level, String> listener) { + // ON_NOTIFY.add(listener); + } + + public void addProgressNotifier(final Listener<String> listener) { + // ON_PROGRESS.add(listener); + } + +} Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -31,7 +31,7 @@ import org.ourproject.kune.platf.client.actions.ui.GuiBindingsRegister; import org.ourproject.kune.platf.client.actions.ui.OldGuiActionDescrip; import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.platf.client.ui.rte.RichTextArea; import org.ourproject.kune.platf.client.ui.rte.RichTextArea.FontSize; import org.ourproject.kune.platf.client.ui.rte.RichTextArea.Formatter; @@ -173,7 +173,7 @@ // + selection.getRangeAt(0).toHTML(); // NotifyUser.info(info); final String info = "range count: " + getFstRange().getCommonAncestorContainer().getFirstChild().getNodeName(); - NotifyUser.info(info); + OldNotifyUser.info(info); } public String getSelectionText() { Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -47,7 +47,7 @@ import org.ourproject.kune.platf.client.actions.ui.PushButtonDescriptor; import org.ourproject.kune.platf.client.actions.ui.ToolbarSeparatorDescriptor; import org.ourproject.kune.platf.client.actions.ui.ToolbarSeparatorDescriptor.Type; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette; import org.ourproject.kune.platf.client.ui.rte.RichTextArea; import org.ourproject.kune.platf.client.ui.rte.edithtml.EditHtmlDialog; @@ -135,7 +135,7 @@ final String author = session.isLogged() ? session.getCurrentUser().getShortName() : i18n.t("anonymous user"); if (view.isAnythingSelected()) { - NotifyUser.askConfirmation(i18n.t("Insert a comment"), + OldNotifyUser.askConfirmation(i18n.t("Insert a comment"), i18n.t("Include the selected text in the comment?"), new Listener0() { @Override public void onEvent() { @@ -453,7 +453,7 @@ @Override public void actionPerformed(final ActionEvent actionEvent) { - NotifyUser.showProgressLoading(); + OldNotifyUser.showProgressLoading(); if (insCharListener == null) { insCharListener = new Listener<String>() { @Override @@ -468,7 +468,7 @@ insCharDialog.setOnInsertSpecialChar(insCharListener); insCharDialog.show(); hideLinkCtxMenu(); - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); } } Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPanel.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/RTESavingEditorPanel.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -21,7 +21,7 @@ import org.ourproject.kune.platf.client.actions.ui.GuiBindingsRegister; import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.platf.client.ui.rte.basic.RTEditorPanel; import org.ourproject.kune.platf.client.ui.rte.basic.RTEditorPresenter; @@ -38,7 +38,7 @@ public void askConfirmation(final String confirmationTitle, final String confirmationText, final Listener0 onConfirm, final Listener0 onCancel) { - NotifyUser.askConfirmation(confirmationTitle, confirmationText, onConfirm, onCancel); + OldNotifyUser.askConfirmation(confirmationTitle, confirmationText, onConfirm, onCancel); } } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -31,7 +31,7 @@ import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor; import org.ourproject.kune.platf.client.actions.ActionToolbarPosition; import org.ourproject.kune.platf.client.actions.RadioMustBeChecked; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator; import org.ourproject.kune.workspace.client.cxt.ContextActionRegistry; import org.ourproject.kune.workspace.client.cxt.ContextPropEditor; @@ -172,7 +172,7 @@ AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() { @Override public void onEvent(final StateToken token) { - NotifyUser.info("Sorry, in development"); + OldNotifyUser.info("Sorry, in development"); } }); delContainer.setParentMenuTitle(parentMenuTitle); @@ -245,7 +245,7 @@ AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() { @Override public void onEvent(final StateToken stateToken) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); session.check(new AsyncCallbackSimple<Void>() { @Override public void onSuccess(final Void result) { @@ -256,16 +256,16 @@ editor.edit(session.getContentState().getContent(), new Listener<String>() { @Override public void onEvent(final String html) { - NotifyUser.showProgressSaving(); + OldNotifyUser.showProgressSaving(); contentServiceProvider.get().save(session.getUserHash(), stateToken, html, new AsyncCallback<Void>() { @Override public void onFailure(final Throwable caught) { - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); if (caught instanceof SessionExpiredException) { errorHandler.doSessionExpired(); } else { - NotifyUser.error(i18n.t("Error saving document. Retrying...")); + OldNotifyUser.error(i18n.t("Error saving document. Retrying...")); errorHandler.process(caught); editor.onSaveFailed(); } @@ -273,7 +273,7 @@ @Override public void onSuccess(final Void param) { - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); session.getContentState().setContent(html); editor.onSavedSuccessful(); } @@ -298,7 +298,7 @@ } }); editor.setFileMenuTitle(fileMenuTitle); - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); } }); } @@ -356,13 +356,13 @@ new Listener<StateToken>() { @Override public void onEvent(final StateToken stateToken) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName, contentTypeId, new AsyncCallbackSimple<StateContainerDTO>() { @Override public void onSuccess(final StateContainerDTO state) { contextNavigator.setEditOnNextStateChange(true); - stateManager.setRetrievedState(state); + stateManager.setRetrievedStateAndGo(state); } }); } @@ -381,14 +381,14 @@ AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() { @Override public void onEvent() { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); contentServiceProvider.get().addContent(session.getUserHash(), session.getCurrentState().getStateToken(), description, typeId, new AsyncCallbackSimple<StateContentDTO>() { @Override public void onSuccess(final StateContentDTO state) { contextNavigator.setEditOnNextStateChange(true); - stateManager.setRetrievedState(state); + stateManager.setRetrievedStateAndGo(state); } }); } @@ -461,14 +461,14 @@ new Listener<StateToken>() { @Override public void onEvent(final StateToken token) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); contentServiceProvider.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("Content selected as the group homepage")); + OldNotifyUser.hideProgress(); + OldNotifyUser.info(i18n.t("Content selected as the group homepage")); } }); } @@ -569,7 +569,7 @@ AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() { @Override public void onEvent(final StateToken stateToken) { - NotifyUser.important(i18n.t("Sorry, this functionality is currently in development")); + OldNotifyUser.important(i18n.t("Sorry, this functionality is currently in development")); } }); translateContent.setParentMenuTitle(fileMenuTitle); Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -22,7 +22,7 @@ import org.ourproject.kune.platf.client.actions.ActionItem; import org.ourproject.kune.platf.client.actions.ActionManager; import org.ourproject.kune.platf.client.actions.MenuItemsContainer; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; import cc.kune.core.shared.domain.ContentStatus; @@ -244,7 +244,7 @@ public boolean doBeforeNodeDrop(final TreePanel treePanel, final TreeNode target, final DragData dragData, final String point, final DragDrop source, final TreeNode dropNode, final DropNodeCallback dropNodeCallback) { - NotifyUser.info("Drag & drop of contents in development"); + OldNotifyUser.info("Drag & drop of contents in development"); return false; } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -22,7 +22,7 @@ import java.util.Date; import java.util.List; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.title.EntitySubTitle; import cc.kune.core.client.registry.ContentCapabilitiesRegistry; @@ -62,12 +62,12 @@ } public void addAuthor(final String authorShortName) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); final StateContainerDTO currentState = session.getContentState(); contentServiceProvider.get().addAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName, new AsyncCallbackSimple<Void>() { public void onSuccess(final Void result) { - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); stateManager.reload(); } }); @@ -82,12 +82,12 @@ } public void delAuthor(final String authorShortName) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); final StateContainerDTO currentState = session.getContentState(); contentServiceProvider.get().removeAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName, new AsyncCallbackSimple<Void>() { public void onSuccess(final Void result) { - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); stateManager.reload(); } }); @@ -98,12 +98,12 @@ } public void doChangeLanguage(final String langCode) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); final StateContainerDTO currentState = session.getContentState(); contentServiceProvider.get().setLanguage(session.getUserHash(), currentState.getStateToken(), langCode, new AsyncCallbackSimple<I18nLanguageDTO>() { public void onSuccess(final I18nLanguageDTO lang) { - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); } }); } @@ -113,12 +113,12 @@ } public void setPublishedOn(final Date publishedOn) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); final StateContainerDTO currentState = session.getContentState(); contentServiceProvider.get().setPublishedOn(session.getUserHash(), currentState.getStateToken(), publishedOn, new AsyncCallbackSimple<Void>() { public void onSuccess(final Void result) { - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); entitySubTitle.setContentDate(publishedOn); } }); @@ -179,13 +179,13 @@ } public void setTags(final String tagsString) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); final StateContainerDTO currentState = session.getContentState(); contentServiceProvider.get().setTags(session.getUserHash(), currentState.getStateToken(), tagsString, new AsyncCallbackSimple<TagCloudResult>() { public void onSuccess(final TagCloudResult result) { tagsSummaryProvider.get().setGroupTags(result); - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); } }); } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/hello/HelloWorldModule.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -33,7 +33,7 @@ import org.ourproject.kune.platf.client.actions.ui.PushButtonDescriptor; import org.ourproject.kune.platf.client.services.AbstractExtendedModule; import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.editor.ContentEditor; import org.ourproject.kune.workspace.client.hello.HelloWorldModule.HelloWorldPanel.HelloWorldPresenter; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; @@ -194,7 +194,7 @@ public void showMessage() { // i18n use with parameters - NotifyUser.info(i18n.t("Hello [%s]!", "world")); + OldNotifyUser.info(i18n.t("Hello [%s]!", "world")); } } @@ -216,9 +216,9 @@ public void actionPerformed(final ActionEvent actionEvent) { if (actionEvent.getEvent().getCtrlKey()) { - NotifyUser.info("Hello world action fired with ctrl key pressed"); + OldNotifyUser.info("Hello world action fired with ctrl key pressed"); } else { - NotifyUser.info("Hello world action fired"); + OldNotifyUser.info("Hello world action fired"); } } } @@ -298,7 +298,7 @@ i(GlobalShortcutRegister.class).put(Shortcut.getShortcut(true, Character.valueOf('S')), new AbstractExtendedAction() { public void actionPerformed(final ActionEvent event) { - NotifyUser.info("Global Ctrl+S pressed"); + OldNotifyUser.info("Global Ctrl+S pressed"); } }); Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -22,7 +22,7 @@ import org.ourproject.kune.platf.client.services.Images; import org.ourproject.kune.platf.client.ui.AbstractSearcherPanel; import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.search.SiteBottomTrayButton; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; @@ -309,10 +309,10 @@ } private void setLanguage(final String language) { - NotifyUser.showProgressLoading(); + OldNotifyUser.showProgressLoading(); query(unTransStore, unTransGrid, language); query(transStore, transGrid, language); - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); } private String[] splitNT(final String textWithNT) { Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPresenter.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -20,7 +20,7 @@ package org.ourproject.kune.workspace.client.i18n; import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import cc.kune.core.client.i18n.I18nUITranslationService; import cc.kune.core.client.rpcservices.I18nServiceAsync; @@ -53,25 +53,25 @@ } public void doShowTranslator() { - NotifyUser.showProgressLoading(); + OldNotifyUser.showProgressLoading(); if (session.isLogged()) { view.show(); } else { - NotifyUser.info(i18n.t("Sign in or register to help with the translation")); + OldNotifyUser.info(i18n.t("Sign in or register to help with the translation")); } - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); } public void doTranslation(final String id, final String trKey, final String translation) { - NotifyUser.showProgressSaving(); + OldNotifyUser.showProgressSaving(); i18nService.setTranslation(session.getUserHash(), id, translation, new AsyncCallback<String>() { public void onFailure(final Throwable caught) { - NotifyUser.hideProgress(); - NotifyUser.error(i18n.t("Server error saving the translation")); + OldNotifyUser.hideProgress(); + OldNotifyUser.error(i18n.t("Server error saving the translation")); } public void onSuccess(final String result) { - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); i18n.setTranslationAfterSave(trKey, result); } }); Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseChangeAction.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -19,7 +19,7 @@ */ package org.ourproject.kune.workspace.client.licensewizard; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import cc.kune.core.client.rpcservices.GroupServiceAsync; import cc.kune.core.client.state.Session; @@ -47,11 +47,11 @@ } public void changeLicense(final StateToken token, final LicenseDTO license, final Listener0 onSuccess) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); groupService.get().changeDefLicense(session.getUserHash(), token, license, new AsyncCallback<Void>() { public void onFailure(final Throwable caught) { - NotifyUser.hideProgress(); - NotifyUser.error(i18n.t("Error changing default group license")); + OldNotifyUser.hideProgress(); + OldNotifyUser.error(i18n.t("Error changing default group license")); } public void onSuccess(final Void result) { Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensewizard/LicenseWizardPresenter.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -22,7 +22,7 @@ import java.util.List; import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFirstFormView; import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardFrdFormView; import org.ourproject.kune.workspace.client.licensewizard.pages.LicenseWizardSndFormView; @@ -120,7 +120,7 @@ } } else if (in(sndForm)) { licenseShortName = "by-sa" + ccVers; - NotifyUser.error("Programatic error in LicenseWizardPresenter"); + OldNotifyUser.error("Programatic error in LicenseWizardPresenter"); } else { licenseShortName = frdForm.getSelectedLicense(); } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/other/AddAsBuddieHeaderButton.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/other/AddAsBuddieHeaderButton.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/oldsn/other/AddAsBuddieHeaderButton.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -27,7 +27,7 @@ import org.ourproject.kune.platf.client.actions.PropertyChangeEvent; import org.ourproject.kune.platf.client.actions.PropertyChangeListener; import org.ourproject.kune.platf.client.actions.ui.ButtonDescriptor; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.entityheader.EntityHeader; import cc.kune.core.client.resources.icons.IconConstants; @@ -68,7 +68,7 @@ public void actionPerformed(final ActionEvent event) { chatEngine.get().addNewBuddie(session.getCurrentState().getGroup().getShortName()); - NotifyUser.info("Added as buddie. Waiting buddie response"); + OldNotifyUser.info("Added as buddie. Waiting buddie response"); setEnabled(false); } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -20,7 +20,7 @@ package org.ourproject.kune.workspace.client.options.logo; import org.ourproject.kune.platf.client.ui.dialogs.DefaultFormUtils; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.options.EntityOptionsView; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; @@ -101,7 +101,7 @@ final FieldListenerAdapter changeListener = new FieldListenerAdapter() { @Override public void onChange(final Field field, final Object newVal, final Object oldVal) { - NotifyUser.info("change"); + OldNotifyUser.info("change"); // setEnableFileField(); } }; Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -21,7 +21,7 @@ import org.ourproject.kune.chat.client.ChatEngine; import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.entityheader.EntityHeader; import org.ourproject.kune.workspace.client.options.EntityOptions; @@ -64,7 +64,7 @@ } public void onSubmitFailed(final int httpStatus, final String responseText) { - NotifyUser.error("Error setting the logo: " + responseText); + OldNotifyUser.error("Error setting the logo: " + responseText); } protected abstract void setState(); Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPanel.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -19,7 +19,7 @@ */ package org.ourproject.kune.workspace.client.options.pscape; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.options.EntityOptionsView; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; import org.ourproject.kune.workspace.client.themes.WsThemeSelector; @@ -96,7 +96,7 @@ final Panel stylesPanel = new Panel(); final ClickHandler clickHandler = new ClickHandler() { public void onClick(final ClickEvent event) { - NotifyUser.info(TextUtils.IN_DEVELOPMENT_P); + OldNotifyUser.info(TextUtils.IN_DEVELOPMENT_P); } }; for (int i = 1; i <= 6; i++) { Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPresenter.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/rate/RateItPresenter.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -19,7 +19,7 @@ */ package org.ourproject.kune.workspace.client.rate; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import cc.kune.core.client.registry.ContentCapabilitiesRegistry; import cc.kune.core.client.rpcservices.AsyncCallbackSimple; @@ -94,12 +94,12 @@ isRating = true; final Double newValue = Math.abs(starClicked + 1d - currentRate) < 0.01 ? currentRate - 0.5d : starClicked + 1d; setRatePanel(newValue); - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); final StateAbstractDTO currentState = session.getCurrentState(); contentServiceProvider.get().rateContent(session.getUserHash(), currentState.getStateToken(), newValue, new AsyncCallbackSimple<RateResult>() { public void onSuccess(final RateResult result) { - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); // NotifyUser.info(i18n.t("Content rated")); if (currentState.getStateToken().equals(session.getCurrentStateToken())) { session.getContentState().setRate(result); Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -22,7 +22,7 @@ import java.util.HashMap; import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import cc.kune.core.client.state.StateManager; @@ -59,11 +59,11 @@ } public void doSearch(final String text) { - NotifyUser.showProgressLoading(); + OldNotifyUser.showProgressLoading(); searchHistory.put(text, null); view.search(text, currentSearch); view.show(); - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); } public void doSearchOfType(final String text, final SiteSearcherType typeOfSearch) { Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/WorkspaceNotifyUser.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -20,8 +20,8 @@ package org.ourproject.kune.workspace.client.site; import org.ourproject.kune.platf.client.ui.noti.ConfirmationAsk; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser.Level; import org.ourproject.kune.workspace.client.site.msg.ToastMessage; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; @@ -34,7 +34,7 @@ public class WorkspaceNotifyUser { - public WorkspaceNotifyUser(final NotifyUser notifyUser, final I18nTranslationService i18n, + public WorkspaceNotifyUser(final OldNotifyUser notifyUser, final I18nTranslationService i18n, final Provider<ToastMessage> toaster, final Provider<WorkspaceSkeleton> ws) { notifyUser.addProgressNotifier(new Listener<String>() { @Override Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessage.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessage.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessage.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -19,7 +19,7 @@ */ package org.ourproject.kune.workspace.client.site.msg; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser.Level; public interface ToastMessage { Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePanel.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePanel.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -19,8 +19,8 @@ */ package org.ourproject.kune.workspace.client.site.msg; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser.Level; import com.google.gwt.user.client.ui.HTML; import com.gwtextux.client.widgets.window.ToastWindow; @@ -34,7 +34,7 @@ HTML html = new HTML(message); html.addStyleName("kune-Margin-Medium-trbl"); ToastWindow toastWindow = new ToastWindow(title, html.toString()); - String iconCls = NotifyUser.getCls(level); + String iconCls = OldNotifyUser.getCls(level); toastWindow.setIconCls(iconCls); toastWindow.show(); } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePresenter.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessagePresenter.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -20,7 +20,7 @@ package org.ourproject.kune.workspace.client.site.msg; import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser.Level; public class ToastMessagePresenter implements ToastMessage { Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessageView.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessageView.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/site/msg/ToastMessageView.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -20,7 +20,7 @@ package org.ourproject.kune.workspace.client.site.msg; import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser.Level; public interface ToastMessageView extends View { Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesearch/SiteSearchPanel.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -21,7 +21,7 @@ import org.ourproject.kune.platf.client.services.Images; import org.ourproject.kune.platf.client.ui.AbstractToolbar; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; import com.google.gwt.event.dom.client.BlurEvent; @@ -72,7 +72,7 @@ }); searchButton.addClickHandler(new ClickHandler() { public void onClick(final ClickEvent event) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); presenter.doSearch(searchTextBox.getText()); } }); @@ -80,7 +80,7 @@ public void onKeyUp(final KeyUpEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { if (searchTextBox.getText().length() > 0) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); presenter.doSearch(searchTextBox.getText()); } } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemeManager.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemeManager.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/themes/WsThemeManager.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -19,7 +19,7 @@ \*/ package org.ourproject.kune.workspace.client.themes; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import cc.kune.core.client.rpcservices.AsyncCallbackSimple; import cc.kune.core.client.rpcservices.GroupServiceAsync; @@ -66,7 +66,7 @@ } public void changeTheme(final StateToken token, final WsTheme newTheme) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); groupServiceProvider.get().changeGroupWsTheme(session.getUserHash(), token, newTheme.getName(), new AsyncCallbackSimple<Void>() { @Override @@ -74,19 +74,19 @@ if (session.getCurrentState().getStateToken().getGroup().equals(token.getGroup())) { setTheme(newTheme); } - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); } }); } protected void onChangeGroupWsTheme(final WsTheme newTheme) { - NotifyUser.showProgressProcessing(); + OldNotifyUser.showProgressProcessing(); groupServiceProvider.get().changeGroupWsTheme(session.getUserHash(), session.getCurrentState().getStateToken(), newTheme.getName(), new AsyncCallbackSimple<Void>() { @Override public void onSuccess(final Void result) { setTheme(newTheme); - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); } }); } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/RenameAction.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -19,7 +19,7 @@ */ package org.ourproject.kune.workspace.client.title; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import cc.kune.core.client.errors.NameInUseException; import cc.kune.core.client.errors.NameNotPermittedException; @@ -60,26 +60,26 @@ public void rename(final StateToken token, final String oldName, final String newName) { if (!newName.equals(oldName)) { - NotifyUser.showProgress(i18n.t("Renaming")); + OldNotifyUser.showProgress(i18n.t("Renaming")); final AsyncCallback<StateAbstractDTO> asyncCallback = new AsyncCallback<StateAbstractDTO>() { @Override public void onFailure(final Throwable caught) { - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); if (caught instanceof NameInUseException) { - NotifyUser.error(i18n.tWithNT("This name already exists", + OldNotifyUser.error(i18n.tWithNT("This name already exists", "It is used when a file or a folder with the same name already exists")); } else if (caught instanceof NameNotPermittedException) { - NotifyUser.error(i18n.tWithNT("This name is not permitted", + OldNotifyUser.error(i18n.tWithNT("This name is not permitted", "It is used when a file or a folder does not have a permitted name")); } else { - NotifyUser.error(i18n.t("Error renaming")); + OldNotifyUser.error(i18n.t("Error renaming")); } // onFail.fire(token, oldName); } @Override public void onSuccess(final StateAbstractDTO state) { - NotifyUser.hideProgress(); + OldNotifyUser.hideProgress(); session.setCurrentState(state); // onSuccess.fire(token, state.getTitle()); } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderDialog.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderDialog.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/upload/FileUploaderDialog.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -19,7 +19,7 @@ \*/ package org.ourproject.kune.workspace.client.upload; -import org.ourproject.kune.platf.client.ui.noti.NotifyUser; +import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser; import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton; import cc.kune.common.client.utils.TextUtils; @@ -59,7 +59,7 @@ public void destroy() { if (hasUploadingFiles()) { dialog.stopUpload(); - NotifyUser.important(i18n.t("Upload cancelled after signing out")); + OldNotifyUser.important(i18n.t("Upload cancelled after signing out")); } if (dialog != null) { dialog.destroy(); @@ -138,7 +138,7 @@ public boolean onBeforeAdd(final UploadDialog source, final String filename) { final boolean mustAdd = presenter.checkFolderChange(); if (!mustAdd) { - NotifyUser.important(i18n.t("Please, wait until current uploads are finished to upload new files into another location")); + OldNotifyUser.important(i18n.t("Please, wait until current uploads are finished to upload new files into another location")); } return mustAdd; } @@ -151,7 +151,7 @@ @Override public void onUploadComplete(final UploadDialog source) { if (!dialog.isVisible()) { - NotifyUser.info(i18n.t("Upload completed")); + OldNotifyUser.info(i18n.t("Upload completed")); traybarButton.destroy(); traybarButton = null; } @@ -170,7 +170,7 @@ private void showError() { if (!dialog.isVisible()) { - NotifyUser.veryImportant(i18n.t("Error uploading")); + OldNotifyUser.veryImportant(i18n.t("Error uploading")); } } Modified: trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java =================================================================== --- trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java 2011-04-25 17:07:00 UTC (rev 1318) +++ trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java 2011-04-26 09:28:16 UTC (rev 1319) @@ -8,9 +8,9 @@ import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip; import cc.kune.core.shared.domain.utils.AccessRights; -import cc.kune.gspace.client.actions.perspective.ActionPerspective; -import cc.kune.gspace.client.actions.perspective.EditPerspective; -import cc.kune.gspace.client.actions.perspective.ViewPerspective; +import cc.kune.gspace.client.actions.perspective.ActionsGroup; +import cc.kune.gspace.client.actions.perspective.EditActionsGroup; +import cc.kune.gspace.client.actions.perspective.ViewActionsGroup; import com.google.inject.Provider; @@ -37,19 +37,19 @@ @Test public void testDontGetCurrentActionsOfOtherPerspective() { - Mockito.when(action.getValue(ActionPerspective.KEY)).thenReturn(ViewPerspective.class); - assertEquals(0, actionRegistryByType.getCurrentActions(null, false, allRights, EditPerspective.class).size()); + Mockito.when(action.getValue(ActionsGroup.KEY)).thenReturn(ViewActionsGroup.class); + assertEquals(0, actionRegistryByType.getCurrentActions(null, false, allRights, EditActionsGroup.class).size()); } @Test public void testGetCurrentActions() { - Mockito.when(action.getValue(ActionPerspective.KEY)).thenReturn(null); + Mockito.when(action.getValue(ActionsGroup.KEY)).thenReturn(null); assertEquals(1, actionRegistryByType.getCurrentActions(null, false, allRights, null).size()); } @Test public void testGetCurrentActionsOfPerspective() { - Mockito.when(action.getValue(ActionPerspective.KEY)).thenReturn(EditPerspective.class); - assertEquals(1, actionRegistryByType.getCurrentActions(null, false, allRights, EditPerspective.class).size()); + Mockito.when(action.getValue(ActionsGroup.KEY)).thenReturn(EditActionsGroup.class); + assertEquals(1, actionRegistryByType.getCurrentActions(null, false, allRights, EditActionsGroup.class).size()); } }