[kune-commits] r1131 - in trunk: .
src/main/java/org/ourproject/kune/platf/client
src/main/java/org/ourproject/kune/platf/client/actions
src/main/java/org/ourproject/kune/platf/client/actions/ui
src/main/java/org/ourproject/kune/platf/client/app
src/main/java/org/ourproject/kune/platf/client/dto
src/main/java/org/ourproject/kune/platf/client/services
src/main/java/org/ourproject/kune/platf/client/state
src/main/java/org/ourproject/kune/platf/client/ui
src/main/java/org/ourproject/kune/platf/client/ui/dialogs
src/main/java/org/ourproject/kune/platf/client/ui/download
src/main/java/org/ourproject/kune/platf/client/ui/img
src/main/java/org/ourproject/kune/platf/client/ui/rte/basic
src/main/java/org/ourproject/kune/platf/public/images
src/main/java/org/ourproject/kune/platf/server/manager/file
src/main/java/org/ourproject/kune/platf/server/users
src/main/java/org/ourproject/kune/workspace/client
src/main/java/org/ourproject/kune/workspace/client/entityheader
src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin
src/main/java/org/ourproject/kune/workspace/client/i18n
src/main/java/org/ourproject/kune/workspace/client/options
src/main/java/org/ourproject/kune/workspace/client/options/license
src/main/java/org/ourproject/kune/workspace/client/options/logo
src/main/java/org/ourproject/kune/workspace/client/options/pscape
src/main/java/org/ourproject/kune/workspace/client/options/tools
src/main/java/org/ourproject/kune/workspace/client/search
src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions
src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu
src/main/java/org/ourproject/kune/workspace/client/skel
src/test/java/org/ourproject/kune/platf/integration/selenium
vjrj
vjrj at ourproject.org
Sun Jun 28 00:41:21 CEST 2009
Author: vjrj
Date: 2009-06-28 00:41:14 +0200 (Sun, 28 Jun 2009)
New Revision: 1131
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/app/GroupOptionsCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/UserOptionsCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/arrow_in.png
trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/arrow_out.png
trunk/src/main/java/org/ourproject/kune/platf/public/images/prefs.png
trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptionsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptionsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptionsView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/GroupOptionsDefLicense.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/GroupOptionsDefLicensePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/UserOptionsDefLicense.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/UserOptionsDefLicensePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/GroupOptionsPublicSpaceConf.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/UserOptionsPublicSpaceConf.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/GroupOptionsToolConf.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/GroupOptionsToolsConfPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/UserOptionsToolsConf.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/UserOptionsToolsConfPresenter.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/app/EntityOptionsGroup.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java
Modified:
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/platf/client/PlatfMessages.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractAction.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractButtonGui.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuItemGui.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/ComplexToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiActionDescrip.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuGui.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateAbstractDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileConstants.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgResources.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/kimg.css
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java
trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspacePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspacePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspaceView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/SiteOptionsI18nTranslatorAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Entity.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java
trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java
Log:
Incomplete - task User/GroupOptions cleanup
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/pom.xml 2009-06-27 22:41:14 UTC (rev 1131)
@@ -80,7 +80,7 @@
<dependency>
<groupId>com.gwtext</groupId>
<artifactId>gwtext</artifactId>
- <version>2.0.6-r1872</version>
+ <version>2.0.5</version>
</dependency>
<dependency>
<groupId>com.gwtextux</groupId>
@@ -90,7 +90,7 @@
<dependency>
<groupId>com.allen_sauer.gwt.log.gwt-log</groupId>
<artifactId>gwt-log</artifactId>
- <version>2.5.3</version>
+ <version>2.6.0</version>
</dependency>
<dependency>
<groupId>com.allen_sauer.gwt.voices.gwt-voices</groupId>
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/PlatfMessages.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/PlatfMessages.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/PlatfMessages.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -31,8 +31,8 @@
public final static String USER_DOESN_T_HAVE_A_HOMEPAGE = "This user does not have a homepage";
public final static String ENT_LOGO_SELECTOR_NORMAL_TITLE = "Logo";
public final static String ENT_LOGO_SELECTOR_PERSON_TITLE = "Avatar";
- public final static String ENT_OPTIONS_GROUP_TITLE = "Group options";
- public final static String ENT_OPTIONS_USER_TITLE = "User options";
+ public final static String GROUP_OPTIONS_DIALOG_TITLE = "Group options";
+ public final static String USER_OPTIONS_DIALOG_TITLE = "User options";
private PlatfMessages() {
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractAction.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractAction.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -234,6 +234,10 @@
}
}
+ public void setShortcut(final KeyStroke key) {
+ putValue(Action.ACCELERATOR_KEY, key);
+ }
+
/**
* Sends a {@link PropertyChangeEvent} for the named property to all
* registered listeners.
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractButtonGui.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractButtonGui.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractButtonGui.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -22,6 +22,10 @@
super();
button = new Button();
button.setEnableToggle(enableTongle);
+ final String id = buttonDescriptor.getId();
+ if (id != null) {
+ button.setId(id);
+ }
initWidget(button);
button.addListener(new ButtonListenerAdapter() {
@Override
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuItemGui.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuItemGui.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/AbstractMenuItemGui.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -35,6 +35,10 @@
} else {
item = new Item();
}
+ final String id = descriptor.getId();
+ if (id != null) {
+ item.setId(id);
+ }
// initWidget(item);
final BaseItemListenerAdapter clickListener = new BaseItemListenerAdapter() {
@Override
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/ComplexToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/ComplexToolbar.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/ComplexToolbar.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -25,10 +25,16 @@
toolbar.addSpacer();
}
+ /**
+ * Set the blank/clean style
+ */
public void setCleanStyle() {
toolbar.setCleanStyle();
}
+ /**
+ * Set the normal grey style
+ */
public void setNormalStyle() {
toolbar.setNormalStyle();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiActionDescrip.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiActionDescrip.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/GuiActionDescrip.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -28,6 +28,9 @@
/** The item location. */
private String location;
+ /** The item DOM id. */
+ private String id;
+
/**
* Instantiates a new abstract ui action descriptor. This is used for
* describe UI button, menus, menu items and so on
@@ -49,6 +52,10 @@
return addCondition;
}
+ public String getId() {
+ return id;
+ }
+
/**
* Gets the location, a string used to group actions with locations (top
* bar, bottom bar, user bar...).
@@ -124,6 +131,10 @@
action.setEnabled(enabled);
}
+ public void setId(final String id) {
+ this.id = id;
+ }
+
/**
* 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
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuGui.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuGui.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/MenuGui.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -22,6 +22,10 @@
if (notStandAlone) {
button = new ToolbarButton();
button.setMenu(menu);
+ final String id = descriptor.getId();
+ if (id != null) {
+ button.setId(id);
+ }
initWidget(button);
} else {
initWidget(menu);
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/app/EntityOptionsGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/EntityOptionsGroup.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/EntityOptionsGroup.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package org.ourproject.kune.platf.client.app;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class EntityOptionsGroup extends ProviderCollection {
-
- public EntityOptionsGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/app/GroupOptionsCollection.java (from rev 1121, trunk/src/main/java/org/ourproject/kune/platf/client/app/EntityOptionsGroup.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/EntityOptionsGroup.java 2009-06-08 14:18:03 UTC (rev 1121)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/GroupOptionsCollection.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,38 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package org.ourproject.kune.platf.client.app;
+
+import com.calclab.suco.client.ioc.Container;
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.ioc.decorator.ProviderCollection;
+import com.calclab.suco.client.ioc.decorator.Singleton;
+
+public class GroupOptionsCollection extends ProviderCollection {
+
+ public GroupOptionsCollection(final Container container) {
+ super(container, Singleton.instance);
+ }
+
+ public void createAll() {
+ for (final Provider<?> p : getProviders()) {
+ p.get();
+ }
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/app/UserOptionsCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/UserOptionsCollection.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/UserOptionsCollection.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,38 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package org.ourproject.kune.platf.client.app;
+
+import com.calclab.suco.client.ioc.Container;
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.ioc.decorator.ProviderCollection;
+import com.calclab.suco.client.ioc.decorator.Singleton;
+
+public class UserOptionsCollection extends ProviderCollection {
+
+ public UserOptionsCollection(final Container container) {
+ super(container, Singleton.instance);
+ }
+
+ public void createAll() {
+ for (final Provider<?> p : getProviders()) {
+ p.get();
+ }
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateAbstractDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateAbstractDTO.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/StateAbstractDTO.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -70,23 +70,23 @@
return socialNetworkData.getUserBuddies();
}
- public void setEnabledTools(List<String> enabledTools) {
+ public void setEnabledTools(final List<String> enabledTools) {
this.enabledTools = enabledTools;
}
- public void setGroup(GroupDTO group) {
+ public void setGroup(final GroupDTO group) {
this.group = group;
}
- public void setSocialNetworkData(SocialNetworkDataDTO socialNetworkData) {
+ public void setSocialNetworkData(final SocialNetworkDataDTO socialNetworkData) {
this.socialNetworkData = socialNetworkData;
}
- public void setStateToken(StateToken stateToken) {
+ public void setStateToken(final StateToken stateToken) {
this.stateToken = stateToken;
}
- public void setTitle(String title) {
+ public void setTitle(final String title) {
this.title = title;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/UserInfoDTO.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -32,6 +32,7 @@
private List<GroupDTO> groupsIsAdmin;
private List<GroupDTO> groupsIsCollab;
private boolean showDeletedContent;
+ private List<String> enabledTools;
public String getChatName() {
return chatName;
@@ -45,6 +46,10 @@
return user.getCountry();
}
+ public List<String> getEnabledTools() {
+ return enabledTools;
+ }
+
public List<GroupDTO> getGroupsIsAdmin() {
return groupsIsAdmin;
}
@@ -90,6 +95,10 @@
}
+ public void setEnabledTools(final List<String> enabledTools) {
+ this.enabledTools = enabledTools;
+ }
+
public void setGroupsIsAdmin(final List<GroupDTO> groupsIsAdmin) {
this.groupsIsAdmin = groupsIsAdmin;
}
@@ -102,11 +111,11 @@
this.homePage = homePage;
}
- public void setShowDeletedContent(boolean showDeletedContent) {
+ public void setShowDeletedContent(final boolean showDeletedContent) {
this.showDeletedContent = showDeletedContent;
}
- public void setUser(UserSimpleDTO user) {
+ public void setUser(final UserSimpleDTO user) {
this.user = user;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/CoreModule.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -20,10 +20,11 @@
package org.ourproject.kune.platf.client.services;
import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
-import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
+import org.ourproject.kune.platf.client.app.GroupOptionsCollection;
import org.ourproject.kune.platf.client.app.HistoryWrapper;
import org.ourproject.kune.platf.client.app.HistoryWrapperDefault;
import org.ourproject.kune.platf.client.app.ToolGroup;
+import org.ourproject.kune.platf.client.app.UserOptionsCollection;
import org.ourproject.kune.platf.client.i18n.I18nUITranslationService;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.I18nService;
@@ -114,7 +115,8 @@
registerDecorator(ApplicationComponentGroup.class, new ApplicationComponentGroup(container));
registerDecorator(ToolGroup.class, new ToolGroup(container));
- registerDecorator(EntityOptionsGroup.class, new EntityOptionsGroup(container));
+ registerDecorator(GroupOptionsCollection.class, new GroupOptionsCollection(container));
+ registerDecorator(UserOptionsCollection.class, new UserOptionsCollection(container));
registerDecorator(InsertImageGroup.class, new InsertImageGroup(container));
registerDecorator(InsertMediaGroup.class, new InsertMediaGroup(container));
registerDecorator(InsertLinkGroup.class, new InsertLinkGroup(container));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -127,6 +127,8 @@
boolean isCurrentStateAContent();
+ boolean isCurrentStateAGroup();
+
boolean isLogged();
boolean isNotLogged();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -197,6 +197,10 @@
return currentState instanceof StateContentDTO;
}
+ public boolean isCurrentStateAGroup() {
+ return currentState == null ? false : !currentState.getGroup().isPersonal();
+ }
+
public boolean isLogged() {
return userHash != null;
}
@@ -247,7 +251,7 @@
assert (initData != null);
final Object[][] objs = new Object[initData.getCountries().size()][1];
int i = 0;
- for (I18nCountryDTO country : initData.getCountries()) {
+ for (final I18nCountryDTO country : initData.getCountries()) {
final Object[] obj = new Object[] { country.getCode(), country.getEnglishName() };
objs[i++] = obj;
}
@@ -258,7 +262,7 @@
assert (initData != null);
final Object[][] objs = new Object[initData.getLanguages().size()][1];
int i = 0;
- for (I18nLanguageSimpleDTO language : initData.getLanguages()) {
+ for (final I18nLanguageSimpleDTO language : initData.getLanguages()) {
final Object[] obj = new Object[] { language.getCode(), language.getEnglishName() };
objs[i++] = obj;
}
@@ -273,5 +277,4 @@
timezonesArray[i] = obj;
}
}
-
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -32,6 +32,7 @@
private final FlowPanel childPanel;
public FlowToolbar() {
+ super();
mainPanel = new HorizontalPanel();
childPanel = new FlowPanel();
mainPanel.add(childPanel);
@@ -42,7 +43,7 @@
childPanel.add(widget);
}
- public void add(final Widget widget, VerticalAlignmentConstant valign) {
+ public void add(final Widget widget, final VerticalAlignmentConstant valign) {
childPanel.add(widget);
}
@@ -70,7 +71,7 @@
return emptyLabel;
}
- public void insert(final Widget widget, int position) {
+ public void insert(final Widget widget, final int position) {
childPanel.insert(widget, position);
}
@@ -82,17 +83,23 @@
childPanel.clear();
}
+ /**
+ * Set the blank/clean style
+ */
public void setCleanStyle() {
setBasicStyle();
addStyleName("k-blank-toolbar");
}
@Override
- public void setHeight(String height) {
+ public void setHeight(final String height) {
mainPanel.setHeight(height);
childPanel.setHeight(height);
}
+ /**
+ * Set the normal grey style
+ */
public void setNormalStyle() {
setBasicStyle();
addStyleName("k-toolbar-bottom-line");
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -21,7 +21,10 @@
import com.gwtext.client.core.Ext;
import com.gwtext.client.core.Position;
+import com.gwtext.client.widgets.BoxComponent;
+import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Window;
+import com.gwtext.client.widgets.event.WindowListenerAdapter;
public class BasicDialog extends Window {
@@ -59,6 +62,23 @@
setResizable(true);
setCloseAction(Window.HIDE);
setButtonAlign(Position.RIGHT);
+ addListener(new WindowListenerAdapter() {
+ @Override
+ public void onMove(final BoxComponent component, final int x, final int y) {
+ checkPosition(component, x, y);
+ }
+
+ @Override
+ public void onShow(final Component component) {
+ checkPosition(BasicDialog.this, component.getAbsoluteLeft(), component.getAbsoluteTop());
+ }
+
+ private void checkPosition(final BoxComponent component, final int x, final int y) {
+ if (y < 0) {
+ component.setPagePosition(x, 0);
+ }
+ }
+ });
}
public BasicDialog(final String id, final String caption, final boolean modal, final boolean autoScroll,
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileConstants.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileConstants.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/download/FileConstants.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -27,7 +27,8 @@
public final static String IMGSIZE = "imgsize";
public final static String FILENAME = "filename";
public final static String TYPE_ID = "typeid";
- public final static String LOGO_FORM_FIELD = "k-elogov-ff";
+ public final static String USER_LOGO_FIELD = "k-ulogov-ff";
+ public final static String GROUP_LOGO_FIELD = "k-glogov-ff";
public final static int LOGO_DEF_HEIGHT = 60;
public final static int LOGO_DEF_WIDTH = 468;
public final static int LOGO_MIN_HEIGHT = 28;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgResources.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgResources.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/ImgResources.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -21,6 +21,12 @@
@Resource("language.png")
ImageResource language();
+ @Resource("arrow_out.png")
+ ImageResource maximize();
+
+ @Resource("arrow_in.png")
+ ImageResource minimize();
+
@Resource("prefs.png")
ImageResource prefs();
}
\ No newline at end of file
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/arrow_in.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/arrow_in.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/arrow_out.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/arrow_out.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/kimg.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/kimg.css 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/img/kimg.css 2009-06-27 22:41:14 UTC (rev 1131)
@@ -17,3 +17,11 @@
@sprite div .k-icon-groupHome {
gwt-image: 'groupHome';
}
+
+ at sprite div .k-icon-maximize {
+ gwt-image: 'maximize';
+}
+
+ at sprite div .k-icon-minimize {
+ gwt-image: 'minimize';
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -297,11 +297,9 @@
super.onBrowserEvent(event);
break;
case Event.ONKEYPRESS:
- final AbstractAction rtaActionItem = inputMap.get(KeyStroke.getKeyStrokeForEvent(event));
- // FIXME
- // final Action actionItem = rtaActionItem == null ?
- // globalShortcutReg.get(event) : rtaActionItem;
- final AbstractAction actionItem = rtaActionItem == null ? null : rtaActionItem;
+ final KeyStroke keystroke = KeyStroke.getKeyStrokeForEvent(event);
+ final AbstractAction rtaActionItem = inputMap.get(keystroke);
+ final AbstractAction actionItem = rtaActionItem == null ? globalShortcutReg.get(keystroke) : rtaActionItem;
if (actionItem == null) {
super.onBrowserEvent(event);
updateStatus();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/RTEditorPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -11,7 +11,6 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.AbstractAction;
import org.ourproject.kune.platf.client.actions.AbstractExtendedAction;
-import org.ourproject.kune.platf.client.actions.Action;
import org.ourproject.kune.platf.client.actions.ActionEvent;
import org.ourproject.kune.platf.client.actions.InputMap;
import org.ourproject.kune.platf.client.actions.KeyStroke;
@@ -812,13 +811,13 @@
public void setActionShortcut(final KeyStroke key, final AbstractAction action) {
inputMap.put(key, action);
- action.putValue(Action.ACCELERATOR_KEY, key);
+ action.setShortcut(key);
}
public void setActionShortcut(final KeyStroke key, final AbstractAction mainAction, final AbstractAction... actions) {
setActionShortcut(key, mainAction);
for (final AbstractAction action : actions) {
- action.putValue(Action.ACCELERATOR_KEY, key);
+ action.setShortcut(key);
}
}
@@ -835,7 +834,7 @@
view.focus();
}
- public void setLocation(final String location, final GuiActionDescrip[] descripts) {
+ public void setLocation(final String location, final GuiActionDescrip... descripts) {
for (final GuiActionDescrip descript : descripts) {
descript.setLocation(location);
}
Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/prefs.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/prefs.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/file/EntityLogoUploadManager.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -66,17 +66,17 @@
protected void createUploadedFile(final StateToken stateToken, final String mimeTypeS, final File origFile)
throws Exception, IOException, MagickException, FileNotFoundException {
- BasicMimeType mimeType = new BasicMimeType(mimeTypeS);
+ final BasicMimeType mimeType = new BasicMimeType(mimeTypeS);
if (!mimeType.getType().equals("image")) {
throw new Exception("Trying to set a non image (" + mimeTypeS + ") as group logo");
}
- Group group = groupManager.findByShortName(stateToken.getGroup());
+ final Group group = groupManager.findByShortName(stateToken.getGroup());
if (group == Group.NO_GROUP) {
throw new Exception("Group not found trying to set the logo");
}
- File tmpDestFile = File.createTempFile("logoDest", "");
+ final File tmpDestFile = File.createTempFile("logoDest", "");
final boolean result = ImageUtilsDefault.scaleImageToMax(origFile.getAbsolutePath(),
tmpDestFile.getAbsolutePath(), FileConstants.LOGO_DEF_HEIGHT);
@@ -97,8 +97,8 @@
@Transactional(type = TransactionType.READ_WRITE)
protected void createUploadedFile(final String userHash, final StateToken stateToken, final String fileName,
final FileItem file, final String typeId) throws Exception {
- String mimeTypeS = file.getContentType();
- File tmpOrigFile = File.createTempFile("logoOrig", "");
+ final String mimeTypeS = file.getContentType();
+ final File tmpOrigFile = File.createTempFile("logoOrig", "");
file.write(tmpOrigFile);
createUploadedFile(stateToken, mimeTypeS, tmpOrigFile);
logFileDel(tmpOrigFile.delete());
@@ -129,8 +129,9 @@
**/
protected String createXmlResponse(final boolean success, final String message) {
String error = "";
+ // FIXME: Use Group/User field when necessary
if (!success) {
- error = "<errors><field><id>" + FileConstants.LOGO_FORM_FIELD + "</id><msg><![CDATA[" + message
+ error = "<errors><field><id>" + FileConstants.GROUP_LOGO_FIELD + "</id><msg><![CDATA[" + message
+ "]]></msg></field></errors>";
}
return "<response success=\"" + success + "\">" + error + "</response>";
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfo.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -35,6 +35,7 @@
private List<Group> groupsIsCollab;
private String userHash;
private boolean showDeletedContent;
+ private List<String> enabledTools;
public String getChatName() {
return chatName;
@@ -48,6 +49,10 @@
return user.getCountry();
}
+ public List<String> getEnabledTools() {
+ return enabledTools;
+ }
+
public List<Group> getGroupsIsAdmin() {
return groupsIsAdmin;
}
@@ -92,6 +97,10 @@
this.chatPassword = chatPassword;
}
+ public void setEnabledTools(final List<String> enabledTools) {
+ this.enabledTools = enabledTools;
+ }
+
public void setGroupsIsAdmin(final List<Group> groupsIsAdmin) {
this.groupsIsAdmin = groupsIsAdmin;
}
@@ -104,11 +113,11 @@
this.homePage = homePage;
}
- public void setShowDeletedContent(boolean showDeletedContent) {
+ public void setShowDeletedContent(final boolean showDeletedContent) {
this.showDeletedContent = showDeletedContent;
}
- public void setUser(User user) {
+ public void setUser(final User user) {
this.user = user;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/users/UserInfoServiceDefault.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -23,6 +23,7 @@
import org.ourproject.kune.platf.server.domain.Content;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.User;
+import org.ourproject.kune.platf.server.manager.GroupManager;
import org.ourproject.kune.platf.server.manager.SocialNetworkManager;
import org.ourproject.kune.platf.server.sn.ParticipationData;
@@ -33,10 +34,12 @@
public class UserInfoServiceDefault implements UserInfoService {
private final SocialNetworkManager socialNetworkManager;
+ private final GroupManager groupManager;
@Inject
- public UserInfoServiceDefault(final SocialNetworkManager socialNetwork) {
+ public UserInfoServiceDefault(final SocialNetworkManager socialNetwork, final GroupManager groupManager) {
this.socialNetworkManager = socialNetwork;
+ this.groupManager = groupManager;
}
public UserInfo buildInfo(final User user, final String userHash) throws DefaultException {
@@ -56,7 +59,7 @@
final ParticipationData participation = socialNetworkManager.findParticipation(user, userGroup);
info.setGroupsIsAdmin(participation.getGroupsIsAdmin());
info.setGroupsIsCollab(participation.getGroupsIsCollab());
-
+ info.setEnabledTools(groupManager.findEnabledTools(userGroup.getId()));
final Content defaultContent = userGroup.getDefaultContent();
if (defaultContent != null) {
info.setHomePage(defaultContent.getStateToken().toString());
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -24,7 +24,8 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
import org.ourproject.kune.platf.client.actions.ui.GuiBindingsRegister;
import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
-import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
+import org.ourproject.kune.platf.client.app.GroupOptionsCollection;
+import org.ourproject.kune.platf.client.app.UserOptionsCollection;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.StateTokenUtils;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
@@ -126,22 +127,33 @@
import org.ourproject.kune.workspace.client.nohomepage.NoHomePagePanel;
import org.ourproject.kune.workspace.client.nohomepage.NoHomePagePresenter;
import org.ourproject.kune.workspace.client.options.EntityOptions;
-import org.ourproject.kune.workspace.client.options.EntityOptionsPanel;
-import org.ourproject.kune.workspace.client.options.EntityOptionsPresenter;
import org.ourproject.kune.workspace.client.options.GroupOptions;
+import org.ourproject.kune.workspace.client.options.GroupOptionsPanel;
+import org.ourproject.kune.workspace.client.options.GroupOptionsPresenter;
import org.ourproject.kune.workspace.client.options.UserOptions;
-import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicense;
+import org.ourproject.kune.workspace.client.options.UserOptionsPanel;
+import org.ourproject.kune.workspace.client.options.UserOptionsPresenter;
import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicensePanel;
-import org.ourproject.kune.workspace.client.options.license.EntityOptionsDefLicensePresenter;
-import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogo;
-import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogoPanel;
+import org.ourproject.kune.workspace.client.options.license.GroupOptionsDefLicense;
+import org.ourproject.kune.workspace.client.options.license.GroupOptionsDefLicensePresenter;
+import org.ourproject.kune.workspace.client.options.license.UserOptionsDefLicense;
+import org.ourproject.kune.workspace.client.options.license.UserOptionsDefLicensePresenter;
import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogoPresenter;
-import org.ourproject.kune.workspace.client.options.pscape.EntityOptionsPublicSpaceConf;
+import org.ourproject.kune.workspace.client.options.logo.GroupOptionsLogo;
+import org.ourproject.kune.workspace.client.options.logo.GroupOptionsLogoPanel;
+import org.ourproject.kune.workspace.client.options.logo.GroupOptionsLogoPresenter;
+import org.ourproject.kune.workspace.client.options.logo.UserOptionsLogo;
+import org.ourproject.kune.workspace.client.options.logo.UserOptionsLogoPanel;
+import org.ourproject.kune.workspace.client.options.logo.UserOptionsLogoPresenter;
import org.ourproject.kune.workspace.client.options.pscape.EntityOptionsPublicSpaceConfPanel;
import org.ourproject.kune.workspace.client.options.pscape.EntityOptionsPublicSpaceConfPresenter;
+import org.ourproject.kune.workspace.client.options.pscape.GroupOptionsPublicSpaceConf;
+import org.ourproject.kune.workspace.client.options.pscape.UserOptionsPublicSpaceConf;
import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConf;
import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConfPanel;
-import org.ourproject.kune.workspace.client.options.tools.EntityOptionsToolsConfPresenter;
+import org.ourproject.kune.workspace.client.options.tools.GroupOptionsToolsConfPresenter;
+import org.ourproject.kune.workspace.client.options.tools.UserOptionsToolsConf;
+import org.ourproject.kune.workspace.client.options.tools.UserOptionsToolsConfPresenter;
import org.ourproject.kune.workspace.client.rate.RateIt;
import org.ourproject.kune.workspace.client.rate.RateItPanel;
import org.ourproject.kune.workspace.client.rate.RateItPresenter;
@@ -416,7 +428,7 @@
final EntityHeaderPresenter presenter = new EntityHeaderPresenter(i(StateManager.class),
i(WsThemePresenter.class), i(Session.class));
final EntityHeaderPanel panel = new EntityHeaderPanel(i(WorkspaceSkeleton.class),
- p(FileDownloadUtils.class), i(Images.class));
+ p(FileDownloadUtils.class), i(Images.class), i(GuiBindingsRegister.class));
presenter.init(panel);
return presenter;
}
@@ -608,37 +620,49 @@
}
});
- register(ApplicationComponentGroup.class, new Factory<EntityOptions>(EntityOptions.class) {
+ register(ApplicationComponentGroup.class, new Factory<GroupOptions>(GroupOptions.class) {
@Override
- public EntityOptions create() {
- final EntityOptionsPresenter presenter = new EntityOptionsPresenter(i(StateManager.class));
- final EntityOptionsPanel panel = new EntityOptionsPanel(presenter, i(EntityHeader.class),
- i(I18nTranslationService.class), i(Images.class), i(EntityOptionsGroup.class));
+ public GroupOptions create() {
+ final GroupOptionsPresenter presenter = new GroupOptionsPresenter(i(StateManager.class),
+ i(I18nTranslationService.class), i(ImgResources.class));
+ final GroupOptionsPanel panel = new GroupOptionsPanel(presenter, i(EntityHeader.class),
+ i(I18nTranslationService.class), i(Images.class), i(GroupOptionsCollection.class));
presenter.init(panel);
return presenter;
}
});
- register(Singleton.class, new Factory<GroupOptions>(GroupOptions.class) {
+ register(ApplicationComponentGroup.class, new Factory<UserOptions>(UserOptions.class) {
@Override
- public GroupOptions create() {
- return (GroupOptions) i(EntityOptions.class);
+ public UserOptions create() {
+ final UserOptionsPresenter presenter = new UserOptionsPresenter(i(Session.class),
+ i(I18nTranslationService.class), i(ImgResources.class), i(SiteUserOptions.class));
+ final UserOptionsPanel panel = new UserOptionsPanel(presenter, i(EntityHeader.class),
+ i(I18nTranslationService.class), i(Images.class), i(UserOptionsCollection.class));
+ presenter.init(panel);
+ return presenter;
}
});
- register(Singleton.class, new Factory<UserOptions>(UserOptions.class) {
+ register(GroupOptionsCollection.class, new Factory<EntityOptionsToolsConf>(EntityOptionsToolsConf.class) {
@Override
- public UserOptions create() {
- return (UserOptions) i(EntityOptions.class);
+ public EntityOptionsToolsConf create() {
+ final GroupOptionsToolsConfPresenter presenter = new GroupOptionsToolsConfPresenter(
+ i(StateManager.class), i(Session.class), i(I18nTranslationService.class),
+ i(GroupOptions.class), p(GroupServiceAsync.class));
+ final EntityOptionsToolsConfPanel panel = new EntityOptionsToolsConfPanel(presenter,
+ i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
}
});
- register(EntityOptionsGroup.class, new Factory<EntityOptionsToolsConf>(EntityOptionsToolsConf.class) {
+ register(UserOptionsCollection.class, new Factory<UserOptionsToolsConf>(UserOptionsToolsConf.class) {
@Override
- public EntityOptionsToolsConf create() {
- final EntityOptionsToolsConfPresenter presenter = new EntityOptionsToolsConfPresenter(
- i(StateManager.class), i(Session.class), i(I18nTranslationService.class),
- i(EntityOptions.class), p(GroupServiceAsync.class));
+ public UserOptionsToolsConf create() {
+ final UserOptionsToolsConfPresenter presenter = new UserOptionsToolsConfPresenter(i(Session.class),
+ i(StateManager.class), i(I18nTranslationService.class), i(UserOptions.class),
+ p(GroupServiceAsync.class));
final EntityOptionsToolsConfPanel panel = new EntityOptionsToolsConfPanel(presenter,
i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
presenter.init(panel);
@@ -646,24 +670,37 @@
}
});
- register(EntityOptionsGroup.class, new Factory<EntityOptionsLogo>(EntityOptionsLogo.class) {
+ register(GroupOptionsCollection.class, new Factory<GroupOptionsLogo>(GroupOptionsLogo.class) {
@Override
- public EntityOptionsLogo create() {
- final EntityOptionsLogoPresenter presenter = new EntityOptionsLogoPresenter(i(Session.class),
- i(EntityHeader.class), i(EntityOptions.class), i(StateManager.class),
- p(UserServiceAsync.class), p(ChatEngine.class));
- final EntityOptionsLogoPanel panel = new EntityOptionsLogoPanel(presenter, i(WorkspaceSkeleton.class),
+ public GroupOptionsLogo create() {
+ final EntityOptionsLogoPresenter presenter = new GroupOptionsLogoPresenter(i(Session.class),
+ i(EntityHeader.class), i(GroupOptions.class), i(StateManager.class), p(UserServiceAsync.class),
+ p(ChatEngine.class));
+ final GroupOptionsLogoPanel panel = new GroupOptionsLogoPanel(presenter, i(WorkspaceSkeleton.class),
i(I18nTranslationService.class));
presenter.init(panel);
return presenter;
}
});
- register(EntityOptionsGroup.class, new Factory<EntityOptionsDefLicense>(EntityOptionsDefLicense.class) {
+ register(UserOptionsCollection.class, new Factory<UserOptionsLogo>(UserOptionsLogo.class) {
@Override
- public EntityOptionsDefLicense create() {
- final EntityOptionsDefLicensePresenter presenter = new EntityOptionsDefLicensePresenter(
- i(EntityOptions.class), i(StateManager.class), i(Session.class), p(LicenseWizard.class),
+ public UserOptionsLogo create() {
+ final EntityOptionsLogoPresenter presenter = new UserOptionsLogoPresenter(i(Session.class),
+ i(EntityHeader.class), i(UserOptions.class), i(StateManager.class), p(UserServiceAsync.class),
+ p(ChatEngine.class));
+ final UserOptionsLogoPanel panel = new UserOptionsLogoPanel(presenter, i(WorkspaceSkeleton.class),
+ i(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(GroupOptionsCollection.class, new Factory<GroupOptionsDefLicense>(GroupOptionsDefLicense.class) {
+ @Override
+ public GroupOptionsDefLicense create() {
+ final GroupOptionsDefLicensePresenter presenter = new GroupOptionsDefLicensePresenter(
+ i(GroupOptions.class), i(StateManager.class), i(Session.class), p(LicenseWizard.class),
p(LicenseChangeAction.class));
final EntityOptionsDefLicensePanel panel = new EntityOptionsDefLicensePanel(presenter,
i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
@@ -672,17 +709,31 @@
}
});
- register(EntityOptionsGroup.class,
- new Factory<EntityOptionsPublicSpaceConf>(EntityOptionsPublicSpaceConf.class) {
+ register(UserOptionsCollection.class, new Factory<UserOptionsDefLicense>(UserOptionsDefLicense.class) {
+ @Override
+ public UserOptionsDefLicense create() {
+ final UserOptionsDefLicensePresenter presenter = new UserOptionsDefLicensePresenter(
+ i(UserOptions.class), i(Session.class), p(LicenseWizard.class), p(LicenseChangeAction.class));
+ final EntityOptionsDefLicensePanel panel = new EntityOptionsDefLicensePanel(presenter,
+ i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
+ presenter.init(panel);
+ return presenter;
+ }
+ });
+
+ register(GroupOptionsCollection.class, new Factory<GroupOptionsPublicSpaceConf>(
+ GroupOptionsPublicSpaceConf.class) {
+ @Override
+ public GroupOptionsPublicSpaceConf create() {
+ return createEntityOptionsPublicSpace(i(GroupOptions.class));
+ }
+ });
+
+ register(UserOptionsCollection.class,
+ new Factory<UserOptionsPublicSpaceConf>(UserOptionsPublicSpaceConf.class) {
@Override
- public EntityOptionsPublicSpaceConf create() {
- final EntityOptionsPublicSpaceConfPresenter presenter = new EntityOptionsPublicSpaceConfPresenter(
- i(EntityOptions.class));
- final EntityOptionsPublicSpaceConfPanel panel = new EntityOptionsPublicSpaceConfPanel(
- presenter, i(WorkspaceSkeleton.class), i(I18nTranslationService.class),
- i(WsThemePresenter.class));
- presenter.init(panel);
- return presenter;
+ public UserOptionsPublicSpaceConf create() {
+ return createEntityOptionsPublicSpace(i(UserOptions.class));
}
});
@@ -984,9 +1035,10 @@
register(ApplicationComponentGroup.class, new Factory<MaxMinWorkspace>(MaxMinWorkspace.class) {
@Override
public MaxMinWorkspace create() {
- final MaxMinWorkspacePresenter presenter = new MaxMinWorkspacePresenter();
- final MaxMinWorkspacePanel panel = new MaxMinWorkspacePanel(presenter, i(WorkspaceSkeleton.class),
- i(Images.class), i(EntityHeader.class), i(I18nTranslationService.class));
+ final MaxMinWorkspacePresenter presenter = new MaxMinWorkspacePresenter(
+ i(GlobalShortcutRegister.class), i(ImgResources.class), i(I18nTranslationService.class),
+ i(SiteOptions.class));
+ final MaxMinWorkspacePanel panel = new MaxMinWorkspacePanel(i(WorkspaceSkeleton.class));
presenter.init(panel);
return presenter;
}
@@ -1024,4 +1076,12 @@
i(GlobalShortcutRegister.class).enable();
}
+
+ private EntityOptionsPublicSpaceConfPresenter createEntityOptionsPublicSpace(final EntityOptions entityOptions) {
+ final EntityOptionsPublicSpaceConfPresenter presenter = new EntityOptionsPublicSpaceConfPresenter(entityOptions);
+ final EntityOptionsPublicSpaceConfPanel panel = new EntityOptionsPublicSpaceConfPanel(presenter,
+ i(WorkspaceSkeleton.class), i(I18nTranslationService.class), i(WsThemePresenter.class));
+ presenter.init(panel);
+ return presenter;
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -20,9 +20,12 @@
package org.ourproject.kune.workspace.client.entityheader;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.ui.GuiActionDescrip;
public interface EntityHeader {
+ void addAction(GuiActionDescrip descriptor);
+
void addWidget(View widget);
/**
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -22,6 +22,9 @@
import java.util.Date;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.ui.ComplexToolbar;
+import org.ourproject.kune.platf.client.actions.ui.GuiActionDescrip;
+import org.ourproject.kune.platf.client.actions.ui.GuiBindingsRegister;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.services.Images;
@@ -41,25 +44,34 @@
private final Provider<FileDownloadUtils> downloadProvider;
private final EntityTextLogo entityTextLogo;
private final Images images;
- private final VerticalPanel vp;
+ private final VerticalPanel vpanel;
+ private final ComplexToolbar toolbar;
- public EntityHeaderPanel(final WorkspaceSkeleton ws, final Provider<FileDownloadUtils> downloadProvider,
- final Images images) {
+ public EntityHeaderPanel(final WorkspaceSkeleton wskel, final Provider<FileDownloadUtils> downloadProvider,
+ final Images images, final GuiBindingsRegister bindings) {
+ super();
super.setWidth("100%");
this.downloadProvider = downloadProvider;
this.images = images;
- vp = new VerticalPanel();
- vp.setWidth("100%");
- vp.setHorizontalAlignment(ALIGN_RIGHT);
+ vpanel = new VerticalPanel();
+ vpanel.setWidth("100%");
+ vpanel.setHorizontalAlignment(ALIGN_RIGHT);
entityTextLogo = new EntityTextLogo();
add(entityTextLogo);
- add(vp);
- ws.addToEntityMainHeader(this);
+ toolbar = new ComplexToolbar(bindings);
+ toolbar.setCleanStyle();
+ vpanel.add(toolbar);
+ add(vpanel);
+ wskel.addToEntityMainHeader(this);
}
+ public void addAction(final GuiActionDescrip descriptor) {
+ toolbar.add(descriptor);
+ }
+
public void addWidget(final View view) {
- Widget widget = (Widget) view;
- vp.add(widget);
+ final Widget widget = (Widget) view;
+ vpanel.add(widget);
}
public void reloadImage(final GroupDTO group) {
@@ -72,12 +84,11 @@
final String imageUrl = downloadProvider.get().getImageUrl(stateToken);
Image logo;
if (clipped) {
- logo = new Image(imageUrl, 0, 0, FileConstants.LOGO_DEF_WIDTH,
- FileConstants.LOGO_DEF_HEIGHT);
+ logo = new Image(imageUrl, 0, 0, FileConstants.LOGO_DEF_WIDTH, FileConstants.LOGO_DEF_HEIGHT);
} else {
logo = new Image(imageUrl);
- logo.setWidth("" + FileConstants.LOGO_DEF_WIDTH);
- logo.setHeight("" + FileConstants.LOGO_DEF_HEIGHT);
+ logo.setWidth(String.valueOf(FileConstants.LOGO_DEF_WIDTH));
+ logo.setHeight(String.valueOf(FileConstants.LOGO_DEF_HEIGHT));
}
add(logo);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -20,6 +20,7 @@
package org.ourproject.kune.workspace.client.entityheader;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.ui.GuiActionDescrip;
import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.state.Session;
@@ -51,6 +52,10 @@
});
}
+ public void addAction(final GuiActionDescrip descriptor) {
+ view.addAction(descriptor);
+ }
+
public void addWidget(final View widget) {
view.addWidget(widget);
}
@@ -87,7 +92,7 @@
}
void setLogoText(final String name) {
- int length = name.length();
+ final int length = name.length();
if (length <= LARGE_NAME_LIMIT) {
view.setLargeFont();
} else if (length <= MEDIUM_NAME_LIMIT) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -20,12 +20,15 @@
package org.ourproject.kune.workspace.client.entityheader;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.ui.GuiActionDescrip;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.workspace.client.themes.WsTheme;
public interface EntityHeaderView {
+ void addAction(GuiActionDescrip descriptor);
+
void addWidget(View view);
void reloadImage(GroupDTO group);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspace.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspace.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -2,4 +2,8 @@
public interface MaxMinWorkspace {
+ void maximize();
+
+ void minimize();
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspacePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspacePanel.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspacePanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -1,53 +1,16 @@
package org.ourproject.kune.workspace.client.entityheader.maxmin;
-import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeaderButton;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-
public class MaxMinWorkspacePanel implements MaxMinWorkspaceView {
- public static final String MIN_ICON = "mmwp-min_bt";
- public static final String MAX_ICON = "mmwp-max_bt";
- private final WorkspaceSkeleton ws;
- private final EntityHeaderButton maxBtn;
- private final EntityHeaderButton minBtn;
+ private final WorkspaceSkeleton wskel;
- public MaxMinWorkspacePanel(final MaxMinWorkspacePresenter presenter, final WorkspaceSkeleton ws,
- final Images images, final EntityHeader entityHeader, final I18nTranslationService i18n) {
- this.ws = ws;
- maxBtn = new EntityHeaderButton("", images.arrowOut());
- minBtn = new EntityHeaderButton("", images.arrowIn());
- maxBtn.setTitle(i18n.t("Maximize the workspace"));
- minBtn.setTitle(i18n.t("Minimize the workspace"));
- maxBtn.addClickHandler(new ClickHandler() {
- public void onClick(final ClickEvent event) {
- presenter.onMaximize();
- }
- });
- minBtn.addClickHandler(new ClickHandler() {
- public void onClick(final ClickEvent event) {
- presenter.onMinimize();
- }
- });
- minBtn.setVisible(false);
- minBtn.ensureDebugId(MIN_ICON);
- maxBtn.ensureDebugId(MAX_ICON);
- entityHeader.addWidget(maxBtn);
- entityHeader.addWidget(minBtn);
+ public MaxMinWorkspacePanel(final WorkspaceSkeleton wskel) {
+ this.wskel = wskel;
}
public void setMaximized(final boolean maximized) {
- ws.setMaximized(maximized);
+ wskel.setMaximized(maximized);
}
-
- public void showMaxButton(final boolean showMax) {
- maxBtn.setVisible(showMax);
- minBtn.setVisible(!showMax);
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspacePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspacePresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspacePresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -1,32 +1,117 @@
package org.ourproject.kune.workspace.client.entityheader.maxmin;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.AbstractExtendedAction;
+import org.ourproject.kune.platf.client.actions.Action;
+import org.ourproject.kune.platf.client.actions.ActionEvent;
+import org.ourproject.kune.platf.client.actions.KeyStroke;
+import org.ourproject.kune.platf.client.actions.Shortcut;
+import org.ourproject.kune.platf.client.actions.ui.MenuItemDescriptor;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister;
+import org.ourproject.kune.platf.client.ui.img.ImgResources;
+import org.ourproject.kune.workspace.client.sitebar.siteoptions.SiteOptions;
+import com.google.gwt.libideas.resources.client.ImageResource;
+
public class MaxMinWorkspacePresenter implements MaxMinWorkspace {
+ public class MaximizeAction extends AbstractExtendedAction {
+ public MaximizeAction(final String name, final ImageResource img) {
+ super();
+ putValue(Action.NAME, name);
+ putValue(Action.SMALL_ICON, img);
+ }
+ public void actionPerformed(final ActionEvent event) {
+ showMaximized(true);
+ }
+ }
+ public class MinimizeAction extends AbstractExtendedAction {
+ public MinimizeAction(final String name, final ImageResource img) {
+ super();
+ putValue(Action.NAME, name);
+ putValue(Action.SMALL_ICON, img);
+ }
+
+ public void actionPerformed(final ActionEvent event) {
+ showMaximized(false);
+ }
+ }
+
+ public static final String MIN_ICON = "mmwp-min_bt";
+ public static final String MAX_ICON = "mmwp-max_bt";
private MaxMinWorkspaceView view;
- public MaxMinWorkspacePresenter() {
+ private boolean maximized;
+
+ private final ImgResources images;
+
+ private final I18nTranslationService i18n;
+
+ private final GlobalShortcutRegister shortcutReg;
+
+ private MenuItemDescriptor maximizeButton;
+
+ private MenuItemDescriptor minimizeButton;
+ private final SiteOptions siteOptions;
+
+ public MaxMinWorkspacePresenter(final GlobalShortcutRegister shortcutReg, final ImgResources images,
+ final I18nTranslationService i18n, final SiteOptions siteOptions) {
+ this.shortcutReg = shortcutReg;
+ this.images = images;
+ this.i18n = i18n;
+ this.siteOptions = siteOptions;
+ maximized = false;
+
}
public View getView() {
return view;
}
- public void init(MaxMinWorkspaceView view) {
+ public void init(final MaxMinWorkspaceView view) {
this.view = view;
+ createActions();
}
- public void onMaximize() {
+ public void maximize() {
showMaximized(true);
}
- public void onMinimize() {
+ public void minimize() {
showMaximized(false);
}
- private void showMaximized(boolean maximized) {
+ private void createActions() {
+ final KeyStroke shortcut = Shortcut.getShortcut(true, true, false, false, Character.valueOf('F'));
+
+ final MaximizeAction maximizeAction = new MaximizeAction(i18n.t("Maximize the workspace"), images.maximize());
+ maximizeAction.setShortcut(shortcut);
+ maximizeButton = new MenuItemDescriptor(maximizeAction);
+ maximizeButton.setPosition(0);
+ maximizeButton.setId(MAX_ICON);
+
+ final MinimizeAction minimizeAction = new MinimizeAction(i18n.t("Minimize the workspace"), images.minimize());
+ minimizeAction.setShortcut(shortcut);
+ minimizeButton = new MenuItemDescriptor(minimizeAction);
+ minimizeButton.setPosition(1);
+ minimizeButton.setVisible(false);
+ minimizeButton.setId(MIN_ICON);
+
+ shortcutReg.put(shortcut, new AbstractExtendedAction() {
+ public void actionPerformed(final ActionEvent event) {
+ showMaximized(!maximized);
+ }
+ });
+
+ siteOptions.addAction(maximizeButton);
+ siteOptions.addAction(minimizeButton);
+ }
+
+ private void showMaximized(final boolean maximized) {
+ maximizeButton.setVisible(!maximized);
+ minimizeButton.setVisible(maximized);
+ this.maximized = maximized;
view.setMaximized(maximized);
- view.showMaxButton(!maximized);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspaceView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspaceView.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/MaxMinWorkspaceView.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -6,5 +6,4 @@
void setMaximized(boolean maximized);
- void showMaxButton(boolean showMax);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -39,11 +39,14 @@
import com.gwtext.client.data.Store;
import com.gwtext.client.data.StringFieldDef;
import com.gwtext.client.util.Format;
+import com.gwtext.client.widgets.BoxComponent;
import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.TabPanel;
import com.gwtext.client.widgets.Window;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.event.WindowListenerAdapter;
import com.gwtext.client.widgets.form.ComboBox;
import com.gwtext.client.widgets.form.TextField;
import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
@@ -182,7 +185,23 @@
dialog.add(center, new BorderLayoutData(RegionPosition.CENTER));
center.setActiveItemID(unTransCenterPanel.getId());
+ dialog.addListener(new WindowListenerAdapter() {
+ @Override
+ public void onMove(final BoxComponent component, final int x, final int y) {
+ checkPosition(component, x, y);
+ }
+ @Override
+ public void onShow(final Component component) {
+ checkPosition(dialog, component.getAbsoluteLeft(), component.getAbsoluteTop());
+ }
+
+ private void checkPosition(final BoxComponent component, final int x, final int y) {
+ if (y < 0) {
+ component.setPagePosition(x, 0);
+ }
+ }
+ });
return dialog;
}
@@ -192,10 +211,10 @@
public String render(final Object value, final CellMetadata cellMetadata, final Record record,
final int rowIndex, final int colNum, final Store store) {
String renderer;
- String[] splitted = splitNT((String) value);
+ final String[] splitted = splitNT((String) value);
if (splitted.length > 1) {
renderer = "{0} " + img.nt().getHTML();
- String tip = "<div style='min-width: 75px'>" + splitted[1] + "</div>";
+ final String tip = "<div style='min-width: 75px'>" + splitted[1] + "</div>";
cellMetadata.setHtmlAttribute("ext:qtip=\"" + tip + "\" ext:qtitle=\"Note for translators\"");
} else {
renderer = "{0}";
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/SiteOptionsI18nTranslatorAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/SiteOptionsI18nTranslatorAction.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/SiteOptionsI18nTranslatorAction.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -20,7 +20,7 @@
putValue(Action.NAME, i18n.t("Help with the translation"));
putValue(Action.SMALL_ICON, img.language());
final MenuItemDescriptor item = new MenuItemDescriptor(this);
- item.setPosition(0);
+ item.setPosition(1);
siteOptions.addAction(item);
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -1,91 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.options;
-
-import org.ourproject.kune.platf.client.PlatfMessages;
-import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
-import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeaderButton;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-
-public class EntityOptionsPanel extends AbstractTabbedDialogPanel implements EntityOptionsView {
-
- public static final String ENTITY_OP_PANEL_ID = "k-eop-diagpan";
- public static final String GROUP_OPTIONS_ERROR_ID = "k-eop-err-mess";
- public static final String GROUP_OPTIONS_ICON = "k-eop-icon";
- private final I18nTranslationService i18n;
- private final EntityHeader entityHeader;
- private EntityHeaderButton optionsButton;
- private final Images images;
-
- private final EntityOptionsGroup entityPreferencesGroup;
-
- public EntityOptionsPanel(final EntityOptions presenter, final EntityHeader entityHeader,
- final I18nTranslationService i18n, final Images images, final EntityOptionsGroup entityOptionsGroup) {
- super(ENTITY_OP_PANEL_ID, "", 400, HEIGHT + 80, 400, HEIGHT + 80, false, images, GROUP_OPTIONS_ERROR_ID);
- this.entityHeader = entityHeader;
- this.i18n = i18n;
- this.images = images;
- this.entityPreferencesGroup = entityOptionsGroup;
- super.setIconCls("k-options-icon");
- createOptionsButton();
- }
-
- @Override
- public void createAndShow() {
- // FIXME: use onAfterCreate in Factory/Module
- createAndShowItImpl();
- }
-
- public void setButtonVisible(final boolean visible) {
- optionsButton.setVisible(visible);
- }
-
- public void setGroupTitle() {
- super.setTitle(i18n.t(PlatfMessages.ENT_OPTIONS_GROUP_TITLE));
- optionsButton.setText(i18n.t(PlatfMessages.ENT_OPTIONS_GROUP_TITLE));
- }
-
- public void setPersonalTitle() {
- super.setTitle(i18n.t(PlatfMessages.ENT_OPTIONS_USER_TITLE));
- optionsButton.setText(i18n.t(PlatfMessages.ENT_OPTIONS_USER_TITLE));
- }
-
- private void createAndShowItImpl() {
- entityPreferencesGroup.createAll();
- super.createAndShow();
- }
-
- private void createOptionsButton() {
- optionsButton = new EntityHeaderButton("", images.emblemSystem());
- optionsButton.addClickHandler(new ClickHandler() {
- public void onClick(final ClickEvent event) {
- createAndShowItImpl();
- }
- });
- optionsButton.ensureDebugId(GROUP_OPTIONS_ICON);
- entityHeader.addWidget(optionsButton);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -1,54 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.options;
-
-import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
-
-import com.calclab.suco.client.events.Listener;
-
-public class EntityOptionsPresenter extends AbstractTabbedDialogPresenter implements GroupOptions, UserOptions {
-
- private EntityOptionsView view;
-
- public EntityOptionsPresenter(final StateManager stateManager) {
- stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
- public void onEvent(final StateAbstractDTO state) {
- if (state.getGroup().isPersonal()) {
- view.setPersonalTitle();
- } else {
- view.setGroupTitle();
- }
- if (state.getGroupRights().isAdministrable()) {
- view.setButtonVisible(true);
- } else {
- view.setButtonVisible(false);
- view.hide();
- }
- }
- });
- }
-
- public void init(final EntityOptionsView view) {
- super.init(view);
- this.view = view;
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsView.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsView.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -25,9 +25,4 @@
int HEIGHT = 270;
- void setButtonVisible(boolean visible);
-
- void setGroupTitle();
-
- void setPersonalTitle();
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptionsPanel.java (from rev 1121, trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java 2009-06-08 14:18:03 UTC (rev 1121)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptionsPanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,60 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.platf.client.PlatfMessages;
+import org.ourproject.kune.platf.client.actions.ui.GuiActionDescrip;
+import org.ourproject.kune.platf.client.app.GroupOptionsCollection;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
+import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
+
+public class GroupOptionsPanel extends AbstractTabbedDialogPanel implements GroupOptionsView {
+
+ public static final String GROUP_OP_PANEL_ID = "k-gop-diagpan";
+ public static final String GROUP_OPTIONS_ERROR_ID = "k-gop-err-mess";
+ private final EntityHeader entityHeader;
+
+ private final GroupOptionsCollection entityPreferencesGroup;
+
+ public GroupOptionsPanel(final EntityOptions presenter, final EntityHeader entityHeader,
+ final I18nTranslationService i18n, final Images images, final GroupOptionsCollection entityOptionsGroup) {
+ super(GROUP_OP_PANEL_ID, "", 400, HEIGHT + 80, 400, HEIGHT + 80, false, images, GROUP_OPTIONS_ERROR_ID);
+ this.entityHeader = entityHeader;
+ this.entityPreferencesGroup = entityOptionsGroup;
+ super.setIconCls("k-options-icon");
+ super.setTitle(i18n.t(PlatfMessages.GROUP_OPTIONS_DIALOG_TITLE));
+ }
+
+ public void addAction(final GuiActionDescrip descriptor) {
+ entityHeader.addAction(descriptor);
+ }
+
+ @Override
+ public void createAndShow() {
+ createAndShowItImpl();
+ }
+
+ private void createAndShowItImpl() {
+ entityPreferencesGroup.createAll();
+ super.createAndShow();
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptionsPresenter.java (from rev 1129, trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java 2009-06-14 20:00:52 UTC (rev 1129)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptionsPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,76 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.platf.client.actions.AbstractExtendedAction;
+import org.ourproject.kune.platf.client.actions.Action;
+import org.ourproject.kune.platf.client.actions.ActionEvent;
+import org.ourproject.kune.platf.client.actions.ui.ButtonDescriptor;
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
+import org.ourproject.kune.platf.client.ui.img.ImgConstants;
+import org.ourproject.kune.platf.client.ui.img.ImgResources;
+
+import com.calclab.suco.client.events.Listener;
+
+public class GroupOptionsPresenter extends AbstractTabbedDialogPresenter implements GroupOptions {
+ public static final String GROUP_OPTIONS_ICON = "k-eop-icon";
+ private GroupOptionsView view;
+ private final I18nTranslationService i18n;
+ private final ImgResources img;
+ private ButtonDescriptor prefsItem;
+
+ public GroupOptionsPresenter(final StateManager stateManager, final I18nTranslationService i18n,
+ final ImgResources img) {
+ this.i18n = i18n;
+ this.img = img;
+ stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
+ public void onEvent(final StateAbstractDTO state) {
+ if (!state.getGroup().isPersonal() && state.getGroupRights().isAdministrable()) {
+ prefsItem.setVisible(true);
+ } else {
+ view.hide();
+ prefsItem.setVisible(false);
+ }
+ }
+ });
+ }
+
+ public void init(final GroupOptionsView view) {
+ super.init(view);
+ this.view = view;
+ createActions();
+ }
+
+ private void createActions() {
+ final AbstractExtendedAction groupPrefsAction = new AbstractExtendedAction() {
+ public void actionPerformed(final ActionEvent event) {
+ show();
+ }
+ };
+ groupPrefsAction.putValue(Action.NAME, i18n.t("Group options"));
+ groupPrefsAction.putValue(Action.SMALL_ICON, ImgConstants.toPath(img.prefs()));
+ prefsItem = new ButtonDescriptor(groupPrefsAction);
+ prefsItem.setId(GROUP_OPTIONS_ICON);
+ view.addAction(prefsItem);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptionsView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptionsView.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/GroupOptionsView.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.platf.client.actions.ui.GuiActionDescrip;
+
+public interface GroupOptionsView extends EntityOptionsView {
+
+ void addAction(GuiActionDescrip descriptor);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsPanel.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsPanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,53 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.platf.client.PlatfMessages;
+import org.ourproject.kune.platf.client.app.UserOptionsCollection;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPanel;
+import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
+
+public class UserOptionsPanel extends AbstractTabbedDialogPanel implements UserOptionsView {
+
+ public static final String USER_OP_PANEL_ID = "k-uop-diagpan";
+ public static final String USER_OPTIONS_ERROR_ID = "k-uop-err-mess";
+
+ private final UserOptionsCollection userPreferencesGroup;
+
+ public UserOptionsPanel(final EntityOptions presenter, final EntityHeader entityHeader,
+ final I18nTranslationService i18n, final Images images, final UserOptionsCollection userOptionsGroup) {
+ super(USER_OP_PANEL_ID, "", 400, HEIGHT + 80, 400, HEIGHT + 80, false, images, USER_OPTIONS_ERROR_ID);
+ this.userPreferencesGroup = userOptionsGroup;
+ super.setIconCls("k-options-icon");
+ super.setTitle(i18n.t(PlatfMessages.USER_OPTIONS_DIALOG_TITLE));
+ }
+
+ @Override
+ public void createAndShow() {
+ createAndShowItImpl();
+ }
+
+ private void createAndShowItImpl() {
+ userPreferencesGroup.createAll();
+ super.createAndShow();
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,71 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.platf.client.actions.AbstractExtendedAction;
+import org.ourproject.kune.platf.client.actions.Action;
+import org.ourproject.kune.platf.client.actions.ActionEvent;
+import org.ourproject.kune.platf.client.actions.ui.MenuItemDescriptor;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
+import org.ourproject.kune.platf.client.ui.img.ImgResources;
+import org.ourproject.kune.workspace.client.sitebar.siteusermenu.SiteUserOptions;
+
+import com.calclab.suco.client.events.Listener0;
+
+public class UserOptionsPresenter extends AbstractTabbedDialogPresenter implements UserOptions {
+
+ private UserOptionsView view;
+ private final ImgResources img;
+ private final I18nTranslationService i18n;
+ private final SiteUserOptions userOptions;
+
+ public UserOptionsPresenter(final Session session, final I18nTranslationService i18n, final ImgResources img,
+ final SiteUserOptions userOptions) {
+ this.i18n = i18n;
+ this.img = img;
+ this.userOptions = userOptions;
+ session.onUserSignOut(new Listener0() {
+ public void onEvent() {
+ view.hide();
+ }
+ });
+ }
+
+ public void init(final UserOptionsView view) {
+ super.init(view);
+ this.view = view;
+ createActions();
+ }
+
+ private void createActions() {
+ final AbstractExtendedAction userPrefsAction = new AbstractExtendedAction() {
+ public void actionPerformed(final ActionEvent event) {
+ show();
+ }
+ };
+ userPrefsAction.putValue(Action.NAME, i18n.t("Your preferences"));
+ userPrefsAction.putValue(Action.SMALL_ICON, img.prefs());
+ final MenuItemDescriptor prefsItem = new MenuItemDescriptor(userPrefsAction);
+ prefsItem.setPosition(1);
+ userOptions.addAction(prefsItem);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsView.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/UserOptionsView.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.options;
+
+public interface UserOptionsView extends EntityOptionsView {
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/EntityOptionsDefLicensePresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -22,42 +22,36 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.licensewizard.LicenseChangeAction;
import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
import org.ourproject.kune.workspace.client.options.EntityOptions;
import com.calclab.suco.client.events.Listener;
import com.calclab.suco.client.events.Listener0;
-import com.calclab.suco.client.events.Listener2;
import com.calclab.suco.client.ioc.Provider;
-public class EntityOptionsDefLicensePresenter implements EntityOptionsDefLicense {
+public abstract class EntityOptionsDefLicensePresenter {
private EntityOptionsDefLicenseView view;
private final EntityOptions entityOptions;
- private final Session session;
+ protected final Session session;
private final Provider<LicenseWizard> licenseWizard;
- private final Provider<LicenseChangeAction> licenseChangeAction;
+ private final Provider<LicenseChangeAction> licChangeAction;
- public EntityOptionsDefLicensePresenter(EntityOptions entityOptions, StateManager stateManager, Session session,
- Provider<LicenseWizard> licenseWizard, Provider<LicenseChangeAction> licenseChangeAction) {
+ public EntityOptionsDefLicensePresenter(final EntityOptions entityOptions, final Session session,
+ final Provider<LicenseWizard> licenseWizard, final Provider<LicenseChangeAction> licChangeAction) {
this.entityOptions = entityOptions;
this.session = session;
this.licenseWizard = licenseWizard;
- this.licenseChangeAction = licenseChangeAction;
- stateManager.onGroupChanged(new Listener2<String, String>() {
- public void onEvent(String group1, String group2) {
- setState();
- }
- });
+ this.licChangeAction = licChangeAction;
+
}
public View getView() {
return view;
}
- public void init(EntityOptionsDefLicenseView view) {
+ public void init(final EntityOptionsDefLicenseView view) {
this.view = view;
entityOptions.addTab(view);
setState();
@@ -66,7 +60,7 @@
public void onChange() {
licenseWizard.get().start(new Listener<LicenseDTO>() {
public void onEvent(final LicenseDTO license) {
- licenseChangeAction.get().changeLicense(license, new Listener0() {
+ licChangeAction.get().changeLicense(license, new Listener0() {
public void onEvent() {
setLicense(license);
}
@@ -79,15 +73,17 @@
view.openWindow(getCurrentDefLicense().getUrl());
}
- private LicenseDTO getCurrentDefLicense() {
- return session.getCurrentState().getGroup().getDefaultLicense();
+ protected abstract boolean applicable();
+
+ protected abstract LicenseDTO getCurrentDefLicense();
+
+ protected void setState() {
+ if (applicable()) {
+ setLicense(getCurrentDefLicense());
+ }
}
- private void setLicense(LicenseDTO license) {
+ private void setLicense(final LicenseDTO license) {
view.setLicense(license);
}
-
- private void setState() {
- setLicense(getCurrentDefLicense());
- }
}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/GroupOptionsDefLicense.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/GroupOptionsDefLicense.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/GroupOptionsDefLicense.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.options.license;
+
+public interface GroupOptionsDefLicense extends EntityOptionsDefLicense {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/GroupOptionsDefLicensePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/GroupOptionsDefLicensePresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/GroupOptionsDefLicensePresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,35 @@
+package org.ourproject.kune.workspace.client.options.license;
+
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseChangeAction;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
+import org.ourproject.kune.workspace.client.options.EntityOptions;
+
+import com.calclab.suco.client.events.Listener2;
+import com.calclab.suco.client.ioc.Provider;
+
+public class GroupOptionsDefLicensePresenter extends EntityOptionsDefLicensePresenter implements GroupOptionsDefLicense {
+
+ public GroupOptionsDefLicensePresenter(final EntityOptions entityOptions, final StateManager stateManager,
+ final Session session, final Provider<LicenseWizard> licenseWizard,
+ final Provider<LicenseChangeAction> licChangeAction) {
+ super(entityOptions, session, licenseWizard, licChangeAction);
+ stateManager.onGroupChanged(new Listener2<String, String>() {
+ public void onEvent(final String group1, final String group2) {
+ setState();
+ }
+ });
+ }
+
+ @Override
+ protected boolean applicable() {
+ return session.isCurrentStateAGroup();
+ }
+
+ @Override
+ protected LicenseDTO getCurrentDefLicense() {
+ return session.getCurrentState().getGroup().getDefaultLicense();
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/UserOptionsDefLicense.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/UserOptionsDefLicense.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/UserOptionsDefLicense.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.options.license;
+
+public interface UserOptionsDefLicense extends EntityOptionsDefLicense {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/UserOptionsDefLicensePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/UserOptionsDefLicensePresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/license/UserOptionsDefLicensePresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,34 @@
+package org.ourproject.kune.workspace.client.options.license;
+
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseChangeAction;
+import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
+import org.ourproject.kune.workspace.client.options.EntityOptions;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.ioc.Provider;
+
+public class UserOptionsDefLicensePresenter extends EntityOptionsDefLicensePresenter implements UserOptionsDefLicense {
+
+ public UserOptionsDefLicensePresenter(final EntityOptions entityOptions, final Session session,
+ final Provider<LicenseWizard> licenseWizard, final Provider<LicenseChangeAction> licChangeAction) {
+ super(entityOptions, session, licenseWizard, licChangeAction);
+ session.onUserSignIn(new Listener<UserInfoDTO>() {
+ public void onEvent(final UserInfoDTO parameter) {
+ setState();
+ }
+ });
+ }
+
+ @Override
+ protected boolean applicable() {
+ return session.isCurrentStateAGroup();
+ }
+
+ @Override
+ protected LicenseDTO getCurrentDefLicense() {
+ return session.getCurrentState().getGroup().getDefaultLicense();
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -42,19 +42,18 @@
import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
import com.gwtext.client.widgets.form.event.FormListener;
-public class EntityOptionsLogoPanel extends FormPanel implements EntityOptionsLogoView {
+public abstract class EntityOptionsLogoPanel extends FormPanel implements EntityOptionsLogoView {
- public static final String ICON_UPLOAD_SERVLET = "/ws/servlets/EntityLogoUploadManager";
- public static final String SET_LOGO_ID = "k-eolp-sendb";
- public static final String PANEL_ID = "k-eolp-pan";
+ public static final String ICON_UPLD_SERVLET = "/ws/servlets/EntityLogoUploadManager";
private final Hidden userhashField;
private final Hidden tokenField;
private final TextField file;
private final Label dialogInfoLabel;
private final I18nTranslationService i18n;
- public EntityOptionsLogoPanel(final EntityOptionsLogoPresenter presenter, final WorkspaceSkeleton ws,
- final I18nTranslationService i18n) {
+ public EntityOptionsLogoPanel(final EntityOptionsLogoPresenter presenter, final WorkspaceSkeleton wskel,
+ final I18nTranslationService i18n, final String panelId, final String buttonId, final String inputId) {
+ super();
this.i18n = i18n;
super.setHeight(EntityOptionsView.HEIGHT);
super.setButtonAlign(Position.LEFT);
@@ -65,7 +64,7 @@
super.setWidth(400);
super.setIconCls("k-picture-icon");
super.setMethod(Connection.POST);
- super.setUrl(ICON_UPLOAD_SERVLET);
+ super.setUrl(ICON_UPLD_SERVLET);
super.setWaitMsgTarget(true);
super.setHideLabels(true);
super.setPaddings(10);
@@ -84,21 +83,21 @@
});
dialogInfoLabel = new Label();
super.add(dialogInfoLabel);
- file = new TextField("File", FileConstants.LOGO_FORM_FIELD);
- EventCallback keyListener = new EventCallback() {
+ file = new TextField("File", inputId);
+ final EventCallback keyListener = new EventCallback() {
public void execute(final EventObject e) {
// setEnableFileField();
}
};
file.addKeyPressListener(keyListener);
- file.setId(FileConstants.LOGO_FORM_FIELD);
+ file.setId(inputId);
file.setInputType("file");
userhashField = new Hidden(FileConstants.HASH, FileConstants.HASH);
tokenField = new Hidden(FileConstants.TOKEN, FileConstants.TOKEN);
super.add(userhashField);
super.add(tokenField);
super.add(file);
- FieldListenerAdapter changeListener = new FieldListenerAdapter() {
+ final FieldListenerAdapter changeListener = new FieldListenerAdapter() {
@Override
public void onChange(final Field field, final Object newVal, final Object oldVal) {
NotifyUser.info("change");
@@ -107,18 +106,18 @@
};
// Don't works:
file.addListener(changeListener);
- setId(PANEL_ID);
+ setId(panelId);
- Button sendButton = new Button(i18n.t("Send"), new ButtonListenerAdapter() {
+ final Button sendButton = new Button(i18n.t("Send"), new ButtonListenerAdapter() {
@Override
public void onClick(final Button button, final EventObject e) {
- String filename = file.getValueAsString();
+ final String filename = file.getValueAsString();
if (filename != null && filename.length() > 0) {
getForm().submit();
}
}
});
- sendButton.setId(SET_LOGO_ID);
+ sendButton.setId(buttonId);
super.addButton(sendButton);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/EntityOptionsLogoPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -21,74 +21,51 @@
import org.ourproject.kune.chat.client.ChatEngine;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.noti.NotifyUser;
import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
import org.ourproject.kune.workspace.client.options.EntityOptions;
-import com.calclab.suco.client.events.Listener2;
import com.calclab.suco.client.ioc.Provider;
-public class EntityOptionsLogoPresenter implements EntityOptionsLogo {
+public abstract class EntityOptionsLogoPresenter implements GroupOptionsLogo, UserOptionsLogo {
- private EntityOptionsLogoView view;
- private final Session session;
+ protected EntityOptionsLogoView view;
+ protected final Session session;
private final EntityHeader entityLogo;
private final EntityOptions entityOptions;
- private final Provider<UserServiceAsync> userService;
- private final Provider<ChatEngine> chatEngine;
+ protected final Provider<UserServiceAsync> userService;
+ protected final Provider<ChatEngine> chatEngine;
- public EntityOptionsLogoPresenter(Session session, EntityHeader entityLogo, EntityOptions entityOptions,
- StateManager stateManager, Provider<UserServiceAsync> userService, Provider<ChatEngine> chatEngine) {
+ public EntityOptionsLogoPresenter(final Session session, final EntityHeader entityLogo,
+ final EntityOptions entityOptions, final Provider<UserServiceAsync> userService,
+ final Provider<ChatEngine> chatEngine) {
this.session = session;
this.entityLogo = entityLogo;
this.entityOptions = entityOptions;
this.userService = userService;
this.chatEngine = chatEngine;
- stateManager.onGroupChanged(new Listener2<String, String>() {
- public void onEvent(String group1, String group2) {
- setState();
- }
- });
}
public View getView() {
return view;
}
- public void init(EntityOptionsLogoView view) {
+ public void init(final EntityOptionsLogoView view) {
this.view = view;
entityOptions.addTab(view);
setState();
}
- public void onSubmitComplete(int httpStatus, String photoBinary) {
+ public void onSubmitComplete(final int httpStatus, final String photoBinary) {
entityLogo.reloadGroupLogoImage();
- GroupDTO group = session.getCurrentState().getGroup();
- if (session.getCurrentUser().getShortName().equals(group.getShortName())) {
- userService.get().getUserAvatarBaser64(session.getUserHash(), group.getStateToken(),
- new AsyncCallbackSimple<String>() {
- public void onSuccess(String photoBinary) {
- chatEngine.get().setAvatar(photoBinary);
- }
- });
- }
}
- public void onSubmitFailed(int httpStatus, String responseText) {
- NotifyUser.error("Error setting the group logo: " + responseText);
+ public void onSubmitFailed(final int httpStatus, final String responseText) {
+ NotifyUser.error("Error setting the logo: " + responseText);
}
- private void setState() {
- view.setUploadParams(session.getUserHash(), session.getCurrentStateToken().toString());
- if (session.getCurrentState().getGroup().isPersonal()) {
- view.setPersonalGroupsLabels();
- } else {
- view.setNormalGroupsLabels();
- }
- }
+ protected abstract void setState();
+
}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogo.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogo.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.options.logo;
+
+public interface GroupOptionsLogo extends EntityOptionsLogo {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogoPanel.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogoPanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,16 @@
+package org.ourproject.kune.workspace.client.options.logo;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.download.FileConstants;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+public class GroupOptionsLogoPanel extends EntityOptionsLogoPanel {
+ public static final String PANEL_ID = "k-golp-pan";
+ public static final String BUTTON_ID = "k-golp-sendb";
+
+ public GroupOptionsLogoPanel(final EntityOptionsLogoPresenter presenter, final WorkspaceSkeleton wskel,
+ final I18nTranslationService i18n) {
+ super(presenter, wskel, i18n, PANEL_ID, BUTTON_ID, FileConstants.GROUP_LOGO_FIELD);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogoPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/GroupOptionsLogoPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,36 @@
+package org.ourproject.kune.workspace.client.options.logo;
+
+import org.ourproject.kune.chat.client.ChatEngine;
+import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
+import org.ourproject.kune.workspace.client.options.EntityOptions;
+
+import com.calclab.suco.client.events.Listener2;
+import com.calclab.suco.client.ioc.Provider;
+
+public class GroupOptionsLogoPresenter extends EntityOptionsLogoPresenter {
+
+ public GroupOptionsLogoPresenter(final Session session, final EntityHeader entityLogo,
+ final EntityOptions entityOptions, final StateManager stateManager,
+ final Provider<UserServiceAsync> userService, final Provider<ChatEngine> chatEngine) {
+ super(session, entityLogo, entityOptions, userService, chatEngine);
+ stateManager.onGroupChanged(new Listener2<String, String>() {
+ public void onEvent(final String group1, final String group2) {
+ setState();
+ }
+ });
+ }
+
+ @Override
+ public void init(final EntityOptionsLogoView view) {
+ super.init(view);
+ view.setNormalGroupsLabels();
+ }
+
+ @Override
+ protected void setState() {
+ view.setUploadParams(session.getUserHash(), session.getCurrentStateToken().toString());
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogo.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogo.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.options.logo;
+
+public interface UserOptionsLogo extends EntityOptionsLogo {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogoPanel.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogoPanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,16 @@
+package org.ourproject.kune.workspace.client.options.logo;
+
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.download.FileConstants;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+public class UserOptionsLogoPanel extends EntityOptionsLogoPanel {
+ public static final String PANEL_ID = "k-uolp-pan";
+ public static final String BUTTON_ID = "k-uolp-sendb";
+
+ public UserOptionsLogoPanel(final EntityOptionsLogoPresenter presenter, final WorkspaceSkeleton wskel,
+ final I18nTranslationService i18n) {
+ super(presenter, wskel, i18n, PANEL_ID, BUTTON_ID, FileConstants.USER_LOGO_FIELD);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogoPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/logo/UserOptionsLogoPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,53 @@
+package org.ourproject.kune.workspace.client.options.logo;
+
+import org.ourproject.kune.chat.client.ChatEngine;
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.UserServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
+import org.ourproject.kune.workspace.client.options.EntityOptions;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.ioc.Provider;
+
+public class UserOptionsLogoPresenter extends EntityOptionsLogoPresenter {
+
+ public UserOptionsLogoPresenter(final Session session, final EntityHeader entityLogo,
+ final EntityOptions entityOptions, final StateManager stateManager,
+ final Provider<UserServiceAsync> userService, final Provider<ChatEngine> chatEngine) {
+ super(session, entityLogo, entityOptions, userService, chatEngine);
+ session.onUserSignIn(new Listener<UserInfoDTO>() {
+ public void onEvent(final UserInfoDTO parameter) {
+ setState();
+ }
+ });
+ }
+
+ @Override
+ public void init(final EntityOptionsLogoView view) {
+ super.init(view);
+ view.setPersonalGroupsLabels();
+ }
+
+ @Override
+ public void onSubmitComplete(final int httpStatus, final String photoBinary) {
+ super.onSubmitComplete(httpStatus, photoBinary);
+ final GroupDTO group = session.getCurrentState().getGroup();
+ if (session.getCurrentUser().getShortName().equals(group.getShortName())) {
+ userService.get().getUserAvatarBaser64(session.getUserHash(), group.getStateToken(),
+ new AsyncCallbackSimple<String>() {
+ public void onSuccess(final String photoBinary) {
+ chatEngine.get().setAvatar(photoBinary);
+ }
+ });
+ }
+ }
+
+ @Override
+ protected void setState() {
+ view.setUploadParams(session.getUserHash(), session.getCurrentUser().getStateToken().toString());
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/EntityOptionsPublicSpaceConfPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -22,12 +22,12 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.workspace.client.options.EntityOptions;
-public class EntityOptionsPublicSpaceConfPresenter implements EntityOptionsPublicSpaceConf {
+public class EntityOptionsPublicSpaceConfPresenter implements GroupOptionsPublicSpaceConf, UserOptionsPublicSpaceConf {
private EntityOptionsPublicSpaceConfView view;
private final EntityOptions entityOptions;
- public EntityOptionsPublicSpaceConfPresenter(EntityOptions entityOptions) {
+ public EntityOptionsPublicSpaceConfPresenter(final EntityOptions entityOptions) {
this.entityOptions = entityOptions;
}
@@ -35,7 +35,7 @@
return view;
}
- public void init(EntityOptionsPublicSpaceConfView view) {
+ public void init(final EntityOptionsPublicSpaceConfView view) {
this.view = view;
entityOptions.addTab(view);
}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/GroupOptionsPublicSpaceConf.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/GroupOptionsPublicSpaceConf.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/GroupOptionsPublicSpaceConf.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.options.pscape;
+
+public interface GroupOptionsPublicSpaceConf extends EntityOptionsPublicSpaceConf {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/UserOptionsPublicSpaceConf.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/UserOptionsPublicSpaceConf.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/pscape/UserOptionsPublicSpaceConf.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.options.pscape;
+
+public interface UserOptionsPublicSpaceConf extends EntityOptionsPublicSpaceConf {
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPanel.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -41,7 +41,7 @@
private final I18nTranslationService i18n;
public EntityOptionsToolsConfPanel(final EntityOptionsToolsConfPresenter presenter, final WorkspaceSkeleton ws,
- I18nTranslationService i18n) {
+ final I18nTranslationService i18n) {
super(i18n.t("Tools"));
this.i18n = i18n;
super.setHeight(EntityOptionsView.HEIGHT);
@@ -53,13 +53,14 @@
}
public void add(final ToolSimpleDTO tool) {
- Checkbox checkbox = new Checkbox(tool.getRootName(), new CheckboxListenerAdapter() {
+ final Checkbox checkbox = new Checkbox(tool.getRootName());
+ checkbox.setChecked(false);
+ checkbox.addListener(new CheckboxListenerAdapter() {
@Override
- public void onCheck(Checkbox field, boolean checked) {
+ public void onCheck(final Checkbox field, final boolean checked) {
presenter.onCheck(tool, checked);
}
});
- checkbox.setChecked(false);
super.add(checkbox);
fields.put(tool.getName(), checkbox);
doLayoutIfNeeded();
@@ -68,18 +69,18 @@
public void clear() {
super.getFormPanel().removeAll(true);
fields.clear();
- Label label = new Label();
+ final Label label = new Label();
label.setHtml(i18n.t("Here you can select the tools used:") + "<br/><br/>");
super.add(label);
}
- public void setChecked(String tool, boolean checked) {
- Checkbox field = getTool(tool);
+ public void setChecked(final String tool, final boolean checked) {
+ final Checkbox field = getTool(tool);
field.setValue(checked);
}
- public void setEnabled(String tool, boolean enabled) {
- Checkbox field = getTool(tool);
+ public void setEnabled(final String tool, final boolean enabled) {
+ final Checkbox field = getTool(tool);
if (enabled) {
field.enable();
} else {
@@ -87,9 +88,9 @@
}
}
- public void setTooltip(String tool, String tip) {
- Checkbox field = getTool(tool);
- ToolTip tooltip = new ToolTip();
+ public void setTooltip(final String tool, final String tip) {
+ final Checkbox field = getTool(tool);
+ final ToolTip tooltip = new ToolTip();
tooltip.setHtml(tip);
tooltip.setWidth(250);
tooltip.applyTo(field);
@@ -103,8 +104,8 @@
}
}
- private Checkbox getTool(String tool) {
- Checkbox field = fields.get(tool);
+ private Checkbox getTool(final String tool) {
+ final Checkbox field = fields.get(tool);
if (field == null) {
Log.error("Field " + tool + " not found in EOTCP");
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -1,29 +1,10 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
package org.ourproject.kune.workspace.client.options.tools;
import java.util.Collection;
+import java.util.List;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
-import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.ToolSimpleDTO;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
@@ -32,32 +13,26 @@
import org.ourproject.kune.platf.client.ui.noti.NotifyUser.Level;
import org.ourproject.kune.workspace.client.options.EntityOptions;
-import com.calclab.suco.client.events.Listener2;
import com.calclab.suco.client.ioc.Provider;
import com.google.gwt.user.client.rpc.AsyncCallback;
-public class EntityOptionsToolsConfPresenter implements EntityOptionsToolsConf {
+public abstract class EntityOptionsToolsConfPresenter {
private EntityOptionsToolsConfView view;
- private final Session session;
private final EntityOptions entityOptions;
+ protected final Session session;
private final Provider<GroupServiceAsync> groupServiceProvider;
- private final I18nTranslationService i18n;
- private final StateManager stateManager;
+ protected final I18nTranslationService i18n;
+ protected final StateManager stateManager;
- public EntityOptionsToolsConfPresenter(final StateManager stateManager, final Session session,
+ public EntityOptionsToolsConfPresenter(final Session session, final StateManager stateManager,
final I18nTranslationService i18n, final EntityOptions entityOptions,
final Provider<GroupServiceAsync> groupServiceProvider) {
- this.stateManager = stateManager;
this.session = session;
+ this.stateManager = stateManager;
this.i18n = i18n;
this.entityOptions = entityOptions;
this.groupServiceProvider = groupServiceProvider;
- stateManager.onGroupChanged(new Listener2<String, String>() {
- public void onEvent(final String group1, final String group2) {
- setState();
- }
- });
}
public View getView() {
@@ -71,62 +46,65 @@
}
public void onCheck(final ToolSimpleDTO tool, final boolean checked) {
- StateAbstractDTO state = session.getCurrentState();
- String toolName = tool.getName();
+ final List<String> enabledTools = getEnabledTools();
+ final String toolName = tool.getName();
if (checked) {
- if (!(state.getEnabledTools().contains(toolName))) {
- // Log.info("Tool " + tool.getName() + " checked: " + checked +
- // " enabled tools: "
- // + state.getEnabledTools().toString());
+ if (!(enabledTools.contains(toolName))) {
setToolCheckedInServer(checked, toolName);
} else {
// do nothing
}
} else {
- if (state.getEnabledTools().contains(tool.getName())) {
- // Log.info("Tool " + tool.getName() + " checked: " + checked);
+ if (enabledTools.contains(toolName)) {
setToolCheckedInServer(checked, toolName);
- if (session.getCurrentStateToken().getTool().equals(toolName)) {
- stateManager.gotoToken(session.getCurrentState().getGroup().getDefaultContent().getStateToken());
- }
+ gotoDifLocationIfNecessary(toolName);
}
}
}
- private void reset() {
+ protected abstract boolean applicable();
+
+ protected abstract Collection<ToolSimpleDTO> getAllTools();
+
+ protected abstract StateToken getDefContentToken();
+
+ protected abstract String getDefContentTooltip();
+
+ protected abstract List<String> getEnabledTools();
+
+ protected abstract StateToken getOperationToken();
+
+ protected abstract void gotoDifLocationIfNecessary(String toolName);
+
+ protected void reset() {
view.clear();
entityOptions.hideMessages();
}
- private void setState() {
- StateAbstractDTO state = session.getCurrentState();
+ protected void setState() {
reset();
- Collection<ToolSimpleDTO> toolCollection;
- if (state.getGroup().isPersonal()) {
- toolCollection = session.getUserTools();
- } else {
- toolCollection = session.getGroupTools();
- }
- for (ToolSimpleDTO tool : toolCollection) {
+ final Collection<ToolSimpleDTO> toolCollection = getAllTools();
+ for (final ToolSimpleDTO tool : toolCollection) {
view.add(tool);
view.setEnabled(tool.getName(), true);
}
- for (String tool : state.getEnabledTools()) {
+ for (final String tool : getEnabledTools()) {
view.setChecked(tool, true);
}
- ContentSimpleDTO defaultContent = session.getCurrentState().getGroup().getDefaultContent();
- if (defaultContent != null) {
- String defContentTool = defaultContent.getStateToken().getTool();
- view.setEnabled(defContentTool, false);
- view.setTooltip(
- defContentTool,
- i18n.t("You cannot disable this tool because it's where the current group home page is located. To do that you have to select other content as the default group home page but in another tool."));
+
+ final StateToken token = getDefContentToken();
+ if (token != null) {
+ final String defContentTool = token.getTool();
+ if (defContentTool != null) {
+ view.setEnabled(defContentTool, false);
+ view.setTooltip(defContentTool, getDefContentTooltip());
+ }
}
}
- private void setToolCheckedInServer(final boolean checked, final String toolName) {
- groupServiceProvider.get().setToolEnabled(session.getUserHash(), session.getCurrentStateToken(), toolName,
- checked, new AsyncCallback<Object>() {
+ protected void setToolCheckedInServer(final boolean checked, final String toolName) {
+ groupServiceProvider.get().setToolEnabled(session.getUserHash(), getOperationToken(), toolName, checked,
+ new AsyncCallback<Object>() {
public void onFailure(final Throwable caught) {
view.setChecked(toolName, !checked);
entityOptions.setErrorMessage(i18n.t("Error configuring the tool"), Level.error);
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/GroupOptionsToolConf.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/GroupOptionsToolConf.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/GroupOptionsToolConf.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.options.tools;
+
+public interface GroupOptionsToolConf extends EntityOptionsToolsConf {
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/GroupOptionsToolsConfPresenter.java (from rev 1121, trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/EntityOptionsToolsConfPresenter.java 2009-06-08 14:18:03 UTC (rev 1121)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/GroupOptionsToolsConfPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,91 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.options.tools;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.dto.ToolSimpleDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.options.EntityOptions;
+
+import com.calclab.suco.client.events.Listener2;
+import com.calclab.suco.client.ioc.Provider;
+
+public class GroupOptionsToolsConfPresenter extends EntityOptionsToolsConfPresenter implements GroupOptionsToolConf {
+
+ public GroupOptionsToolsConfPresenter(final StateManager stateManager, final Session session,
+ final I18nTranslationService i18n, final EntityOptions entityOptions,
+ final Provider<GroupServiceAsync> groupService) {
+ super(session, stateManager, i18n, entityOptions, groupService);
+ stateManager.onGroupChanged(new Listener2<String, String>() {
+ public void onEvent(final String group1, final String group2) {
+ setState();
+ }
+ });
+ }
+
+ @Override
+ protected boolean applicable() {
+ return session.isCurrentStateAGroup();
+ }
+
+ @Override
+ protected Collection<ToolSimpleDTO> getAllTools() {
+ return session.getGroupTools();
+ }
+
+ @Override
+ protected StateToken getDefContentToken() {
+ final ContentSimpleDTO defaultContent = session.getCurrentState().getGroup().getDefaultContent();
+ return defaultContent == null ? null : defaultContent.getStateToken();
+ }
+
+ @Override
+ protected String getDefContentTooltip() {
+ return i18n.t("You cannot disable this tool because it's where the current group home page is located. To do that you have to select other content as the default group home page but in another tool.");
+ }
+
+ @Override
+ protected List<String> getEnabledTools() {
+ return session.getCurrentState().getEnabledTools();
+ }
+
+ @Override
+ protected StateToken getOperationToken() {
+ return session.getCurrentStateToken();
+ }
+
+ @Override
+ protected void gotoDifLocationIfNecessary(final String toolName) {
+ if (session.getCurrentStateToken().getTool().equals(toolName)) {
+ final ContentSimpleDTO defaultContent = session.getCurrentState().getGroup().getDefaultContent();
+ if (defaultContent != null) {
+ stateManager.gotoToken(defaultContent.getStateToken());
+ }
+ }
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/UserOptionsToolsConf.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/UserOptionsToolsConf.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/UserOptionsToolsConf.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.options.tools;
+
+public interface UserOptionsToolsConf extends EntityOptionsToolsConf {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/UserOptionsToolsConfPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/UserOptionsToolsConfPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/tools/UserOptionsToolsConfPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -0,0 +1,88 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.options.tools;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.dto.ToolSimpleDTO;
+import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.options.EntityOptions;
+
+import com.calclab.suco.client.events.Listener;
+import com.calclab.suco.client.ioc.Provider;
+
+public class UserOptionsToolsConfPresenter extends EntityOptionsToolsConfPresenter implements UserOptionsToolsConf {
+
+ public UserOptionsToolsConfPresenter(final Session session, final StateManager stateManager,
+ final I18nTranslationService i18n, final EntityOptions entityOptions,
+ final Provider<GroupServiceAsync> groupService) {
+ super(session, stateManager, i18n, entityOptions, groupService);
+ session.onUserSignIn(new Listener<UserInfoDTO>() {
+ public void onEvent(final UserInfoDTO parameter) {
+ setState();
+ }
+ });
+ }
+
+ @Override
+ protected boolean applicable() {
+ return session.isLogged();
+ }
+
+ @Override
+ protected Collection<ToolSimpleDTO> getAllTools() {
+ return session.getUserTools();
+ }
+
+ @Override
+ protected StateToken getDefContentToken() {
+ final String homePage = session.getCurrentUserInfo().getHomePage();
+ return homePage == null ? null : new StateToken(homePage);
+ }
+
+ @Override
+ protected String getDefContentTooltip() {
+ return i18n.t("You cannot disable this tool because it's where your home page is located. To do that you have to select other content as the default home page but in another tool.");
+ }
+
+ @Override
+ protected List<String> getEnabledTools() {
+ return session.getCurrentUserInfo().getEnabledTools();
+ }
+
+ @Override
+ protected StateToken getOperationToken() {
+ return session.getCurrentUser().getStateToken();
+ }
+
+ @Override
+ protected void gotoDifLocationIfNecessary(final String toolName) {
+ if (session.getCurrentStateToken().getGroup().equals(session.getCurrentUserInfo().getShortName())
+ && session.getCurrentStateToken().getTool().equals(toolName)) {
+ stateManager.gotoToken(session.getCurrentState().getGroup().getDefaultContent().getStateToken());
+ }
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -35,6 +35,7 @@
import com.gwtext.client.data.Record;
import com.gwtext.client.data.Store;
import com.gwtext.client.data.StringFieldDef;
+import com.gwtext.client.widgets.BoxComponent;
import com.gwtext.client.widgets.Button;
import com.gwtext.client.widgets.Component;
import com.gwtext.client.widgets.Panel;
@@ -42,6 +43,7 @@
import com.gwtext.client.widgets.Window;
import com.gwtext.client.widgets.event.ButtonListenerAdapter;
import com.gwtext.client.widgets.event.PanelListenerAdapter;
+import com.gwtext.client.widgets.event.WindowListenerAdapter;
import com.gwtext.client.widgets.form.Field;
import com.gwtext.client.widgets.form.FormPanel;
import com.gwtext.client.widgets.form.TextField;
@@ -169,7 +171,23 @@
centerPanel.setActiveItemID(panelId);
dialog.setCloseAction(Window.HIDE);
+ dialog.addListener(new WindowListenerAdapter() {
+ @Override
+ public void onMove(final BoxComponent component, final int x, final int y) {
+ checkPosition(component, x, y);
+ }
+ @Override
+ public void onShow(final Component component) {
+ checkPosition(dialog, component.getAbsoluteLeft(), component.getAbsoluteTop());
+ }
+
+ private void checkPosition(final BoxComponent component, final int x, final int y) {
+ if (y < 0) {
+ component.setPagePosition(x, 0);
+ }
+ }
+ });
return dialog;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteoptions/SiteOptionsPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -27,6 +27,7 @@
import org.ourproject.kune.platf.client.actions.ui.GuiActionDescrip;
import org.ourproject.kune.platf.client.actions.ui.MenuDescriptor;
import org.ourproject.kune.platf.client.actions.ui.MenuItemDescriptor;
+import org.ourproject.kune.platf.client.actions.ui.MenuSeparatorDescriptor;
import org.ourproject.kune.platf.client.i18n.I18nTranslationService;
import org.ourproject.kune.platf.client.ui.KuneWindowUtils;
import org.ourproject.kune.platf.client.ui.img.ImgResources;
@@ -64,6 +65,8 @@
menuDescriptor.setStandalone(true);
view.addAction(menuDescriptor);
view.setMenu(menuDescriptor);
+ final MenuSeparatorDescriptor sep = new MenuSeparatorDescriptor(menuDescriptor);
+ view.addAction(sep);
final AbstractExtendedAction bugsAction = new AbstractExtendedAction() {
public void actionPerformed(final ActionEvent event) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsPresenter.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/siteusermenu/SiteUserOptionsPresenter.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -122,18 +122,6 @@
final MenuItemDescriptor item = new MenuItemDescriptor(userHomeAction);
item.setPosition(0);
addAction(item);
-
- final AbstractExtendedAction userPrefsAction = new AbstractExtendedAction() {
- public void actionPerformed(final ActionEvent event) {
- goUserHome();
- userOptions.get().show();
- }
- };
- userPrefsAction.putValue(Action.NAME, i18n.t("Your preferences"));
- userPrefsAction.putValue(Action.SMALL_ICON, img.prefs());
- final MenuItemDescriptor prefsItem = new MenuItemDescriptor(userPrefsAction);
- prefsItem.setPosition(1);
- addAction(prefsItem);
}
private void goUserHome() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Entity.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Entity.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Entity.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -44,13 +44,13 @@
entityFitPanel.setLayout(new FitLayout());
entityFitPanel.setBorder(false);
- Panel entityAnchorLayout = new Panel();
- entityAnchorLayout.setBorder(false);
- entityAnchorLayout.setLayout(new AnchorLayout());
+ final Panel entityAnchor = new Panel();
+ entityAnchor.setBorder(false);
+ entityAnchor.setLayout(new AnchorLayout());
- Panel entityBorderLayout = new Panel();
- entityBorderLayout.setLayout(new BorderLayout());
- entityBorderLayout.setBorder(false);
+ final Panel entityBorder = new Panel();
+ entityBorder.setLayout(new BorderLayout());
+ entityBorder.setBorder(false);
entityMainHeader = new Panel();
entityMainHeader.setBorder(false);
@@ -58,22 +58,22 @@
entityWorkspace = new EntityWorkspace();
- BorderLayoutData eastData = new BorderLayoutData(RegionPosition.EAST);
+ final BorderLayoutData eastData = new BorderLayoutData(RegionPosition.EAST);
eastData.setMinSize(50);
eastData.setSplit(true);
eastData.setCollapseModeMini(true);
eastData.setUseSplitTips(true);
entitySummary = new EntitySummary();
- entityBorderLayout.add(entityWorkspace.getPanel(), new BorderLayoutData(RegionPosition.CENTER));
- entityBorderLayout.add(entitySummary.getPanel(), eastData);
+ entityBorder.add(entityWorkspace.getPanel(), new BorderLayoutData(RegionPosition.CENTER));
+ entityBorder.add(entitySummary.getPanel(), eastData);
- entityAnchorLayout.add(entityMainHeader, new AnchorLayoutData("100%"));
- entityAnchorLayout.add(entityBorderLayout, new AnchorLayoutData("100% -65"));
- entityFitPanel.add(entityAnchorLayout);
+ entityAnchor.add(entityMainHeader, new AnchorLayoutData("100%"));
+ entityAnchor.add(entityBorder, new AnchorLayoutData("100% -65"));
+ entityFitPanel.add(entityAnchor);
}
- public void addInSummary(Panel panel) {
+ public void addInSummary(final Panel panel) {
entitySummary.addInSummary(panel);
}
@@ -82,7 +82,7 @@
doLayoutIfNeeded();
}
- public void addListenerInEntitySummary(ContainerListenerAdapter listener) {
+ public void addListenerInEntitySummary(final ContainerListenerAdapter listener) {
entitySummary.addListener(listener);
}
@@ -111,9 +111,9 @@
entitySummary.doLayoutIfNeeded();
}
- public void setMaximized(boolean maximized) {
+ public void setMaximized(final boolean maximized) {
+ entitySummary.setMaximized(maximized);
entityWorkspace.setMaximized(maximized);
- entitySummary.setMaximized(maximized);
}
public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -72,7 +72,7 @@
entitySummary.setId(ENTITY_SUMMARY);
trayBar = new Toolbar();
- trayBar.setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT);
+ trayBar.setHeight(WorkspaceSkeleton.DEF_BAR_HEIGHT);
trayBar.setId(SITE_TRAYBAR);
trayBar.setCls(SITE_TRAYBAR);
trayBar.addFill();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -77,25 +77,25 @@
bottomPanel.setLayout(new AnchorLayout());
title = new SimpleToolbar();
- title.setHeight("" + (WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT - 2));
+ title.setHeight("" + (WorkspaceSkeleton.DEF_BAR_HEIGHT - 2));
title.setStylePrimaryName(ENTITY_TITLE);
// title.ensureDebugId(ENTITY_TITLE);
subTitle = new SimpleToolbar();
subTitle.setStylePrimaryName(ENTITY_SUBTITLE);
// subTitle.ensureDebugId(ENTITY_SUBTITLE);
bottom = new SimpleToolbar();
- bottom.setHeight("" + (WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT - 2));
+ bottom.setHeight("" + (WorkspaceSkeleton.DEF_BAR_HEIGHT - 2));
bottom.setStylePrimaryName(ENTITY_BOTTOM);
// bottom.ensureDebugId(ENTITY_BOTTOM);
roundedTitle = new RoundedPanel(title, RoundedPanel.TOPLEFT, 2);
roundedBottom = new RoundedPanel(bottom, RoundedPanel.BOTTOMLEFT, 2);
- titles.add(roundedTitle, new AnchorLayoutData("100% -" + WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT));
- titles.add(subTitle, new AnchorLayoutData("100% -" + WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT));
- bottomPanel.add(roundedBottom, new AnchorLayoutData("100% -" + WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT));
- titles.setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT * 2);
- bottomPanel.setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT);
+ titles.add(roundedTitle, new AnchorLayoutData("100% -" + WorkspaceSkeleton.DEF_BAR_HEIGHT));
+ titles.add(subTitle, new AnchorLayoutData("100% -" + WorkspaceSkeleton.DEF_BAR_HEIGHT));
+ bottomPanel.add(roundedBottom, new AnchorLayoutData("100% -" + WorkspaceSkeleton.DEF_BAR_HEIGHT));
+ titles.setHeight(WorkspaceSkeleton.DEF_BAR_HEIGHT * 2);
+ bottomPanel.setHeight(WorkspaceSkeleton.DEF_BAR_HEIGHT);
final Panel contentWrap = new Panel();
contextWrap = new Panel();
@@ -117,10 +117,10 @@
contentBottomBar = new Toolbar();
contextTopBar = new Toolbar();
contextBottomBar = new Toolbar();
- contentTopBar.getPanel().setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT);
- contextTopBar.getPanel().setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT);
- contentBottomBar.getPanel().setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT);
- contentBottomBar.getPanel().setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT);
+ contentTopBar.getPanel().setHeight(WorkspaceSkeleton.DEF_BAR_HEIGHT);
+ contextTopBar.getPanel().setHeight(WorkspaceSkeleton.DEF_BAR_HEIGHT);
+ contentBottomBar.getPanel().setHeight(WorkspaceSkeleton.DEF_BAR_HEIGHT);
+ contentBottomBar.getPanel().setHeight(WorkspaceSkeleton.DEF_BAR_HEIGHT);
contentTopBar.addStyleName("k-toolbar-bottom-line");
contentBottomBar.addStyleName("k-toolbar-top-line");
contextTopBar.addStyleName("k-toolbar-bottom-line");
@@ -142,8 +142,8 @@
mainAnchorLayout.add(titles, new AnchorLayoutData("100%"));
mainAnchorLayout.add(cntCtxBorderLayout, new AnchorLayoutData("100% -"
- + ((WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT * 3))));
- mainAnchorLayout.add(bottomPanel, new AnchorLayoutData("100% -" + WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT * 3));
+ + ((WorkspaceSkeleton.DEF_BAR_HEIGHT * 3))));
+ mainAnchorLayout.add(bottomPanel, new AnchorLayoutData("100% -" + WorkspaceSkeleton.DEF_BAR_HEIGHT * 3));
mainFitPanel.add(mainAnchorLayout);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/Toolbar.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -35,7 +35,7 @@
container = new Panel();
container.setBorder(false);
container.setBodyBorder(false);
- container.setHeight(WorkspaceSkeleton.DEF_TOOLBAR_HEIGHT);
+ container.setHeight(WorkspaceSkeleton.DEF_BAR_HEIGHT);
container.setWidth(_100PC);
container.setHeader(false);
container.setBaseCls("x-toolbar");
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/WorkspaceSkeleton.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -39,38 +39,36 @@
import com.gwtext.client.widgets.layout.FitLayout;
public class WorkspaceSkeleton {
- public static final int DEF_TOOLBAR_HEIGHT = 26;
+ public static final int DEF_BAR_HEIGHT = 26;
private final Entity entity;
private final SimpleToolbar sitebar;
- private final Panel mainPanel;
- private final Panel container;
private final ExtElement extRootBody;
public WorkspaceSkeleton() {
extRootBody = new ExtElement(RootPanel.getBodyElement());
- container = new Panel();
+ final Panel container = new Panel();
container.setLayout(new FitLayout());
container.setBorder(false);
container.setPaddings(5);
- mainPanel = new Panel();
+ final Panel mainPanel = new Panel();
mainPanel.setLayout(new AnchorLayout());
mainPanel.setBorder(false);
sitebar = new SimpleToolbar();
sitebar.setStyleName("k-sitebar");
- sitebar.setHeight("" + DEF_TOOLBAR_HEIGHT);
+ sitebar.setHeight(String.valueOf(DEF_BAR_HEIGHT));
entity = new Entity();
mainPanel.add(sitebar, new AnchorLayoutData("100%"));
- mainPanel.add(entity.getPanel(), new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+ mainPanel.add(entity.getPanel(), new AnchorLayoutData("100% -" + DEF_BAR_HEIGHT));
container.add(mainPanel);
new Viewport(container);
}
- public void addInSummary(Panel panel) {
+ public void addInSummary(final Panel panel) {
entity.addInSummary(panel);
}
@@ -78,7 +76,7 @@
entity.addInTools(widget);
}
- public void addListenerInEntitySummary(ContainerListenerAdapter listener) {
+ public void addListenerInEntitySummary(final ContainerListenerAdapter listener) {
entity.addListenerInEntitySummary(listener);
}
@@ -90,7 +88,7 @@
final Listener0 onCancel) {
MessageBox.confirm(title, message, new MessageBox.ConfirmCallback() {
public void execute(final String btnID) {
- if (btnID.equals("yes")) {
+ if ("yes".equals(btnID)) {
DeferredCommand.addCommand(new Command() {
public void execute() {
onConfirmed.onEvent();
@@ -136,7 +134,7 @@
entity.refreshSummary();
}
- public void setMaximized(boolean maximized) {
+ public void setMaximized(final boolean maximized) {
entity.setMaximized(maximized);
}
@@ -147,6 +145,7 @@
public void showAlertMessage(final String title, final String message) {
MessageBox.alert(title, message, new MessageBox.AlertCallback() {
public void execute() {
+ // Do nothing
}
});
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java 2009-06-25 14:55:19 UTC (rev 1130)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java 2009-06-27 22:41:14 UTC (rev 1131)
@@ -5,8 +5,8 @@
import org.junit.Ignore;
import org.ourproject.kune.platf.client.ui.download.FileConstants;
-import org.ourproject.kune.workspace.client.options.EntityOptionsPanel;
-import org.ourproject.kune.workspace.client.options.logo.EntityOptionsLogoPanel;
+import org.ourproject.kune.workspace.client.options.GroupOptionsPresenter;
+import org.ourproject.kune.workspace.client.options.logo.GroupOptionsLogoPanel;
public class EntityLogoSeleniumTest extends KuneSeleniumTestHelper {
@@ -18,13 +18,14 @@
setLogo("kune-logo-without-text.png");
}
- private void setLogo(String filename) throws Exception, IOException {
- click(gid(EntityOptionsPanel.GROUP_OPTIONS_ICON));
+ private void setLogo(final String filename) throws Exception, IOException {
+ click(gid(GroupOptionsPresenter.GROUP_OPTIONS_ICON));
// waitForTextInside(EntityOptionsLogoPanel.PANEL_ID,
// PlatfMessages.ENT_OPTIONS_GROUP_TITLE);
- click(EntityOptionsLogoPanel.SET_LOGO_ID);
- File dir = new File(".");
- type(FileConstants.LOGO_FORM_FIELD, dir.getCanonicalPath() + File.separator + "img" + File.separator + filename);
- click(EntityOptionsLogoPanel.SET_LOGO_ID);
+ click(GroupOptionsLogoPanel.BUTTON_ID);
+ final File dir = new File(".");
+ type(FileConstants.GROUP_LOGO_FIELD, dir.getCanonicalPath() + File.separator + "img" + File.separator
+ + filename);
+ click(GroupOptionsLogoPanel.BUTTON_ID);
}
}
More information about the kune-commits
mailing list