[kune-commits] r1314 - in trunk/src: main/java/cc main/java/cc/kune/chat/client main/java/cc/kune/client main/java/cc/kune/common/client main/java/cc/kune/common/client/actions/ui main/java/cc/kune/common/client/actions/ui/descrip main/java/cc/kune/common/client/tooltip main/java/cc/kune/common/client/ui main/java/cc/kune/core/client main/java/cc/kune/core/client/actions main/java/cc/kune/core/client/cnt main/java/cc/kune/core/client/notify/spiner main/java/cc/kune/core/client/resources main/java/cc/kune/core/client/services main/java/cc/kune/core/client/sitebar main/java/cc/kune/core/client/sn main/java/cc/kune/core/client/sn/actions/registry main/java/cc/kune/core/client/ws main/java/cc/kune/core/client/ws/entheader main/java/cc/kune/core/shared/dto main/java/cc/kune/docs/client main/java/cc/kune/gspace/client main/java/cc/kune/gspace/client/actions main/java/cc/kune/gspace/client/actions/perspective main/java/cc/kune/gspace/client/tool main/java/cc/kune/gspace/client/tool/old main/java/cc/kune/gspace/client/tool/selector main/java/cc/kune/wave/client main/java/com/example/client main/java/org/ourproject/kune/blogs/client main/java/org/ourproject/kune/chat/client main/java/org/ourproject/kune/gallery/client main/java/org/ourproject/kune/platf/public main/java/org/ourproject/kune/wiki/client main/java/org/ourproject/kune/workspace/client/tool test/java/cc/kune/core/client test/java/cc/kune/core/client/actions test/java/cc/kune/core/server/integration test/java/cc/kune/gspace/client/tool test/java/cc/kune/gspace/client/tool/selector
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Sun Apr 17 21:25:13 CEST 2011
Author: vjrj_
Date: 2011-04-17 21:25:13 +0200 (Sun, 17 Apr 2011)
New Revision: 1314
Added:
trunk/src/main/java/cc/kune/core/client/resources/arrowdown.png
trunk/src/main/java/cc/kune/core/client/resources/arrowdownsquarewhite.gif
trunk/src/main/java/cc/kune/core/client/resources/charfontname.png
trunk/src/main/java/cc/kune/core/client/resources/content_edit.png
trunk/src/main/java/cc/kune/core/client/resources/emite-room.png
trunk/src/main/java/cc/kune/core/client/resources/folder-go-up.gif
trunk/src/main/java/cc/kune/core/client/resources/folderpathmenu.gif
trunk/src/main/java/cc/kune/core/client/resources/fontheight.png
trunk/src/main/java/cc/kune/core/client/resources/generateMainImageBundle.sh
trunk/src/main/java/cc/kune/core/client/resources/kuneicon16.gif
trunk/src/main/java/cc/kune/core/client/resources/nav/
trunk/src/main/java/cc/kune/core/client/resources/persons/
trunk/src/main/java/cc/kune/core/client/resources/prefs.png
trunk/src/main/java/cc/kune/core/shared/dto/HasContent.java
trunk/src/main/java/cc/kune/docs/client/DocsGinjector.java
trunk/src/main/java/cc/kune/docs/client/DocsGoUpBtn.java
trunk/src/main/java/cc/kune/docs/client/DocsParts.java
trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.java
trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.ui.xml
trunk/src/main/java/cc/kune/docs/client/DocsViewerPresenter.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
trunk/src/main/java/cc/kune/gspace/client/actions/
trunk/src/main/java/cc/kune/gspace/client/actions/perspective/
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/ViewPerspective.java
trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewer.java
trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java
trunk/src/main/java/cc/kune/gspace/client/tool/old/
trunk/src/main/java/cc/kune/gspace/client/tool/old/AbstractClientTool.java
trunk/src/main/java/cc/kune/gspace/client/tool/old/FoldableAbstractClientTool.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolResources.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelector.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItem.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.ui.xml
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPresenter.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.ui.xml
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowdown-def.png
trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowleft-def.png
trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowright-def.png
trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowup-def.png
trunk/src/test/java/cc/kune/core/client/actions/
trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java
trunk/src/test/java/cc/kune/gspace/client/tool/selector/
trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java
Removed:
trunk/src/main/java/cc/kune/core/client/resources/arrowdown.gif
trunk/src/main/java/cc/kune/gspace/client/tool/AbstractClientTool.java
trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java
trunk/src/main/java/cc/kune/gspace/client/tool/ToolResources.java
trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelector.java
trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItem.java
trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPanel.java
trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPanel.ui.xml
trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPresenter.java
trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPanel.java
trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPanel.ui.xml
trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPresenter.java
trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowdown-def.png
trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowleft-def.png
trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowright-def.png
trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowup-def.png
trunk/src/main/java/cc/ourproject/
trunk/src/main/java/org/ourproject/kune/platf/public/images/
trunk/src/test/java/cc/kune/gspace/client/tool/ToolSelectorPresenterTest.java
Modified:
trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
trunk/src/main/java/cc/kune/client/KuneEntryPoint.java
trunk/src/main/java/cc/kune/client/KuneGinjector.java
trunk/src/main/java/cc/kune/common/client/SampleEntryPoint.java
trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractActionExtensiblePresenter.java
trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java
trunk/src/main/java/cc/kune/common/client/actions/ui/ActionExtensibleView.java
trunk/src/main/java/cc/kune/common/client/actions/ui/IsActionExtensible.java
trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java
trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/ButtonDescriptor.java
trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java
trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
trunk/src/main/java/cc/kune/common/client/ui/MaskWidget.ui.xml
trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
trunk/src/main/java/cc/kune/core/client/CoreParts.java
trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java
trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java
trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java
trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.java
trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
trunk/src/main/java/cc/kune/core/client/services/ImageUtils.java
trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java
trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java
trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java
trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
trunk/src/main/java/cc/kune/core/shared/dto/StateContainerDTO.java
trunk/src/main/java/cc/kune/core/shared/dto/StateContentDTO.java
trunk/src/main/java/cc/kune/docs/client/AbstractFoldableContentActions.java
trunk/src/main/java/cc/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/cc/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/cc/kune/docs/client/DocumentGinModule.java
trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
trunk/src/main/java/cc/kune/wave/client/WebClient.java
trunk/src/main/java/com/example/client/HelloWorldActions.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/OldAbstractClientTool.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/OldFoldableAbstractClientTool.java
trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java
Log:
Doc viewer
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -226,13 +226,13 @@
shorcutRegister.put(shortcut, action);
action.setShortcut(shortcut);
chatIcon.setVisible(session.isLogged());
- siteActions.getLeftToolbar().addAction(
+ siteActions.getLeftToolbar().add(
new ToolbarSeparatorDescriptor(Type.spacer, SitebarActionsPresenter.LEFT_TOOLBAR));
- siteActions.getLeftToolbar().addAction(
+ siteActions.getLeftToolbar().add(
new ToolbarSeparatorDescriptor(Type.spacer, SitebarActionsPresenter.LEFT_TOOLBAR));
- siteActions.getLeftToolbar().addAction(
+ siteActions.getLeftToolbar().add(
new ToolbarSeparatorDescriptor(Type.spacer, SitebarActionsPresenter.LEFT_TOOLBAR));
- siteActions.getLeftToolbar().addAction(chatIcon);
+ siteActions.getLeftToolbar().add(chatIcon);
}
}
Modified: trunk/src/main/java/cc/kune/client/KuneEntryPoint.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneEntryPoint.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/client/KuneEntryPoint.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -76,10 +76,13 @@
ginjector.getUserNotifierPresenter();
ginjector.getSpinerPresenter();
ginjector.getGroupMembersPresenter();
+ ginjector.getDocsParts();
ginjector.getSiteLogoPresenter();
ginjector.getSpacesTabPresenter();
ginjector.getChatClient();
ginjector.getCoreParts();
+ ginjector.getGSpaceParts();
ginjector.getPSpaceParts();
+ ginjector.getContentViewerSelector().init();
}
}
Modified: trunk/src/main/java/cc/kune/client/KuneGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/client/KuneGinjector.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -48,10 +48,10 @@
import cc.kune.core.client.ws.CorePresenter;
import cc.kune.core.client.ws.entheader.EntityHeaderPresenter;
import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.docs.client.DocsGinjector;
import cc.kune.docs.client.DocumentGinModule;
-import cc.kune.gspace.client.tags.TagsSummaryPresenter;
-import cc.kune.gspace.client.tool.ToolSelectorPresenter;
-import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter;
+import cc.kune.gspace.client.GSpaceGinModule;
+import cc.kune.gspace.client.GSpaceGinjector;
import cc.kune.pspace.client.PSpaceGinModule;
import cc.kune.pspace.client.PSpaceParts;
import cc.kune.pspace.client.PSpacePresenter;
@@ -66,8 +66,8 @@
import com.gwtplatform.mvp.client.proxy.ProxyFailureHandler;
@GinModules({ KuneGinModule.class, CoreGinModule.class, ChatGinModule.class, WaveGinModule.class,
- PSpaceGinModule.class, DocumentGinModule.class })
-public interface KuneGinjector extends Ginjector {
+ PSpaceGinModule.class, GSpaceGinModule.class, DocumentGinModule.class })
+public interface KuneGinjector extends Ginjector, GSpaceGinjector, DocsGinjector {
/*
* You have to add here all the GWTPresenters (as Provider or AsyncProvider)
@@ -88,8 +88,6 @@
AsyncProvider<EntityHeaderPresenter> getEntityHeaderPresenter();
- AsyncProvider<EntityLicensePresenter> getEntityLicensePresenter();
-
ErrorHandler getErrorHandler();
EventBus getEventBus();
@@ -134,12 +132,8 @@
StateManager getStateManager();
- AsyncProvider<TagsSummaryPresenter> getTagsSummaryPresenter();
-
TokenMatcher getTokenMatcher();
- AsyncProvider<ToolSelectorPresenter> getToolSelectorPresenter();
-
AsyncProvider<UserConfirmPresenter> getUserConfirmPresenter();
AsyncProvider<UserNotifierPresenter> getUserNotifierPresenter();
Modified: trunk/src/main/java/cc/kune/common/client/SampleEntryPoint.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/SampleEntryPoint.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/common/client/SampleEntryPoint.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -132,7 +132,7 @@
menuItem2, menuItem, iconLabelDescr, submenu, menuItem3, menuItem4, menu2, iconLabelNoAct, menuItem5);
final ActionFlowPanel view = new ActionFlowPanel(ginjector.getGuiProvider());
- view.addActions(actions);
+ view.addAll(actions);
final IconLabel simpleIconLabel = new IconLabel("IconLabel (no action)");
simpleIconLabel.setRightIcon("oc-testico");
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractActionExtensiblePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractActionExtensiblePresenter.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractActionExtensiblePresenter.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -25,18 +25,18 @@
public abstract class AbstractActionExtensiblePresenter implements IsActionExtensible {
@Override
- public abstract void addAction(final GuiActionDescrip descriptor);
+ public abstract void add(final GuiActionDescrip descriptor);
public void addActionCollection(final GuiActionDescCollection descriptors) {
for (final GuiActionDescrip descriptor : descriptors) {
- addAction(descriptor);
+ add(descriptor);
}
}
@Override
- public void addActions(final GuiActionDescrip... descriptors) {
+ public void add(final GuiActionDescrip... descriptors) {
for (final GuiActionDescrip descriptor : descriptors) {
- addAction(descriptor);
+ add(descriptor);
}
}
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractComposedGuiItem.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -40,42 +40,36 @@
public void add(final GuiActionDescCollection descriptors) {
for (final GuiActionDescrip descriptor : descriptors) {
- addAction(descriptor);
+ add(descriptor);
}
}
+ @Override
public void add(final GuiActionDescrip... descriptors) {
for (final GuiActionDescrip descriptor : descriptors) {
- addAction(descriptor);
+ add(descriptor);
}
}
@Override
- public void addAction(final GuiActionDescrip descriptor) {
+ public void add(final GuiActionDescrip descriptor) {
getGuiItems().add(descriptor);
beforeAddWidget(descriptor);
}
- @Override
- public void addActions(final GuiActionDescCollection descriptors) {
+ public void addActions(final List<GuiActionDescrip> descriptors) {
for (final GuiActionDescrip descriptor : descriptors) {
- addAction(descriptor);
+ add(descriptor);
}
}
@Override
- public void addActions(final GuiActionDescrip... descriptors) {
+ public void addAll(final GuiActionDescCollection descriptors) {
for (final GuiActionDescrip descriptor : descriptors) {
- addAction(descriptor);
+ add(descriptor);
}
}
- public void addActions(final List<GuiActionDescrip> descriptors) {
- for (final GuiActionDescrip descriptor : descriptors) {
- addAction(descriptor);
- }
- }
-
protected abstract void addWidget(AbstractGuiItem item);
protected void beforeAddWidget(final GuiActionDescrip descrip) {
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/ActionExtensibleView.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/ActionExtensibleView.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/ActionExtensibleView.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -25,6 +25,6 @@
public interface ActionExtensibleView extends IsWidget {
- void addAction(GuiActionDescrip descriptor);
+ void add(GuiActionDescrip descriptor);
}
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/IsActionExtensible.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/IsActionExtensible.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/IsActionExtensible.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -30,7 +30,7 @@
* @param action
* the action
*/
- void addAction(GuiActionDescrip action);
+ void add(GuiActionDescrip action);
/**
* Adds some action descriptions
@@ -38,7 +38,7 @@
* @param actions
* the actions
*/
- void addActions(GuiActionDescCollection actions);
+ void addAll(GuiActionDescCollection actions);
/**
* Adds some action descriptions
@@ -46,6 +46,6 @@
* @param action
* the action
*/
- void addActions(GuiActionDescrip... actions);
+ void add(GuiActionDescrip... 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-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -26,6 +26,7 @@
import cc.kune.common.client.actions.Action;
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.actions.ChangeableObject;
+import cc.kune.gspace.client.actions.perspective.ActionPerspective;
/**
* The Class AbstractUIActionDescriptor.
@@ -51,7 +52,7 @@
/**
* Instantiates a new abstract ui action descriptor. This is used for
* describe UI button, menus, menu items and so on
- *
+ *
* @param action
* the action
*/
@@ -87,7 +88,7 @@
/**
* Gets the location, a string used to group actions with locations (top
* bar, bottom bar, user bar...).
- *
+ *
* @return the location
*/
@Override
@@ -102,7 +103,7 @@
/**
* Gets the position.
- *
+ *
* @return the position
*/
@Override
@@ -142,6 +143,11 @@
}
@Override
+ public void in(Class<? extends ActionPerspective> clazz) {
+ putValue(ActionPerspective.KEY, clazz);
+ }
+
+ @Override
public boolean isEnabled() {
return (Boolean) getValue(Action.ENABLED);
}
@@ -176,7 +182,7 @@
* If we have several toolbars, we can group with the "location" string key
* actions that must be in the same location (ex: top bar, bottom bar, and
* so on).
- *
+ *
* @param location
* the new location
*/
@@ -193,7 +199,7 @@
/**
* Sets the position (where the UI element will be positioned, for instance
* in a toolbar or in a menu).
- *
+ *
* @param position
* the new position
*/
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/ButtonDescriptor.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/ButtonDescriptor.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/ButtonDescriptor.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -20,6 +20,7 @@
package cc.kune.common.client.actions.ui.descrip;
import cc.kune.common.client.actions.AbstractAction;
+import cc.kune.common.client.actions.Action;
public class ButtonDescriptor extends AbstractGuiActionDescrip {
@@ -27,6 +28,11 @@
super(action);
}
+ public ButtonDescriptor(final String text, final AbstractAction action) {
+ this(action);
+ putValue(Action.NAME, text);
+ }
+
@Override
public Class<?> getType() {
return ButtonDescriptor.class;
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-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/GuiActionDescrip.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -3,6 +3,7 @@
import cc.kune.common.client.actions.AbstractAction;
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.actions.PropertyChangeListener;
+import cc.kune.gspace.client.actions.perspective.ActionPerspective;
public interface GuiActionDescrip {
@@ -47,6 +48,8 @@
boolean hasTarget();
+ void in(Class<? extends ActionPerspective> clazz);
+
boolean isChild();
boolean isEnabled();
Modified: trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -161,7 +161,7 @@
ofWidget.addDomHandler(new FocusHandler() {
@Override
public void onFocus(final FocusEvent event) {
- // timers.onOver();
+ timers.onOut();
}
}, FocusEvent.getType());
ofWidget.addDomHandler(new BlurHandler() {
Modified: trunk/src/main/java/cc/kune/common/client/ui/MaskWidget.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/MaskWidget.ui.xml 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/common/client/ui/MaskWidget.ui.xml 2011-04-17 19:25:13 UTC (rev 1314)
@@ -4,43 +4,43 @@
<ui:with field='img' type='cc.kune.core.client.resources.CoreResources' />
<ui:style>
.main {
-
+
}
-
+
.flow {
- position: absolute;
- /* left: 40%;
- top: 40%;
- height: auto; */
- border: solid 1px #ccc;
- -moz-border-radius: 10px;
- -webkit-border-radius: 10px;
- border-radius: 10px;
- background-color: white;
- padding: 3px;
+ position: absolute;
+ /* left: 40%;
+ top: 40%;
+ height: auto; */
+ border: solid 1px #ccc;
+ -moz-border-radius: 10px;
+ -webkit-border-radius: 10px;
+ border-radius: 10px;
+ background-color: white;
+ padding: 3px;
}
-
+
.icon {
- width: 35px;
- height: 35px;
- margin-right: 3px;
- float: left;
- vertical-align: top;
+ width: 35px;
+ height: 35px;
+ margin-right: 3px;
+ float: left;
+ vertical-align: top;
}
-
+
.label {
- float: left;
- font-size: 16px;
- color: #808080;
- line-height: 1.9em;
- padding: 0 5px 0 1px;
+ float: left;
+ font-size: 16px;
+ color: #808080;
+ line-height: 1.9em;
+ padding: 0 5px 0 1px;
}
</ui:style>
<g:SimplePanel ui:field="mainPanel" styleName='{style.main}'>
<g:FlowPanel ui:field="flow" styleName='{style.flow}'>
<g:Image ui:field="icon" styleName='{style.icon}'
- resource="{img.kuneAnimGray}" />
+ resource="{img.kuneAnimG}" />
<g:Label ui:field="label" styleName='{style.label}' />
</g:FlowPanel>
</g:SimplePanel>
-</ui:UiBinder>
\ No newline at end of file
+</ui:UiBinder>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -103,9 +103,6 @@
import cc.kune.gspace.client.WsArmorImpl;
import cc.kune.gspace.client.tags.TagsSummaryPanel;
import cc.kune.gspace.client.tags.TagsSummaryPresenter;
-import cc.kune.gspace.client.tool.ToolSelector;
-import cc.kune.gspace.client.tool.ToolSelectorPanel;
-import cc.kune.gspace.client.tool.ToolSelectorPresenter;
import cc.kune.gspace.client.ui.footer.license.EntityLicensePanel;
import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter;
import cc.kune.msgs.client.UserMessagesPanel;
@@ -168,9 +165,6 @@
UserConfirmPresenter.UserConfirmProxy.class);
bindPresenter(TagsSummaryPresenter.class, TagsSummaryPresenter.TagsSummaryView.class, TagsSummaryPanel.class,
TagsSummaryPresenter.TagsSummaryProxy.class);
- bindPresenter(ToolSelectorPresenter.class, ToolSelectorPresenter.ToolSelectorView.class,
- ToolSelectorPanel.class, ToolSelectorPresenter.ToolSelectorProxy.class);
- bind(ToolSelector.class).to(ToolSelectorPresenter.class).in(Singleton.class);
bind(UserPassAutocompleteManager.class).to(UserPassAutocompleteManagerImpl.class).in(Singleton.class);
bind(SignIn.class).to(SignInPresenter.class).in(Singleton.class);
Modified: trunk/src/main/java/cc/kune/core/client/CoreParts.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreParts.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/CoreParts.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -8,9 +8,6 @@
import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
import cc.kune.core.client.sn.actions.registry.UserSNConfActions;
import cc.kune.core.client.state.Session;
-import cc.kune.gspace.client.tags.TagsSummaryPresenter;
-import cc.kune.gspace.client.tool.ToolSelector;
-import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -21,9 +18,7 @@
public CoreParts(final Session session, final Provider<GroupSNPresenter> groupMembersPresenter,
final Provider<UserSNPresenter> buddiesAndParticipationPresenter,
final Provider<GroupSNConfActions> groupMembersConfActions,
- final Provider<UserSNConfActions> userSNConfActions, final Provider<SiteUserOptionsPresenter> userOptions,
- final Provider<EntityLicensePresenter> licenseFooter, final Provider<TagsSummaryPresenter> tagsPresenter,
- final Provider<ToolSelector> toolSelector) {
+ final Provider<UserSNConfActions> userSNConfActions, final Provider<SiteUserOptionsPresenter> userOptions) {
session.onAppStart(true, new AppStartHandler() {
@Override
public void onAppStart(final AppStartEvent event) {
@@ -32,9 +27,6 @@
groupMembersPresenter.get();
buddiesAndParticipationPresenter.get();
userOptions.get();
- licenseFooter.get();
- tagsPresenter.get();
- toolSelector.get();
}
});
}
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-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/actions/ActionRegistryByType.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -2,11 +2,14 @@
import java.util.HashMap;
+import javax.annotation.Nullable;
+
import cc.kune.common.client.actions.AbstractAction;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
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 com.google.inject.Provider;
@@ -49,19 +52,39 @@
return actionColl;
}
+ public GuiActionDescCollection getCurrentActions(final Object targetItem, final boolean isLogged,
+ final AccessRights rights) {
+ return getCurrentActions(targetItem, GENERIC, isLogged, rights, null);
+ }
+
+ public GuiActionDescCollection getCurrentActions(final Object targetItem, final boolean isLogged,
+ final AccessRights rights, @Nullable final Class<?> clazz) {
+ return getCurrentActions(targetItem, GENERIC, isLogged, rights, clazz);
+ }
+
public GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
final boolean isLogged, final AccessRights rights) {
+ return getCurrentActions(targetItem, typeId, isLogged, rights, null);
+ }
+
+ public GuiActionDescCollection getCurrentActions(final Object targetItem, final String typeId,
+ final boolean isLogged, final AccessRights rights, @Nullable final Class<?> clazz) {
final GuiActionDescCollection collection = new GuiActionDescCollection();
-
for (final Provider<GuiActionDescrip> descripProv : getActions(typeId)) {
final GuiActionDescrip descrip = descripProv.get();
final AbstractAction action = descrip.getAction();
- if (action instanceof RolAction) {
- if (mustAdd((RolAction) action, isLogged, rights)) {
+ final Object perspective = descrip.getValue(ActionPerspective.KEY);
+ if (clazz != null && clazz != perspective) {
+ // Not this perspective, then don't add this action
+ } else {
+ // Any perspective it's ok (==null) or same perspective -> add
+ if (action instanceof RolAction) {
+ if (mustAdd((RolAction) action, isLogged, rights)) {
+ add(collection, descrip, targetItem);
+ }
+ } else {
add(collection, descrip, targetItem);
}
- } else {
- add(collection, descrip, targetItem);
}
}
return collection;
Modified: trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -19,53 +19,30 @@
*/
package cc.kune.core.client.cnt;
-import org.waveprotocol.box.webclient.client.RemoteViewServiceMultiplexer;
-import org.waveprotocol.box.webclient.client.SimpleWaveStore;
-import org.waveprotocol.box.webclient.client.StagesProvider;
-import org.waveprotocol.box.webclient.search.WaveStore;
-import org.waveprotocol.box.webclient.widget.frame.FramedPanel;
-import org.waveprotocol.box.webclient.widget.loading.LoadingIndicator;
-import org.waveprotocol.wave.client.account.ProfileManager;
-import org.waveprotocol.wave.client.widget.common.ImplPanel;
-import org.waveprotocol.wave.model.id.IdGenerator;
import org.waveprotocol.wave.model.waveref.WaveRef;
-import cc.kune.common.client.log.Log;
import cc.kune.common.client.ui.IconLabel;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.gspace.client.WsArmor;
import cc.kune.wave.client.WaveClientManager;
-import cc.kune.wave.client.WebClient;
-import com.google.gwt.dom.client.Document;
-import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.UIObject;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
+ at Deprecated
public abstract class FoldableContentPanel extends AbstractContentPanel implements AbstractContentView {
private static final String DEF_CONTENT_MARGINS_STYLE = "kune-Margin-7-trbl";
- private final RemoteViewServiceMultiplexer channel;
private final I18nTranslationService i18n;
- private final IdGenerator idGenerator;
- private final Element loading = new LoadingIndicator().getElement();
private final IconLabel messageLabel;
private final FlowPanel messagePanel;
- private final ProfileManager profiles;
- /** The wave panel, if a wave is open. */
- private StagesProvider wave;
- private final FramedPanel waveFrame;
- private final ImplPanel waveHolder;
- private final WaveStore waveStore = new SimpleWaveStore();
public FoldableContentPanel(final WsArmor ws, final I18nTranslationService i18n, final CoreResources res,
final WaveClientManager waveClientManager) {
@@ -78,13 +55,6 @@
messagePanel.add(messageLabel);
messagePanel.addStyleName("k-preview-msg");
messagePanel.addStyleName("kune-Margin-7-b");
- waveFrame = new FramedPanel();
- waveHolder = new ImplPanel("");
- waveFrame.add(waveHolder);
- final WebClient webClient = waveClientManager.getWebClient();
- channel = webClient.getChannel();
- profiles = webClient.getProfiles();
- idGenerator = webClient.getIdGenerator();
}
private VerticalPanel createMessageVp(final boolean showMsg) {
@@ -119,8 +89,7 @@
}
@Override
- public void setInfo(final String info) {
- setLabel(info);
+ public void setEditableWaveContent(final WaveRef waveRef, final boolean isNewWave) {
}
// public void setWave(final String waveId, final Listener0 onLoaded) {
@@ -141,6 +110,11 @@
// }
@Override
+ public void setInfo(final String info) {
+ setLabel(info);
+ }
+
+ @Override
public void setInfoMessage(final String text) {
final VerticalPanel vp = createMessageVp(true);
messageLabel.setText(text);
@@ -172,31 +146,6 @@
}
@Override
- public void setEditableWaveContent(final WaveRef waveRef, final boolean isNewWave) {
- Log.info("FCPanel.setWave()");
-
- if (wave != null) {
- wave.destroy();
- wave = null;
- }
-
- // Release the display:none.
- UIObject.setVisible(waveFrame.getElement(), true);
- waveHolder.getElement().appendChild(loading);
- final Element holder = waveHolder.getElement().appendChild(Document.get().createDivElement());
- final StagesProvider wave = new StagesProvider(holder, waveHolder, waveRef, channel, idGenerator, profiles,
- waveStore, isNewWave);
- this.wave = wave;
- wave.load(new Command() {
- @Override
- public void execute() {
- loading.removeFromParent();
- }
- });
- setWidgetAsContent(waveFrame, false);
- }
-
- @Override
public void setWidgetAsContent(final Widget widget, final boolean setDefMargins) {
if (setDefMargins) {
widget.addStyleName(DEF_CONTENT_MARGINS_STYLE);
Modified: trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -146,7 +146,7 @@
private void setToolbar(final GuiActionDescCollection collection) {
// toolbar.disableMenusAndClearButtons();
- toolbar.addActions(collection);
+ toolbar.addAll(collection);
toolbar.attach();
}
Modified: trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -58,7 +58,7 @@
widget = uiBinder.createAndBindUi(this);
popup = new PopupPanel(false, false);
popup.add(widget);
- popup.setPopupPosition(200, 0);
+ popup.setPopupPosition(190, 0);
popup.setStyleName("k-spiner-popup");
popup.show();
}
Modified: trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -43,6 +43,9 @@
@Source("anybody.png")
ImageResource anybody();
+ @Source("arrowdown.png")
+ ImageResource arrowdown();
+
@Source("arrow-down-black.gif")
ImageResource arrowDownBlack();
@@ -50,8 +53,11 @@
ImageResource arrowDownGreen();
@Source("arrowdownsitebar.gif")
- ImageResource arrowDownSitebar();
+ ImageResource arrowdownsitebar();
+ @Source("arrowdownsquarewhite.gif")
+ ImageResource arrowdownsquarewhite();
+
@Source("arrow-down-white.gif")
ImageResource arrowDownWhite();
@@ -142,9 +148,6 @@
@Source("button15rblue.png")
ImageResource button15rblue();
- @Source("wave-icon.png")
- ImageResource waveIcon();
-
@Source("button15rdark.png")
ImageResource button15rdark();
@@ -238,9 +241,6 @@
@Source("button-help-light.png")
ImageResource buttonHelpLight();
- @Source("arrowdown.gif")
- ImageResource buttonSitebarArrowDown();
-
@Source("by80x15.png")
ImageResource by80x15();
@@ -265,9 +265,15 @@
@Source("cancel-32.png")
ImageResource cancel32();
+ @Source("charfontname.png")
+ ImageResource charfontname();
+
@Source("clear.png")
ImageResource clear();
+ @Source("content_edit.png")
+ ImageResource contentEdit();
+
@Source("copyleft.png")
ImageResource copyleft();
@@ -289,21 +295,27 @@
@Source("emblem-system.png")
ImageResource emblemSystem();
+ @Source("emite-room.png")
+ ImageResource emiteRoom();
+
@Source("error.png")
ImageResource error();
@Source("everybody.png")
ImageResource everybody();
+ @Source("folder-go-up.gif")
+ ImageResource folderGoUp();
+
+ @Source("folderpathmenu.gif")
+ ImageResource folderpathmenu();
+
+ @Source("fontheight.png")
+ ImageResource fontheight();
+
@Source("fullscreen.png")
ImageResource fullscreen();
- @Source("loading_gadget.gif")
- ImageResource gadgetLoading();
-
- @Source("loading_gadget_small.gif")
- ImageResource gadgetLoadingSmall();
-
@Source("gnu-fdl.gif")
ImageResource gnuFdl();
@@ -329,7 +341,7 @@
ImageResource kuneAnim();
@Source("kune-anim-g.gif")
- ImageResource kuneAnimGray();
+ ImageResource kuneAnimG();
@Source("kune-close.png")
ImageResource kuneClose();
@@ -340,6 +352,9 @@
@Source("kune-help-translation-icon.png")
ImageResource kuneHelpTranslationIcon();
+ @Source("kuneicon16.gif")
+ ImageResource kuneicon16();
+
@Source("kune-icon16.png")
ImageResource kuneIcon16();
@@ -358,6 +373,12 @@
@Source("language.png")
ImageResource language();
+ @Source("loading_gadget.gif")
+ ImageResource loadingGadget();
+
+ @Source("loading_gadget_small.gif")
+ ImageResource loadingGadgetSmall();
+
@Source("loading-spiner.gif")
ImageResource loadingSpiner();
@@ -376,12 +397,15 @@
@Source("opentriangle.gif")
ImageResource opentriangle();
- @Source("unknown-60.png")
- ImageResource personAvatarDef();
+ @Source("person2-60.png")
+ ImageResource person260();
@Source("person-def.png")
ImageResource personDef();
+ @Source("prefs.png")
+ ImageResource prefs();
+
@Source("remove.png")
ImageResource remove();
@@ -456,4 +480,11 @@
@Source("triangle.gif")
ImageResource triangle();
+
+ @Source("unknown-60.png")
+ ImageResource unknown60();
+
+ @Source("wave-icon.png")
+ ImageResource waveIcon();
+
}
Deleted: trunk/src/main/java/cc/kune/core/client/resources/arrowdown.gif
===================================================================
(Binary files differ)
Added: trunk/src/main/java/cc/kune/core/client/resources/arrowdown.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/arrowdown.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Copied: trunk/src/main/java/cc/kune/core/client/resources/arrowdownsquarewhite.gif (from rev 1306, trunk/src/main/java/cc/kune/core/client/resources/arrowdown.gif)
===================================================================
(Binary files differ)
Added: trunk/src/main/java/cc/kune/core/client/resources/charfontname.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/charfontname.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/core/client/resources/content_edit.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/content_edit.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/core/client/resources/emite-room.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/emite-room.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/core/client/resources/folder-go-up.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/folder-go-up.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/core/client/resources/folderpathmenu.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/folderpathmenu.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/core/client/resources/fontheight.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/fontheight.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/core/client/resources/generateMainImageBundle.sh
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/generateMainImageBundle.sh (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/resources/generateMainImageBundle.sh 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,26 @@
+#
+# Generates methods AbstractImagePrototype with the content of the directory:
+#
+# @Resource("image")
+# AbstractImagePrototype arrowDownWhite();
+#
+
+cat << EOF
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.ImageBundle;
+
+/**
+ *
+ * http://code.google.com/p/google-web-toolkit/wiki/ImageBundleDesign
+ *
+ */
+public interface XXXResources extends ClientBundle {
+EOF
+for i in `ls -1 *png *gif 2> /dev/null`
+do
+ echo -e "\n at Source(\"$i\")\nImageResource" \
+ `echo ·$i |cut -d '.' -f 1 | sed 's/-/ /g' | sed 's/_/ /g' | perl -ne '@a=split;foreach (@a) {push @b,ucfirst};print "@b\n"' | sed 's/ //g' | sed 's/·//g'`"();"
+done
+echo "}"
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/generateMainImageBundle.sh
___________________________________________________________________
Name: svn:executable
+ *
Added: trunk/src/main/java/cc/kune/core/client/resources/kuneicon16.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/kuneicon16.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Copied: trunk/src/main/java/cc/kune/core/client/resources/nav (from rev 1306, trunk/src/main/java/org/ourproject/kune/platf/public/images/nav)
Copied: trunk/src/main/java/cc/kune/core/client/resources/persons (from rev 1306, trunk/src/main/java/org/ourproject/kune/platf/public/images/persons)
Added: trunk/src/main/java/cc/kune/core/client/resources/prefs.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/prefs.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/cc/kune/core/client/services/ImageUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/services/ImageUtils.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/services/ImageUtils.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -232,7 +232,7 @@
return img.buttonHelpLight();
}
case buttonSitebarArrowDown: {
- return img.buttonSitebarArrowDown();
+ return img.arrowdownsquarewhite();
}
case by80x15: {
return img.by80x15();
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -99,7 +99,7 @@
private void addActionImpl(final GuiActionDescrip descriptor) {
descriptor.setParent(LOGGED_USER_MENU);
- siteOptions.getRightToolbar().addAction(descriptor);
+ siteOptions.getRightToolbar().add(descriptor);
}
private void addPartipation(final GroupDTO group) {
@@ -110,16 +110,16 @@
participant.putValue(Action.NAME, group.getLongName());
participant.putValue(Action.SMALL_ICON, logoImageUrl);
participant.setParent(partiMenu);
- siteOptions.getRightToolbar().addAction(participant);
+ siteOptions.getRightToolbar().add(participant);
}
private void createActions() {
LOGGED_USER_MENU.setId(LOGGED_USER_MENU_ID);
LOGGED_USER_MENU.setParent(SitebarActionsPresenter.RIGHT_TOOLBAR);
LOGGED_USER_MENU.setStyles("k-no-backimage, k-btn-sitebar, k-fl");
- siteOptions.getRightToolbar().addAction(LOGGED_USER_MENU);
+ siteOptions.getRightToolbar().add(LOGGED_USER_MENU);
separator = new ToolbarSeparatorDescriptor(Type.separator, SitebarActionsPresenter.RIGHT_TOOLBAR);
- siteOptions.getRightToolbar().addAction(separator);
+ siteOptions.getRightToolbar().add(separator);
partiMenu = new SubMenuDescriptor(i18n.t("Your groups"));
addActionImpl(partiMenu);
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -90,6 +90,7 @@
init();
}
+ @Override
public IsActionExtensible getLeftToolbar() {
return getView().getLeftBar();
}
@@ -98,20 +99,21 @@
return OPTIONS_MENU;
}
+ @Override
public IsActionExtensible getRightToolbar() {
return getView().getRightBar();
}
private void init() {
- getView().getLeftBar().addAction(LEFT_TOOLBAR);
- getView().getRightBar().addAction(RIGHT_TOOLBAR);
+ getView().getLeftBar().add(LEFT_TOOLBAR);
+ getView().getRightBar().add(RIGHT_TOOLBAR);
}
@ProxyEvent
public void onAppStart(final AppStartEvent event) {
final IsActionExtensible right = getView().getRightBar();
OPTIONS_MENU.putValue(Action.NAME, i18n.t("Options"));
- OPTIONS_MENU.putValue(Action.SMALL_ICON, res.arrowDownSitebar());
+ OPTIONS_MENU.putValue(Action.SMALL_ICON, res.arrowdownsitebar());
OPTIONS_MENU.setParent(RIGHT_TOOLBAR);
OPTIONS_MENU.setStyles("k-no-backimage, k-btn-sitebar, k-fl");
OPTIONS_MENU.putValue(AbstractGxtMenuGui.MENU_POSITION, AbstractGxtMenuGui.MenuPosition.bl);
@@ -161,17 +163,17 @@
// aboutAction.setShortcut(shortcut);
// shortcutReg.put(shortcut, aboutAction);
- right.addAction(signInLink.get());
- right.addAction(signOutLink.get());
- right.addAction(separator2);
- right.addAction(newGroupLink.get());
- right.addAction(separator);
- right.addAction(OPTIONS_MENU);
- right.addAction(gotoKuneDevSite);
- right.addAction(reportBugs);
- right.addAction(new MenuItemDescriptor(OPTIONS_MENU, aboutAction));
- right.addAction(menuSeparator);
- right.addAction(new MenuItemDescriptor(OPTIONS_MENU, wavePowered));
+ right.add(signInLink.get());
+ right.add(signOutLink.get());
+ right.add(separator2);
+ right.add(newGroupLink.get());
+ right.add(separator);
+ right.add(OPTIONS_MENU);
+ right.add(gotoKuneDevSite);
+ right.add(reportBugs);
+ right.add(new MenuItemDescriptor(OPTIONS_MENU, aboutAction));
+ right.add(menuSeparator);
+ right.add(new MenuItemDescriptor(OPTIONS_MENU, wavePowered));
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -117,7 +117,7 @@
}
private void createActions() {
- getView().getBottomToolbar().addActions(actionsRegistry);
+ getView().getBottomToolbar().addAll(actionsRegistry);
}
@Override
Modified: trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -108,7 +108,7 @@
}
private void createActions() {
- getView().getBottomToolbar().addActions(confActionsRegistry);
+ getView().getBottomToolbar().addAll(confActionsRegistry);
}
@Override
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -39,7 +39,7 @@
final Provider<MembersModerationMenuItem> membersModeration, final CoreResources res,
final IsLoggedCondition isLoggedCondition, final JoinGroupAction joinGroupAction,
final IsGroupCondition isGroupCondition, final UnJoinGroupAction unJoinGroupAction) {
- OPTIONS_MENU.withToolTip(i18n.t("Options")).withIcon(res.arrowDownSitebar()).withStyles(
+ OPTIONS_MENU.withToolTip(i18n.t("Options")).withIcon(res.arrowdownsitebar()).withStyles(
"k-sn-options-menu, k-noborder, k-nobackcolor");
final GuiActionDescrip optionsTitle = new MenuTitleItemDescriptor(i18n.t("Options")).withParent(OPTIONS_MENU);
final MenuRadioItemDescriptor anyoneItem = membersVisibility.get().withVisibility(
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -29,7 +29,7 @@
public UserSNConfActions(final Session session, final StateManager stateManager, final I18nTranslationService i18n,
final Provider<UserSNVisibilityMenuItem> userBuddiesVisibility, final CoreResources res,
final IsGroupCondition isGroupCondition, final AddNewBuddiesAction addNewBuddiesAction) {
- OPTIONS_MENU.withToolTip(i18n.t("Options")).withIcon(res.arrowDownSitebar()).withStyles(
+ OPTIONS_MENU.withToolTip(i18n.t("Options")).withIcon(res.arrowdownsitebar()).withStyles(
"k-sn-options-menu, k-noborder, k-nobackcolor");
final MenuRadioItemDescriptor anyoneItem = userBuddiesVisibility.get().withVisibility(UserSNetVisibility.anyone);
final MenuRadioItemDescriptor onlyYourBuddiesItem = userBuddiesVisibility.get().withVisibility(
Modified: trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -44,7 +44,7 @@
* the body
*/
@Inject
- public CoreViewImpl(final WsArmorImpl armor, StateManagerDefault stateManager) {
+ public CoreViewImpl(final WsArmorImpl armor, final StateManagerDefault stateManager) {
this.armor = armor;
GWT.<CoreResources> create(CoreResources.class).css().ensureInjected();
GWT.<WsArmorResources> create(WsArmorResources.class).style().ensureInjected();
Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -147,6 +147,6 @@
@Override
public void showDefUserLogo() {
- entityTextLogo.setLogoImage(AbstractImagePrototype.create(images.personAvatarDef()));
+ entityTextLogo.setLogoImage(AbstractImagePrototype.create(images.unknown60()));
}
}
Added: trunk/src/main/java/cc/kune/core/shared/dto/HasContent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/HasContent.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/shared/dto/HasContent.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,7 @@
+package cc.kune.core.shared.dto;
+
+public interface HasContent {
+ String getTypeId();
+
+ void setTypeId(String typeId);
+}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/StateContainerDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/StateContainerDTO.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/shared/dto/StateContainerDTO.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -24,17 +24,17 @@
import com.google.gwt.user.client.rpc.IsSerializable;
-public class StateContainerDTO extends StateAbstractDTO implements IsSerializable {
+public class StateContainerDTO extends StateAbstractDTO implements IsSerializable, HasContent {
- private I18nLanguageDTO language;
- private String typeId;
- private String toolName;
+ private AccessListsDTO accessLists;
private ContainerDTO container;
- private ContainerDTO rootContainer;
private AccessRights containerRights;
+ private I18nLanguageDTO language;
private LicenseDTO license;
+ private ContainerDTO rootContainer;
private TagCloudResult tagCloudResult;
- private AccessListsDTO accessLists;
+ private String toolName;
+ private String typeId;
public StateContainerDTO() {
}
@@ -71,6 +71,7 @@
return toolName;
}
+ @Override
public String getTypeId() {
return typeId;
}
@@ -111,6 +112,7 @@
this.toolName = toolName;
}
+ @Override
public void setTypeId(final String typeId) {
this.typeId = typeId;
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/StateContentDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/StateContentDTO.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/core/shared/dto/StateContentDTO.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -28,7 +28,7 @@
import com.google.gwt.user.client.rpc.IsSerializable;
-public class StateContentDTO extends StateContainerDTO implements IsSerializable {
+public class StateContentDTO extends StateContainerDTO implements IsSerializable, HasContent {
private List<UserSimpleDTO> authors;
private String content;
Modified: trunk/src/main/java/cc/kune/docs/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/AbstractFoldableContentActions.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/docs/client/AbstractFoldableContentActions.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -19,54 +19,25 @@
*/
package cc.kune.docs.client;
-import cc.kune.common.client.actions.ui.descrip.ToolbarDescriptor;
-import cc.kune.common.client.utils.SchedulerManager;
-import cc.kune.core.client.cnt.FoldableContent;
-import cc.kune.core.client.errors.ErrorHandler;
import cc.kune.core.client.i18n.I18nUITranslationService;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
-import com.google.inject.Provider;
-
public abstract class AbstractFoldableContentActions {
- public static final ToolbarDescriptor CONTENT_BOTTOMBAR = new ToolbarDescriptor();
- public static final ToolbarDescriptor CONTENT_TOPBAR = new ToolbarDescriptor();
- public static final ToolbarDescriptor CONTEXT_BOTTOMBAR = new ToolbarDescriptor();
- public static final ToolbarDescriptor CONTEXT_TOPBAR = new ToolbarDescriptor();
-
private static final String PUBLICATION_MENU = "Publication";
- protected final Provider<ContentServiceAsync> contentServiceProvider;
- protected final SchedulerManager deferredCommandWrapper;
- protected final ErrorHandler errorHandler;
- protected final Provider<FileDownloadUtils> fileDownloadProvider;
- protected final FoldableContent foldableContent;
- protected final Provider<GroupServiceAsync> groupServiceProvider;
protected final I18nUITranslationService i18n;
protected final Session session;
protected final StateManager stateManager;
public AbstractFoldableContentActions(final Session session, final StateManager stateManager,
- final I18nUITranslationService i18n, final ErrorHandler errorHandler,
- final SchedulerManager deferredCommandWrapper, final Provider<GroupServiceAsync> groupServiceProvider,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final Provider<FileDownloadUtils> fileDownloadProvider, final FoldableContent foldableContent) {
+ final I18nUITranslationService i18n) {
this.session = session;
this.stateManager = stateManager;
this.i18n = i18n;
- this.errorHandler = errorHandler;
- this.deferredCommandWrapper = deferredCommandWrapper;
- this.groupServiceProvider = groupServiceProvider;
- this.contentServiceProvider = contentServiceProvider;
- this.fileDownloadProvider = fileDownloadProvider;
- this.foldableContent = foldableContent;
createActions();
session.onAppStart(true, new AppStartHandler() {
@Override
Added: trunk/src/main/java/cc/kune/docs/client/DocsGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsGinjector.java (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/DocsGinjector.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,12 @@
+package cc.kune.docs.client;
+
+import com.google.gwt.inject.client.AsyncProvider;
+import com.google.gwt.inject.client.Ginjector;
+
+public interface DocsGinjector extends Ginjector {
+
+ DocsParts getDocsParts();
+
+ AsyncProvider<DocsViewerPresenter> getDocsViewerPresenter();
+
+}
Added: trunk/src/main/java/cc/kune/docs/client/DocsGoUpBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsGoUpBtn.java (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/DocsGoUpBtn.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,32 @@
+package cc.kune.docs.client;
+
+import cc.kune.common.client.actions.AbstractExtendedAction;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.actions.perspective.ViewPerspective;
+
+import com.google.inject.Inject;
+
+public class DocsGoUpBtn extends ButtonDescriptor {
+
+ public class DocNewAction extends AbstractExtendedAction {
+
+ public DocNewAction() {
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ }
+
+ }
+
+ @Inject
+ public DocsGoUpBtn(final I18nTranslationService i18n, final DocNewAction action, final CoreResources res) {
+ super(action);
+ this.withToolTip(i18n.t("Go up: Open the container folder")).withIcon(res.folderGoUp()).in(
+ ViewPerspective.class);
+ }
+
+}
Added: trunk/src/main/java/cc/kune/docs/client/DocsParts.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsParts.java (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/DocsParts.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,14 @@
+package cc.kune.docs.client;
+
+import cc.kune.core.client.state.Session;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class DocsParts {
+
+ @Inject
+ public DocsParts(final Session session, final Provider<DocsViewerPresenter> docsViewer) {
+ docsViewer.get();
+ }
+}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,156 @@
+package cc.kune.docs.client;
+
+import org.waveprotocol.box.webclient.client.ClientIdGenerator;
+import org.waveprotocol.box.webclient.client.RemoteViewServiceMultiplexer;
+import org.waveprotocol.box.webclient.client.Session;
+import org.waveprotocol.box.webclient.client.SimpleWaveStore;
+import org.waveprotocol.box.webclient.client.StagesProvider;
+import org.waveprotocol.box.webclient.client.WaveWebSocketClient;
+import org.waveprotocol.box.webclient.search.WaveStore;
+import org.waveprotocol.box.webclient.widget.loading.LoadingIndicator;
+import org.waveprotocol.wave.client.account.ProfileManager;
+import org.waveprotocol.wave.client.account.impl.ProfileManagerImpl;
+import org.waveprotocol.wave.client.widget.common.ImplPanel;
+import org.waveprotocol.wave.model.id.IdGenerator;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+import org.waveprotocol.wave.util.escapers.GwtWaverefEncoder;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.common.client.errors.UIException;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.docs.client.DocsViewerPresenter.DocsViewerView;
+import cc.kune.gspace.client.WsArmor;
+import cc.kune.wave.client.WaveClientManager;
+import cc.kune.wave.client.WebClient;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.safehtml.shared.SafeHtmlUtils;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.ui.DeckPanel;
+import com.google.gwt.user.client.ui.InlineHTML;
+import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.ViewImpl;
+
+public class DocsViewerPanel extends ViewImpl implements DocsViewerView {
+ interface DocsViewerPanelUiBinder extends UiBinder<Widget, DocsViewerPanel> {
+ }
+
+ private static DocsViewerPanelUiBinder uiBinder = GWT.create(DocsViewerPanelUiBinder.class);
+
+ private RemoteViewServiceMultiplexer channel;
+ @UiField
+ DeckPanel deck;
+ private IdGenerator idGenerator;
+ private final Element loading = new LoadingIndicator().getElement();
+ @UiField
+ InlineHTML onlyViewPanel;
+ private ProfileManager profiles;
+ /** The wave panel, if a wave is open. */
+ private StagesProvider wave;
+ private final WaveClientManager waveClientManager;
+ // @UiField
+ // FramedPanel waveFrame;
+ @UiField
+ ImplPanel waveHolder;
+ private final WaveStore waveStore = new SimpleWaveStore();
+ private final Widget widget;
+ private final WsArmor wsArmor;
+
+ @Inject
+ public DocsViewerPanel(final WsArmor wsArmor, final WaveClientManager waveClientManager) {
+ this.wsArmor = wsArmor;
+ this.waveClientManager = waveClientManager;
+ widget = uiBinder.createAndBindUi(this);
+ }
+
+ @Override
+ public Widget asWidget() {
+ return widget;
+ }
+
+ @Override
+ public void attach() {
+ final ForIsWidget docContainer = wsArmor.getDocContainer();
+ final int widgetCount = docContainer.getWidgetCount();
+ for (int i = 0; i < widgetCount; i++) {
+ docContainer.remove(i);
+ }
+ docContainer.add(widget);
+ }
+
+ @Override
+ public void detach() {
+ widget.removeFromParent();
+ }
+
+ private WaveRef getWaveRef(final String waveRefS) {
+ try {
+ return GwtWaverefEncoder.decodeWaveRefFromPath(waveRefS);
+ } catch (final InvalidWaveRefException e) {
+ throw new UIException("Invalid waveref: " + waveRefS);
+ }
+ }
+
+ private void initWaveClientIfNeeded() {
+ if (channel == null) {
+ final WaveWebSocketClient webSocket = new WaveWebSocketClient(WebClient.useSocketIO(),
+ WebClient.getWebSocketBaseUrl(GWT.getModuleBaseURL()));
+ webSocket.connect();
+ channel = new RemoteViewServiceMultiplexer(webSocket,
+ new ParticipantId(Session.get().getAddress()).getAddress());
+ profiles = new ProfileManagerImpl();
+ idGenerator = ClientIdGenerator.create();
+ }
+ }
+
+ @Override
+ public void setActions(final GuiActionDescCollection actions) {
+ }
+
+ @Override
+ public void setContent(final StateContentDTO state) {
+ final boolean editable = state.getContentRights().isEditable();
+ if (editable) {
+ // initWaveClientIfNeeded();
+ // setEditableWaveContent(state.getWaveRef(), false);
+ waveHolder.clear();
+ waveHolder.add(new Label(state.getContent() + " (but here goes the Wave editor -we are testing it-)"));
+ onlyViewPanel.setHTML(SafeHtmlUtils.fromTrustedString(state.getContent()));
+ } else {
+ onlyViewPanel.setHTML(SafeHtmlUtils.fromTrustedString(state.getContent()));
+ }
+ deck.showWidget(editable ? 0 : 1);
+ }
+
+ public void setEditableWaveContent(final String waveRefS, final boolean isNewWave) {
+ final WaveRef waveRef = getWaveRef(waveRefS);
+
+ if (wave != null) {
+ wave.destroy();
+ wave = null;
+ }
+
+ // Release the display:none.
+ // UIObject.setVisible(waveFrame.getElement(), true);
+ waveHolder.getElement().appendChild(loading);
+ final Element holder = waveHolder.getElement().appendChild(Document.get().createDivElement());
+ final StagesProvider wave = new StagesProvider(holder, waveHolder, waveRef, channel, idGenerator, profiles,
+ waveStore, isNewWave);
+ this.wave = wave;
+ wave.load(new Command() {
+ @Override
+ public void execute() {
+ loading.removeFromParent();
+ }
+ });
+ }
+}
Added: trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/DocsViewerPanel.ui.xml 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,25 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g='urn:import:com.google.gwt.user.client.ui' xmlns:f='urn:import:org.waveprotocol.box.webclient.widget.frame'
+ xmlns:w='urn:import:org.waveprotocol.wave.client.widget.common'>
+ <ui:style>
+ .wavePanel {
+ margin: 0 0 0 0;
+ }
+ .waveHolder {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ }
+ </ui:style>
+ <g:HTMLPanel width="100%" height="100%">
+ <g:DeckPanel ui:field="deck" addStyleNames="k-doc-content-deck">
+<!-- <f:FramedPanel ui:field="waveFrame" addStyleNames="{style.wavePanel}"> -->
+<!-- </f:FramedPanel> -->
+ <w:ImplPanel ui:field="waveHolder" addStyleNames="{style.waveHolder}" />
+ <g:InlineHTML ui:field="onlyViewPanel" />
+ </g:DeckPanel>
+ </g:HTMLPanel>
+</ui:UiBinder>
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/docs/client/DocsViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsViewerPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/docs/client/DocsViewerPresenter.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,77 @@
+package cc.kune.docs.client;
+
+import javax.annotation.Nonnull;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.core.client.actions.ActionRegistryByType;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.domain.utils.AccessRights;
+import cc.kune.core.shared.dto.HasContent;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.gspace.client.tool.ContentViewer;
+import cc.kune.gspace.client.tool.ContentViewerSelector;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.View;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
+
+public class DocsViewerPresenter extends
+ Presenter<DocsViewerPresenter.DocsViewerView, DocsViewerPresenter.DocsViewerProxy> implements ContentViewer {
+
+ @ProxyCodeSplit
+ public interface DocsViewerProxy extends Proxy<DocsViewerPresenter> {
+ }
+
+ public interface DocsViewerView extends View {
+
+ void attach();
+
+ void detach();
+
+ void setActions(GuiActionDescCollection actions);
+
+ void setContent(StateContentDTO state);
+ }
+
+ private final ActionRegistryByType actionsRegistry;
+ private final Session session;
+
+ @Inject
+ public DocsViewerPresenter(final EventBus eventBus, final DocsViewerView view, final DocsViewerProxy proxy,
+ final Session session, final ContentViewerSelector viewerSelector,
+ final ActionRegistryByType actionsRegistry) {
+ super(eventBus, view, proxy);
+ this.session = session;
+ this.actionsRegistry = actionsRegistry;
+ viewerSelector.register(DocumentClientTool.TYPE_WAVE, this, true);
+ }
+
+ @Override
+ public void attach() {
+ getView().attach();
+ }
+
+ @Override
+ public void detach() {
+ getView().detach();
+ }
+
+ @Override
+ protected void revealInParent() {
+ RevealRootContentEvent.fire(this, this);
+ }
+
+ @Override
+ public void setContent(@Nonnull final HasContent state) {
+ final StateContentDTO stateContent = (StateContentDTO) state;
+ final AccessRights rights = stateContent.getContentRights();
+ final GuiActionDescCollection actions = actionsRegistry.getCurrentActions(stateContent.getGroup(),
+ stateContent.getTypeId(), session.isLogged(), rights);
+ getView().setActions(actions);
+ getView().setContent(stateContent);
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocumentClientActions.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/docs/client/DocumentClientActions.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -23,30 +23,14 @@
import static cc.kune.docs.client.DocumentClientTool.TYPE_FOLDER;
import static cc.kune.docs.client.DocumentClientTool.TYPE_ROOT;
import static cc.kune.docs.client.DocumentClientTool.TYPE_UPLOADEDFILE;
-
-
-import cc.kune.common.client.utils.SchedulerManager;
-import cc.kune.core.client.cnt.ContentActionRegistry;
-import cc.kune.core.client.errors.ErrorHandler;
import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
-import cc.kune.docs.client.cnt.DocumentViewer;
-import com.google.inject.Provider;
-
public class DocumentClientActions extends AbstractFoldableContentActions {
public DocumentClientActions(final I18nUITranslationService i18n, final Session session,
- final StateManager stateManager, final SchedulerManager deferredCommandWrapper,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final Provider<GroupServiceAsync> groupServiceProvider, final ContentActionRegistry contentActionRegistry,
- final Provider<FileDownloadUtils> fileDownloadProvider, final DocumentViewer docViewer,
- final ErrorHandler errorHandler) {
- super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
- contentServiceProvider, fileDownloadProvider, docViewer);
+ final StateManager stateManager) {
+ super(session, stateManager, i18n);
}
@Override
Modified: trunk/src/main/java/cc/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocumentClientTool.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/docs/client/DocumentClientTool.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -21,8 +21,8 @@
import cc.kune.core.client.i18n.I18nUITranslationService;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
-import cc.kune.gspace.client.tool.FoldableAbstractClientTool;
-import cc.kune.gspace.client.tool.ToolSelector;
+import cc.kune.gspace.client.tool.old.FoldableAbstractClientTool;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
import com.google.inject.Inject;
Modified: trunk/src/main/java/cc/kune/docs/client/DocumentGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocumentGinModule.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/docs/client/DocumentGinModule.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -8,6 +8,8 @@
@Override
protected void configure() {
bind(DocumentClientTool.class).in(Singleton.class);
+ bindPresenter(DocsViewerPresenter.class, DocsViewerPresenter.DocsViewerView.class, DocsViewerPanel.class,
+ DocsViewerPresenter.DocsViewerProxy.class);
}
}
Added: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,44 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client;
+
+import cc.kune.gspace.client.tool.selector.ToolSelector;
+import cc.kune.gspace.client.tool.selector.ToolSelectorPanel;
+import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter;
+
+import com.google.inject.Singleton;
+import com.gwtplatform.mvp.client.gin.AbstractPresenterModule;
+
+public class GSpaceGinModule extends AbstractPresenterModule {
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.google.gwt.inject.client.AbstractGinModule#configure()
+ */
+ @Override
+ protected void configure() {
+ bind(GSpaceParts.class).asEagerSingleton();
+ bindPresenter(ToolSelectorPresenter.class, ToolSelectorPresenter.ToolSelectorView.class,
+ ToolSelectorPanel.class, ToolSelectorPresenter.ToolSelectorProxy.class);
+ bind(ToolSelector.class).to(ToolSelectorPresenter.class).in(Singleton.class);
+ }
+
+}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinjector.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,22 @@
+package cc.kune.gspace.client;
+
+import cc.kune.gspace.client.tags.TagsSummaryPresenter;
+import cc.kune.gspace.client.tool.ContentViewerSelector;
+import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter;
+import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter;
+
+import com.google.gwt.inject.client.AsyncProvider;
+import com.google.gwt.inject.client.Ginjector;
+
+public interface GSpaceGinjector extends Ginjector {
+
+ ContentViewerSelector getContentViewerSelector();
+
+ AsyncProvider<EntityLicensePresenter> getEntityLicensePresenter();
+
+ GSpaceParts getGSpaceParts();
+
+ AsyncProvider<TagsSummaryPresenter> getTagsSummaryPresenter();
+
+ AsyncProvider<ToolSelectorPresenter> getToolSelectorPresenter();
+}
Added: trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,27 @@
+package cc.kune.gspace.client;
+
+import cc.kune.core.client.init.AppStartEvent;
+import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.state.Session;
+import cc.kune.gspace.client.tags.TagsSummaryPresenter;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
+import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class GSpaceParts {
+
+ @Inject
+ public GSpaceParts(final Session session, final Provider<EntityLicensePresenter> licenseFooter,
+ final Provider<TagsSummaryPresenter> tagsPresenter, final Provider<ToolSelector> toolSelector) {
+ session.onAppStart(true, new AppStartHandler() {
+ @Override
+ public void onAppStart(final AppStartEvent event) {
+ licenseFooter.get();
+ tagsPresenter.get();
+ toolSelector.get();
+ }
+ });
+ }
+}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionPerspective.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionPerspective.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ActionPerspective.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,8 @@
+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";
+}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditPerspective.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditPerspective.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/EditPerspective.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,7 @@
+package cc.kune.gspace.client.actions.perspective;
+
+/**
+ * An action that must be showed when editing
+ */
+public interface EditPerspective extends ActionPerspective {
+}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewPerspective.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewPerspective.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/perspective/ViewPerspective.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,7 @@
+package cc.kune.gspace.client.actions.perspective;
+
+/**
+ * An action that must be showed when editing
+ */
+public interface ViewPerspective extends ActionPerspective {
+}
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/AbstractClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/AbstractClientTool.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/AbstractClientTool.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.tool;
-
-public abstract class AbstractClientTool {
-
- public AbstractClientTool(final String shortName, final String longName, final ToolSelector toolSelector) {
- final ToolSelectorItemPresenter presenter = new ToolSelectorItemPresenter(shortName, longName, toolSelector);
- final ToolSelectorItemPanel panel = new ToolSelectorItemPanel();
- presenter.init(panel);
- }
-
- public abstract String getName();
-}
Added: trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewer.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewer.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewer.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,12 @@
+package cc.kune.gspace.client.tool;
+
+import cc.kune.core.shared.dto.HasContent;
+
+public interface ContentViewer {
+
+ void attach();
+
+ void detach();
+
+ void setContent(HasContent state);
+}
Added: trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,98 @@
+package cc.kune.gspace.client.tool;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.annotation.Nonnull;
+
+import cc.kune.common.client.errors.UIException;
+import cc.kune.common.client.log.Log;
+import cc.kune.core.client.init.AppStartEvent;
+import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateChangedEvent;
+import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.dto.HasContent;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.dto.StateContentDTO;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class ContentViewerSelector {
+
+ private final HashMap<String, ContentViewer> defViewsRegister;
+ private final Session session;
+ private final StateManager stateManager;
+ private final HashMap<String, List<ContentViewer>> viewsRegister;
+
+ @Inject
+ public ContentViewerSelector(final StateManager stateManager, final Session session) {
+ this.stateManager = stateManager;
+ this.session = session;
+ viewsRegister = new HashMap<String, List<ContentViewer>>();
+ defViewsRegister = new HashMap<String, ContentViewer>();
+ }
+
+ public void init() {
+ session.onAppStart(true, new AppStartHandler() {
+ @Override
+ public void onAppStart(final AppStartEvent event) {
+ stateManager.onStateChanged(true, new StateChangedHandler() {
+ @Override
+ public void onStateChanged(final StateChangedEvent event) {
+ final StateAbstractDTO state = event.getState();
+ if (state instanceof StateContentDTO || state instanceof StateContainerDTO) {
+ setContent((HasContent) state);
+ } else {
+ // NoContent
+ }
+ }
+ });
+ }
+ });
+ }
+
+ public void register(final String typeId, final ContentViewer view) {
+ Log.info("Registered " + typeId + " with class " + ContentViewer.class);
+ register(typeId, view, false);
+ }
+
+ public void register(@Nonnull final String typeId, @Nonnull final ContentViewer view, final boolean isDefault) {
+ List<ContentViewer> list = viewsRegister.get(typeId);
+ if (list == null) {
+ list = new ArrayList<ContentViewer>();
+ }
+ if (!list.contains(view)) {
+ list.add(view);
+ }
+ if (isDefault) {
+ defViewsRegister.put(typeId, view);
+ }
+ }
+
+ private void setContent(final ContentViewer view, final HasContent state) {
+ view.setContent(state);
+ view.attach();
+ }
+
+ public void setContent(@Nonnull final HasContent state) {
+ final String typeId = state.getTypeId();
+ assert typeId != null;
+ final ContentViewer defView = defViewsRegister.get(typeId);
+ if (defView == null) {
+ final List<ContentViewer> viewsList = viewsRegister.get(typeId);
+ if (viewsList != null && !viewsList.isEmpty()) {
+ setContent(viewsList.get(0), state);
+ } else {
+ throw new UIException("Unsupported typeId: " + typeId);
+ }
+ } else {
+ setContent(defView, state);
+ }
+ }
+}
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,122 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.tool;
-
-
-import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
-import cc.kune.core.shared.dto.BasicMimeTypeDTO;
-
-public abstract class FoldableAbstractClientTool extends AbstractClientTool {
- public static final String UPLOADEDFILE_SUFFIX = "uploaded";
- public static final String WAVE_SUFFIX = "wave";
-
- protected final ContentCapabilitiesRegistry contentCapabilitiesRegistry;
-
- public FoldableAbstractClientTool(final String shortName, final String longName, final ToolSelector toolSelector,
- final ContentCapabilitiesRegistry contentCapabilitiesRegistry) {
- super(shortName, longName, toolSelector);
- this.contentCapabilitiesRegistry = contentCapabilitiesRegistry;
- }
-
- protected void registerAclEditableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getAclEditable().register(typeIds);
- }
-
- protected void registerAuthorableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getAuthorable().register(typeIds);
- }
-
- protected void registerComentableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getComentable().register(typeIds);
- }
-
- public void registerContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType, final String iconUrl) {
- contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(typeId, mimeType, iconUrl);
- }
-
- public void registerContentTypeIcon(final String contentTypeId, final String iconUrl) {
- contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(contentTypeId, iconUrl);
- }
-
- protected void registerDragableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getDragable().register(typeIds);
- }
-
- protected void registerDropableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getDropable().register(typeIds);
- }
-
- protected void registerEmailSubscribeAbleTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getEmailSubscribeAble().register(typeIds);
- }
-
- protected void registerLicensableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getLicensable().register(typeIds);
- }
-
- protected void registerPublishModerableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getPublishModerable().register(typeIds);
- }
-
- protected void registerRateableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getRateable().register(typeIds);
- }
-
- protected void registerRenamableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getRenamable().register(typeIds);
- }
-
- protected void registerTageableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getTageable().register(typeIds);
- }
-
- protected void registerTranslatableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getTranslatable().register(typeIds);
- }
-
- protected void registerUploadTypesAndMimes(final String typeUploadedfile) {
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("image"), "images/nav/picture.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("video"), "images/nav/film.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("audio"), "images/nav/music.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "pdf"), "images/nav/page_pdf.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "zip"), "images/nav/page_zip.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "zip"), "images/nav/page_zip.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("text"), "images/nav/page_text.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "msword"),
- "images/nav/page_word.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "excel"),
- "images/nav/page_excel.png");
- registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "mspowerpoint"),
- "images/nav/page_pps.png");
- registerContentTypeIcon(typeUploadedfile, "images/nav/page.png");
- }
-
- protected void registerVersionableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getVersionable().register(typeIds);
- }
-
- protected void registerXmppComentableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getXmppComentable().register(typeIds);
- }
-
- protected void registerXmppNotifyCapableTypes(final String... typeIds) {
- contentCapabilitiesRegistry.getXmppNotificyCapable().register(typeIds);
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/ToolResources.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ToolResources.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ToolResources.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,20 +0,0 @@
-package cc.kune.gspace.client.tool;
-
-import com.google.gwt.resources.client.ClientBundle;
-import com.google.gwt.resources.client.ImageResource;
-
-public interface ToolResources extends ClientBundle {
-
- @Source("tool-arrowdown-def.png")
- ImageResource arrowDownDef();
-
- @Source("tool-arrowleft-def.png")
- ImageResource arrowLeftDef();
-
- @Source("tool-arrowright-def.png")
- ImageResource arrowRightDef();
-
- @Source("tool-arrowup-def.png")
- ImageResource arrowUpDef();
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelector.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelector.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelector.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.gspace.client.tool;
-
-public interface ToolSelector {
-
- void addTool(ToolSelectorItem item);
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItem.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItem.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.gspace.client.tool;
-
-import cc.kune.gspace.client.tool.ToolSelectorItemPresenter.ToolSelectorItemView;
-
-public interface ToolSelectorItem {
-
- String getShortName();
-
- ToolSelectorItemView getView();
-
- void setGroupShortName(String groupShortName);
-
- void setSelected(boolean selected);
-
- void setVisible(boolean visible);
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPanel.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPanel.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,101 +0,0 @@
-package cc.kune.gspace.client.tool;
-
-import cc.kune.gspace.client.tool.ToolSelectorItemPresenter.ToolSelectorItemView;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.event.dom.client.MouseOutEvent;
-import com.google.gwt.event.dom.client.MouseOverEvent;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.uibinder.client.UiHandler;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.FocusPanel;
-import com.google.gwt.user.client.ui.HasText;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.InlineLabel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class ToolSelectorItemPanel extends Composite implements ToolSelectorItemView {
-
- interface ToolSelectorItemPanelUiBinder extends UiBinder<Widget, ToolSelectorItemPanel> {
- }
-
- private static ToolSelectorItemPanelUiBinder uiBinder = GWT.create(ToolSelectorItemPanelUiBinder.class);
-
- @UiField
- Image iconLeft;
- @UiField
- Image iconRight;
- @UiField
- InlineLabel label;
- @UiField
- FocusPanel self;
-
- public ToolSelectorItemPanel() {
- initWidget(uiBinder.createAndBindUi(this));
- }
-
- @Override
- public Widget asWidget() {
- return this;
- }
-
- private void focus() {
- self.addStyleDependentName("focus");
- self.removeStyleDependentName("nofocus");
- }
-
- @Override
- public HasClickHandlers getFocus() {
- return self;
- }
-
- @Override
- public HasText getLabel() {
- return label;
- }
-
- @UiHandler("self")
- void onSelfMouseOut(final MouseOutEvent event) {
- unfocus();
- }
-
- // public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- // if (oldTheme != null) {
- // final String oldName = oldTheme.getName();
- // hl.removeStyleDependentName(oldName);
- // }
- // final String newName = newTheme.getName();
- // hl.addStyleDependentName(newName);
- // super.setCornerStyleName(hl.getStyleName());
- // }
-
- @UiHandler("self")
- void onSelfMouseOver(final MouseOverEvent event) {
- focus();
- }
-
- @Override
- public void setSelected(final boolean selected) {
- if (selected) {
- self.addStyleDependentName("selected");
- self.removeStyleDependentName("notselected");
- iconRight.setVisible(true);
- } else {
- self.addStyleDependentName("notselected");
- self.removeStyleDependentName("selected");
- iconRight.setVisible(false);
- }
- }
-
- @Override
- public void setVisible(final boolean visible) {
- self.setVisible(visible);
- }
-
- private void unfocus() {
- self.addStyleDependentName("nofocus");
- self.removeStyleDependentName("focus");
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPanel.ui.xml 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPanel.ui.xml 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,46 +0,0 @@
-<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
-<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
- xmlns:g="urn:import:com.google.gwt.user.client.ui">
- <ui:style>
- .label {
- text-decoration: none;
- font-size: 22px;
- color: white; /*
- text-shadow: 1px 1px 6px grey;
- */
- }
-
- .link a:link {
- text-decoration: none;
- }
-
- .self {
-
- }
-
- .flow {
- min-height: 30px;
- padding: 5px 10px;
- }
-
- .iconLeft {
-
- }
-
- .iconRight {
- float: right;
- position: relative;
- right: -17px;
- top: -6px;
- }
- </ui:style>
- <ui:with field='res' type='cc.kune.gspace.client.tool.ToolResources' />
- <g:FocusPanel ui:field="self" stylePrimaryName="k-tool-item">
- <g:FlowPanel styleName="{style.flow}" ui:field="flow">
- <g:Image ui:field="iconLeft" styleName="{style.iconLeft}" />
- <g:Image ui:field="iconRight" styleName="{style.iconRight}"
- resource='{res.arrowRightDef}' />
- <g:InlineLabel ui:field="label" styleName="{style.label}" />
- </g:FlowPanel>
- </g:FocusPanel>
-</ui:UiBinder>
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPresenter.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPresenter.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,104 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.gspace.client.tool;
-
-import cc.kune.core.shared.domain.utils.StateToken;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.user.client.History;
-import com.google.gwt.user.client.ui.HasText;
-import com.google.gwt.user.client.ui.IsWidget;
-
-public class ToolSelectorItemPresenter implements ToolSelectorItem {
- public interface ToolSelectorItemView extends IsWidget {
-
- HasClickHandlers getFocus();
-
- HasText getLabel();
-
- // void setTheme(WsTheme oldTheme, WsTheme newTheme);
-
- void setSelected(boolean selected);
-
- void setVisible(boolean visible);
- }
-
- private final String longName;
- // private final WsThemeManager wsThemePresenter;
- private final String shortName;
- private StateToken token;
- private final ToolSelector toolSelector;
- private ToolSelectorItemView view;
-
- public ToolSelectorItemPresenter(final String shortName, final String longName, final ToolSelector toolSelector) {
- this.shortName = shortName;
- this.longName = longName;
- this.toolSelector = toolSelector;
- // this.wsThemePresenter = wsThemePresenter;
- }
-
- @Override
- public String getShortName() {
- return shortName;
- }
-
- public ToolSelectorItemView getView() {
- return view;
- }
-
- public void init(final ToolSelectorItemView view) {
- this.view = view;
- toolSelector.addTool(this);
- view.getFocus().addClickHandler(new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- History.newItem(token.toString());
- }
- });
- view.getLabel().setText(longName);
- // wsThemePresenter.addOnThemeChanged(new Listener2<WsTheme, WsTheme>()
- // {
- // public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
- // setTheme(oldTheme, newTheme);
- // }
- // });
- }
-
- @Override
- public void setGroupShortName(final String groupShortName) {
- token = new StateToken(groupShortName, getShortName(), null, null);
- }
-
- @Override
- public void setSelected(final boolean selected) {
- view.setSelected(selected);
- }
-
- // private void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- // view.setTheme(oldTheme, newTheme);
- // }
-
- @Override
- public void setVisible(final boolean visible) {
- view.setVisible(visible);
- }
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPanel.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPanel.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,40 +0,0 @@
-package cc.kune.gspace.client.tool;
-
-import cc.kune.gspace.client.WsArmor;
-import cc.kune.gspace.client.tool.ToolSelectorItemPresenter.ToolSelectorItemView;
-import cc.kune.gspace.client.tool.ToolSelectorPresenter.ToolSelectorView;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.inject.Inject;
-import com.gwtplatform.mvp.client.ViewImpl;
-
-public class ToolSelectorPanel extends ViewImpl implements ToolSelectorView {
-
- interface ToolSelectorPanelUiBinder extends UiBinder<Widget, ToolSelectorPanel> {
- }
-
- private static ToolSelectorPanelUiBinder uiBinder = GWT.create(ToolSelectorPanelUiBinder.class);
-
- @UiField
- FlowPanel flow;
-
- @Inject
- public ToolSelectorPanel(final WsArmor wsArmor) {
- wsArmor.getEntityToolsCenter().add(uiBinder.createAndBindUi(this));
- }
-
- @Override
- public void addItem(final ToolSelectorItemView item) {
- flow.add(item.asWidget());
- }
-
- @Override
- public Widget asWidget() {
- return flow;
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPanel.ui.xml 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPanel.ui.xml 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,5 +0,0 @@
-<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
-<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
- xmlns:g="urn:import:com.google.gwt.user.client.ui">
- <g:FlowPanel styleName="k-tool-panel" ui:field="flow" />
-</ui:UiBinder>
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPresenter.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPresenter.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,135 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.gspace.client.tool;
-
-import java.util.HashMap;
-import java.util.List;
-
-import cc.kune.common.client.errors.UIException;
-import cc.kune.common.client.log.Log;
-import cc.kune.core.client.state.GroupChangedEvent;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
-import cc.kune.core.client.state.StateChangedEvent;
-import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.client.state.ToolChangedEvent;
-import cc.kune.core.client.state.ToolChangedEvent.ToolChangedHandler;
-import cc.kune.gspace.client.tool.ToolSelectorItemPresenter.ToolSelectorItemView;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-import com.gwtplatform.mvp.client.Presenter;
-import com.gwtplatform.mvp.client.View;
-import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
-import com.gwtplatform.mvp.client.proxy.Proxy;
-import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
-
-public class ToolSelectorPresenter extends
- Presenter<ToolSelectorPresenter.ToolSelectorView, ToolSelectorPresenter.ToolSelectorProxy> implements
- ToolSelector {
-
- @ProxyCodeSplit
- public interface ToolSelectorProxy extends Proxy<ToolSelectorPresenter> {
- }
-
- public interface ToolSelectorView extends View {
- void addItem(ToolSelectorItemView item);
- }
-
- private final HashMap<String, ToolSelectorItem> tools;
-
- @Inject
- public ToolSelectorPresenter(final EventBus eventBus, final ToolSelectorView view, final ToolSelectorProxy proxy,
- final StateManager stateManager) {
- super(eventBus, view, proxy);
- tools = new HashMap<String, ToolSelectorItem>();
- stateManager.onStateChanged(true, new StateChangedHandler() {
- @Override
- public void onStateChanged(final StateChangedEvent event) {
- for (final String tool : tools.keySet()) {
- final List<String> enabledTools = event.getState().getEnabledTools();
- if (enabledTools != null && enabledTools.contains(tool)) {
- tools.get(tool).setVisible(true);
- } else {
- tools.get(tool).setVisible(false);
- }
- }
- }
- });
- stateManager.onGroupChanged(true, new GroupChangedHandler() {
- @Override
- public void onGroupChanged(final GroupChangedEvent event) {
- ToolSelectorPresenter.this.onGroupChanged(event.getNewGroup());
- }
- });
- stateManager.onToolChanged(false, new ToolChangedHandler() {
- @Override
- public void onToolChanged(final ToolChangedEvent event) {
- ToolSelectorPresenter.this.onToolChanged(event.getPreviousTool(), event.getNewTool());
- }
- });
- }
-
- @Override
- public void addTool(final ToolSelectorItem item) {
- final String name = item.getShortName();
- if (name == null) {
- throw new UIException("You cannot add a tool without a name");
- }
- if (tools.get(name) != null) {
- throw new UIException("A tool with the same name already added");
- }
- tools.put(name, item);
- item.setSelected(false);
- getView().addItem(item.getView());
- }
-
- private void checkTool(final ToolSelectorItem tool) {
- if (tool == null) {
- throw new UIException("Trying to activate an unregistered tool in client");
- }
-
- }
-
- void onGroupChanged(final String newGroupName) {
- for (final String name : tools.keySet()) {
- tools.get(name).setGroupShortName(newGroupName);
- }
- }
-
- void onToolChanged(final String oldTool, final String newTool) {
- Log.debug("Registered tools: " + tools.keySet().toString());
- if (oldTool != null && !oldTool.equals("")) {
- final ToolSelectorItem tool = tools.get(oldTool);
- checkTool(tool);
- tool.setSelected(false);
- }
- if (!newTool.equals("")) {
- final ToolSelectorItem tool = tools.get(newTool);
- checkTool(tool);
- tool.setSelected(true);
- }
- }
-
- @Override
- protected void revealInParent() {
- RevealRootContentEvent.fire(this, this);
- }
-}
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/old/AbstractClientTool.java (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/AbstractClientTool.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/old/AbstractClientTool.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/old/AbstractClientTool.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,35 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.tool.old;
+
+import cc.kune.gspace.client.tool.selector.ToolSelector;
+import cc.kune.gspace.client.tool.selector.ToolSelectorItemPanel;
+import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter;
+
+public abstract class AbstractClientTool {
+
+ public AbstractClientTool(final String shortName, final String longName, final ToolSelector toolSelector) {
+ final ToolSelectorItemPresenter presenter = new ToolSelectorItemPresenter(shortName, longName, toolSelector);
+ final ToolSelectorItemPanel panel = new ToolSelectorItemPanel();
+ presenter.init(panel);
+ }
+
+ public abstract String getName();
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/old/FoldableAbstractClientTool.java (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/old/FoldableAbstractClientTool.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/old/FoldableAbstractClientTool.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,123 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.tool.old;
+
+
+import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
+import cc.kune.core.shared.dto.BasicMimeTypeDTO;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
+
+public abstract class FoldableAbstractClientTool extends AbstractClientTool {
+ public static final String UPLOADEDFILE_SUFFIX = "uploaded";
+ public static final String WAVE_SUFFIX = "wave";
+
+ protected final ContentCapabilitiesRegistry contentCapabilitiesRegistry;
+
+ public FoldableAbstractClientTool(final String shortName, final String longName, final ToolSelector toolSelector,
+ final ContentCapabilitiesRegistry contentCapabilitiesRegistry) {
+ super(shortName, longName, toolSelector);
+ this.contentCapabilitiesRegistry = contentCapabilitiesRegistry;
+ }
+
+ protected void registerAclEditableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getAclEditable().register(typeIds);
+ }
+
+ protected void registerAuthorableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getAuthorable().register(typeIds);
+ }
+
+ protected void registerComentableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getComentable().register(typeIds);
+ }
+
+ public void registerContentTypeIcon(final String typeId, final BasicMimeTypeDTO mimeType, final String iconUrl) {
+ contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(typeId, mimeType, iconUrl);
+ }
+
+ public void registerContentTypeIcon(final String contentTypeId, final String iconUrl) {
+ contentCapabilitiesRegistry.getIconsRegistry().registerContentTypeIcon(contentTypeId, iconUrl);
+ }
+
+ protected void registerDragableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getDragable().register(typeIds);
+ }
+
+ protected void registerDropableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getDropable().register(typeIds);
+ }
+
+ protected void registerEmailSubscribeAbleTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getEmailSubscribeAble().register(typeIds);
+ }
+
+ protected void registerLicensableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getLicensable().register(typeIds);
+ }
+
+ protected void registerPublishModerableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getPublishModerable().register(typeIds);
+ }
+
+ protected void registerRateableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getRateable().register(typeIds);
+ }
+
+ protected void registerRenamableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getRenamable().register(typeIds);
+ }
+
+ protected void registerTageableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getTageable().register(typeIds);
+ }
+
+ protected void registerTranslatableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getTranslatable().register(typeIds);
+ }
+
+ protected void registerUploadTypesAndMimes(final String typeUploadedfile) {
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("image"), "images/nav/picture.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("video"), "images/nav/film.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("audio"), "images/nav/music.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "pdf"), "images/nav/page_pdf.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "zip"), "images/nav/page_zip.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "zip"), "images/nav/page_zip.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("text"), "images/nav/page_text.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "msword"),
+ "images/nav/page_word.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "excel"),
+ "images/nav/page_excel.png");
+ registerContentTypeIcon(typeUploadedfile, new BasicMimeTypeDTO("application", "mspowerpoint"),
+ "images/nav/page_pps.png");
+ registerContentTypeIcon(typeUploadedfile, "images/nav/page.png");
+ }
+
+ protected void registerVersionableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getVersionable().register(typeIds);
+ }
+
+ protected void registerXmppComentableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getXmppComentable().register(typeIds);
+ }
+
+ protected void registerXmppNotifyCapableTypes(final String... typeIds) {
+ contentCapabilitiesRegistry.getXmppNotificyCapable().register(typeIds);
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolResources.java (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/ToolResources.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolResources.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolResources.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,20 @@
+package cc.kune.gspace.client.tool.selector;
+
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+
+public interface ToolResources extends ClientBundle {
+
+ @Source("tool-arrowdown-def.png")
+ ImageResource arrowDownDef();
+
+ @Source("tool-arrowleft-def.png")
+ ImageResource arrowLeftDef();
+
+ @Source("tool-arrowright-def.png")
+ ImageResource arrowRightDef();
+
+ @Source("tool-arrowup-def.png")
+ ImageResource arrowUpDef();
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelector.java (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelector.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelector.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelector.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,26 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.gspace.client.tool.selector;
+
+public interface ToolSelector {
+
+ void addTool(ToolSelectorItem item);
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItem.java (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItem.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItem.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,36 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.gspace.client.tool.selector;
+
+import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter.ToolSelectorItemView;
+
+public interface ToolSelectorItem {
+
+ String getShortName();
+
+ ToolSelectorItemView getView();
+
+ void setGroupShortName(String groupShortName);
+
+ void setSelected(boolean selected);
+
+ void setVisible(boolean visible);
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.java (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,101 @@
+package cc.kune.gspace.client.tool.selector;
+
+import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter.ToolSelectorItemView;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.uibinder.client.UiHandler;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FocusPanel;
+import com.google.gwt.user.client.ui.HasText;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.InlineLabel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class ToolSelectorItemPanel extends Composite implements ToolSelectorItemView {
+
+ interface ToolSelectorItemPanelUiBinder extends UiBinder<Widget, ToolSelectorItemPanel> {
+ }
+
+ private static ToolSelectorItemPanelUiBinder uiBinder = GWT.create(ToolSelectorItemPanelUiBinder.class);
+
+ @UiField
+ Image iconLeft;
+ @UiField
+ Image iconRight;
+ @UiField
+ InlineLabel label;
+ @UiField
+ FocusPanel self;
+
+ public ToolSelectorItemPanel() {
+ initWidget(uiBinder.createAndBindUi(this));
+ }
+
+ @Override
+ public Widget asWidget() {
+ return this;
+ }
+
+ private void focus() {
+ self.addStyleDependentName("focus");
+ self.removeStyleDependentName("nofocus");
+ }
+
+ @Override
+ public HasClickHandlers getFocus() {
+ return self;
+ }
+
+ @Override
+ public HasText getLabel() {
+ return label;
+ }
+
+ @UiHandler("self")
+ void onSelfMouseOut(final MouseOutEvent event) {
+ unfocus();
+ }
+
+ // public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ // if (oldTheme != null) {
+ // final String oldName = oldTheme.getName();
+ // hl.removeStyleDependentName(oldName);
+ // }
+ // final String newName = newTheme.getName();
+ // hl.addStyleDependentName(newName);
+ // super.setCornerStyleName(hl.getStyleName());
+ // }
+
+ @UiHandler("self")
+ void onSelfMouseOver(final MouseOverEvent event) {
+ focus();
+ }
+
+ @Override
+ public void setSelected(final boolean selected) {
+ if (selected) {
+ self.addStyleDependentName("selected");
+ self.removeStyleDependentName("notselected");
+ iconRight.setVisible(true);
+ } else {
+ self.addStyleDependentName("notselected");
+ self.removeStyleDependentName("selected");
+ iconRight.setVisible(false);
+ }
+ }
+
+ @Override
+ public void setVisible(final boolean visible) {
+ self.setVisible(visible);
+ }
+
+ private void unfocus() {
+ self.addStyleDependentName("nofocus");
+ self.removeStyleDependentName("focus");
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.ui.xml (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPanel.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPanel.ui.xml 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,46 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui">
+ <ui:style>
+ .label {
+ text-decoration: none;
+ font-size: 22px;
+ color: white; /*
+ text-shadow: 1px 1px 6px grey;
+ */
+ }
+
+ .link a:link {
+ text-decoration: none;
+ }
+
+ .self {
+
+ }
+
+ .flow {
+ min-height: 30px;
+ padding: 5px 10px;
+ }
+
+ .iconLeft {
+
+ }
+
+ .iconRight {
+ float: right;
+ position: relative;
+ right: -17px;
+ top: -6px;
+ }
+ </ui:style>
+ <ui:with field='res' type='cc.kune.gspace.client.tool.selector.ToolResources' />
+ <g:FocusPanel ui:field="self" stylePrimaryName="k-tool-item">
+ <g:FlowPanel styleName="{style.flow}" ui:field="flow">
+ <g:Image ui:field="iconLeft" styleName="{style.iconLeft}" />
+ <g:Image ui:field="iconRight" styleName="{style.iconRight}"
+ resource='{res.arrowRightDef}' />
+ <g:InlineLabel ui:field="label" styleName="{style.label}" />
+ </g:FlowPanel>
+ </g:FocusPanel>
+</ui:UiBinder>
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPresenter.java (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorItemPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPresenter.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,104 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.gspace.client.tool.selector;
+
+import cc.kune.core.shared.domain.utils.StateToken;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.ui.HasText;
+import com.google.gwt.user.client.ui.IsWidget;
+
+public class ToolSelectorItemPresenter implements ToolSelectorItem {
+ public interface ToolSelectorItemView extends IsWidget {
+
+ HasClickHandlers getFocus();
+
+ HasText getLabel();
+
+ // void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
+ void setSelected(boolean selected);
+
+ void setVisible(boolean visible);
+ }
+
+ private final String longName;
+ // private final WsThemeManager wsThemePresenter;
+ private final String shortName;
+ private StateToken token;
+ private final ToolSelector toolSelector;
+ private ToolSelectorItemView view;
+
+ public ToolSelectorItemPresenter(final String shortName, final String longName, final ToolSelector toolSelector) {
+ this.shortName = shortName;
+ this.longName = longName;
+ this.toolSelector = toolSelector;
+ // this.wsThemePresenter = wsThemePresenter;
+ }
+
+ @Override
+ public String getShortName() {
+ return shortName;
+ }
+
+ public ToolSelectorItemView getView() {
+ return view;
+ }
+
+ public void init(final ToolSelectorItemView view) {
+ this.view = view;
+ toolSelector.addTool(this);
+ view.getFocus().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(final ClickEvent event) {
+ History.newItem(token.toString());
+ }
+ });
+ view.getLabel().setText(longName);
+ // wsThemePresenter.addOnThemeChanged(new Listener2<WsTheme, WsTheme>()
+ // {
+ // public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ // setTheme(oldTheme, newTheme);
+ // }
+ // });
+ }
+
+ @Override
+ public void setGroupShortName(final String groupShortName) {
+ token = new StateToken(groupShortName, getShortName(), null, null);
+ }
+
+ @Override
+ public void setSelected(final boolean selected) {
+ view.setSelected(selected);
+ }
+
+ // private void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ // view.setTheme(oldTheme, newTheme);
+ // }
+
+ @Override
+ public void setVisible(final boolean visible) {
+ view.setVisible(visible);
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPanel.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,40 @@
+package cc.kune.gspace.client.tool.selector;
+
+import cc.kune.gspace.client.WsArmor;
+import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter.ToolSelectorItemView;
+import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter.ToolSelectorView;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.ViewImpl;
+
+public class ToolSelectorPanel extends ViewImpl implements ToolSelectorView {
+
+ interface ToolSelectorPanelUiBinder extends UiBinder<Widget, ToolSelectorPanel> {
+ }
+
+ private static ToolSelectorPanelUiBinder uiBinder = GWT.create(ToolSelectorPanelUiBinder.class);
+
+ @UiField
+ FlowPanel flow;
+
+ @Inject
+ public ToolSelectorPanel(final WsArmor wsArmor) {
+ wsArmor.getEntityToolsCenter().add(uiBinder.createAndBindUi(this));
+ }
+
+ @Override
+ public void addItem(final ToolSelectorItemView item) {
+ flow.add(item.asWidget());
+ }
+
+ @Override
+ public Widget asWidget() {
+ return flow;
+ }
+
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.ui.xml (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPanel.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.ui.xml 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,5 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui">
+ <g:FlowPanel styleName="k-tool-panel" ui:field="flow" />
+</ui:UiBinder>
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/ToolSelectorPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,135 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.gspace.client.tool.selector;
+
+import java.util.HashMap;
+import java.util.List;
+
+import cc.kune.common.client.errors.UIException;
+import cc.kune.common.client.log.Log;
+import cc.kune.core.client.state.GroupChangedEvent;
+import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
+import cc.kune.core.client.state.StateChangedEvent;
+import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.ToolChangedEvent;
+import cc.kune.core.client.state.ToolChangedEvent.ToolChangedHandler;
+import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter.ToolSelectorItemView;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.View;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
+
+public class ToolSelectorPresenter extends
+ Presenter<ToolSelectorPresenter.ToolSelectorView, ToolSelectorPresenter.ToolSelectorProxy> implements
+ ToolSelector {
+
+ @ProxyCodeSplit
+ public interface ToolSelectorProxy extends Proxy<ToolSelectorPresenter> {
+ }
+
+ public interface ToolSelectorView extends View {
+ void addItem(ToolSelectorItemView item);
+ }
+
+ private final HashMap<String, ToolSelectorItem> tools;
+
+ @Inject
+ public ToolSelectorPresenter(final EventBus eventBus, final ToolSelectorView view, final ToolSelectorProxy proxy,
+ final StateManager stateManager) {
+ super(eventBus, view, proxy);
+ tools = new HashMap<String, ToolSelectorItem>();
+ stateManager.onStateChanged(true, new StateChangedHandler() {
+ @Override
+ public void onStateChanged(final StateChangedEvent event) {
+ for (final String tool : tools.keySet()) {
+ final List<String> enabledTools = event.getState().getEnabledTools();
+ if (enabledTools != null && enabledTools.contains(tool)) {
+ tools.get(tool).setVisible(true);
+ } else {
+ tools.get(tool).setVisible(false);
+ }
+ }
+ }
+ });
+ stateManager.onGroupChanged(true, new GroupChangedHandler() {
+ @Override
+ public void onGroupChanged(final GroupChangedEvent event) {
+ ToolSelectorPresenter.this.onGroupChanged(event.getNewGroup());
+ }
+ });
+ stateManager.onToolChanged(false, new ToolChangedHandler() {
+ @Override
+ public void onToolChanged(final ToolChangedEvent event) {
+ ToolSelectorPresenter.this.onToolChanged(event.getPreviousTool(), event.getNewTool());
+ }
+ });
+ }
+
+ @Override
+ public void addTool(final ToolSelectorItem item) {
+ final String name = item.getShortName();
+ if (name == null) {
+ throw new UIException("You cannot add a tool without a name");
+ }
+ if (tools.get(name) != null) {
+ throw new UIException("A tool with the same name already added");
+ }
+ tools.put(name, item);
+ item.setSelected(false);
+ getView().addItem(item.getView());
+ }
+
+ private void checkTool(final ToolSelectorItem tool) {
+ if (tool == null) {
+ throw new UIException("Trying to activate an unregistered tool in client");
+ }
+
+ }
+
+ void onGroupChanged(final String newGroupName) {
+ for (final String name : tools.keySet()) {
+ tools.get(name).setGroupShortName(newGroupName);
+ }
+ }
+
+ void onToolChanged(final String oldTool, final String newTool) {
+ Log.debug("Registered tools: " + tools.keySet().toString());
+ if (oldTool != null && !oldTool.equals("")) {
+ final ToolSelectorItem tool = tools.get(oldTool);
+ checkTool(tool);
+ tool.setSelected(false);
+ }
+ if (!newTool.equals("")) {
+ final ToolSelectorItem tool = tools.get(newTool);
+ checkTool(tool);
+ tool.setSelected(true);
+ }
+ }
+
+ @Override
+ protected void revealInParent() {
+ RevealRootContentEvent.fire(this, this);
+ }
+}
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowdown-def.png (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowdown-def.png)
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowdown-def.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowleft-def.png (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowleft-def.png)
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowleft-def.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowright-def.png (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowright-def.png)
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowright-def.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Copied: trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowup-def.png (from rev 1306, trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowup-def.png)
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/gspace/client/tool/selector/tool-arrowup-def.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowdown-def.png
===================================================================
(Binary files differ)
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowleft-def.png
===================================================================
(Binary files differ)
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowright-def.png
===================================================================
(Binary files differ)
Deleted: trunk/src/main/java/cc/kune/gspace/client/tool/tool-arrowup-def.png
===================================================================
(Binary files differ)
Modified: trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -55,6 +55,6 @@
public WaveStatusIndicator(final SitebarActionsPresenter sitebar, final WaveStatusAction action) {
final IconLabelDescriptor status = new IconLabelDescriptor(action);
status.setPosition(0);
- sitebar.getRightToolbar().addAction(status);
+ sitebar.getRightToolbar().add(status);
}
}
Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -139,18 +139,6 @@
private RemoteViewServiceMultiplexer channel;
- public RemoteViewServiceMultiplexer getChannel() {
- return channel;
-}
-
- public IdGenerator getIdGenerator() {
- return idGenerator;
-}
-
- public ProfileManager getProfiles() {
- return profiles;
-}
-
private final EventBus eventBus;
/**
@@ -273,11 +261,11 @@
* Returns <code>ws://yourhost[:port]/</code>.
*/
// XXX check formatting wrt GPE
- private native String getWebSocketBaseUrl(String moduleBase) /*-{
+ public native static String getWebSocketBaseUrl(String moduleBase) /*-{
return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";
}-*/;
- private native boolean useSocketIO() /*-{
+ public native static boolean useSocketIO() /*-{
return !!$wnd.__useSocketIO
}-*/;
Modified: trunk/src/main/java/com/example/client/HelloWorldActions.java
===================================================================
--- trunk/src/main/java/com/example/client/HelloWorldActions.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/com/example/client/HelloWorldActions.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -34,7 +34,7 @@
final ButtonDescriptor siteBarBtn = new ButtonDescriptor(sharedAction);
siteBarBtn.withText("HWorld!").withIcon(coreResources.info());
// FIXME setParent as in siteUsOp
- sitebarActions.getLeftToolbar().addAction(siteBarBtn);
+ sitebarActions.getLeftToolbar().add(siteBarBtn);
// Other action in the sitebar options menu
Modified: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -25,7 +25,7 @@
import cc.kune.core.client.i18n.I18nUITranslationService;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
-import cc.kune.gspace.client.tool.ToolSelector;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
public class BlogClientTool extends OldFoldableAbstractClientTool {
public static final String NAME = "blogs";
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -25,7 +25,7 @@
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.tool.ToolSelector;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
public class ChatClientTool extends OldFoldableAbstractClientTool {
public static final String NAME = "chats";
Modified: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -25,7 +25,7 @@
import cc.kune.core.client.i18n.I18nUITranslationService;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
-import cc.kune.gspace.client.tool.ToolSelector;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
public class GalleryClientTool extends OldFoldableAbstractClientTool {
public static final String NAME = "gallery";
Modified: trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/org/ourproject/kune/wiki/client/WikiClientTool.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -25,7 +25,7 @@
import cc.kune.core.client.i18n.I18nUITranslationService;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
-import cc.kune.gspace.client.tool.ToolSelector;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
public class WikiClientTool extends OldFoldableAbstractClientTool {
public static final String NAME = "wiki";
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/OldAbstractClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tool/OldAbstractClientTool.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/OldAbstractClientTool.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -22,9 +22,9 @@
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemeManager;
-import cc.kune.gspace.client.tool.ToolSelector;
-import cc.kune.gspace.client.tool.ToolSelectorItemPanel;
-import cc.kune.gspace.client.tool.ToolSelectorItemPresenter;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
+import cc.kune.gspace.client.tool.selector.ToolSelectorItemPanel;
+import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter;
public abstract class OldAbstractClientTool implements OldClientTool {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tool/OldFoldableAbstractClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tool/OldFoldableAbstractClientTool.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tool/OldFoldableAbstractClientTool.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -24,7 +24,7 @@
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.shared.dto.BasicMimeTypeDTO;
-import cc.kune.gspace.client.tool.ToolSelector;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
public abstract class OldFoldableAbstractClientTool extends OldAbstractClientTool {
public static final String UPLOADEDFILE_SUFFIX = "uploaded";
Added: trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java (rev 0)
+++ trunk/src/test/java/cc/kune/core/client/actions/ActionRegistryByTypeTest.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,55 @@
+package cc.kune.core.client.actions;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+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 com.google.inject.Provider;
+
+public class ActionRegistryByTypeTest {
+
+ private GuiActionDescrip action;
+ private ActionRegistryByType actionRegistryByType;
+ private AccessRights allRights;
+
+ @SuppressWarnings({ "unchecked", "rawtypes" })
+ @Before
+ public void before() {
+ actionRegistryByType = new ActionRegistryByType();
+ action = Mockito.mock(GuiActionDescrip.class);
+ allRights = new AccessRights(true, true, true);
+ actionRegistryByType.addAction(new Provider() {
+
+ @Override
+ public Object get() {
+ return action;
+ }
+ });
+ }
+
+ @Test
+ public void testDontGetCurrentActionsOfOtherPerspective() {
+ Mockito.when(action.getValue(ActionPerspective.KEY)).thenReturn(ViewPerspective.class);
+ assertEquals(0, actionRegistryByType.getCurrentActions(null, false, allRights, EditPerspective.class).size());
+ }
+
+ @Test
+ public void testGetCurrentActions() {
+ Mockito.when(action.getValue(ActionPerspective.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());
+ }
+}
Modified: trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/test/java/cc/kune/core/server/integration/DatabaseInitializerTest.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -80,7 +80,7 @@
@Test
public void testDefaultDocumentContent() {
final Content content = defaultGroup.getDefaultContent();
- assertEquals(DocumentServerTool.TYPE_DOCUMENT, content.getTypeId());
+ assertEquals(DocumentServerTool.TYPE_WAVE, content.getTypeId());
final Container rootDocFolder = content.getContainer();
assertEquals(true, rootDocFolder.isRoot());
}
Deleted: trunk/src/test/java/cc/kune/gspace/client/tool/ToolSelectorPresenterTest.java
===================================================================
--- trunk/src/test/java/cc/kune/gspace/client/tool/ToolSelectorPresenterTest.java 2011-04-16 10:50:40 UTC (rev 1313)
+++ trunk/src/test/java/cc/kune/gspace/client/tool/ToolSelectorPresenterTest.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -1,129 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.gspace.client.tool;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-
-import cc.kune.core.client.state.EventBusTester;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.gspace.client.tool.ToolSelectorItem;
-import cc.kune.gspace.client.tool.ToolSelectorPresenter;
-import cc.kune.gspace.client.tool.ToolSelectorPresenter.ToolSelectorProxy;
-import cc.kune.gspace.client.tool.ToolSelectorPresenter.ToolSelectorView;
-
-public class ToolSelectorPresenterTest {
-
- private static final String GROUP1_NAME = "group1";
- private static final String TOOL1_NAME = "tool1";
- private static final String TOOL2_NAME = "tool2";
- private ToolSelectorPresenter toolSelector;
- private ToolSelectorItem toolSelectorItem1;
- private ToolSelectorItem toolSelectorItem2;
-
- @Test
- public void addFirstToolMustNotSelect() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- Mockito.verify(toolSelectorItem1).setSelected(false);
- }
-
- @Test(expected = RuntimeException.class)
- public void addToolWithoutNameMustGiveException() {
- toolSelector.addTool(toolSelectorItem1);
- }
-
- @Test
- public void addTwoToolsMustSelectNothing() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- Mockito.verify(toolSelectorItem1).setSelected(false);
- Mockito.verify(toolSelectorItem2).setSelected(false);
- }
-
- @Test(expected = RuntimeException.class)
- public void addTwoToolsWithSameNameMustGiveException() {
- setToolNames();
- final ToolSelectorItem toolSelectorItemCopy = Mockito.mock(ToolSelectorItem.class);
- Mockito.when(toolSelectorItemCopy.getShortName()).thenReturn(TOOL1_NAME);
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItemCopy);
- }
-
- @Before
- public void begin() {
- final StateManager stateManager = Mockito.mock(StateManager.class);
- // final WsThemeManager themePresenter =
- // Mockito.mock(WsThemeManager.class);
- toolSelector = new ToolSelectorPresenter(new EventBusTester(), Mockito.mock(ToolSelectorView.class),
- Mockito.mock(ToolSelectorProxy.class), stateManager);
- toolSelectorItem1 = Mockito.mock(ToolSelectorItem.class);
- toolSelectorItem2 = Mockito.mock(ToolSelectorItem.class);
- }
-
- @Test
- public void setStateFirstMustSelect() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.onToolChanged("", TOOL1_NAME);
- Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(false);
- Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(true);
- }
-
- @Test
- public void setStateWithADifferentGroupMustSetLink() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- toolSelector.onGroupChanged(GROUP1_NAME);
- Mockito.verify(toolSelectorItem1, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
- }
-
- @Test
- public void setStateWithADifferentToolNameMustSelectAndUnSelectTheOlder() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- toolSelector.onToolChanged(TOOL1_NAME, TOOL2_NAME);
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
- Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(true);
- }
-
- @Test
- public void setStateWithNoToolNameMustUnSelectTheOlder() {
- setToolNames();
- toolSelector.addTool(toolSelectorItem1);
- toolSelector.addTool(toolSelectorItem2);
- toolSelector.onToolChanged(TOOL1_NAME, "");
- Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
- Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
- Mockito.verify(toolSelectorItem2, Mockito.never()).setSelected(true);
- }
-
- public void setToolNames() {
- Mockito.when(toolSelectorItem1.getShortName()).thenReturn(TOOL1_NAME);
- Mockito.when(toolSelectorItem2.getShortName()).thenReturn(TOOL2_NAME);
- }
-
-}
Copied: trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java (from rev 1306, trunk/src/test/java/cc/kune/gspace/client/tool/ToolSelectorPresenterTest.java)
===================================================================
--- trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java (rev 0)
+++ trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java 2011-04-17 19:25:13 UTC (rev 1314)
@@ -0,0 +1,129 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.tool.selector;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+
+import cc.kune.core.client.state.EventBusTester;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.gspace.client.tool.selector.ToolSelectorItem;
+import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter;
+import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter.ToolSelectorProxy;
+import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter.ToolSelectorView;
+
+public class ToolSelectorPresenterTest {
+
+ private static final String GROUP1_NAME = "group1";
+ private static final String TOOL1_NAME = "tool1";
+ private static final String TOOL2_NAME = "tool2";
+ private ToolSelectorPresenter toolSelector;
+ private ToolSelectorItem toolSelectorItem1;
+ private ToolSelectorItem toolSelectorItem2;
+
+ @Test
+ public void addFirstToolMustNotSelect() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ Mockito.verify(toolSelectorItem1).setSelected(false);
+ }
+
+ @Test(expected = RuntimeException.class)
+ public void addToolWithoutNameMustGiveException() {
+ toolSelector.addTool(toolSelectorItem1);
+ }
+
+ @Test
+ public void addTwoToolsMustSelectNothing() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ Mockito.verify(toolSelectorItem1).setSelected(false);
+ Mockito.verify(toolSelectorItem2).setSelected(false);
+ }
+
+ @Test(expected = RuntimeException.class)
+ public void addTwoToolsWithSameNameMustGiveException() {
+ setToolNames();
+ final ToolSelectorItem toolSelectorItemCopy = Mockito.mock(ToolSelectorItem.class);
+ Mockito.when(toolSelectorItemCopy.getShortName()).thenReturn(TOOL1_NAME);
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItemCopy);
+ }
+
+ @Before
+ public void begin() {
+ final StateManager stateManager = Mockito.mock(StateManager.class);
+ // final WsThemeManager themePresenter =
+ // Mockito.mock(WsThemeManager.class);
+ toolSelector = new ToolSelectorPresenter(new EventBusTester(), Mockito.mock(ToolSelectorView.class),
+ Mockito.mock(ToolSelectorProxy.class), stateManager);
+ toolSelectorItem1 = Mockito.mock(ToolSelectorItem.class);
+ toolSelectorItem2 = Mockito.mock(ToolSelectorItem.class);
+ }
+
+ @Test
+ public void setStateFirstMustSelect() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.onToolChanged("", TOOL1_NAME);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setSelected(true);
+ }
+
+ @Test
+ public void setStateWithADifferentGroupMustSetLink() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onGroupChanged(GROUP1_NAME);
+ Mockito.verify(toolSelectorItem1, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setGroupShortName(GROUP1_NAME);
+ }
+
+ @Test
+ public void setStateWithADifferentToolNameMustSelectAndUnSelectTheOlder() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onToolChanged(TOOL1_NAME, TOOL2_NAME);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(true);
+ }
+
+ @Test
+ public void setStateWithNoToolNameMustUnSelectTheOlder() {
+ setToolNames();
+ toolSelector.addTool(toolSelectorItem1);
+ toolSelector.addTool(toolSelectorItem2);
+ toolSelector.onToolChanged(TOOL1_NAME, "");
+ Mockito.verify(toolSelectorItem2, Mockito.times(1)).setSelected(false);
+ Mockito.verify(toolSelectorItem1, Mockito.times(2)).setSelected(false);
+ Mockito.verify(toolSelectorItem2, Mockito.never()).setSelected(true);
+ }
+
+ public void setToolNames() {
+ Mockito.when(toolSelectorItem1.getShortName()).thenReturn(TOOL1_NAME);
+ Mockito.when(toolSelectorItem2.getShortName()).thenReturn(TOOL2_NAME);
+ }
+
+}
More information about the kune-commits
mailing list