kune-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 1587 discussions
r799 - in trunk/src/main/java/org/ourproject/kune: platf/client/services platf/client/ui workspace/client/ui/newtmp/themes
by vjrj 11 Jul '08
by vjrj 11 Jul '08
11 Jul '08
Author: vjrj
Date: 2008-07-11 13:18:26 +0200 (Fri, 11 Jul 2008)
New Revision: 799
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
Log:
Workspace refactorization
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-11 10:36:49 UTC (rev 798)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-11 11:18:26 UTC (rev 799)
@@ -172,7 +172,7 @@
builder.registerProvider(WsThemePresenter.class, new Provider<WsThemePresenter>() {
public WsThemePresenter get() {
final WsThemePresenter presenter = new WsThemePresenter(builder.getInstance(Session.class));
- final WsThemePanel panel = new WsThemePanel(ws, presenter);
+ final WsThemePanel panel = new WsThemePanel(ws, presenter, i18n);
presenter.init(panel);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-11 10:36:49 UTC (rev 798)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-11 11:18:26 UTC (rev 799)
@@ -44,11 +44,11 @@
private final SimplePanel contentPanel;
private final Images img;
private final Image arrowImage;
- private final RoundedBorderDecorator outerBorder;
+ private final RoundedPanel outerBorder;
public DropDownPanel() {
vp = new VerticalPanel();
- outerBorder = new RoundedBorderDecorator(vp, RoundedBorderDecorator.ALL);
+ outerBorder = new RoundedPanel(vp, RoundedPanel.ALL);
titleHP = new HorizontalPanel();
arrowImage = new Image();
titleLabel = new Label();
@@ -142,14 +142,14 @@
public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
if (oldTheme != null) {
final String oldThemeS = oldTheme.toString();
- outerBorder.removeStyleDependentName(oldThemeS);
+ // outerBorder.removeStyleDependentName(oldThemeS);
vp.removeStyleDependentName(oldThemeS);
titleHP.removeStyleDependentName(oldThemeS);
contentPanel.removeStyleDependentName(oldThemeS);
}
final String newThemeS = newTheme.toString();
outerBorder.setCornerStyleName("k-dropdownouter-" + newThemeS);
- outerBorder.addStyleDependentName(newThemeS);
+ // outerBorder.addStyleDependentName(newThemeS);
vp.addStyleDependentName(newThemeS);
titleHP.addStyleDependentName(newThemeS);
contentPanel.addStyleDependentName(newThemeS);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-11 10:36:49 UTC (rev 798)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-11 11:18:26 UTC (rev 799)
@@ -1,5 +1,6 @@
package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.calclab.suco.client.signal.Slot2;
@@ -15,13 +16,15 @@
private final Menu menu;
private final WsThemePresenter presenter;
- public WsThemePanel(final WorkspaceSkeleton ws, final WsThemePresenter presenter) {
+ public WsThemePanel(final WorkspaceSkeleton ws, final WsThemePresenter presenter,
+ final I18nUITranslationService i18n) {
this.presenter = presenter;
menu = new Menu();
menu.setDefaultAlign("br-tr");
super.setMenu(menu);
super.setIcon("images/colors.gif");
+ super.setTooltip(i18n.t("Select Workspace theme for this group"));
ws.getSiteTraybar().addButton(this);
presenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
1
0
Author: vjrj
Date: 2008-07-11 12:36:49 +0200 (Fri, 11 Jul 2008)
New Revision: 798
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcher.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java
Removed:
trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/search/ui/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
Log:
Workspace refactorization
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-11 10:36:49 UTC (rev 798)
@@ -249,3 +249,38 @@
.ytb-spacer {
width: 2px;
}
+
+/* Drop down */
+
+.k-dropdownouter {
+}
+
+.k-dropdownouter-def {
+ background-color: #87501E;
+}
+
+.k-dropdownouter-green {
+ background-color: #00D400;
+}
+
+.k-dropdowninner {
+ margin: 0 3px 1px 3px;
+ background: green;
+ background-color: #FFF;
+ padding: 3px;
+}
+
+.k-dropdownlabel {
+ color: #FFF;
+ cursor: pointer;
+}
+
+.k-dropdownlabel .gwt-Label {
+ margin: 0 5px 0 0;
+ width: 100%;
+}
+
+.k-dropdownlabel img {
+ margin: 0 3px 0 1px;
+}
+
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -28,7 +28,6 @@
import org.ourproject.kune.docs.client.actions.ContentRenameAction;
import org.ourproject.kune.docs.client.actions.ContentSetLanguageAction;
import org.ourproject.kune.docs.client.actions.ContentSetPublishedOnAction;
-import org.ourproject.kune.docs.client.actions.ContentSetTagsAction;
import org.ourproject.kune.docs.client.actions.DocsEvents;
import org.ourproject.kune.docs.client.actions.GoParentFolderAction;
import org.ourproject.kune.docs.client.actions.RenameTokenAction;
@@ -51,27 +50,26 @@
private final I18nTranslationService i18n;
public DocsClientModule(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.workspace = workspace;
- this.i18n = i18n;
+ final I18nTranslationService i18n) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.workspace = workspace;
+ this.i18n = i18n;
}
public void configure(final Register register) {
- register.addAction(DocsEvents.SAVE_DOCUMENT, new SaveDocumentAction(session, i18n));
- register.addAction(DocsEvents.ADD_DOCUMENT, new AddDocumentAction(stateManager, session, i18n));
- register.addAction(DocsEvents.ADD_FOLDER, new AddFolderAction(stateManager, session, i18n));
- register.addAction(DocsEvents.GO_PARENT_FOLDER, new GoParentFolderAction(stateManager, session));
- register.addAction(DocsEvents.ADD_AUTHOR, new ContentAddAuthorAction(stateManager, session));
- register.addAction(DocsEvents.REMOVE_AUTHOR, new ContentRemoveAuthorAction(stateManager, session));
- register.addAction(DocsEvents.SET_LANGUAGE, new ContentSetLanguageAction(session, workspace));
- register.addAction(DocsEvents.SET_PUBLISHED_ON, new ContentSetPublishedOnAction(session, workspace));
- register.addAction(DocsEvents.SET_TAGS, new ContentSetTagsAction(session, workspace));
- register.addAction(DocsEvents.RENAME_CONTENT, new ContentRenameAction(session));
- register.addAction(DocsEvents.DEL_CONTENT, new ContentDelContentAction(stateManager, session));
- register.addAction(DocsEvents.RENAME_TOKEN, new RenameTokenAction(session, stateManager));
- register.addAction(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, new WSSplitterStartResizingAction());
- register.addAction(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, new WSSplitterStopResizingAction());
+ register.addAction(DocsEvents.SAVE_DOCUMENT, new SaveDocumentAction(session, i18n));
+ register.addAction(DocsEvents.ADD_DOCUMENT, new AddDocumentAction(stateManager, session, i18n));
+ register.addAction(DocsEvents.ADD_FOLDER, new AddFolderAction(stateManager, session, i18n));
+ register.addAction(DocsEvents.GO_PARENT_FOLDER, new GoParentFolderAction(stateManager, session));
+ register.addAction(DocsEvents.ADD_AUTHOR, new ContentAddAuthorAction(stateManager, session));
+ register.addAction(DocsEvents.REMOVE_AUTHOR, new ContentRemoveAuthorAction(stateManager, session));
+ register.addAction(DocsEvents.SET_LANGUAGE, new ContentSetLanguageAction(session, workspace));
+ register.addAction(DocsEvents.SET_PUBLISHED_ON, new ContentSetPublishedOnAction(session, workspace));
+ register.addAction(DocsEvents.RENAME_CONTENT, new ContentRenameAction(session));
+ register.addAction(DocsEvents.DEL_CONTENT, new ContentDelContentAction(stateManager, session));
+ register.addAction(DocsEvents.RENAME_TOKEN, new RenameTokenAction(session, stateManager));
+ register.addAction(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, new WSSplitterStartResizingAction());
+ register.addAction(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, new WSSplitterStopResizingAction());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -6,6 +6,7 @@
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.workspace.Tags;
import com.calclab.suco.client.container.Container;
import com.calclab.suco.client.container.Provider;
@@ -25,7 +26,8 @@
public void onLoad(final ModuleBuilder builder) {
builder.registerProvider(DocumentFactory.class, new Provider<DocumentFactory>() {
public DocumentFactory get() {
- return new DocumentFactory(builder.getInstance(I18nUITranslationService.class));
+ return new DocumentFactory(builder.getInstance(I18nUITranslationService.class), builder
+ .getInstance(Session.class), builder.getInstance(Tags.class));
}
}, SingletonScope.class);
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,60 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.docs.client.actions;
-
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.ContentService;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class ContentSetTagsAction implements Action<String> {
-
- private final Session session;
- private final Workspace workspace;
-
- public ContentSetTagsAction(final Session session, final Workspace workspace) {
- this.session = session;
- this.workspace = workspace;
- }
-
- public void execute(final String value) {
- onContentsetTags(value);
- }
-
- private void onContentsetTags(final String tags) {
- Site.showProgressProcessing();
- ContentServiceAsync server = ContentService.App.getInstance();
- StateDTO currentState = session.getCurrentState();
- server.setTags(session.getUserHash(), currentState.getGroup().getShortName(), currentState.getDocumentId(),
- tags, new AsyncCallbackSimple<List<TagResultDTO>>() {
- public void onSuccess(final List<TagResultDTO> result) {
- workspace.getTagsComponent().setGroupTags(result);
- Site.hideProgress();
- }
- });
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -28,7 +28,6 @@
public static final String REMOVE_AUTHOR = "docs.removeAuthor";
public static final String SET_LANGUAGE = "docs.setLanguage";
public static final String SET_PUBLISHED_ON = "docs.setPublishedOn";
- public static final String SET_TAGS = "docs.setTags";
public static final String RENAME_CONTENT = "docs.setTitle";
public static final String RENAME_TOKEN = "docs.RenameToken";
public static final String DEL_CONTENT = "docs.delContent";
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -30,70 +30,90 @@
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.ContentService;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.workspace.Tags;
public class AdminContextPresenter extends AbstractPresenter implements AdminContext {
private AdminContextView view;
+ private final Session session;
+ private final Tags tags;
- public AdminContextPresenter() {
+ public AdminContextPresenter(final Session session, final Tags tags) {
+ this.session = session;
+ this.tags = tags;
}
- public void init(final AdminContextView view) {
- this.view = view;
+ public void doChangeLanguage(final String langCode) {
+ DefaultDispatcher.getInstance().fire(DocsEvents.SET_LANGUAGE, langCode);
}
- public void setState(final StateDTO content) {
- // In the future check the use of these components by each tool
- I18nLanguageDTO language = content.getLanguage();
- AccessListsDTO accessLists = content.getAccessLists();
- Date publishedOn = content.getPublishedOn();
- String tags = content.getTags();
- List<UserSimpleDTO> authors = content.getAuthors();
-
- if (content.hasDocument()) {
- if (tags != null) {
- view.setTags(tags);
- } else {
- view.removeTagsComponent();
- }
- if (language != null) {
- view.setLanguage(language);
- } else {
- view.removeLangComponent();
- }
- if (authors != null) {
- view.setAuthors(authors);
- } else {
- view.removeAuthorsComponent();
- }
- if (publishedOn != null) {
- view.setPublishedOn(publishedOn);
- } else {
- view.removePublishedOnComponent();
- }
- if (accessLists != null) {
- view.setAccessLists(accessLists);
- } else {
- view.removeAccessListComponent();
- }
- }
+ public View getView() {
+ return view;
}
- public View getView() {
- return view;
+ public void init(final AdminContextView view) {
+ this.view = view;
}
public void setPublishedOn(final Date date) {
- DefaultDispatcher.getInstance().fire(DocsEvents.SET_PUBLISHED_ON, date);
+ DefaultDispatcher.getInstance().fire(DocsEvents.SET_PUBLISHED_ON, date);
}
- public void setTags(final String tags) {
- DefaultDispatcher.getInstance().fire(DocsEvents.SET_TAGS, tags);
+ public void setState(final StateDTO content) {
+ // In the future check the use of these components by each tool
+ final I18nLanguageDTO language = content.getLanguage();
+ final AccessListsDTO accessLists = content.getAccessLists();
+ final Date publishedOn = content.getPublishedOn();
+ final String tags = content.getTags();
+ final List<UserSimpleDTO> authors = content.getAuthors();
+
+ if (content.hasDocument()) {
+ if (tags != null) {
+ view.setTags(tags);
+ } else {
+ view.removeTagsComponent();
+ }
+ if (language != null) {
+ view.setLanguage(language);
+ } else {
+ view.removeLangComponent();
+ }
+ if (authors != null) {
+ view.setAuthors(authors);
+ } else {
+ view.removeAuthorsComponent();
+ }
+ if (publishedOn != null) {
+ view.setPublishedOn(publishedOn);
+ } else {
+ view.removePublishedOnComponent();
+ }
+ if (accessLists != null) {
+ view.setAccessLists(accessLists);
+ } else {
+ view.removeAccessListComponent();
+ }
+ }
}
- public void doChangeLanguage(final String langCode) {
- DefaultDispatcher.getInstance().fire(DocsEvents.SET_LANGUAGE, langCode);
+ public void setTags(final String tagsString) {
+ Site.showProgressProcessing();
+ final ContentServiceAsync server = ContentService.App.getInstance();
+ final StateDTO currentState = session.getCurrentState();
+ server.setTags(session.getUserHash(), currentState.getGroup().getShortName(), currentState.getDocumentId(),
+ tagsString, new AsyncCallbackSimple<List<TagResultDTO>>() {
+ public void onSuccess(final List<TagResultDTO> result) {
+ tags.setGroupTags(result);
+ Site.hideProgress();
+ }
+ });
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -48,65 +48,71 @@
import org.ourproject.kune.docs.client.ctx.folder.FolderContext;
import org.ourproject.kune.docs.client.ctx.folder.FolderContextPresenter;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.WorkspaceFactory;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
+import org.ourproject.kune.workspace.client.workspace.Tags;
public class DocumentFactory {
private final I18nTranslationService i18n;
+ private final Session session;
+ private final Tags tags;
- public DocumentFactory(final I18nTranslationService i18n) {
- this.i18n = i18n;
+ public DocumentFactory(final I18nTranslationService i18n, final Session session, final Tags tags) {
+ this.i18n = i18n;
+ this.session = session;
+ this.tags = tags;
}
public AdminContext createAdminContext() {
- AdminContextPresenter presenter = new AdminContextPresenter();
- AdminContextView view = new AdminContextPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final AdminContextPresenter presenter = new AdminContextPresenter(session, tags);
+ final AdminContextView view = new AdminContextPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public DocumentContent createDocumentContent(final DocumentContentListener listener) {
- WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- DocumentContentPresenter presenter = new DocumentContentPresenter(this, listener, panel);
- return presenter;
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final DocumentContentPresenter presenter = new DocumentContentPresenter(this, listener, panel);
+ return presenter;
}
public DocumentContext createDocumentContext() {
- WorkspaceDeckPanel view = new WorkspaceDeckPanel();
- DocumentContextPresenter presenter = new DocumentContextPresenter(this, view);
- return presenter;
+ final WorkspaceDeckPanel view = new WorkspaceDeckPanel();
+ final DocumentContextPresenter presenter = new DocumentContextPresenter(this, view);
+ return presenter;
}
public DocumentReader createDocumentReader(final DocumentReaderListener listener) {
- DocumentReaderView view = new DocumentReaderPanel();
- DocumentReaderPresenter presenter = new DocumentReaderPresenter(view);
- return presenter;
+ final DocumentReaderView view = new DocumentReaderPanel();
+ final DocumentReaderPresenter presenter = new DocumentReaderPresenter(view);
+ return presenter;
}
public DocumentReaderControl createDocumentReaderControl(final DocumentReaderListener listener) {
- DocumentReaderControlView view = new DocumentReaderControlPanel(listener, i18n);
- DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter(view);
- return presenter;
+ final DocumentReaderControlView view = new DocumentReaderControlPanel(listener, i18n);
+ final DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter(view);
+ return presenter;
}
public FolderContext createFolderContext() {
- ContextItems contextItems = WorkspaceFactory.createContextItems();
- FolderContextPresenter presenter = new FolderContextPresenter(contextItems, i18n);
- return presenter;
+ final ContextItems contextItems = WorkspaceFactory.createContextItems();
+ final FolderContextPresenter presenter = new FolderContextPresenter(contextItems, i18n);
+ return presenter;
}
public FolderEditor createFolderEditor() {
- FolderEditorPanel view = new FolderEditorPanel();
- FolderEditorPresenter presenter = new FolderEditorPresenter(view);
- return presenter;
+ final FolderEditorPanel view = new FolderEditorPanel();
+ final FolderEditorPresenter presenter = new FolderEditorPresenter(view);
+ return presenter;
}
public FolderViewer createFolderViewer() {
- FolderViewerView view = new FolderViewerPanel();
- FolderViewerPresenter presenter = new FolderViewerPresenter(view);
- return presenter;
+ final FolderViewerView view = new FolderViewerPanel();
+ final FolderViewerPresenter presenter = new FolderViewerPresenter(view);
+ return presenter;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -67,7 +67,7 @@
configurationManager.persist(config);
final String longName = group.getLongName();
final String publicDesc = group.getPublicDesc();
- final Content descriptor = contentManager.createContent(i18n.t("About") + longName, publicDesc == null ? ""
+ final Content descriptor = contentManager.createContent(i18n.t("About [%s]", longName), publicDesc == null ? ""
: publicDesc, user, container);
descriptor.addAuthor(user);
descriptor.setLanguage(user.getLanguage());
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -17,12 +17,16 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.state.StateManagerDefault;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.search.SiteSearcher;
+import org.ourproject.kune.workspace.client.search.SiteSearcherPanel;
+import org.ourproject.kune.workspace.client.search.SiteSearcherPresenter;
+import org.ourproject.kune.workspace.client.search.SiteSearcherView;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.tags.TagsPresenter;
+import org.ourproject.kune.workspace.client.tags.ui.TagsPanel;
import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPanel;
-import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPanel;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPresenter;
@@ -36,6 +40,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
+import org.ourproject.kune.workspace.client.workspace.Tags;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel;
@@ -137,9 +142,18 @@
}
}, SingletonScope.class);
+ builder.registerProvider(SiteSearcher.class, new Provider<SiteSearcher>() {
+ public SiteSearcher get() {
+ final SiteSearcherPresenter presenter = new SiteSearcherPresenter();
+ final SiteSearcherView view = new SiteSearcherPanel(presenter, i18n, ws);
+ presenter.init(view);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
builder.registerProvider(SiteSearch.class, new Provider<SiteSearch>() {
public SiteSearch get() {
- final SiteSearchPresenter presenter = new SiteSearchPresenter();
+ final SiteSearchPresenter presenter = new SiteSearchPresenter(builder.getProvider(SiteSearcher.class));
final SiteSearchPanel panel = new SiteSearchPanel(presenter, ws, i18n);
presenter.init(panel);
return presenter;
@@ -192,24 +206,29 @@
}
}, SingletonScope.class);
- builder.registerProvider(SiteBarPresenter.class, new Provider<SiteBarPresenter>() {
- public SiteBarPresenter get() {
- final SiteBarPresenter presenter = new SiteBarPresenter();
- final SiteBarPanel panel = new SiteBarPanel(presenter, i18n, ws);
- presenter.init(panel);
- return presenter;
- }
- }, SingletonScope.class);
-
builder.registerProvider(WorkspaceManager.class, new Provider<WorkspaceManager>() {
public WorkspaceManager get() {
final WorkspaceManager presenter = new WorkspaceManager(builder.getInstance(EntityLogo.class), builder
.getInstance(EntityTitlePresenter.class), builder.getInstance(EntitySubTitlePresenter.class),
- builder.getInstance(WsThemePresenter.class), builder.getInstance(EntityLicensePresenter.class));
+ builder.getInstance(WsThemePresenter.class), builder.getInstance(EntityLicensePresenter.class),
+ builder.getInstance(Tags.class));
return presenter;
}
}, SingletonScope.class);
+ builder.registerProvider(Tags.class, new Provider<Tags>() {
+ public Tags get() {
+ final TagsPresenter presenter = new TagsPresenter(builder.getProvider(Session.class), builder
+ .getProvider(SiteSearcher.class));
+ final TagsPanel panel = new TagsPanel(presenter, i18n, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ // builder.registerProvider(type, new Provider<>() {},
+ // SingletonScope.class);
+
builder.registerProvider(StateManager.class, new Provider<StateManager>() {
public StateManager get() {
final Session session = builder.getInstance(Session.class);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -150,7 +150,6 @@
workspace.setContent(clientTool.getContent());
workspace.setContext(clientTool.getContext());
workspace.getLicenseComponent().setLicense(state);
- workspace.getTagsComponent().setState(state);
setSocialNetwork(state);
workspace.getGroupSummaryComponent().setGroupSummary(state);
Site.hideProgress();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -20,8 +20,8 @@
package org.ourproject.kune.platf.client.ui;
import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
@@ -37,129 +37,127 @@
* </p>
*
*/
-public class DropDownPanel extends Composite implements ClickListener, HasColor {
- private VerticalPanel vp;
- private HorizontalPanel titleHP;
- private Label titleLabel;
- private SimplePanel contentPanel;
- private Images img;
- private Image arrowImage;
- private RoundedBorderDecorator outerBorder;
+public class DropDownPanel extends Composite implements ClickListener {
+ private final VerticalPanel vp;
+ private final HorizontalPanel titleHP;
+ private final Label titleLabel;
+ private final SimplePanel contentPanel;
+ private final Images img;
+ private final Image arrowImage;
+ private final RoundedBorderDecorator outerBorder;
public DropDownPanel() {
- initialize();
- layout();
- setProperties();
- setContentVisible(false);
- arrowImage.addClickListener(this);
- titleLabel.addClickListener(this);
+ vp = new VerticalPanel();
+ outerBorder = new RoundedBorderDecorator(vp, RoundedBorderDecorator.ALL);
+ titleHP = new HorizontalPanel();
+ arrowImage = new Image();
+ titleLabel = new Label();
+ contentPanel = new SimplePanel();
+
+ initWidget(outerBorder);
+ vp.add(titleHP);
+ vp.add(contentPanel);
+ titleHP.add(arrowImage);
+ titleHP.add(titleLabel);
+
+ outerBorder.setCornerStyleName("k-dropdownouter");
+ vp.setStylePrimaryName("k-dropdownouter");
+ vp.setWidth("100%");
+ vp.setCellWidth(contentPanel, "100%");
+ vp.setCellWidth(titleHP, "100%");
+ titleHP.setStylePrimaryName("k-dropdownlabel");
+ img = Images.App.getInstance();
+ img.arrowDownWhite().applyTo(arrowImage);
+ titleLabel.setText("");
+ contentPanel.setStylePrimaryName("k-dropdowninner");
+
+ setContentVisible(false);
+ arrowImage.addClickListener(this);
+ titleLabel.addClickListener(this);
}
public DropDownPanel(final boolean visible) {
- this();
- setContentVisible(visible);
+ this();
+ setContentVisible(visible);
}
public DropDownPanel(final String headerText, final boolean visible) {
- this();
- setContentVisible(visible);
- setHeaderText(headerText);
+ this();
+ setContentVisible(visible);
+ setHeaderText(headerText);
}
- public void setContent(final Widget widget) {
- contentPanel.setWidget(widget);
- // refresh panel
- setContentVisible(isContentVisible());
- }
-
- public void setContentVisible(final boolean visible) {
- if (visible) {
- img.arrowDownWhite().applyTo(arrowImage);
- contentPanel.setVisible(true);
-
- } else {
- img.arrowRightWhite().applyTo(arrowImage);
- contentPanel.setVisible(false);
- }
- }
-
public boolean isContentVisible() {
- return contentPanel.isVisible();
+ return contentPanel.isVisible();
}
- public void setHeaderText(final String text) {
- titleLabel.setText(text);
+ public void onClick(final Widget sender) {
+ if (sender == titleHP | sender == arrowImage | sender == titleLabel) {
+ setContentVisible(!isContentVisible());
+ }
}
- public void setHeaderTitle(final String title) {
- // QuickTips size problems with images
- // KuneUiUtils.setQuickTip(arrowImage, title);
- KuneUiUtils.setQuickTip(titleLabel, title);
+ @Deprecated
+ public void setColor(final String color) {
+ // outerBorder.setColor(color);
+ // DOM.setStyleAttribute(arrowImage.getElement(), "backgroundColor",
+ // color);
+ // DOM.setStyleAttribute(vp.getElement(), "backgroundColor", color);
+ // DOM.setStyleAttribute(titleLabel.getElement(), "backgroundColor",
+ // color);
}
- public void onClick(final Widget sender) {
- if (sender == titleHP | sender == arrowImage | sender == titleLabel) {
- setContentVisible(!isContentVisible());
- }
+ public void setContent(final Widget widget) {
+ contentPanel.setWidget(widget);
+ // refresh panel
+ setContentVisible(isContentVisible());
}
- public void setColor(final String color) {
- outerBorder.setColor(color);
- DOM.setStyleAttribute(arrowImage.getElement(), "backgroundColor", color);
- DOM.setStyleAttribute(vp.getElement(), "backgroundColor", color);
- DOM.setStyleAttribute(titleLabel.getElement(), "backgroundColor", color);
- }
+ public void setContentVisible(final boolean visible) {
+ if (visible) {
+ img.arrowDownWhite().applyTo(arrowImage);
+ contentPanel.setVisible(true);
- public void setBackgroundColor(final String color) {
- DOM.setStyleAttribute(contentPanel.getElement(), "backgroundColor", color);
+ } else {
+ img.arrowRightWhite().applyTo(arrowImage);
+ contentPanel.setVisible(false);
+ }
}
- public String getColor() {
- return outerBorder.getColor();
+ public void setHeaderText(final String text) {
+ titleLabel.setText(text);
}
- public void setWidth(final String width) {
- super.setWidth(width);
- outerBorder.setWidth(width);
+ public void setHeaderTitle(final String title) {
+ // QuickTips size problems with images
+ KuneUiUtils.setQuickTip(arrowImage, title);
+ KuneUiUtils.setQuickTip(titleLabel, title);
}
public void setHeight(final String height) {
- super.setHeight(height);
- outerBorder.setHeight(height);
+ super.setHeight(height);
+ outerBorder.setHeight(height);
}
- private void initialize() {
- vp = new VerticalPanel();
- outerBorder = new RoundedBorderDecorator(vp, RoundedBorderDecorator.ALL);
- titleHP = new HorizontalPanel();
- arrowImage = new Image();
- titleLabel = new Label();
- contentPanel = new SimplePanel();
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ final String oldThemeS = oldTheme.toString();
+ outerBorder.removeStyleDependentName(oldThemeS);
+ vp.removeStyleDependentName(oldThemeS);
+ titleHP.removeStyleDependentName(oldThemeS);
+ contentPanel.removeStyleDependentName(oldThemeS);
+ }
+ final String newThemeS = newTheme.toString();
+ outerBorder.setCornerStyleName("k-dropdownouter-" + newThemeS);
+ outerBorder.addStyleDependentName(newThemeS);
+ vp.addStyleDependentName(newThemeS);
+ titleHP.addStyleDependentName(newThemeS);
+ contentPanel.addStyleDependentName(newThemeS);
}
- private void layout() {
- initWidget(outerBorder);
- vp.add(titleHP);
- vp.add(contentPanel);
- titleHP.add(arrowImage);
- titleHP.add(titleLabel);
+ public void setWidth(final String width) {
+ super.setWidth(width);
+ outerBorder.setWidth(width);
}
- private void setProperties() {
- outerBorder.setCornerStyleName("kune-DropDownOuter");
-
- vp.addStyleName("kune-DropDownOuter");
- vp.setWidth("100%");
- vp.setCellWidth(contentPanel, "100%");
- vp.setCellWidth(titleHP, "100%");
-
- titleHP.addStyleName("kune-DropDownLabel");
-
- img = Images.App.getInstance();
- img.arrowDownWhite().applyTo(arrowImage);
-
- titleLabel.setText("");
-
- contentPanel.addStyleName("kune-DropDownInner");
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -42,7 +42,6 @@
import org.ourproject.kune.workspace.client.actions.RateContentAction;
import org.ourproject.kune.workspace.client.actions.RecalculateWorkspaceAction;
import org.ourproject.kune.workspace.client.actions.ReloadContextAction;
-import org.ourproject.kune.workspace.client.actions.ShowSearcherAction;
import org.ourproject.kune.workspace.client.actions.StopAction;
import org.ourproject.kune.workspace.client.actions.UserLoginAction;
import org.ourproject.kune.workspace.client.actions.UserLogoutAction;
@@ -114,7 +113,6 @@
register.addAction(WorkspaceEvents.ADD_MEMBER_GROUPLIVESEARCH, new AddGroupLiveSearchAction(workspace));
register.addAction(WorkspaceEvents.ADD_USERLIVESEARCH, new AddUserLiveSearchAction(workspace));
register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n));
- register.addAction(WorkspaceEvents.SHOW_SEARCHER, new ShowSearcherAction());
register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n));
register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n));
register.addAction(WorkspaceEvents.USER_LOGIN, new UserLoginAction());
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -57,9 +57,6 @@
import org.ourproject.kune.workspace.client.socialnet.ui.UserLiveSearchPanel;
import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter;
import org.ourproject.kune.workspace.client.summary.GroupSummaryView;
-import org.ourproject.kune.workspace.client.tags.TagsPresenter;
-import org.ourproject.kune.workspace.client.tags.TagsView;
-import org.ourproject.kune.workspace.client.tags.ui.TagsPanel;
import org.ourproject.kune.workspace.client.theme.ThemeMenuPresenter;
import org.ourproject.kune.workspace.client.theme.ThemeMenuView;
import org.ourproject.kune.workspace.client.theme.ui.ThemeMenuPanel;
@@ -82,7 +79,6 @@
import org.ourproject.kune.workspace.client.workspace.GroupMembersComponent;
import org.ourproject.kune.workspace.client.workspace.GroupSummaryComponent;
import org.ourproject.kune.workspace.client.workspace.ParticipationComponent;
-import org.ourproject.kune.workspace.client.workspace.TagsComponent;
import org.ourproject.kune.workspace.client.workspace.ThemeMenuComponent;
import org.ourproject.kune.workspace.client.workspace.UserLiveSearchComponent;
import org.ourproject.kune.workspace.client.workspace.Workspace;
@@ -102,133 +98,126 @@
private static KuneErrorHandler errorHandler;
public static ContentBottomToolBarComponent createContentBottomToolBarComponent() {
- ContentBottomToolBarPresenter presenter = new ContentBottomToolBarPresenter();
- ContentBottomToolBarView view = new ContentBottomToolBarPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final ContentBottomToolBarPresenter presenter = new ContentBottomToolBarPresenter();
+ final ContentBottomToolBarView view = new ContentBottomToolBarPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static ContentSubTitleComponent createContentSubTitleComponent() {
- ContentSubTitlePresenter presenter = new ContentSubTitlePresenter(i18n);
- ContentSubTitleView view = new ContentSubTitlePanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final ContentSubTitlePresenter presenter = new ContentSubTitlePresenter(i18n);
+ final ContentSubTitleView view = new ContentSubTitlePanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static ContentTitleComponent createContentTitleComponent() {
- ContentTitlePresenter presenter = new ContentTitlePresenter(i18n, errorHandler);
- ContentTitleView view = new ContentTitlePanel(presenter);
- presenter.init(view);
- return presenter;
+ final ContentTitlePresenter presenter = new ContentTitlePresenter(i18n, errorHandler);
+ final ContentTitleView view = new ContentTitlePanel(presenter);
+ presenter.init(view);
+ return presenter;
}
public static ContentToolBarComponent createContentToolBarComponent() {
- ContentToolBarPresenter presenter = new ContentToolBarPresenter();
- ContentToolBarView view = new ContentToolBarPanel(presenter);
- presenter.init(view);
- return presenter;
+ final ContentToolBarPresenter presenter = new ContentToolBarPresenter();
+ final ContentToolBarView view = new ContentToolBarPanel(presenter);
+ presenter.init(view);
+ return presenter;
}
public static ContextItems createContextItems() {
- ContextItemsPresenter presenter = new ContextItemsPresenter(i18n);
- ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n);
- presenter.init(panel);
- return presenter;
+ final ContextItemsPresenter presenter = new ContextItemsPresenter(i18n);
+ final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n);
+ presenter.init(panel);
+ return presenter;
}
public static DesktopView createDesktop(final Workspace workspace, final SiteBarListener listener,
- final Session session) {
- return new DesktopPanel(workspace, listener, session, i18n);
+ final Session session) {
+ return new DesktopPanel(workspace, listener, session, i18n);
}
public static TextEditor createDocumentEditor(final TextEditorListener listener) {
- TextEditorPresenter presenter = new TextEditorPresenter(listener, true);
- TextEditorPanel panel = new TextEditorPanel(presenter, i18n);
- presenter.init(panel);
- return presenter;
+ final TextEditorPresenter presenter = new TextEditorPresenter(listener, true);
+ final TextEditorPanel panel = new TextEditorPanel(presenter, i18n);
+ presenter.init(panel);
+ return presenter;
}
public static GroupLiveSearchComponent createGroupLiveSearchComponent() {
- GroupLiveSearchPresenter presenter = new GroupLiveSearchPresenter();
- EntityLiveSearchView view = new GroupLiveSearchPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final GroupLiveSearchPresenter presenter = new GroupLiveSearchPresenter();
+ final EntityLiveSearchView view = new GroupLiveSearchPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static GroupMembersComponent createGroupMembersComponent() {
- GroupMembersPresenter presenter = new GroupMembersPresenter(i18n);
- GroupMembersView view = new GroupMembersPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final GroupMembersPresenter presenter = new GroupMembersPresenter(i18n);
+ final GroupMembersView view = new GroupMembersPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static GroupSummaryComponent createGroupSummaryComponent() {
- GroupSummaryPresenter presenter = new GroupSummaryPresenter();
- GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, colorTheme);
- presenter.init(view);
- return presenter;
+ final GroupSummaryPresenter presenter = new GroupSummaryPresenter();
+ final GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, colorTheme);
+ presenter.init(view);
+ return presenter;
}
public static I18nTranslatorComponent createI18nTranslatorComponent() {
- I18nTranslatorPresenter presenter = new I18nTranslatorPresenter(session);
- I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter(session);
+ final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static LanguageSelectorComponent createLanguageSelectorComponent() {
- LanguageSelectorPresenter presenter = new LanguageSelectorPresenter(session);
- LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final LanguageSelectorPresenter presenter = new LanguageSelectorPresenter(session);
+ final LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static LicenseComponent createLicenseComponent() {
- LicensePresenter presenter = new LicensePresenter();
- LicenseView view = new LicensePanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final LicensePresenter presenter = new LicensePresenter();
+ final LicenseView view = new LicensePanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static ParticipationComponent createParticipationComponent() {
- ParticipationPresenter presenter = new ParticipationPresenter(i18n);
- ParticipationView view = new ParticipationPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final ParticipationPresenter presenter = new ParticipationPresenter(i18n);
+ final ParticipationView view = new ParticipationPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
- public static TagsComponent createTagsComponent() {
- TagsPresenter presenter = new TagsPresenter(session);
- TagsView view = new TagsPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
- }
-
public static ThemeMenuComponent createThemeMenuComponent() {
- ThemeMenuPresenter presenter = new ThemeMenuPresenter();
- ThemeMenuView view = new ThemeMenuPanel(presenter, i18n, colorTheme);
- presenter.init(view);
- return presenter;
+ final ThemeMenuPresenter presenter = new ThemeMenuPresenter();
+ final ThemeMenuView view = new ThemeMenuPanel(presenter, i18n, colorTheme);
+ presenter.init(view);
+ return presenter;
}
public static UserLiveSearchComponent createUserLiveSearchComponent() {
- UserLiveSearchPresenter presenter = new UserLiveSearchPresenter();
- EntityLiveSearchView view = new UserLiveSearchPanel(presenter, i18n);
- presenter.init(view);
- return presenter;
+ final UserLiveSearchPresenter presenter = new UserLiveSearchPresenter();
+ final EntityLiveSearchView view = new UserLiveSearchPanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
}
public static Workspace createWorkspace(final Session session,
- final ExtensibleWidgetsManager extensionPointManager, final I18nTranslationService i18n,
- final ColorTheme colorTheme, final KuneErrorHandler errorHandler) {
- WorkspaceFactory.session = session;
- WorkspaceFactory.i18n = i18n;
- WorkspaceFactory.colorTheme = colorTheme;
- WorkspaceFactory.errorHandler = errorHandler;
- WorkspacePresenter workspace = new WorkspacePresenter(session);
- WorkspaceView view = new WorkspacePanel(workspace, i18n, colorTheme);
- workspace.init(view, extensionPointManager);
- return workspace;
+ final ExtensibleWidgetsManager extensionPointManager, final I18nTranslationService i18n,
+ final ColorTheme colorTheme, final KuneErrorHandler errorHandler) {
+ WorkspaceFactory.session = session;
+ WorkspaceFactory.i18n = i18n;
+ WorkspaceFactory.colorTheme = colorTheme;
+ WorkspaceFactory.errorHandler = errorHandler;
+ final WorkspacePresenter workspace = new WorkspacePresenter(session);
+ final WorkspaceView view = new WorkspacePanel(workspace, i18n, colorTheme);
+ workspace.init(view, extensionPointManager);
+ return workspace;
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.actions;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.ShowSearcherActionParams;
-import org.ourproject.kune.workspace.client.search.SearchSite;
-import org.ourproject.kune.workspace.client.search.ui.SearchSitePanel;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.sitebar.SiteBarFactory;
-
-public class ShowSearcherAction implements Action<ShowSearcherActionParams> {
-
- public void execute(final ShowSearcherActionParams params) {
- onShowSearcherAction(params.getTermToSearch(), params.getTypeOfSearch());
- }
-
- private void onShowSearcherAction(final String termToSearch, final Integer typeOfSearch) {
- Site.showProgressLoading();
- final SearchSite search = SiteBarFactory.getSearch();
- if (termToSearch != null) {
- if (typeOfSearch != null) {
- search.doSearchOfType(termToSearch, typeOfSearch.intValue());
- } else {
- search.doSearch(termToSearch);
- }
- }
- SearchSitePanel searchPanel = (SearchSitePanel) search.getView();
- searchPanel.show();
- Site.hideProgress();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.search;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface SearchSite {
-
- public View getView();
-
- public void doSearch(String termToSearch);
-
- public void doSearchOfType(String termToSearch, int type);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,88 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.search;
-
-import java.util.HashMap;
-import java.util.Iterator;
-
-import org.ourproject.kune.platf.client.AbstractPresenter;
-import org.ourproject.kune.platf.client.PlatformEvents;
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
-import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
-
-import com.allen_sauer.gwt.log.client.Log;
-
-public class SearchSitePresenter extends AbstractPresenter implements SearchSite {
-
- private SearchSiteView view;
- private int currentSearch;
- private final HashMap<String, Integer> searchHistory;
-
- public SearchSitePresenter() {
- searchHistory = new HashMap<String, Integer>();
- currentSearch = SearchSiteView.GROUP_USER_SEARCH;
- }
-
- public void init(final SearchSiteView view) {
- this.view = view;
- }
-
- public View getView() {
- return view;
- }
-
- public void doClose() {
- view.hide();
- }
-
- public void doSearch(final int typeOfSearch) {
- doSearchOfType(view.getComboTextToSearch(), typeOfSearch);
- }
-
- public void doSearchOfType(final String text, final int typeOfSearch) {
- this.currentSearch = typeOfSearch;
- doSearch(text);
- }
-
- public void doSearch(final String text) {
- searchHistory.put(text, null);
- Log.debug("Search History: " + searchHistory.toString());
- view.search(text, currentSearch);
- }
-
- public Object[][] getSearchHistory() {
- Object[][] objs = new Object[searchHistory.size()][1];
- int i = 0;
- for (Iterator<String> iterator = searchHistory.keySet().iterator(); iterator.hasNext();) {
- String search = iterator.next();
- Object[] obj = new Object[] { search };
- objs[i++] = obj;
- }
- return objs;
- }
-
- public void attachIconToBottomBar(final View view) {
- DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, view));
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.search;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface SearchSiteView extends View {
-
- public static final int GROUP_USER_SEARCH = 1;
- public static final int CONTENT_SEARCH = 2;
-
- void search(String text, int currentSearch);
-
- String getComboTextToSearch();
-
- void hide();
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcher.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcher.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -0,0 +1,28 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.search;
+
+public interface SiteSearcher {
+
+ public void doSearch(String termToSearch);
+
+ public void doSearchOfType(String termToSearch, SiteSearcherType type);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -0,0 +1,315 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.search;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.AbstractSearcherPanel;
+import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.KeyboardListener;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.RegionPosition;
+import com.gwtext.client.data.FieldDef;
+import com.gwtext.client.data.Record;
+import com.gwtext.client.data.SimpleStore;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.data.StringFieldDef;
+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.ToolbarButton;
+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.ComboBox;
+import com.gwtext.client.widgets.form.Field;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
+import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
+import com.gwtext.client.widgets.grid.ColumnConfig;
+import com.gwtext.client.widgets.grid.ColumnModel;
+import com.gwtext.client.widgets.grid.GridPanel;
+import com.gwtext.client.widgets.grid.event.GridCellListenerAdapter;
+import com.gwtext.client.widgets.layout.BorderLayoutData;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class SiteSearcherPanel extends AbstractSearcherPanel implements SiteSearcherView {
+
+ private final Window dialog;
+ private final SiteSearcherPresenter presenter;
+ private Store groupStore;
+ private ComboBox searchCombo;
+ private Store historyStore;
+ private Store contentStore;
+ private GridPanel groupsGrid;
+ private GridPanel contentGrid;
+ private final WorkspaceSkeleton ws;
+
+ public SiteSearcherPanel(final SiteSearcherPresenter initPresenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ super(i18n);
+ this.presenter = initPresenter;
+ this.ws = ws;
+ dialog = createDialog();
+ }
+
+ public String getComboTextToSearch() {
+ return searchCombo.getValue();
+ }
+
+ public void hide() {
+ dialog.hide();
+ }
+
+ public void search(final String text, final SiteSearcherType type) {
+ searchCombo.setValue(text);
+ switch (type) {
+ case group_user:
+ query(groupStore, groupsGrid, text);
+ break;
+ case content:
+ query(contentStore, contentGrid, text);
+ break;
+ default:
+ break;
+ }
+ }
+
+ public void show() {
+ dialog.show();
+ dialog.expand();
+ dialog.center();
+ final ToolbarButton toolbarButton = new ToolbarButton();
+ toolbarButton.setTooltip(i18n.t("Show/hide searcher"));
+ toolbarButton.setIcon("images/kune-search-ico-push.gif");
+ toolbarButton.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ if (dialog.isVisible()) {
+ dialog.hide();
+ } else {
+ dialog.show();
+ }
+ }
+
+ });
+ ws.getSiteTraybar().addButton(toolbarButton);
+ }
+
+ private Window createDialog() {
+ final Panel north = new Panel();
+ north.setHeight(50);
+ north.setBorder(false);
+
+ final TabPanel centerPanel = new TabPanel();
+ centerPanel.setActiveTab(0);
+ centerPanel.setAutoScroll(true);
+ centerPanel.setClosable(false);
+ centerPanel.setBorder(false);
+
+ final BasicDialog dialog = new BasicDialog(i18n.t("Search"), false, false, 500, 400);
+ // dialog.setResizable(false);
+ dialog.setIconCls("search-icon");
+ final Button closeButton = new Button(i18n.tWithNT("Close", "used in button"));
+ closeButton.addListener(new ButtonListenerAdapter() {
+ public void onClick(final Button button, final EventObject e) {
+ presenter.doClose();
+ }
+ });
+ dialog.addButton(closeButton);
+
+ final Panel searchPanel = createSearchForm(presenter);
+ final Panel groupsPanel = new Panel("Groups & Users");
+ final Panel contentPanel = new Panel("Content");
+ groupsPanel.setLayout(new FitLayout());
+ contentPanel.setLayout(new FitLayout());
+
+ groupsGrid = createSearchPanel(SiteSearcherType.group_user);
+ contentGrid = createSearchPanel(SiteSearcherType.content);
+ groupsPanel.add(groupsGrid);
+ contentPanel.add(contentGrid);
+ centerPanel.add(groupsPanel);
+ centerPanel.add(contentPanel);
+ dialog.add(searchPanel, new BorderLayoutData(RegionPosition.NORTH));
+ dialog.add(centerPanel, new BorderLayoutData(RegionPosition.CENTER));
+
+ groupsPanel.addListener(new PanelListenerAdapter() {
+ public void onActivate(final Panel panel) {
+ dialog.setTitle(i18n.t("Search users & groups"));
+ presenter.doSearch(SiteSearcherType.group_user);
+ }
+ });
+
+ contentPanel.addListener(new PanelListenerAdapter() {
+ public void onActivate(final Panel panel) {
+ dialog.setTitle(i18n.t("Search contents"));
+ presenter.doSearch(SiteSearcherType.content);
+ }
+ });
+
+ final String panelId = groupsPanel.getId();
+ centerPanel.setActiveItemID(panelId);
+
+ dialog.setCloseAction(Window.HIDE);
+
+ dialog.addListener(new WindowListenerAdapter() {
+ public void onCollapse(final Panel panel) {
+ // dialog.hide();
+ }
+ });
+
+ return dialog;
+ }
+
+ private Panel createSearchForm(final SiteSearcherPresenter presenter) {
+ final Panel searchPanel = new Panel();
+ searchPanel.setBorder(false);
+
+ final HorizontalPanel hp = new HorizontalPanel();
+
+ final FormPanel form = new FormPanel();
+ form.setBorder(false);
+ form.setWidth(330);
+ form.setHideLabels(true);
+
+ historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory());
+
+ searchCombo = new ComboBox();
+ searchCombo.setStore(historyStore);
+ searchCombo.setDisplayField("term");
+ searchCombo.setTypeAhead(false);
+ searchCombo.setLoadingText(i18n.t("Searching..."));
+ searchCombo.setWidth(300);
+ searchCombo.setPageSize(10);
+ searchCombo.setMode(ComboBox.LOCAL);
+ searchCombo.setMinChars(1);
+ searchCombo.setValueField("term");
+ searchCombo.setForceSelection(false);
+ searchCombo.setEditable(true);
+ historyStore.load();
+ searchCombo.addListener(new ComboBoxListenerAdapter() {
+ public void onSelect(final ComboBox comboBox, final Record record, final int index) {
+ presenter.doSearch(getComboTextToSearch());
+ historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory());
+ searchCombo.setStore(historyStore);
+ historyStore.load();
+ }
+ });
+ searchCombo.addListener(new FieldListenerAdapter() {
+ public void onChange(final Field field, final Object newVal, final Object oldVal) {
+ // Maybe we use...
+ }
+
+ public void onSpecialKey(final Field field, final EventObject e) {
+ switch (e.getKey()) {
+ case KeyboardListener.KEY_ENTER:
+ Log.debug("Enter pressed");
+ Log.debug("field: " + field.getValueAsString());
+ Log.debug("field2: " + getComboTextToSearch());
+ presenter.doSearch(field.getValueAsString());
+ historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory());
+ historyStore.load();
+ searchCombo.setStore(historyStore);
+ break;
+ }
+ e.stopEvent();
+ }
+
+ });
+ form.add(searchCombo);
+
+ final Button searchBtn = new Button(i18n.tWithNT("Search", "used in button"));
+ searchBtn.addListener(new ButtonListenerAdapter() {
+ public void onClick(final Button button, final EventObject e) {
+ presenter.doSearch(getComboTextToSearch());
+ }
+ });
+ hp.add(form);
+ hp.add(searchBtn);
+ hp.setSpacing(7);
+ hp.addStyleName("kune-Margin-Large-trbl");
+ searchPanel.add(hp);
+ return searchPanel;
+ }
+
+ private GridPanel createSearchPanel(final SiteSearcherType type) {
+ final String id = "shortName";
+ final FieldDef[] fieldDefs = new FieldDef[] { new StringFieldDef(id), new StringFieldDef("longName"),
+ new StringFieldDef("link"), new StringFieldDef("iconUrl") };
+ final Store store;
+
+ switch (type) {
+ case group_user:
+ store = groupStore = createStore(fieldDefs, "/kune/json/GroupJSONService/search", id);
+ break;
+ case content:
+ store = contentStore = createStore(fieldDefs, "/kune/json/ContentJSONService/search", id);
+ break;
+ default:
+ throw new RuntimeException("Unknown type of search");
+ }
+
+ final ColumnModel columnModel = new ColumnModel(new ColumnConfig[] { new ColumnConfig() {
+ {
+ setDataIndex(id);
+ setWidth(100);
+ }
+ }, new ColumnConfig() {
+ {
+ setDataIndex("longName");
+ setWidth(350);
+ }
+ } });
+
+ // columnModel.setDefaultSortable(true);
+
+ final String gridName = type == SiteSearcherType.group_user ? "group-search" : "content-search";
+
+ final GridPanel grid = new GridPanel(gridName, 474, 250, store, columnModel);
+ createPagingToolbar(store, grid);
+ grid.setHideColumnHeader(true);
+ // final GridView view = new GridView();
+ // view.setForceFit(true);
+ // // view.setEnableRowBody(true);
+ // grid.setView(view);
+
+ grid.addListener(new PanelListenerAdapter() {
+ public void onRender(final Component component) {
+ Log.debug("Loading store");
+ store.load(0, PAGINATION_SIZE);
+ }
+ });
+
+ grid.addGridCellListener(new GridCellListenerAdapter() {
+ public void onCellClick(final GridPanel grid, final int rowIndex, final int colindex, final EventObject e) {
+ final Record record = store.getRecordAt(rowIndex);
+ final String groupShortName = record.getAsString(id);
+ presenter.doGoto(groupShortName);
+ }
+ });
+
+ return grid;
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -0,0 +1,82 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.search;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.ourproject.kune.platf.client.AbstractPresenter;
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+
+import com.allen_sauer.gwt.log.client.Log;
+
+public class SiteSearcherPresenter extends AbstractPresenter implements SiteSearcher {
+
+ private SiteSearcherView view;
+ private SiteSearcherType currentSearch;
+ private final HashMap<String, Integer> searchHistory;
+
+ public SiteSearcherPresenter() {
+ searchHistory = new HashMap<String, Integer>();
+ currentSearch = SiteSearcherType.group_user;
+ }
+
+ public void doClose() {
+ view.hide();
+ }
+
+ public void doSearch(final SiteSearcherType typeOfSearch) {
+ doSearchOfType(view.getComboTextToSearch(), typeOfSearch);
+ }
+
+ public void doSearch(final String text) {
+ searchHistory.put(text, null);
+ Log.debug("Search History: " + searchHistory.toString());
+ Site.hideProgress();
+ view.search(text, currentSearch);
+ view.show();
+ }
+
+ public void doSearchOfType(final String text, final SiteSearcherType typeOfSearch) {
+ this.currentSearch = typeOfSearch;
+ doSearch(text);
+ }
+
+ public Object[][] getSearchHistory() {
+ final Object[][] objs = new Object[searchHistory.size()][1];
+ int i = 0;
+ for (final Iterator<String> iterator = searchHistory.keySet().iterator(); iterator.hasNext();) {
+ final String search = iterator.next();
+ final Object[] obj = new Object[] { search };
+ objs[i++] = obj;
+ }
+ return objs;
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final SiteSearcherView view) {
+ this.view = view;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.search;
+
+public enum SiteSearcherType {
+ group_user, content
+}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.search;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface SiteSearcherView extends View {
+
+ String getComboTextToSearch();
+
+ void hide();
+
+ void search(String text, SiteSearcherType currentSearch);
+
+ void show();
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -33,10 +33,6 @@
import org.ourproject.kune.workspace.client.newgroup.NewGroupListener;
import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
-import org.ourproject.kune.workspace.client.search.SearchSite;
-import org.ourproject.kune.workspace.client.search.SearchSitePresenter;
-import org.ourproject.kune.workspace.client.search.SearchSiteView;
-import org.ourproject.kune.workspace.client.search.ui.SearchSitePanel;
import org.ourproject.kune.workspace.client.sitebar.bar.SiteBar;
import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarListener;
import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarPanel;
@@ -54,75 +50,64 @@
private static SiteMessage siteMessage;
private static Login login;
private static NewGroup newGroup;
- private static SearchSite search;
private static Session session;
private static I18nTranslationService i18n;
public static LicenseChoose createLicenseChoose() {
- List<LicenseDTO> licensesList = session.getLicenses();
- List<LicenseDTO> licensesNonCCList = new ArrayList<LicenseDTO>();
+ final List<LicenseDTO> licensesList = session.getLicenses();
+ final List<LicenseDTO> licensesNonCCList = new ArrayList<LicenseDTO>();
- for (Iterator<LicenseDTO> iterator = licensesList.iterator(); iterator.hasNext();) {
- LicenseDTO license = iterator.next();
- if (!license.isCC()) {
- licensesNonCCList.add(license);
- }
- }
- LicenseChoosePresenter presenter = new LicenseChoosePresenter();
- LicenseChoosePanel view = new LicenseChoosePanel(licensesNonCCList, presenter, i18n);
- presenter.init(view, licensesList, licensesNonCCList);
- return presenter;
+ for (final Iterator<LicenseDTO> iterator = licensesList.iterator(); iterator.hasNext();) {
+ final LicenseDTO license = iterator.next();
+ if (!license.isCC()) {
+ licensesNonCCList.add(license);
+ }
+ }
+ final LicenseChoosePresenter presenter = new LicenseChoosePresenter();
+ final LicenseChoosePanel view = new LicenseChoosePanel(licensesNonCCList, presenter, i18n);
+ presenter.init(view, licensesList, licensesNonCCList);
+ return presenter;
}
public static SiteBar createSiteBar(final SiteBarListener listener, final Session session,
- final I18nTranslationService i18n) {
- SiteBarFactory.session = session;
- SiteBarFactory.i18n = i18n;
- SiteBarPresenter siteBarPresenter = new SiteBarPresenter(listener, session, i18n);
- SiteBarPanel siteBarView = new SiteBarPanel(siteBarPresenter, i18n);
- siteBarPresenter.init(siteBarView);
- Site.sitebar = siteBarPresenter;
- return siteBarPresenter;
+ final I18nTranslationService i18n) {
+ SiteBarFactory.session = session;
+ SiteBarFactory.i18n = i18n;
+ final SiteBarPresenter siteBarPresenter = new SiteBarPresenter(listener, session, i18n);
+ final SiteBarPanel siteBarView = new SiteBarPanel(siteBarPresenter, i18n);
+ siteBarPresenter.init(siteBarView);
+ Site.sitebar = siteBarPresenter;
+ return siteBarPresenter;
}
public static Login getLoginForm(final LoginListener listener) {
- if (login == null) {
- LoginPresenter presenter = new LoginPresenter(session, listener, i18n);
- LoginPanel view = new LoginPanel(presenter, i18n);
- presenter.init(view);
- login = presenter;
- }
- return login;
+ if (login == null) {
+ final LoginPresenter presenter = new LoginPresenter(session, listener, i18n);
+ final LoginPanel view = new LoginPanel(presenter, i18n);
+ presenter.init(view);
+ login = presenter;
+ }
+ return login;
}
public static NewGroup getNewGroupForm(final NewGroupListener listener) {
- if (newGroup == null) {
- NewGroupPresenter presenter = new NewGroupPresenter(listener, i18n);
- NewGroupPanel view = new NewGroupPanel(presenter, i18n);
- presenter.init(view);
- newGroup = presenter;
- }
- return newGroup;
+ if (newGroup == null) {
+ final NewGroupPresenter presenter = new NewGroupPresenter(listener, i18n);
+ final NewGroupPanel view = new NewGroupPanel(presenter, i18n);
+ presenter.init(view);
+ newGroup = presenter;
+ }
+ return newGroup;
}
- public static SearchSite getSearch() {
- if (search == null) {
- SearchSitePresenter presenter = new SearchSitePresenter();
- SearchSiteView view = new SearchSitePanel(presenter, i18n);
- presenter.init(view);
- search = presenter;
- }
- return search;
- }
-
public static SiteMessage getSiteMessage() {
- if (siteMessage == null) {
- SiteMessagePresenter siteMessagePresenter = new SiteMessagePresenter();
- SiteMessageView siteMessageView = new SiteMessagePanel(siteMessagePresenter, true);
- siteMessagePresenter.init(siteMessageView);
- siteMessage = siteMessagePresenter;
- Site.siteUserMessage = siteMessagePresenter;
- }
- return siteMessage;
+ if (siteMessage == null) {
+ final SiteMessagePresenter siteMessagePresenter = new SiteMessagePresenter();
+ final SiteMessageView siteMessageView = new SiteMessagePanel(siteMessagePresenter, true);
+ siteMessagePresenter.init(siteMessageView);
+ siteMessage = siteMessagePresenter;
+ Site.siteUserMessage = siteMessagePresenter;
+ }
+ return siteMessage;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -29,8 +29,6 @@
import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
import org.ourproject.kune.workspace.client.newgroup.NewGroup;
import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
-import org.ourproject.kune.workspace.client.search.SearchSite;
-import org.ourproject.kune.workspace.client.search.ui.SearchSitePanel;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.SiteBarFactory;
import org.ourproject.kune.workspace.client.sitebar.login.Login;
@@ -88,7 +86,6 @@
private final Widget progressPanel;
private final Widget progressText;
private final HorizontalPanel publicHP;
- private SearchSitePanel searchPanel;
private final ExtElement extRootBody;
private String publicUrl;
private Timer timeProgressMaxTime;
@@ -338,14 +335,6 @@
DOM.setInnerText(progressText.getElement(), text);
}
- public void showSearchPanel(final String termToSearch) {
- final SearchSite search = SiteBarFactory.getSearch();
- search.doSearch(termToSearch);
- searchPanel = (SearchSitePanel) search.getView();
- searchPanel.show();
- Site.hideProgress();
- }
-
public void unMask() {
extRootBody.unmask();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -49,198 +49,198 @@
private final I18nTranslationService i18n;
public SiteBarPresenter(final SiteBarListener listener, final Session session, final I18nTranslationService i18n) {
- this.listener = listener;
- this.session = session;
- this.i18n = i18n;
+ this.listener = listener;
+ this.session = session;
+ this.i18n = i18n;
}
public void changeState(final StateToken token) {
- listener.onChangeState(token);
+ listener.onChangeState(token);
}
public void doLogin(final String previousToken) {
- this.previousToken = previousToken;
- Site.showProgressProcessing();
- view.showLoginDialog();
- view.centerLoginDialog();
- Site.hideProgress();
+ this.previousToken = previousToken;
+ Site.showProgressProcessing();
+ view.showLoginDialog();
+ view.centerLoginDialog();
+ Site.hideProgress();
}
public void doLogout() {
- AsyncCallback<Object> callback = new AsyncCallback<Object>() {
- public void onFailure(final Throwable caught) {
- Site.hideProgress();
- try {
- throw caught;
- } catch (final SessionExpiredException e) {
- clientUILogout();
- } catch (final UserMustBeLoggedException e) {
- clientUILogout();
- } catch (final Throwable e) {
- GWT.log("Other kind of exception in doLogout", null);
- throw new RuntimeException();
- }
- }
+ final AsyncCallback<Object> callback = new AsyncCallback<Object>() {
+ public void onFailure(final Throwable caught) {
+ Site.hideProgress();
+ try {
+ throw caught;
+ } catch (final SessionExpiredException e) {
+ clientUILogout();
+ } catch (final UserMustBeLoggedException e) {
+ clientUILogout();
+ } catch (final Throwable e) {
+ GWT.log("Other kind of exception in doLogout", null);
+ throw new RuntimeException();
+ }
+ }
- public void onSuccess(final Object arg0) {
- Site.hideProgress();
- clientUILogout();
- }
+ public void onSuccess(final Object arg0) {
+ Site.hideProgress();
+ clientUILogout();
+ }
- private void clientUILogout() {
- view.restoreLoginLink();
- view.resetOptionsSubmenu();
- view.setLogoutLinkVisible(false);
- listener.onUserLoggedOut();
- }
- };
+ private void clientUILogout() {
+ view.restoreLoginLink();
+ view.resetOptionsSubmenu();
+ view.setLogoutLinkVisible(false);
+ listener.onUserLoggedOut();
+ }
+ };
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGOUT, callback);
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGOUT, callback);
}
public void doNewGroup(final String previousTokenOrig) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.ONLY_CHECK_USER_SESSION,
- new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- previousToken = previousTokenOrig;
- if (session.isLogged()) {
- Site.showProgressProcessing();
- view.showNewGroupDialog();
- view.centerNewGroupDialog();
- } else {
- returnToPreviousState();
- Site.info(i18n.t("Sign in or register to create a group"));
- }
- }
- });
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.ONLY_CHECK_USER_SESSION,
+ new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ previousToken = previousTokenOrig;
+ if (session.isLogged()) {
+ Site.showProgressProcessing();
+ view.showNewGroupDialog();
+ view.centerNewGroupDialog();
+ } else {
+ returnToPreviousState();
+ Site.info(i18n.t("Sign in or register to create a group"));
+ }
+ }
+ });
}
public void doSearch(final String termToSearch) {
- view.showSearchPanel(termToSearch);
+ // view.showSearchPanel(termToSearch);
}
public View getView() {
- return view;
+ return view;
}
public void hideProgress() {
- view.hideProgress();
+ view.hideProgress();
}
public void init(final SiteBarView view) {
- this.view = view;
- view.setLogoutLinkVisible(false);
+ this.view = view;
+ view.setLogoutLinkVisible(false);
}
public void mask() {
- view.mask();
+ view.mask();
}
public void mask(final String message) {
- view.mask(message);
+ view.mask(message);
}
public void onHelpInTranslation() {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
}
public void onLoginCancelled() {
- view.hideLoginDialog();
- returnToPreviousState();
+ view.hideLoginDialog();
+ returnToPreviousState();
}
public void onLoginClose() {
- if (!session.isLogged()) {
- returnToPreviousState();
- }
+ if (!session.isLogged()) {
+ returnToPreviousState();
+ }
}
public void onNewGroupCancel() {
- view.hideNewGroupDialog();
- returnToPreviousState();
+ view.hideNewGroupDialog();
+ returnToPreviousState();
}
public void onNewGroupClose() {
- returnToPreviousState();
+ returnToPreviousState();
}
public void onNewGroupCreated(final StateToken homePage) {
- view.hideNewGroupDialog();
- changeState(homePage);
+ view.hideNewGroupDialog();
+ changeState(homePage);
}
public void reloadUserInfo(final String userHash) {
- UserServiceAsync siteBarService = UserService.App.getInstance();
- siteBarService.reloadUserInfo(userHash, new AsyncCallback<UserInfoDTO>() {
- public void onFailure(final Throwable arg0) {
- Site.hideProgress();
- }
+ final UserServiceAsync siteBarService = UserService.App.getInstance();
+ siteBarService.reloadUserInfo(userHash, new AsyncCallback<UserInfoDTO>() {
+ public void onFailure(final Throwable arg0) {
+ Site.hideProgress();
+ }
- public void onSuccess(final UserInfoDTO response) {
- showLoggedUser(response);
- Site.hideProgress();
- }
- });
+ public void onSuccess(final UserInfoDTO response) {
+ showLoggedUser(response);
+ Site.hideProgress();
+ }
+ });
}
public void setState(final StateDTO state) {
- StateToken token = state.getStateToken();
- if (state.getAccessLists().getViewers().getMode().equals(GroupListDTO.EVERYONE)) {
- String publicUrl = token.getPublicUrl();
- view.setContentGotoPublicUrl(publicUrl);
- view.setContentPublic(true);
- } else {
- view.setContentPublic(false);
- }
+ final StateToken token = state.getStateToken();
+ if (state.getAccessLists().getViewers().getMode().equals(GroupListDTO.EVERYONE)) {
+ final String publicUrl = token.getPublicUrl();
+ view.setContentGotoPublicUrl(publicUrl);
+ view.setContentPublic(true);
+ } else {
+ view.setContentPublic(false);
+ }
}
public void showAlertMessage(final String message) {
- view.showAlertMessage(message);
+ view.showAlertMessage(message);
}
public void showLoggedUser(final UserInfoDTO user) {
- if (user == null) {
- view.restoreLoginLink();
- view.setLogoutLinkVisible(false);
- } else {
- view.showLoggedUserName(user.getShortName(), user.getHomePage());
- view.setLogoutLinkVisible(true);
- view.setGroupsIsMember(user.getGroupsIsAdmin(), user.getGroupsIsCollab());
- }
+ if (user == null) {
+ view.restoreLoginLink();
+ view.setLogoutLinkVisible(false);
+ } else {
+ view.showLoggedUserName(user.getShortName(), user.getHomePage());
+ view.setLogoutLinkVisible(true);
+ view.setGroupsIsMember(user.getGroupsIsAdmin(), user.getGroupsIsCollab());
+ }
}
public void showProgress(final String text) {
- view.showProgress(text);
+ view.showProgress(text);
}
public void unMask() {
- view.unMask();
+ view.unMask();
}
public void userLoggedIn(final UserInfoDTO userInfoDTO) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGGED_IN, userInfoDTO);
- view.hideLoginDialog();
- returnToPreviousState();
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGGED_IN, userInfoDTO);
+ view.hideLoginDialog();
+ returnToPreviousState();
}
protected void onSearchFocus() {
- view.setTextSearchBig();
- view.clearSearchText();
+ view.setTextSearchBig();
+ view.clearSearchText();
}
protected void onSearchLostFocus(final String search) {
- if (search.length() == 0) {
- view.setDefaultTextSearch();
- view.setTextSearchSmall();
- }
+ if (search.length() == 0) {
+ view.setDefaultTextSearch();
+ view.setTextSearchSmall();
+ }
}
private void returnToPreviousState() {
- if (this.previousToken != null) {
- listener.onChangeState(new StateToken(this.previousToken));
- this.previousToken = null;
- }
+ if (this.previousToken != null) {
+ listener.onChangeState(new StateToken(this.previousToken));
+ this.previousToken = null;
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -28,58 +28,56 @@
public interface SiteBarView extends View {
- void showLoggedUserName(String name, String homePage);
+ public void hideLoginDialog();
- void clearUserName();
+ void centerLoginDialog();
- void setLogo(Image logo);
+ void centerNewGroupDialog();
- void showProgress(String text);
+ void clearSearchText();
- void hideProgress();
+ void clearUserName();
- void clearSearchText();
+ void hideNewGroupDialog();
- void setSearchText(String text);
+ void hideProgress();
- void showLoginDialog();
+ void mask();
- void setLogoutLinkVisible(boolean visible);
+ void mask(String message);
- public void hideLoginDialog();
+ void resetOptionsSubmenu();
void restoreLoginLink();
- void showNewGroupDialog();
+ void setContentGotoPublicUrl(String publicUrl);
- void hideNewGroupDialog();
+ void setContentPublic(boolean visible);
void setDefaultTextSearch();
void setGroupsIsMember(List<LinkDTO> groupsIsAdmin, List<LinkDTO> groupsIsCollab);
- void resetOptionsSubmenu();
+ void setLogo(Image logo);
- void setTextSearchSmall();
+ void setLogoutLinkVisible(boolean visible);
+ void setSearchText(String text);
+
void setTextSearchBig();
- void showSearchPanel(String termToSearch);
+ void setTextSearchSmall();
- void centerLoginDialog();
+ void showAlertMessage(String message);
- void centerNewGroupDialog();
+ void showLoggedUserName(String name, String homePage);
- void showAlertMessage(String message);
+ void showLoginDialog();
- void mask();
+ void showNewGroupDialog();
- void mask(String message);
+ void showProgress(String text);
void unMask();
- void setContentGotoPublicUrl(String publicUrl);
-
- void setContentPublic(boolean visible);
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -23,44 +23,50 @@
import java.util.List;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dto.ShowSearcherActionParams;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.TagResultDTO;
import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.search.SearchSiteView;
-import org.ourproject.kune.workspace.client.workspace.TagsComponent;
+import org.ourproject.kune.workspace.client.search.SiteSearcher;
+import org.ourproject.kune.workspace.client.search.SiteSearcherType;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.workspace.Tags;
-public class TagsPresenter implements TagsComponent {
+import com.calclab.suco.client.container.Provider;
+public class TagsPresenter implements Tags {
+
private TagsView view;
- private final Session session;
+ private final Provider<SiteSearcher> searcherProvider;
+ private final Provider<Session> sessionProvider;
- public TagsPresenter(final Session session) {
- this.session = session;
+ public TagsPresenter(final Provider<Session> sessionProvider, final Provider<SiteSearcher> searcherProvider) {
+ this.sessionProvider = sessionProvider;
+ this.searcherProvider = searcherProvider;
}
- public void setState(final StateDTO state) {
- view.setTags(state.getGroupTags());
+ public void doSearchTag(final String name) {
+ searcherProvider.get().doSearchOfType(
+ "group:" + sessionProvider.get().getCurrentState().getGroup().getShortName() + " tag:" + name,
+ SiteSearcherType.content);
}
- public void setGroupTags(final List<TagResultDTO> groupTags) {
- view.setTags(groupTags);
+ public View getView() {
+ return view;
}
public void init(final TagsView view) {
- this.view = view;
+ this.view = view;
}
- public View getView() {
- return view;
+ public void setGroupTags(final List<TagResultDTO> groupTags) {
+ view.setTags(groupTags);
}
- public void doSearchTag(final String name) {
- DefaultDispatcher.getInstance().fire(
- WorkspaceEvents.SHOW_SEARCHER,
- new ShowSearcherActionParams("group:" + session.getCurrentState().getGroup().getShortName() + " tag:"
- + name, SearchSiteView.CONTENT_SEARCH));
+ public void setState(final StateDTO state) {
+ view.setTags(state.getGroupTags());
}
+
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ view.setTheme(oldTheme, newTheme);
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -24,9 +24,12 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.TagResultDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
public interface TagsView extends View {
void setTags(List<TagResultDTO> groupTags);
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -29,6 +29,7 @@
import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.workspace.client.tags.TagsPresenter;
import org.ourproject.kune.workspace.client.tags.TagsView;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.FlowPanel;
@@ -43,43 +44,44 @@
private final Label noTagsLabel;
private final I18nTranslationService i18n;
- public TagsPanel(final TagsPresenter presenter, final I18nTranslationService i18n) {
- super(i18n.t("Tags"), true);
- this.i18n = i18n;
- setHeaderTitle(i18n.t("Keywords or terms associated with this group"));
- this.presenter = presenter;
- addStyleName("kune-Margin-Medium-t");
- flowPanel = new FlowPanel();
- VerticalPanel vp = new VerticalPanel();
- vp.add(flowPanel);
- vp.setWidth("100%");
- vp.setCellWidth(flowPanel, "100%");
- super.setContent(vp);
- noTagsLabel = new Label(i18n.t("The contents of this group don't have any tag"));
+ public TagsPanel(final TagsPresenter presenter, final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
+ super(i18n.t("Tags"), true);
+ this.i18n = i18n;
+ setHeaderTitle(i18n.t("Keywords or terms associated with this group"));
+ this.presenter = presenter;
+ addStyleName("kune-Margin-Medium-t");
+ flowPanel = new FlowPanel();
+ final VerticalPanel vp = new VerticalPanel();
+ vp.add(flowPanel);
+ vp.setWidth("100%");
+ vp.setCellWidth(flowPanel, "100%");
+ super.setContent(vp);
+ noTagsLabel = new Label(i18n.t("The contents of this group don't have any tag"));
+ ws.getEntitySummary().addInSummary(this);
}
public void setTags(final List<TagResultDTO> groupTags) {
- flowPanel.clear();
- if (groupTags.size() == 0) {
- flowPanel.add(noTagsLabel);
- } else {
- for (Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) {
- final TagResultDTO tagResult = iterator.next();
- Label label = new Label(tagResult.getName());
- // i18n pluralization
- if (tagResult.getCount().intValue() > 1) {
- KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount()));
- } else {
- KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount()));
- }
- label.addClickListener(new ClickListener() {
- public void onClick(final Widget sender) {
- presenter.doSearchTag(tagResult.getName());
- }
- });
- label.addStyleName("kune-TagsPanel-tag");
- flowPanel.add(label);
- }
- }
+ flowPanel.clear();
+ if (groupTags.size() == 0) {
+ flowPanel.add(noTagsLabel);
+ } else {
+ for (final Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) {
+ final TagResultDTO tagResult = iterator.next();
+ final Label label = new Label(tagResult.getName());
+ // i18n pluralization
+ if (tagResult.getCount().intValue() > 1) {
+ KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount()));
+ } else {
+ KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount()));
+ }
+ label.addClickListener(new ClickListener() {
+ public void onClick(final Widget sender) {
+ presenter.doSearchTag(tagResult.getName());
+ }
+ });
+ label.addStyleName("kune-TagsPanel-tag");
+ flowPanel.add(label);
+ }
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -7,6 +7,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
+import org.ourproject.kune.workspace.client.workspace.Tags;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
import com.calclab.suco.client.signal.Slot2;
@@ -18,18 +19,21 @@
private final WsThemePresenter wsThemePresenter;
private final EntityLicensePresenter entityLicensePresenter;
private final EntitySubTitlePresenter entitySubTitlePresenter;
+ private final Tags tags;
public WorkspaceManager(final EntityLogo entityLogo, final EntityTitlePresenter entityTitlePresenter,
final EntitySubTitlePresenter entitySubTitlePresenter, final WsThemePresenter wsThemePresenter,
- final EntityLicensePresenter entityLicensePresenter) {
+ final EntityLicensePresenter entityLicensePresenter, final Tags tags) {
this.entityLogo = entityLogo;
this.entityTitlePresenter = entityTitlePresenter;
this.entitySubTitlePresenter = entitySubTitlePresenter;
this.entityLicensePresenter = entityLicensePresenter;
this.wsThemePresenter = wsThemePresenter;
+ this.tags = tags;
wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
entityLogo.setTheme(oldTheme, newTheme);
+ tags.setTheme(oldTheme, newTheme);
}
});
}
@@ -42,11 +46,10 @@
entityTitlePresenter.setState(state);
entitySubTitlePresenter.setState(state);
entityLicensePresenter.setLicense(state);
+ tags.setState(state);
// Only for probes:
wsThemePresenter.setVisible(true);
wsThemePresenter.setTheme(new WsTheme(group.getWorkspaceTheme()));
}
- public void setTheme(final WsTheme theme) {
- }
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.ui.newtmp.sitebar;
-
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-
-public class SiteBarPanel implements SiteBarView {
-
- public SiteBarPanel(final SiteBarPresenter presenter, final I18nUITranslationService i18n,
- final WorkspaceSkeleton ws) {
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.ui.newtmp.sitebar;
-
-public class SiteBarPresenter {
-
- private SiteBarView view;
-
- public void init(final SiteBarView view) {
- this.view = view;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.ui.newtmp.sitebar;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface SiteBarView extends View {
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,16 +1,21 @@
package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.search.SiteSearcher;
+import com.calclab.suco.client.container.Provider;
+
public class SiteSearchPresenter implements SiteSearch {
private SiteSearchView view;
+ private final Provider<SiteSearcher> provider;
- public SiteSearchPresenter() {
+ public SiteSearchPresenter(final Provider<SiteSearcher> provider) {
+ this.provider = provider;
}
public void doSearch(final String termToSearch) {
- // TODO
+ provider.get().doSearch(termToSearch);
}
public View getView() {
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.workspace;
+
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface Tags {
+
+ void setGroupTags(List<TagResultDTO> result);
+
+ void setState(StateDTO state);
+
+ void setTheme(WsTheme oldTheme, WsTheme newTheme);
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.workspace;
-
-import java.util.List;
-
-import org.ourproject.kune.platf.client.Component;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-
-public interface TagsComponent extends Component {
-
- void setState(StateDTO state);
-
- void setGroupTags(List<TagResultDTO> result);
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -67,8 +67,6 @@
public ParticipationComponent getParticipationComponent();
- public TagsComponent getTagsComponent();
-
public ThemeMenuComponent getThemeMenuComponent();
public UserLiveSearchComponent getUserLiveSearchComponent();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -124,10 +124,6 @@
return components.getParticipationComponent();
}
- public TagsComponent getTagsComponent() {
- return components.getTagsComponent();
- }
-
public ThemeMenuComponent getThemeMenuComponent() {
return components.getThemeMenuComponent();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -33,7 +33,6 @@
private ContentSubTitleComponent contentSubTitle;
private ContentBottomToolBarComponent contentBottomToolBar;
private ThemeMenuComponent themeMenu;
- private TagsComponent tags;
private ContentToolBarComponent contentToolBar;
private GroupLiveSearchComponent groupLiveSearch;
private I18nTranslatorComponent i18nTranslatorSearch;
@@ -42,95 +41,88 @@
public WorkspaceUIComponents(final WorkspacePresenter presenter) {
}
- public LicenseComponent getLicenseComponent() {
- if (license == null) {
- license = WorkspaceFactory.createLicenseComponent();
- }
- return license;
+ public ContentBottomToolBarComponent getContentBottomToolBarComponent() {
+ if (contentBottomToolBar == null) {
+ contentBottomToolBar = WorkspaceFactory.createContentBottomToolBarComponent();
+ }
+ return contentBottomToolBar;
}
- public ContentTitleComponent getContentTitleComponent() {
- if (contentTitle == null) {
- contentTitle = WorkspaceFactory.createContentTitleComponent();
- }
- return contentTitle;
+ public ContentSubTitleComponent getContentSubTitleComponent() {
+ if (contentSubTitle == null) {
+ contentSubTitle = WorkspaceFactory.createContentSubTitleComponent();
+ }
+ return contentSubTitle;
}
- public ContentSubTitleComponent getContentSubTitleComponent() {
- if (contentSubTitle == null) {
- contentSubTitle = WorkspaceFactory.createContentSubTitleComponent();
- }
- return contentSubTitle;
+ public ContentTitleComponent getContentTitleComponent() {
+ if (contentTitle == null) {
+ contentTitle = WorkspaceFactory.createContentTitleComponent();
+ }
+ return contentTitle;
}
- public GroupMembersComponent getGroupMembersComponent() {
- if (groupMembers == null) {
- groupMembers = WorkspaceFactory.createGroupMembersComponent();
- }
- return groupMembers;
+ public ContentToolBarComponent getContentToolBarComponent() {
+ if (contentToolBar == null) {
+ contentToolBar = WorkspaceFactory.createContentToolBarComponent();
+ }
+ return contentToolBar;
}
- public GroupSummaryComponent getGroupSummaryComponent() {
- if (groupSummary == null) {
- groupSummary = WorkspaceFactory.createGroupSummaryComponent();
- }
- return groupSummary;
+ public GroupLiveSearchComponent getGroupLiveSearchComponent() {
+ if (groupLiveSearch == null) {
+ groupLiveSearch = WorkspaceFactory.createGroupLiveSearchComponent();
+ }
+ return groupLiveSearch;
}
- public ParticipationComponent getParticipationComponent() {
- if (participatesInGroups == null) {
- participatesInGroups = WorkspaceFactory.createParticipationComponent();
- }
- return participatesInGroups;
+ public GroupMembersComponent getGroupMembersComponent() {
+ if (groupMembers == null) {
+ groupMembers = WorkspaceFactory.createGroupMembersComponent();
+ }
+ return groupMembers;
}
- public ThemeMenuComponent getThemeMenuComponent() {
- if (themeMenu == null) {
- themeMenu = WorkspaceFactory.createThemeMenuComponent();
- }
- return themeMenu;
+ public GroupSummaryComponent getGroupSummaryComponent() {
+ if (groupSummary == null) {
+ groupSummary = WorkspaceFactory.createGroupSummaryComponent();
+ }
+ return groupSummary;
}
- public TagsComponent getTagsComponent() {
- if (tags == null) {
- tags = WorkspaceFactory.createTagsComponent();
- }
- return tags;
+ public I18nTranslatorComponent getI18nTranslatorComponent() {
+ if (i18nTranslatorSearch == null) {
+ i18nTranslatorSearch = WorkspaceFactory.createI18nTranslatorComponent();
+ }
+ return i18nTranslatorSearch;
}
- public ContentBottomToolBarComponent getContentBottomToolBarComponent() {
- if (contentBottomToolBar == null) {
- contentBottomToolBar = WorkspaceFactory.createContentBottomToolBarComponent();
- }
- return contentBottomToolBar;
+ public LicenseComponent getLicenseComponent() {
+ if (license == null) {
+ license = WorkspaceFactory.createLicenseComponent();
+ }
+ return license;
}
- public ContentToolBarComponent getContentToolBarComponent() {
- if (contentToolBar == null) {
- contentToolBar = WorkspaceFactory.createContentToolBarComponent();
- }
- return contentToolBar;
+ public ParticipationComponent getParticipationComponent() {
+ if (participatesInGroups == null) {
+ participatesInGroups = WorkspaceFactory.createParticipationComponent();
+ }
+ return participatesInGroups;
}
- public GroupLiveSearchComponent getGroupLiveSearchComponent() {
- if (groupLiveSearch == null) {
- groupLiveSearch = WorkspaceFactory.createGroupLiveSearchComponent();
- }
- return groupLiveSearch;
+ public ThemeMenuComponent getThemeMenuComponent() {
+ if (themeMenu == null) {
+ themeMenu = WorkspaceFactory.createThemeMenuComponent();
+ }
+ return themeMenu;
}
public UserLiveSearchComponent getUserLiveSearchComponent() {
- if (userLiveSearch == null) {
- userLiveSearch = WorkspaceFactory.createUserLiveSearchComponent();
- }
- return userLiveSearch;
+ if (userLiveSearch == null) {
+ userLiveSearch = WorkspaceFactory.createUserLiveSearchComponent();
+ }
+ return userLiveSearch;
}
- public I18nTranslatorComponent getI18nTranslatorComponent() {
- if (i18nTranslatorSearch == null) {
- i18nTranslatorSearch = WorkspaceFactory.createI18nTranslatorComponent();
- }
- return i18nTranslatorSearch;
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-10 21:06:19 UTC (rev 797)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-11 10:36:49 UTC (rev 798)
@@ -230,7 +230,6 @@
setBottom(components.getLicenseComponent().getView());
setGroupMembers(components.getGroupMembersComponent().getView());
setParticipation(components.getParticipationComponent().getView());
- setTags(components.getTagsComponent().getView());
setSummary(components.getGroupSummaryComponent().getView());
addBottomIconComponent(components.getThemeMenuComponent().getView());
}
@@ -354,7 +353,7 @@
private void AddDropDown(final DropDownPanel panel, final String color) {
groupDropDownsVP.add(panel);
panel.setWidth("145px");
- panel.setColor(color);
+ // panel.setColor(color);
}
private void adjustSizeContentSP() {
1
0
10 Jul '08
Author: vjrj
Date: 2008-07-10 23:06:19 +0200 (Thu, 10 Jul 2008)
New Revision: 797
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
Log:
Workspace refactorization
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-10 21:06:19 UTC (rev 797)
@@ -2,10 +2,55 @@
background: #FFF none repeat scroll 0% 50%;
}
+.k-sitebar .kune-IconHyperlink {
+ white-space: nowrap;
+}
+
+.k-sitebar .kune-IconHyperlink a:link {
+ cursor: pointer;
+ text-decoration: underline;
+ color: #B3B3B3;
+}
+
+.k-sitebar .kune-IconHyperlink a:hover {
+ text-decoration: underline;
+}
+
+.k-sitebar .kune-IconHyperlink a:visited {
+ color: #B3B3B3;
+}
+
.k-sitebar {
- white-space: nowrap;
+ margin-right: 10px;
+ height: 16px;
}
+.k-sitebar .gwt-TextBox {
+ border: 1px solid #E4A374;
+ margin: 0 15px 0 3px;
+ padding-left: 3px;
+ color: #B3B3B3;
+}
+
+.k-sitebar .gwt-Hyperlink a {
+ white-space: nowrap;
+ color: #B3B3B3;
+ text-decoration: underline;
+ cursor: pointer;
+}
+
+.k-sitebar .gwt-PushButton {
+ cursor: pointer;
+}
+
+.k-sitebar-LabelLink {
+ white-space: nowrap;
+ color: #B3B3B3;
+ margin-left: 3px;
+ cursor: pointer;
+ text-decoration: underline;
+}
+
.k-entity-summary {
border-left-color: #FFF;
border-left-width: 5px;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -26,6 +26,9 @@
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPanel;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearch;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearchPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch.SiteSearchPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
@@ -134,6 +137,16 @@
}
}, SingletonScope.class);
+ builder.registerProvider(SiteSearch.class, new Provider<SiteSearch>() {
+ public SiteSearch get() {
+ final SiteSearchPresenter presenter = new SiteSearchPresenter();
+ final SiteSearchPanel panel = new SiteSearchPanel(presenter, ws, i18n);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.getInstance(SiteSearch.class);
builder.getInstance(SiteLogo.class);
builder.registerProvider(EntityLogo.class, new Provider<EntityLogo>() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -1,5 +1,6 @@
package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.SiteBar;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Image;
@@ -10,7 +11,10 @@
public SiteLogoPanel(final SiteLogoPresenter presenter, final WorkspaceSkeleton ws) {
siteLogoImg = new Image();
- ws.getSiteBar().add(siteLogoImg);
+ final SiteBar siteBar = ws.getSiteBar();
+ siteBar.addSpacer();
+ siteBar.addSpacer();
+ siteBar.add(siteLogoImg);
}
public void setSiteLogoUrl(final String siteLogoUrl) {
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearch.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+public interface SiteSearch {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPanel.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,95 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.SiteBar;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.FocusListener;
+import com.google.gwt.user.client.ui.KeyboardListener;
+import com.google.gwt.user.client.ui.PushButton;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.Widget;
+
+public class SiteSearchPanel implements SiteSearchView {
+ private static final String SEARCH_TEXT_WIDTH_SMALL = "120";
+ private static final String SEARCH_TEXT_WIDTH_BIG = "180";
+
+ private final PushButton searchButton;
+ private final TextBox searchTextBox;
+ private final I18nUITranslationService i18n;
+
+ public SiteSearchPanel(final SiteSearchPresenter presenter, final WorkspaceSkeleton ws,
+ final I18nUITranslationService i18n) {
+ this.i18n = i18n;
+ final Images img = Images.App.getInstance();
+ final SiteBar siteBar = ws.getSiteBar();
+ siteBar.addSpacer();
+ siteBar.addSpacer();
+ searchButton = new PushButton(img.kuneSearchIco().createImage(), img.kuneSearchIcoPush().createImage());
+ searchTextBox = new TextBox();
+
+ siteBar.add(searchButton);
+ siteBar.addSpacer();
+ siteBar.add(searchTextBox);
+ siteBar.addSpacer();
+
+ setTextSearchSmall();
+ setDefaultTextSearch();
+ searchTextBox.addFocusListener(new FocusListener() {
+ public void onFocus(final Widget arg0) {
+ presenter.onSearchFocus();
+ }
+
+ public void onLostFocus(final Widget arg0) {
+ presenter.onSearchLostFocus(searchTextBox.getText());
+ }
+ });
+
+ searchButton.addClickListener(new ClickListener() {
+ public void onClick(final Widget arg0) {
+ Site.showProgressProcessing();
+ presenter.doSearch(searchTextBox.getText());
+ }
+ });
+
+ searchTextBox.addKeyboardListener(new KeyboardListener() {
+ public void onKeyDown(final Widget arg0, final char arg1, final int arg2) {
+ }
+
+ public void onKeyPress(final Widget arg0, final char arg1, final int arg2) {
+ }
+
+ public void onKeyUp(final Widget widget, final char key, final int mod) {
+ if (key == KEY_ENTER) {
+ if (searchTextBox.getText().length() > 0) {
+ Site.showProgressProcessing();
+ presenter.doSearch(searchTextBox.getText());
+ }
+ }
+ }
+ });
+ }
+
+ public void clearSearchText() {
+ searchTextBox.setText("");
+ }
+
+ public void setDefaultTextSearch() {
+ searchTextBox.setText(i18n.t("Search"));
+ }
+
+ public void setSearchText(final String text) {
+ searchTextBox.setText(text);
+ }
+
+ public void setTextSearchBig() {
+ searchTextBox.setWidth(SEARCH_TEXT_WIDTH_BIG);
+ }
+
+ public void setTextSearchSmall() {
+ searchTextBox.setWidth(SEARCH_TEXT_WIDTH_SMALL);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,36 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+import org.ourproject.kune.platf.client.View;
+
+public class SiteSearchPresenter implements SiteSearch {
+
+ private SiteSearchView view;
+
+ public SiteSearchPresenter() {
+ }
+
+ public void doSearch(final String termToSearch) {
+ // TODO
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final SiteSearchView view) {
+ this.view = view;
+ }
+
+ public void onSearchFocus() {
+ view.setTextSearchBig();
+ view.clearSearchText();
+ }
+
+ public void onSearchLostFocus(final String search) {
+ if (search.length() == 0) {
+ view.setDefaultTextSearch();
+ view.setTextSearchSmall();
+ }
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java 2008-07-10 17:00:24 UTC (rev 796)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchView.java 2008-07-10 21:06:19 UTC (rev 797)
@@ -0,0 +1,14 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface SiteSearchView extends View {
+
+ void clearSearchText();
+
+ void setDefaultTextSearch();
+
+ void setTextSearchBig();
+
+ void setTextSearchSmall();
+}
1
0
Author: vjrj
Date: 2008-07-10 19:00:24 +0200 (Thu, 10 Jul 2008)
New Revision: 796
Added:
trunk/src/main/java/org/ourproject/kune/app/public/images/colors.gif
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java
Modified:
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
trunk/src/main/resources/kune.properties
Log:
Workspace refactorization
Added: trunk/src/main/java/org/ourproject/kune/app/public/images/colors.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/images/colors.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -39,8 +39,6 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.google.gwt.user.client.Window;
@@ -67,10 +65,8 @@
final I18nUITranslationService i18n = kune.getI18N();
// Temporary new ws
- final WsThemePresenter wstheme = kune.getInstance(WsThemePresenter.class);
final WorkspaceSkeleton ws = kune.getInstance(WorkspaceSkeleton.class);
- wstheme.setTheme(WsTheme.def);
ws.show();
ws.getEntityWorkspace().getContentTopBar().add(new Label("Sorry, kune workspace under heavy refactorization"));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -24,107 +24,117 @@
import com.google.gwt.user.client.rpc.IsSerializable;
public class InitDataDTO implements IsSerializable {
+ private UserInfoDTO userInfo;
private ArrayList<LicenseDTO> licenses;
private ArrayList<I18nLanguageSimpleDTO> languages;
private ArrayList<I18nCountryDTO> countries;
private String[] timezones;
- UserInfoDTO userInfo;
private String chatHttpBase;
private String siteDomain;
private String chatDomain;
private String chatRoomHost;
private String defaultWsTheme;
private String[] wsThemes;
+ private String siteLogoUrl;
- public ArrayList<LicenseDTO> getLicenses() {
- return licenses;
+ public String getChatDomain() {
+ return chatDomain;
}
- public void setLicenses(final ArrayList<LicenseDTO> licenses) {
- this.licenses = licenses;
+ public String getChatHttpBase() {
+ return chatHttpBase;
}
- public UserInfoDTO getUserInfo() {
- return userInfo;
+ public String getChatRoomHost() {
+ return chatRoomHost;
}
- public void setUserInfo(final UserInfoDTO currentUser) {
- this.userInfo = currentUser;
+ public ArrayList<I18nCountryDTO> getCountries() {
+ return countries;
}
- public String getChatHttpBase() {
- return chatHttpBase;
+ public String getDefaultWsTheme() {
+ return defaultWsTheme;
}
- public void setChatHttpBase(final String chatHttpBase) {
- this.chatHttpBase = chatHttpBase;
+ public ArrayList<I18nLanguageSimpleDTO> getLanguages() {
+ return languages;
}
- public String getChatDomain() {
- return chatDomain;
+ public ArrayList<LicenseDTO> getLicenses() {
+ return licenses;
}
- public void setChatDomain(final String chatDomain) {
- this.chatDomain = chatDomain;
+ public String getSiteDomain() {
+ return siteDomain;
}
- public String getChatRoomHost() {
- return chatRoomHost;
+ public String getSiteLogoUrl() {
+ return siteLogoUrl;
}
- public void setChatRoomHost(final String chatRoomHost) {
- this.chatRoomHost = chatRoomHost;
+ public String[] getTimezones() {
+ return timezones;
}
+ public UserInfoDTO getUserInfo() {
+ return userInfo;
+ }
+
+ public String[] getWsThemes() {
+ return wsThemes;
+ }
+
public boolean hasUser() {
- return getUserInfo() != null;
+ return getUserInfo() != null;
}
- public String getDefaultWsTheme() {
- return defaultWsTheme;
+ public void setChatDomain(final String chatDomain) {
+ this.chatDomain = chatDomain;
}
- public void setDefaultWsTheme(final String defaultWsTheme) {
- this.defaultWsTheme = defaultWsTheme;
+ public void setChatHttpBase(final String chatHttpBase) {
+ this.chatHttpBase = chatHttpBase;
}
- public String[] getWsThemes() {
- return wsThemes;
+ public void setChatRoomHost(final String chatRoomHost) {
+ this.chatRoomHost = chatRoomHost;
}
- public void setWsThemes(final String[] wsThemes) {
- this.wsThemes = wsThemes;
+ public void setCountries(final ArrayList<I18nCountryDTO> countries) {
+ this.countries = countries;
}
- public ArrayList<I18nLanguageSimpleDTO> getLanguages() {
- return languages;
+ public void setDefaultWsTheme(final String defaultWsTheme) {
+ this.defaultWsTheme = defaultWsTheme;
}
public void setLanguages(final ArrayList<I18nLanguageSimpleDTO> languages) {
- this.languages = languages;
+ this.languages = languages;
}
- public ArrayList<I18nCountryDTO> getCountries() {
- return countries;
+ public void setLicenses(final ArrayList<LicenseDTO> licenses) {
+ this.licenses = licenses;
}
- public void setCountries(final ArrayList<I18nCountryDTO> countries) {
- this.countries = countries;
+ public void setSiteDomain(final String siteDomain) {
+ this.siteDomain = siteDomain;
}
+ public void setSiteLogoUrl(final String siteLogoUrl) {
+ this.siteLogoUrl = siteLogoUrl;
+ }
+
public void setTimezones(final String[] timezones) {
- this.timezones = timezones;
+ this.timezones = timezones;
}
- public String[] getTimezones() {
- return timezones;
+ public void setUserInfo(final UserInfoDTO currentUser) {
+ this.userInfo = currentUser;
}
- public String getSiteDomain() {
- return siteDomain;
+ public void setWsThemes(final String[] wsThemes) {
+ this.wsThemes = wsThemes;
}
- public void setSiteDomain(final String siteDomain) {
- this.siteDomain = siteDomain;
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -23,6 +23,9 @@
import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPanel;
import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
@@ -122,6 +125,17 @@
final WorkspaceSkeleton ws = builder.getInstance(WorkspaceSkeleton.class);
+ builder.registerProvider(SiteLogo.class, new Provider<SiteLogo>() {
+ public SiteLogo get() {
+ final SiteLogoPresenter presenter = new SiteLogoPresenter(builder.getInstance(Session.class));
+ final SiteLogoPanel panel = new SiteLogoPanel(presenter, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.getInstance(SiteLogo.class);
+
builder.registerProvider(EntityLogo.class, new Provider<EntityLogo>() {
public EntityLogo get() {
return new EntityLogoPanel(i18n, ws);
@@ -130,7 +144,7 @@
builder.registerProvider(WsThemePresenter.class, new Provider<WsThemePresenter>() {
public WsThemePresenter get() {
- final WsThemePresenter presenter = new WsThemePresenter();
+ final WsThemePresenter presenter = new WsThemePresenter(builder.getInstance(Session.class));
final WsThemePanel panel = new WsThemePanel(ws, presenter);
presenter.init(panel);
return presenter;
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 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -24,9 +24,12 @@
import org.ourproject.kune.platf.client.dto.I18nCountryDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageSimpleDTO;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import com.calclab.suco.client.signal.Slot;
+
public interface Session {
/**
@@ -34,48 +37,36 @@
*/
public static int SESSION_DURATION = 1000 * 60 * 60 * 24 * 14;
- public List<LicenseDTO> getLicenses();
+ public List<I18nCountryDTO> getCountries();
- public void setLicenses(final List<LicenseDTO> licenses);
+ public Object[][] getCountriesArray();
- public void setCurrent(final StateDTO currentState);
+ public I18nLanguageDTO getCurrentLanguage();
public StateDTO getCurrentState();
- public void setCurrentState(final StateDTO currentState);
-
- public void setDefaultWsTheme(final String defaultWsTheme);
-
- public void setWsThemes(final String[] wsThemes);
-
- public String[] getWsThemes();
-
- public String getDefaultWsTheme();
-
- public boolean isLogged();
-
public List<I18nLanguageSimpleDTO> getLanguages();
- public void setLanguages(final List<I18nLanguageSimpleDTO> languages);
-
- public List<I18nCountryDTO> getCountries();
-
- public void setCountries(final List<I18nCountryDTO> countries);
-
public Object[][] getLanguagesArray();
- public Object[][] getCountriesArray();
+ public List<LicenseDTO> getLicenses();
- public void setTimezones(final String[] timezones);
-
public Object[][] getTimezones();
+ public boolean isLogged();
+
+ public void setCurrent(final StateDTO currentState);
+
public void setCurrentLanguage(final I18nLanguageDTO currentLanguage);
- public I18nLanguageDTO getCurrentLanguage();
+ public void setCurrentState(final StateDTO currentState);
+ public void setInitData(InitDataDTO initData);
+
String getUserHash();
+ void onInitDataReceived(Slot<InitDataDTO> slot);
+
void setUserHash(String userHash);
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -26,9 +26,13 @@
import org.ourproject.kune.platf.client.dto.I18nCountryDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageSimpleDTO;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import com.calclab.suco.client.signal.Signal;
+import com.calclab.suco.client.signal.Slot;
+
/**
* RESPONSABILITIES: - Store the user's application state - Generates URLable's
* historyTokens
@@ -38,152 +42,123 @@
*/
public class SessionImpl implements Session {
private String userHash;
- private List<LicenseDTO> licenses;
- private List<I18nLanguageSimpleDTO> languages;
- private List<I18nCountryDTO> countries;
private Object[][] languagesArray;
private Object[][] countriesArray;
- private String[] timezones;
private Object[][] timezonesArray;
private StateDTO currentState;
- private String[] wsThemes;
- private String defaultWsTheme;
private I18nLanguageDTO currentLanguage;
+ private InitDataDTO initData;
+ private final Signal<InitDataDTO> onInitDataReceived;
public SessionImpl(final String userHash, final I18nLanguageDTO initialLanguage) {
- this.userHash = userHash;
- currentLanguage = initialLanguage;
- licenses = null;
- languages = null;
- languagesArray = null;
- countries = null;
+ this.userHash = userHash;
+ currentLanguage = initialLanguage;
+ languagesArray = null;
+ this.onInitDataReceived = new Signal<InitDataDTO>("initDataReceived");
}
public List<I18nCountryDTO> getCountries() {
- return countries;
+ return initData.getCountries();
}
public Object[][] getCountriesArray() {
- if (countriesArray == null) {
- countriesArray = mapCountries();
- }
- return countriesArray;
+ if (countriesArray == null) {
+ countriesArray = mapCountries();
+ }
+ return countriesArray;
}
public I18nLanguageDTO getCurrentLanguage() {
- return currentLanguage;
+ return currentLanguage;
}
public StateDTO getCurrentState() {
- return currentState;
+ return currentState;
}
- public String getDefaultWsTheme() {
- return defaultWsTheme;
- }
-
public List<I18nLanguageSimpleDTO> getLanguages() {
- return languages;
+ return initData.getLanguages();
}
public Object[][] getLanguagesArray() {
- if (languagesArray == null) {
- languagesArray = mapLangs();
- }
- return languagesArray;
+ if (languagesArray == null) {
+ languagesArray = mapLangs();
+ }
+ return languagesArray;
}
public List<LicenseDTO> getLicenses() {
- return licenses;
+ return initData.getLicenses();
}
public Object[][] getTimezones() {
- if (timezonesArray == null) {
- mapTimezones();
- }
- return timezonesArray;
+ if (timezonesArray == null) {
+ mapTimezones();
+ }
+ return timezonesArray;
}
public String getUserHash() {
- return userHash;
+ return userHash;
}
- public String[] getWsThemes() {
- return wsThemes;
- }
-
public boolean isLogged() {
- return userHash != null;
+ return userHash != null;
}
- public void setCountries(final List<I18nCountryDTO> countries) {
- this.countries = countries;
+ public void onInitDataReceived(final Slot<InitDataDTO> slot) {
+ onInitDataReceived.add(slot);
}
public void setCurrent(final StateDTO currentState) {
- this.currentState = currentState;
+ this.currentState = currentState;
}
public void setCurrentLanguage(final I18nLanguageDTO currentLanguage) {
- this.currentLanguage = currentLanguage;
+ this.currentLanguage = currentLanguage;
}
public void setCurrentState(final StateDTO currentState) {
- this.currentState = currentState;
+ this.currentState = currentState;
}
- public void setDefaultWsTheme(final String defaultWsTheme) {
- this.defaultWsTheme = defaultWsTheme;
+ public void setInitData(final InitDataDTO initData) {
+ this.initData = initData;
+ onInitDataReceived.fire(initData);
}
- public void setLanguages(final List<I18nLanguageSimpleDTO> languages) {
- this.languages = languages;
- }
-
- public void setLicenses(final List<LicenseDTO> licenses) {
- this.licenses = licenses;
- }
-
- public void setTimezones(final String[] timezones) {
- this.timezones = timezones;
- }
-
public void setUserHash(final String userHash) {
- this.userHash = userHash;
+ this.userHash = userHash;
}
- public void setWsThemes(final String[] wsThemes) {
- this.wsThemes = wsThemes;
- }
-
private Object[][] mapCountries() {
- Object[][] objs = new Object[countries.size()][1];
- int i = 0;
- for (Iterator<I18nCountryDTO> iterator = countries.iterator(); iterator.hasNext();) {
- I18nCountryDTO country = iterator.next();
- Object[] obj = new Object[] { country.getCode(), country.getEnglishName() };
- objs[i++] = obj;
- }
- return objs;
+ final Object[][] objs = new Object[getCountries().size()][1];
+ int i = 0;
+ for (final Iterator<I18nCountryDTO> iterator = getCountries().iterator(); iterator.hasNext();) {
+ final I18nCountryDTO country = iterator.next();
+ final Object[] obj = new Object[] { country.getCode(), country.getEnglishName() };
+ objs[i++] = obj;
+ }
+ return objs;
}
private Object[][] mapLangs() {
- Object[][] objs = new Object[languages.size()][1];
- int i = 0;
- for (Iterator<I18nLanguageSimpleDTO> iterator = languages.iterator(); iterator.hasNext();) {
- I18nLanguageSimpleDTO language = iterator.next();
- Object[] obj = new Object[] { language.getCode(), language.getEnglishName() };
- objs[i++] = obj;
- }
- return objs;
+ final Object[][] objs = new Object[getLanguages().size()][1];
+ int i = 0;
+ for (final Iterator<I18nLanguageSimpleDTO> iterator = getLanguages().iterator(); iterator.hasNext();) {
+ final I18nLanguageSimpleDTO language = iterator.next();
+ final Object[] obj = new Object[] { language.getCode(), language.getEnglishName() };
+ objs[i++] = obj;
+ }
+ return objs;
}
private void mapTimezones() {
- timezonesArray = new Object[timezones.length][1];
- for (int i = 0; i < timezones.length; i++) {
- Object[] obj = new Object[] { timezones[i] };
- timezonesArray[i] = obj;
- }
+ timezonesArray = new Object[getTimezones().length][1];
+ for (int i = 0; i < getTimezones().length; i++) {
+ final Object[] obj = new Object[] { getTimezones()[i] };
+ timezonesArray[i] = obj;
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -41,7 +41,6 @@
private final ContentProvider provider;
private final Workspace workspace;
private StateDTO oldState;
- private String lastTheme;
private final Session session;
private final HistoryWrapper history;
private final WorkspaceManager ws;
@@ -135,7 +134,6 @@
} else {
workspace.getThemeMenuComponent().setVisible(false);
}
- setWsTheme(group);
workspace.showGroup(group, isAdmin);
final String toolName = state.getToolName();
@@ -180,11 +178,4 @@
workspace.getParticipationComponent().setParticipation(state);
}
- private void setWsTheme(final GroupDTO group) {
- final String nextTheme = group.getWorkspaceTheme();
- if (lastTheme == null || !lastTheme.equals(nextTheme)) {
- workspace.setTheme(nextTheme);
- }
- lastTheme = nextTheme;
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -38,93 +38,102 @@
private String chatRoomHost;
private String defaultWsTheme;
private String[] wsThemes;
+ private String siteLogoUrl;
- public UserInfo getUserInfo() {
- return userInfo;
+ public String getChatDomain() {
+ return chatDomain;
}
- public void setUserInfo(final UserInfo currentUserInfo) {
- this.userInfo = currentUserInfo;
+ public String getChatHttpBase() {
+ return chatHttpBase;
}
- public List<License> getLicenses() {
- return licenses;
+ public String getChatRoomHost() {
+ return chatRoomHost;
}
- public void setLicenses(final List<License> licenses) {
- this.licenses = licenses;
+ public List<I18nCountry> getCountries() {
+ return countries;
}
- public void setChatHttpBase(final String chatHttpBase) {
- this.chatHttpBase = chatHttpBase;
+ public String getDefaultWsTheme() {
+ return defaultWsTheme;
}
- public String getChatHttpBase() {
- return chatHttpBase;
+ public List<I18nLanguage> getLanguages() {
+ return languages;
}
- public void setChatDomain(final String chatDomain) {
- this.chatDomain = chatDomain;
+ public List<License> getLicenses() {
+ return licenses;
}
- public String getChatDomain() {
- return chatDomain;
+ public String getSiteDomain() {
+ return siteDomain;
}
- public void setChatRoomHost(final String chatRoomHost) {
- this.chatRoomHost = chatRoomHost;
+ public String getSiteLogoUrl() {
+ return siteLogoUrl;
}
- public String getChatRoomHost() {
- return chatRoomHost;
+ public String[] getTimezones() {
+ return timezones;
}
- public String getDefaultWsTheme() {
- return defaultWsTheme;
+ public UserInfo getUserInfo() {
+ return userInfo;
}
- public void setDefaultWsTheme(final String defaultWsTheme) {
- this.defaultWsTheme = defaultWsTheme;
+ public String[] getWsThemes() {
+ return wsThemes;
}
- public String[] getWsThemes() {
- return wsThemes;
+ public void setChatDomain(final String chatDomain) {
+ this.chatDomain = chatDomain;
}
- public void setWsThemes(final String[] wsThemes) {
- this.wsThemes = wsThemes;
+ public void setChatHttpBase(final String chatHttpBase) {
+ this.chatHttpBase = chatHttpBase;
}
- public List<I18nLanguage> getLanguages() {
- return languages;
+ public void setChatRoomHost(final String chatRoomHost) {
+ this.chatRoomHost = chatRoomHost;
}
+ public void setCountries(final List<I18nCountry> countries) {
+ this.countries = countries;
+ }
+
+ public void setDefaultWsTheme(final String defaultWsTheme) {
+ this.defaultWsTheme = defaultWsTheme;
+ }
+
public void setLanguages(final List<I18nLanguage> languages) {
- this.languages = languages;
+ this.languages = languages;
}
- public List<I18nCountry> getCountries() {
- return countries;
+ public void setLicenses(final List<License> licenses) {
+ this.licenses = licenses;
}
- public void setCountries(final List<I18nCountry> countries) {
- this.countries = countries;
+ public void setSiteDomain(final String siteDomain) {
+ this.siteDomain = siteDomain;
}
- public void setTimezones(final String[] timezones) {
- this.timezones = timezones;
+ public void setSiteLogoUrl(final String siteLogoUrl) {
+ this.siteLogoUrl = siteLogoUrl;
}
- public String[] getTimezones() {
- return timezones;
+ public void setTimezones(final String[] timezones) {
+ this.timezones = timezones;
}
- public String getSiteDomain() {
- return siteDomain;
+ public void setUserInfo(final UserInfo currentUserInfo) {
+ this.userInfo = currentUserInfo;
}
- public void setSiteDomain(final String siteDomain) {
- this.siteDomain = siteDomain;
+ public void setWsThemes(final String[] wsThemes) {
+ this.wsThemes = wsThemes;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/properties/KuneProperties.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -28,6 +28,7 @@
public String CHAT_ROOM_HOST = "kune.chat.roomHost";
public String WS_THEMES_DEF = "kune.wsthemes.default";
public String WS_THEMES = "kune.wsthemes";
+ public String SITE_LOGO_URL = "kune.sitelogourl";
public String get(String key);
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/SiteRPC.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -88,6 +88,7 @@
data.setChatRoomHost(chatProperties.getRoomHost());
data.setWsThemes(this.kuneProperties.get(KuneProperties.WS_THEMES).split(","));
data.setDefaultWsTheme(this.kuneProperties.get(KuneProperties.WS_THEMES_DEF));
+ data.setSiteLogoUrl(kuneProperties.get(KuneProperties.SITE_LOGO_URL));
return mapper.map(data, InitDataDTO.class);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -36,7 +36,6 @@
import org.ourproject.kune.workspace.client.actions.DisableRateItAction;
import org.ourproject.kune.workspace.client.actions.EnableRateItAction;
import org.ourproject.kune.workspace.client.actions.InitAction;
-import org.ourproject.kune.workspace.client.actions.InitDataReceivedAction;
import org.ourproject.kune.workspace.client.actions.LoggedInAction;
import org.ourproject.kune.workspace.client.actions.LoggedOutAction;
import org.ourproject.kune.workspace.client.actions.OnlyCheckUserSessionAction;
@@ -74,56 +73,55 @@
private final I18nUITranslationService i18n;
public WorkspaceClientModule(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nUITranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- dispacher = DefaultDispatcher.getInstance();
- this.workspace = workspace;
+ final I18nUITranslationService i18n) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ dispacher = DefaultDispatcher.getInstance();
+ this.workspace = workspace;
}
public void configure(final Register register) {
- register.addAction(WorkspaceEvents.START_APP, new InitAction(session, dispacher, workspace));
- register.addAction(WorkspaceEvents.STOP_APP, new StopAction(workspace));
- register.addAction(WorkspaceEvents.INIT_DATA_RECEIVED, new InitDataReceivedAction(session, workspace));
- register.addAction(WorkspaceEvents.USER_LOGGED_IN, new LoggedInAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.USER_LOGGED_OUT, new LoggedOutAction(session, stateManager));
- register.addAction(WorkspaceEvents.ONLY_CHECK_USER_SESSION, new OnlyCheckUserSessionAction(session));
- register.addAction(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET, new AttachToExtensibleWidgetAction(workspace));
- register.addAction(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
- new DetachFromExtensibleWidgetAction(workspace));
- register.addAction(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET, new ClearExtensibleWidgetAction(workspace));
- register.addAction(WorkspaceEvents.REQ_JOIN_GROUP, new RequestJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.ACCEPT_JOIN_GROUP, new AcceptJoinGroupAction(session, stateManager,
- workspace, i18n));
- register.addAction(WorkspaceEvents.DENY_JOIN_GROUP, new DenyJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.DEL_MEMBER, new DeleteMemberAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.SET_COLLAB_AS_ADMIN, new SetCollabAsAdminAction(session, stateManager,
- workspace, i18n));
- register.addAction(WorkspaceEvents.SET_ADMIN_AS_COLLAB, new SetAdminAsCollabAction(session, stateManager,
- workspace, i18n));
- register
- .addAction(WorkspaceEvents.ADD_ADMIN_MEMBER, new AddAdminAction(session, stateManager, workspace, i18n));
- register.addAction(WorkspaceEvents.ADD_COLLAB_MEMBER, new AddCollabAction(session, stateManager, workspace,
- i18n));
- register.addAction(WorkspaceEvents.ADD_VIEWER_MEMBER, new AddViewerAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.UNJOIN_GROUP, new UnJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.CHANGE_GROUP_WSTHEME, new ChangeGroupWsThemeAction(session, workspace));
- register.addAction(WorkspaceEvents.RATE_CONTENT, new RateContentAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.ENABLE_RATEIT, new EnableRateItAction(workspace));
- register.addAction(WorkspaceEvents.DISABLE_RATEIT, new DisableRateItAction(workspace));
- register.addAction(WorkspaceEvents.GET_TRANSLATION, new GetTranslationAction(session));
- register.addAction(WorkspaceEvents.ADD_MEMBER_GROUPLIVESEARCH, new AddGroupLiveSearchAction(workspace));
- register.addAction(WorkspaceEvents.ADD_USERLIVESEARCH, new AddUserLiveSearchAction(workspace));
- register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n));
- register.addAction(WorkspaceEvents.SHOW_SEARCHER, new ShowSearcherAction());
- register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n));
- register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n));
- register.addAction(WorkspaceEvents.USER_LOGIN, new UserLoginAction());
- register.addAction(WorkspaceEvents.USER_LOGOUT, new UserLogoutAction(session));
- register.addAction(WorkspaceEvents.USER_REGISTER, new UserRegisterAction());
- register.addAction(WorkspaceEvents.CREATE_NEW_GROUP, new CreateNewGroupAction(session));
- register.addAction(WorkspaceEvents.RELOAD_CONTEXT, new ReloadContextAction(stateManager));
- register.addAction(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, new RecalculateWorkspaceAction(workspace));
+ register.addAction(WorkspaceEvents.START_APP, new InitAction(session, dispacher, workspace));
+ register.addAction(WorkspaceEvents.STOP_APP, new StopAction(workspace));
+ register.addAction(WorkspaceEvents.USER_LOGGED_IN, new LoggedInAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.USER_LOGGED_OUT, new LoggedOutAction(session, stateManager));
+ register.addAction(WorkspaceEvents.ONLY_CHECK_USER_SESSION, new OnlyCheckUserSessionAction(session));
+ register.addAction(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET, new AttachToExtensibleWidgetAction(workspace));
+ register.addAction(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
+ new DetachFromExtensibleWidgetAction(workspace));
+ register.addAction(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET, new ClearExtensibleWidgetAction(workspace));
+ register.addAction(WorkspaceEvents.REQ_JOIN_GROUP, new RequestJoinGroupAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.ACCEPT_JOIN_GROUP, new AcceptJoinGroupAction(session, stateManager,
+ workspace, i18n));
+ register.addAction(WorkspaceEvents.DENY_JOIN_GROUP, new DenyJoinGroupAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.DEL_MEMBER, new DeleteMemberAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.SET_COLLAB_AS_ADMIN, new SetCollabAsAdminAction(session, stateManager,
+ workspace, i18n));
+ register.addAction(WorkspaceEvents.SET_ADMIN_AS_COLLAB, new SetAdminAsCollabAction(session, stateManager,
+ workspace, i18n));
+ register
+ .addAction(WorkspaceEvents.ADD_ADMIN_MEMBER, new AddAdminAction(session, stateManager, workspace, i18n));
+ register.addAction(WorkspaceEvents.ADD_COLLAB_MEMBER, new AddCollabAction(session, stateManager, workspace,
+ i18n));
+ register.addAction(WorkspaceEvents.ADD_VIEWER_MEMBER, new AddViewerAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.UNJOIN_GROUP, new UnJoinGroupAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.CHANGE_GROUP_WSTHEME, new ChangeGroupWsThemeAction(session, workspace));
+ register.addAction(WorkspaceEvents.RATE_CONTENT, new RateContentAction(session, stateManager, i18n));
+ register.addAction(WorkspaceEvents.ENABLE_RATEIT, new EnableRateItAction(workspace));
+ register.addAction(WorkspaceEvents.DISABLE_RATEIT, new DisableRateItAction(workspace));
+ register.addAction(WorkspaceEvents.GET_TRANSLATION, new GetTranslationAction(session));
+ register.addAction(WorkspaceEvents.ADD_MEMBER_GROUPLIVESEARCH, new AddGroupLiveSearchAction(workspace));
+ register.addAction(WorkspaceEvents.ADD_USERLIVESEARCH, new AddUserLiveSearchAction(workspace));
+ register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n));
+ register.addAction(WorkspaceEvents.SHOW_SEARCHER, new ShowSearcherAction());
+ register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n));
+ register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n));
+ register.addAction(WorkspaceEvents.USER_LOGIN, new UserLoginAction());
+ register.addAction(WorkspaceEvents.USER_LOGOUT, new UserLogoutAction(session));
+ register.addAction(WorkspaceEvents.USER_REGISTER, new UserRegisterAction());
+ register.addAction(WorkspaceEvents.CREATE_NEW_GROUP, new CreateNewGroupAction(session));
+ register.addAction(WorkspaceEvents.RELOAD_CONTEXT, new ReloadContextAction(stateManager));
+ register.addAction(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, new RecalculateWorkspaceAction(workspace));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitAction.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -44,59 +44,55 @@
private final Workspace workspace;
public InitAction(final Session session, final Dispatcher dispatcher, final Workspace workspace) {
- this.session = session;
- this.dispatcher = dispatcher;
- this.workspace = workspace;
+ this.session = session;
+ this.dispatcher = dispatcher;
+ this.workspace = workspace;
}
public void execute(final Object value) {
- PrefetchUtilities.preFetchImpImages();
- getInitData();
- dispatcher.fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
- Timer prefetchTimer = new Timer() {
- public void run() {
- PrefetchUtilities.doTasksDeferred(workspace);
- }
- };
- prefetchTimer.schedule(20000);
+ PrefetchUtilities.preFetchImpImages();
+ getInitData();
+ dispatcher.fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
+ final Timer prefetchTimer = new Timer() {
+ public void run() {
+ PrefetchUtilities.doTasksDeferred(workspace);
+ }
+ };
+ prefetchTimer.schedule(20000);
}
private void getInitData() {
- SiteServiceAsync server = SiteService.App.getInstance();
- server.getInitData(session.getUserHash(), new AsyncCallback<InitDataDTO>() {
- public void onFailure(final Throwable error) {
- Site.error("Error fetching initial data");
- Log.debug(error.getMessage());
- }
+ final SiteServiceAsync server = SiteService.App.getInstance();
+ server.getInitData(session.getUserHash(), new AsyncCallback<InitDataDTO>() {
+ public void onFailure(final Throwable error) {
+ Site.error("Error fetching initial data");
+ Log.debug(error.getMessage());
+ }
- public void onSuccess(final InitDataDTO initData) {
- checkChatDomain(initData.getChatDomain());
- session.setLicenses(initData.getLicenses());
- session.setWsThemes(initData.getWsThemes());
- session.setDefaultWsTheme(initData.getDefaultWsTheme());
- session.setLanguages(initData.getLanguages());
- session.setCountries(initData.getCountries());
- session.setTimezones(initData.getTimezones());
- UserInfoDTO currentUser = initData.getUserInfo();
- dispatcher.fire(WorkspaceEvents.INIT_DATA_RECEIVED, initData);
- if (currentUser == null) {
- dispatcher.fire(WorkspaceEvents.USER_LOGGED_OUT, null);
- } else {
- dispatcher.fire(WorkspaceEvents.USER_LOGGED_IN, currentUser);
- }
- RootPanel.get("kuneinitialcurtain").setVisible(false);
+ public void onSuccess(final InitDataDTO initData) {
+ checkChatDomain(initData.getChatDomain());
+ session.setInitData(initData);
+ final UserInfoDTO currentUser = initData.getUserInfo();
+ // use signals:
+ dispatcher.fire(WorkspaceEvents.INIT_DATA_RECEIVED, initData);
+ if (currentUser == null) {
+ dispatcher.fire(WorkspaceEvents.USER_LOGGED_OUT, null);
+ } else {
+ dispatcher.fire(WorkspaceEvents.USER_LOGGED_IN, currentUser);
+ }
+ RootPanel.get("kuneinitialcurtain").setVisible(false);
- Site.unMask();
- }
+ Site.unMask();
+ }
- private void checkChatDomain(final String chatDomain) {
- String httpDomain = WindowUtils.getLocation().getHostName();
- if (!chatDomain.equals(httpDomain)) {
- Log.error("Your http domain (" + httpDomain + ") is different from the chat domain (" + chatDomain
- + "). This will produce problems with the chat functionality. "
- + "Check kune.properties on the server.");
- }
- }
- });
+ private void checkChatDomain(final String chatDomain) {
+ final String httpDomain = WindowUtils.getLocation().getHostName();
+ if (!chatDomain.equals(httpDomain)) {
+ Log.error("Your http domain (" + httpDomain + ") is different from the chat domain (" + chatDomain
+ + "). This will produce problems with the chat functionality. "
+ + "Check kune.properties on the server.");
+ }
+ }
+ });
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/InitDataReceivedAction.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -1,45 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.actions;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class InitDataReceivedAction implements Action<Object> {
-
- private final Workspace workspace;
- private final Session session;
-
- public InitDataReceivedAction(final Session session, final Workspace workspace) {
- this.session = session;
- this.workspace = workspace;
- }
-
- public void execute(final Object value) {
- onInitDataReceived();
- }
-
- private void onInitDataReceived() {
- workspace.setTheme(session.getDefaultWsTheme());
- workspace.getThemeMenuComponent().setThemes(session.getWsThemes());
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -44,6 +44,7 @@
entityLicensePresenter.setLicense(state);
// Only for probes:
wsThemePresenter.setVisible(true);
+ wsThemePresenter.setTheme(new WsTheme(group.getWorkspaceTheme()));
}
public void setTheme(final WsTheme theme) {
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogo.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+public interface SiteLogo {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPanel.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,19 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Image;
+
+public class SiteLogoPanel implements SiteLogoView {
+
+ private final Image siteLogoImg;
+
+ public SiteLogoPanel(final SiteLogoPresenter presenter, final WorkspaceSkeleton ws) {
+ siteLogoImg = new Image();
+ ws.getSiteBar().add(siteLogoImg);
+ }
+
+ public void setSiteLogoUrl(final String siteLogoUrl) {
+ siteLogoImg.setUrl(siteLogoUrl);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoPresenter.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,29 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
+import org.ourproject.kune.platf.client.state.Session;
+
+import com.calclab.suco.client.signal.Slot;
+
+public class SiteLogoPresenter implements SiteLogo {
+
+ private SiteLogoView view;
+
+ public SiteLogoPresenter(final Session session) {
+ session.onInitDataReceived(new Slot<InitDataDTO>() {
+ public void onEvent(final InitDataDTO initData) {
+ view.setSiteLogoUrl(initData.getSiteLogoUrl());
+ }
+ });
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final SiteLogoView view) {
+ this.view = view;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitelogo/SiteLogoView.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface SiteLogoView extends View {
+ void setSiteLogoUrl(String siteLogoUrl);
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -24,6 +24,7 @@
trayBar = mainPanel.createBottomBar(entitySummary, "k-site-traybar");
mainPanel.add(entityTools, DefaultBorderLayout.Position.NORTH, 30);
mainPanel.add(entitySummary, DefaultBorderLayout.Position.CENTER);
+ trayBar.addFill();
}
public void addInSummary(final Widget widget) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -1,5 +1,48 @@
package org.ourproject.kune.workspace.client.ui.newtmp.themes;
-public enum WsTheme {
- def, green, blue, grey, purple, red
+public class WsTheme {
+ private final String name;
+
+ public WsTheme(final String name) {
+ this.name = name;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final WsTheme other = (WsTheme) obj;
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ return true;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (name == null ? 0 : name.hashCode());
+ return result;
+ }
+
+ public String toString() {
+ return name;
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -13,10 +13,26 @@
public class WsThemePanel extends ToolbarButton implements WsThemeView {
private final Menu menu;
+ private final WsThemePresenter presenter;
public WsThemePanel(final WorkspaceSkeleton ws, final WsThemePresenter presenter) {
+ this.presenter = presenter;
menu = new Menu();
- for (final WsTheme theme : WsTheme.values()) {
+
+ menu.setDefaultAlign("br-tr");
+ super.setMenu(menu);
+ super.setIcon("images/colors.gif");
+ ws.getSiteTraybar().addButton(this);
+ presenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ ws.setTheme(oldTheme, newTheme);
+ }
+ });
+ }
+
+ public void setThemes(final String[] themes) {
+ for (int i = 0; i < themes.length; i++) {
+ final WsTheme theme = new WsTheme(themes[i]);
final MenuItem item = new MenuItem();
item.setText(theme.toString());
menu.addItem(item);
@@ -27,14 +43,6 @@
}
});
}
- menu.setDefaultAlign("br-tr");
- super.setMenu(menu);
- ws.getSiteTraybar().addButton(this);
- presenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
- public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
- ws.setTheme(oldTheme, newTheme);
- }
- });
}
public void setVisible(final boolean visible) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -1,6 +1,10 @@
package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
+import org.ourproject.kune.platf.client.state.Session;
+
import com.calclab.suco.client.signal.Signal2;
+import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot2;
public class WsThemePresenter {
@@ -9,8 +13,13 @@
private WsTheme previousTheme;
private final Signal2<WsTheme, WsTheme> onThemeChanged;
- public WsThemePresenter() {
+ public WsThemePresenter(final Session session) {
this.onThemeChanged = new Signal2<WsTheme, WsTheme>("onThemeChanged");
+ session.onInitDataReceived(new Slot<InitDataDTO>() {
+ public void onEvent(final InitDataDTO initData) {
+ view.setThemes(initData.getWsThemes());
+ }
+ });
}
public void init(final WsThemeView view) {
@@ -22,7 +31,9 @@
}
public void setTheme(final WsTheme newTheme) {
- onThemeChanged.fire(previousTheme, newTheme);
+ if (previousTheme == null || !previousTheme.equals(newTheme)) {
+ onThemeChanged.fire(previousTheme, newTheme);
+ }
previousTheme = newTheme;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -2,6 +2,8 @@
public interface WsThemeView {
+ void setThemes(String[] themes);
+
void setVisible(boolean visible);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-10 17:00:24 UTC (rev 796)
@@ -36,7 +36,6 @@
import org.ourproject.kune.workspace.client.workspace.WorkspaceView;
import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.ChangeListener;
import com.google.gwt.user.client.ui.Composite;
@@ -309,27 +308,38 @@
}
public void setTheme(final String theme) {
- colorTheme.setTheme(theme);
- final String mainColor = colorTheme.getContentMainBorder();
- // groupLogoPanel.setTextColor(colorTheme.getContentTitleText());
- contentTitleBarBorderDec.setColor(mainColor);
- bottomBorderDecorator.setColor(mainColor);
- DOM.setStyleAttribute(cntcxtVP.getElement(), "borderRightColor", mainColor);
- contentTitlePanel.setColors(colorTheme.getContentTitle(), colorTheme.getContentTitleText());
- contentSubTitlePanel.setColors(mainColor, colorTheme.getContentSubTitleText());
- DOM.setStyleAttribute(contentTitleBarHP.getElement(), "borderLeftColor", mainColor);
- DOM.setStyleAttribute(contentTitleBarHP.getElement(), "backgroundColor", colorTheme.getContentTitle());
- DOM.setStyleAttribute(contentSubTitleBarHP.getElement(), "backgroundColor", mainColor);
- DOM.setStyleAttribute(contentBottomBarHP.getElement(), "backgroundColor", mainColor);
- DOM.setStyleAttribute(cntcxtHSP.getRightWidget().getElement(), "backgroundColor", colorTheme.getContext());
- DOM.setStyleAttribute(DOM.getChild(DOM.getChild(cntcxtHSP.getElement(), 0), 1), "backgroundColor", colorTheme
- .getSplitter());
- DOM.setStyleAttribute(contentBottomBarHP.getWidget(0).getElement(), "color", colorTheme.getContentBottomText());
- groupMembersPanel.setColor(colorTheme.getGroupMembersDD());
- participationPanel.setColor(colorTheme.getParticipationDD());
- groupSummaryPanel.setColor(colorTheme.getSummaryDD());
- tagsPanel.setColor(colorTheme.getTagsDD());
- groupToolsBar.setTabsColors(colorTheme.getToolSelected(), colorTheme.getToolUnselected());
+ // colorTheme.setTheme(theme);
+ // final String mainColor = colorTheme.getContentMainBorder();
+ // // groupLogoPanel.setTextColor(colorTheme.getContentTitleText());
+ // contentTitleBarBorderDec.setColor(mainColor);
+ // bottomBorderDecorator.setColor(mainColor);
+ // DOM.setStyleAttribute(cntcxtVP.getElement(), "borderRightColor",
+ // mainColor);
+ // contentTitlePanel.setColors(colorTheme.getContentTitle(),
+ // colorTheme.getContentTitleText());
+ // contentSubTitlePanel.setColors(mainColor,
+ // colorTheme.getContentSubTitleText());
+ // DOM.setStyleAttribute(contentTitleBarHP.getElement(),
+ // "borderLeftColor", mainColor);
+ // DOM.setStyleAttribute(contentTitleBarHP.getElement(),
+ // "backgroundColor", colorTheme.getContentTitle());
+ // DOM.setStyleAttribute(contentSubTitleBarHP.getElement(),
+ // "backgroundColor", mainColor);
+ // DOM.setStyleAttribute(contentBottomBarHP.getElement(),
+ // "backgroundColor", mainColor);
+ // DOM.setStyleAttribute(cntcxtHSP.getRightWidget().getElement(),
+ // "backgroundColor", colorTheme.getContext());
+ // DOM.setStyleAttribute(DOM.getChild(DOM.getChild(cntcxtHSP.getElement(),
+ // 0), 1), "backgroundColor", colorTheme
+ // .getSplitter());
+ // DOM.setStyleAttribute(contentBottomBarHP.getWidget(0).getElement(),
+ // "color", colorTheme.getContentBottomText());
+ // groupMembersPanel.setColor(colorTheme.getGroupMembersDD());
+ // participationPanel.setColor(colorTheme.getParticipationDD());
+ // groupSummaryPanel.setColor(colorTheme.getSummaryDD());
+ // tagsPanel.setColor(colorTheme.getTagsDD());
+ // groupToolsBar.setTabsColors(colorTheme.getToolSelected(),
+ // colorTheme.getToolUnselected());
}
public void setTool(final String toolName) {
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2008-07-10 02:28:27 UTC (rev 795)
+++ trunk/src/main/resources/kune.properties 2008-07-10 17:00:24 UTC (rev 796)
@@ -17,6 +17,8 @@
kune.chat.domain = localhost
kune.chat.roomHost = rooms.localhost
-# Workspace themes (see colorthemes.js)
-kune.wsthemes = defaultKuneTheme,greenKuneTheme,blueKuneTheme,greyKuneTheme,purpleKuneTheme,redKuneTheme
-kune.wsthemes.default = defaultKuneTheme
+# Workspace enabled themes
+kune.wsthemes = def,green,blue,grey,purple,red
+kune.wsthemes.default = def
+
+kune.sitelogourl = images/kune-logo-16px.png
\ No newline at end of file
1
0
10 Jul '08
Author: vjrj
Date: 2008-07-10 04:28:27 +0200 (Thu, 10 Jul 2008)
New Revision: 795
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
Log:
Better theme support
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-10 02:28:27 UTC (rev 795)
@@ -14,7 +14,7 @@
.k-EntityTextLogo {
border: 2px solid #F2F2F2;
height: 60px;
- margin-bottom: 4px;
+ margin: 0 0 4px -1px;
overflow: hidden;
width: 468px;
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatFactory.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -47,39 +47,39 @@
private static I18nTranslationService i18n;
public static ChatContent createChatContent(final EmiteUIDialog emiteUIDialog, final I18nTranslationService i18n) {
- ChatFactory.i18n = i18n;
- WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- ChatContentPresenter presenter = new ChatContentPresenter(emiteUIDialog, panel);
- return presenter;
+ ChatFactory.i18n = i18n;
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final ChatContentPresenter presenter = new ChatContentPresenter(emiteUIDialog, panel);
+ return presenter;
}
public static ChatContext createChatContext() {
- WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- ChatContextPresenter presenter = new ChatContextPresenter(panel);
- return presenter;
+ final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
+ final ChatContextPresenter presenter = new ChatContextPresenter(panel);
+ return presenter;
}
public static ChatInfo createChatInfo(final ChatRoomListener listener) {
- ChatInfoPanel panel = new ChatInfoPanel(listener);
- return panel;
+ final ChatInfoPanel panel = new ChatInfoPanel(listener);
+ return panel;
}
public static ChatRoomControl createChatRoomControlViewer(final ChatRoomListener listener) {
- ChatRoomControlPanel panel = new ChatRoomControlPanel(listener, i18n);
- ChatRoomControlPresenter presenter = new ChatRoomControlPresenter(panel);
- return presenter;
+ final ChatRoomControlPanel panel = new ChatRoomControlPanel(listener, i18n);
+ final ChatRoomControlPresenter presenter = new ChatRoomControlPresenter(panel);
+ return presenter;
}
public static ChatRoom createChatRoomViewer(final ChatRoomListener listener) {
- ChatRoomPanel panel = new ChatRoomPanel();
- ChatRoomPresenter presenter = new ChatRoomPresenter(panel);
- return presenter;
+ final ChatRoomPanel panel = new ChatRoomPanel();
+ final ChatRoomPresenter presenter = new ChatRoomPresenter(panel);
+ return presenter;
}
public static RoomsAdmin createRoomsAdmin() {
- ContextItems contextItems = WorkspaceFactory.createContextItems();
- RoomsAdminPresenter presenter = new RoomsAdminPresenter(contextItems, i18n);
- return presenter;
+ final ContextItems contextItems = WorkspaceFactory.createContextItems();
+ final RoomsAdminPresenter presenter = new RoomsAdminPresenter(contextItems, i18n);
+ return presenter;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -38,9 +38,9 @@
import org.ourproject.kune.workspace.client.WorkspaceClientModule;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.google.gwt.user.client.Window;
@@ -67,26 +67,12 @@
final I18nUITranslationService i18n = kune.getI18N();
// Temporary new ws
- final WorkspaceManager wmanager = kune.getInstance(WorkspaceManager.class);
+ final WsThemePresenter wstheme = kune.getInstance(WsThemePresenter.class);
final WorkspaceSkeleton ws = kune.getInstance(WorkspaceSkeleton.class);
- // final com.gwtext.client.widgets.Window dialog = new
- // com.gwtext.client.widgets.Window("gwt-ext new ws 3", 640,
- // 480);
- // final Panel panel = new Panel();
- // panel.setPaddings(5);
- // panel.setLayout(new FitLayout());
- // panel.add(((WorkspaceSkeleton) wsmanager.getView()).getPanel());
- // new Viewport(panel);
- // wsnew.getPanel().setWidth(640);
- // wsnew.getPanel().setHeight(460);
- // panel.setWidth(640);
- // panel.setHeight(460);
- // dialog.add(panel);
- // dialog.show();
- ws.setTheme(WsTheme.def);
+
+ wstheme.setTheme(WsTheme.def);
ws.show();
ws.getEntityWorkspace().getContentTopBar().add(new Label("Sorry, kune workspace under heavy refactorization"));
- wmanager.setTheme(WsTheme.def);
// Testing providers:
platform.install(new PlatformClientModule(session, kune.getProvider(StateManager.class)));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -131,7 +131,7 @@
builder.registerProvider(WsThemePresenter.class, new Provider<WsThemePresenter>() {
public WsThemePresenter get() {
final WsThemePresenter presenter = new WsThemePresenter();
- final WsThemePanel panel = new WsThemePanel(ws);
+ final WsThemePanel panel = new WsThemePanel(ws, presenter);
presenter.init(panel);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -9,6 +9,8 @@
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
+import com.calclab.suco.client.signal.Slot2;
+
public class WorkspaceManager {
private final EntityLogo entityLogo;
@@ -23,8 +25,13 @@
this.entityLogo = entityLogo;
this.entityTitlePresenter = entityTitlePresenter;
this.entitySubTitlePresenter = entitySubTitlePresenter;
+ this.entityLicensePresenter = entityLicensePresenter;
this.wsThemePresenter = wsThemePresenter;
- this.entityLicensePresenter = entityLicensePresenter;
+ wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ entityLogo.setTheme(oldTheme, newTheme);
+ }
+ });
}
public void setState(final StateDTO state) {
@@ -40,6 +47,5 @@
}
public void setTheme(final WsTheme theme) {
- entityLogo.setTheme(theme);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -33,8 +33,11 @@
return entityWorkspace;
}
- public void setTheme(final WsTheme theme) {
- super.setCls("k-entity-" + theme);
- entityWorkspace.setTheme(theme);
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ super.removeStyle("k-entity-" + oldTheme);
+ }
+ super.addStyle("k-entity-" + newTheme);
+ entityWorkspace.setTheme(oldTheme, newTheme);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -23,7 +23,6 @@
private final RoundedPanel roundedTitle;
private final RoundedPanel roundedBottom;
private final DefaultBorderLayout containerWrap;
- private WsTheme previousTheme;
public EntityWorkspace() {
final Panel titles = new Panel();
@@ -120,23 +119,22 @@
setPanel(content, (Widget) view);
}
- public void setTheme(final WsTheme theme) {
- final String themeS = theme.toString();
- if (previousTheme != null) {
- final String previousThemeS = previousTheme.toString();
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ final String themeS = newTheme.toString();
+ if (oldTheme != null) {
+ final String previousThemeS = oldTheme.toString();
title.removeStyleDependentName(previousThemeS);
subTitle.removeStyleDependentName(previousThemeS);
bottom.removeStyleDependentName(previousThemeS);
super.removeStyle("k-entityworkspace-" + previousThemeS);
container.removeStyleName("k-entity-container-" + previousThemeS);
}
- super.addStyle("k-entityworkspace-" + theme);
- roundedTitle.setCornerStyleName("k-entity-title-rd-" + theme);
- roundedBottom.setCornerStyleName("k-entity-bottom-rd-" + theme);
+ super.addStyle("k-entityworkspace-" + newTheme);
+ roundedTitle.setCornerStyleName("k-entity-title-rd-" + newTheme);
+ roundedBottom.setCornerStyleName("k-entity-bottom-rd-" + newTheme);
title.addStyleDependentName(themeS);
subTitle.addStyleDependentName(themeS);
bottom.addStyleDependentName(themeS);
- container.addStyleName("k-entity-container-" + theme);
- previousTheme = theme;
+ container.addStyleName("k-entity-container-" + newTheme);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -47,8 +47,8 @@
return entity.getEntitySummary().getSiteTraybar();
}
- public void setTheme(final WsTheme theme) {
- entity.setTheme(theme);
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ entity.setTheme(oldTheme, newTheme);
}
public void show() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -2,6 +2,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import com.calclab.suco.client.signal.Slot2;
import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.menu.BaseItem;
@@ -13,7 +14,7 @@
private final Menu menu;
- public WsThemePanel(final WorkspaceSkeleton ws) {
+ public WsThemePanel(final WorkspaceSkeleton ws, final WsThemePresenter presenter) {
menu = new Menu();
for (final WsTheme theme : WsTheme.values()) {
final MenuItem item = new MenuItem();
@@ -22,13 +23,18 @@
item.addListener(new BaseItemListenerAdapter() {
@Override
public void onClick(final BaseItem item, final EventObject e) {
- ws.setTheme(theme);
+ presenter.setTheme(theme);
}
});
}
menu.setDefaultAlign("br-tr");
super.setMenu(menu);
ws.getSiteTraybar().addButton(this);
+ presenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() {
+ public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) {
+ ws.setTheme(oldTheme, newTheme);
+ }
+ });
}
public void setVisible(final boolean visible) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -1,14 +1,33 @@
package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+import com.calclab.suco.client.signal.Signal2;
+import com.calclab.suco.client.signal.Slot2;
+
public class WsThemePresenter {
private WsThemeView view;
+ private WsTheme previousTheme;
+ private final Signal2<WsTheme, WsTheme> onThemeChanged;
+ public WsThemePresenter() {
+ this.onThemeChanged = new Signal2<WsTheme, WsTheme>("onThemeChanged");
+ }
+
public void init(final WsThemeView view) {
this.view = view;
}
+ public void onThemeChanged(final Slot2<WsTheme, WsTheme> slot) {
+ onThemeChanged.add(slot);
+ }
+
+ public void setTheme(final WsTheme newTheme) {
+ onThemeChanged.fire(previousTheme, newTheme);
+ previousTheme = newTheme;
+ }
+
public void setVisible(final boolean visible) {
view.setVisible(visible);
}
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -12,6 +12,6 @@
public abstract void setPutYourLogoVisible(final boolean visible);
- public abstract void setTheme(final WsTheme theme);
+ public abstract void setTheme(final WsTheme oldTheme, WsTheme newTheme);
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-07-09 23:43:14 UTC (rev 794)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-07-10 02:28:27 UTC (rev 795)
@@ -106,8 +106,11 @@
getEntityTextLogo().setPutYourLogoVisible(visible);
}
- public void setTheme(final WsTheme theme) {
- getEntityTextLogo().addStyleDependentName(theme.toString());
+ public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
+ if (oldTheme != null) {
+ getEntityTextLogo().removeStyleDependentName(oldTheme.toString());
+ }
+ getEntityTextLogo().addStyleDependentName(newTheme.toString());
}
private EntityTextLogo getEntityTextLogo() {
1
0
Author: vjrj
Date: 2008-07-10 01:43:14 +0200 (Thu, 10 Jul 2008)
New Revision: 794
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicenseView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitleView.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java
Log:
gwt-ext workspace refactorization
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-09 23:43:14 UTC (rev 794)
@@ -64,20 +64,20 @@
}
.k-entity-title {
- line-height: 22px;
border-left-style: solid;
border-left-width: 2px;
}
.k-entity-title div {
- white-space: nowrap;
+ line-height: 22px;
+ white-space: nowrap;
}
.k-entity-subtitle {
- line-height: 2em;
}
.k-entity-subtitle div {
+ line-height: 22px;
white-space: nowrap;
}
@@ -91,23 +91,35 @@
.k-entity-title-def {
background: #F1BB59 none repeat scroll 0% 50%;
- color: #69312F;
border-left-color: #DD8A3D;
}
+.k-entity-title-def div {
+ color: #69312F;
+}
+
.k-entity-title-green {
background: #AFA none repeat scroll 0% 50%;
- color: #250;
border-left-color: #5FD35F;
}
+.k-entity-title-green div {
+ color: #250;
+}
+
.k-entity-subtitle-def {
background: #DD8A3D none repeat scroll 0% 50%;
+}
+
+.k-entity-subtitle-def div {
color: #FFF;
}
.k-entity-subtitle-green {
background: #5FD35F none repeat scroll 0% 50%;
+}
+
+.k-entity-subtitle-green div {
color: #FFF;
}
@@ -119,6 +131,12 @@
background: #5FD35F;
}
+.k-entitylicensepanel-licensetext {
+ cursor: pointer;
+ margin-left: 5px;
+ text-decoration: underline;
+}
+
.k-entity-container-def div {
background: #FFD09D none repeat scroll 0% 50%;
}
@@ -127,17 +145,23 @@
background: #CFA none repeat scroll 0% 50%;
}
-.k-entity-bottom {
+.k-entity-bottom div {
line-height: 2em;
}
.k-entity-bottom-def {
background: #DD8A3D;
+}
+
+.k-entity-bottom-def div {
color: #FFF;
}
.k-entity-bottom-green {
background: #5FD35F;
+}
+
+.k-entity-bottom-green div {
color: #FFF;
}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-07-09 23:43:14 UTC (rev 794)
@@ -165,45 +165,7 @@
}
/* Content titles */
-.kune-ContentTitleBar {
- border-left: 2px solid #DD8A3D;
- width: 100%;
- height: 25px;
- vertical-align: middle;
-}
-.kune-ContentTitleBar .gwt-Label {
- width: 100%;
-}
-
-.kune-ContentTitleBar-l {
- float: left;
-}
-
-.kune-ContentTitleBar-r {
- float: right;
-}
-
-.kune-ContentSubTitleBar {
- vertical-align: middle;
- font-weight: 700;
- width: 100%;
- height: 23px;
-}
-
-.kune-ContentSubTitleBar .gwt-Label {
- width: 100%;
- white-space: nowrap;
-}
-
-.kune-ContentSubTitleBar-l {
- float: left;
-}
-
-.kune-ContentSubTitleBar-r {
- float: right;
-}
-
.kune-ContentToolBarPanel {
background-color: #F2F2F2;
padding: 2px;
@@ -226,12 +188,6 @@
}
-.kune-LicensePanel-licensetext {
- cursor: pointer;
- margin-left: 5px;
- text-decoration: underline;
-}
-
/* Main Content & Context */
.kune-WorkspacePanel-Content {
background-color: #FCFCFC;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -19,9 +19,15 @@
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePanel;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
@@ -141,10 +147,38 @@
}
}, SingletonScope.class);
+ builder.registerProvider(EntitySubTitlePresenter.class, new Provider<EntitySubTitlePresenter>() {
+ public EntitySubTitlePresenter get() {
+ final EntitySubTitlePresenter presenter = new EntitySubTitlePresenter(i18n);
+ final EntitySubTitlePanel panel = new EntitySubTitlePanel(presenter, i18n, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(EntityLicensePresenter.class, new Provider<EntityLicensePresenter>() {
+ public EntityLicensePresenter get() {
+ final EntityLicensePresenter presenter = new EntityLicensePresenter();
+ final EntityLicensePanel panel = new EntityLicensePanel(presenter, i18n, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(SiteBarPresenter.class, new Provider<SiteBarPresenter>() {
+ public SiteBarPresenter get() {
+ final SiteBarPresenter presenter = new SiteBarPresenter();
+ final SiteBarPanel panel = new SiteBarPanel(presenter, i18n, ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
builder.registerProvider(WorkspaceManager.class, new Provider<WorkspaceManager>() {
public WorkspaceManager get() {
final WorkspaceManager presenter = new WorkspaceManager(builder.getInstance(EntityLogo.class), builder
- .getInstance(EntityTitlePresenter.class), builder.getInstance(WsThemePresenter.class));
+ .getInstance(EntityTitlePresenter.class), builder.getInstance(EntitySubTitlePresenter.class),
+ builder.getInstance(WsThemePresenter.class), builder.getInstance(EntityLicensePresenter.class));
return presenter;
}
}, SingletonScope.class);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -72,6 +72,10 @@
doLayoutIfNeeded();
}
+ public void addStyle(final String style) {
+ mainPanel.addClass(style);
+ }
+
public Toolbar createBottomBar(final Panel panel) {
return createBottomBar(panel, null);
}
@@ -110,10 +114,15 @@
return mainPanel;
}
+ public void removeStyle(final String style) {
+ mainPanel.removeClass(style);
+ }
+
public void setBorder(final boolean border) {
mainPanel.setBorder(border);
}
+ @Deprecated
public void setCls(final String style) {
mainPanel.setCls(style);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -2,8 +2,10 @@
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter;
import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
@@ -12,12 +14,17 @@
private final EntityLogo entityLogo;
private final EntityTitlePresenter entityTitlePresenter;
private final WsThemePresenter wsThemePresenter;
+ private final EntityLicensePresenter entityLicensePresenter;
+ private final EntitySubTitlePresenter entitySubTitlePresenter;
public WorkspaceManager(final EntityLogo entityLogo, final EntityTitlePresenter entityTitlePresenter,
- final WsThemePresenter wsThemePresenter) {
+ final EntitySubTitlePresenter entitySubTitlePresenter, final WsThemePresenter wsThemePresenter,
+ final EntityLicensePresenter entityLicensePresenter) {
this.entityLogo = entityLogo;
this.entityTitlePresenter = entityTitlePresenter;
+ this.entitySubTitlePresenter = entitySubTitlePresenter;
this.wsThemePresenter = wsThemePresenter;
+ this.entityLicensePresenter = entityLicensePresenter;
}
public void setState(final StateDTO state) {
@@ -26,12 +33,13 @@
entityLogo.setLogo(group.getLongName());
entityLogo.setPutYourLogoVisible(isAdmin);
entityTitlePresenter.setState(state);
+ entitySubTitlePresenter.setState(state);
+ entityLicensePresenter.setLicense(state);
// Only for probes:
wsThemePresenter.setVisible(true);
}
public void setTheme(final WsTheme theme) {
entityLogo.setTheme(theme);
- entityTitlePresenter.setTheme(theme);
}
}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePanel.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePanel.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,79 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.licensefoot;
+
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.TitleBar;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+
+public class EntityLicensePanel implements EntityLicenseView {
+ private final Label copyright;
+ private final Image image;
+ private final Label license;
+ private final I18nTranslationService i18n;
+
+ public EntityLicensePanel(final EntityLicensePresenter presenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ this.i18n = i18n;
+ copyright = new Label();
+ image = new Image();
+ license = new Label();
+ final TitleBar bottomTitle = ws.getEntityWorkspace().getBottomTitle();
+ bottomTitle.add(copyright);
+ bottomTitle.add(license);
+ bottomTitle.addSpacer();
+ bottomTitle.addSpacer();
+ bottomTitle.add(image);
+ final ClickListener clickListener = new ClickListener() {
+ public void onClick(Widget arg0) {
+ presenter.onLicenseClick();
+ }
+ };
+
+ license.addClickListener(clickListener);
+ image.addClickListener(clickListener);
+ copyright.setVisible(false);
+ license.setVisible(false);
+ image.setVisible(false);
+
+ copyright.addStyleName("kune-Margin-Large-l");
+ license.setStyleName("k-entitylicensepanel-licensetext");
+ }
+
+ public void openWindow(final String url) {
+ Window.open(url, "_blank", "");
+ }
+
+ public void showLicense(final String groupName, final LicenseDTO licenseDTO) {
+ copyright.setText(i18n.t("© [%s], under license: ", groupName));
+ license.setText(licenseDTO.getLongName());
+ copyright.setVisible(true);
+ license.setVisible(true);
+ image.setVisible(true);
+ image.setUrl(licenseDTO.getImageUrl());
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicensePresenter.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,50 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.licensefoot;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+
+public class EntityLicensePresenter {
+
+ private EntityLicenseView view;
+ private LicenseDTO license;
+
+ public EntityLicensePresenter() {
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final EntityLicenseView view) {
+ this.view = view;
+ }
+
+ public void onLicenseClick() {
+ view.openWindow(license.getUrl());
+ }
+
+ public void setLicense(final StateDTO state) {
+ this.license = state.getLicense();
+ view.showLicense(state.getGroup().getLongName(), license);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicenseView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicenseView.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/licensefoot/EntityLicenseView.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,31 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.licensefoot;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.LicenseDTO;
+
+public interface EntityLicenseView extends View {
+
+ void showLicense(String groupName, LicenseDTO licenseDTO);
+
+ void openWindow(String url);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.sitebar;
+
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+public class SiteBarPanel implements SiteBarView {
+
+ public SiteBarPanel(final SiteBarPresenter presenter, final I18nUITranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.sitebar;
+
+public class SiteBarPresenter {
+
+ private SiteBarView view;
+
+ public void init(final SiteBarView view) {
+ this.view = view;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,26 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.sitebar;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface SiteBarView extends View {
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -3,38 +3,43 @@
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
public class AbstractBar extends Composite {
- private final HorizontalPanel horPanel;
+ private final HorizontalPanel childPanel;
+ private final HorizontalPanel mainPanel;
public AbstractBar() {
- horPanel = new HorizontalPanel();
- horPanel.setWidth("100%");
- initWidget(horPanel);
+ mainPanel = new HorizontalPanel();
+ childPanel = new HorizontalPanel();
+ mainPanel.add(childPanel);
+ initWidget(mainPanel);
+ mainPanel.setWidth("100%");
}
public void add(final Widget widget) {
- horPanel.add(widget);
+ childPanel.add(widget);
+ childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
}
public void addFill() {
final Label emptyLabel = new Label("");
- horPanel.add(emptyLabel);
- horPanel.setCellWidth(emptyLabel, "100%");
+ this.add(emptyLabel);
+ childPanel.setCellWidth(emptyLabel, "100%");
}
public void addSeparator() {
final Label emptyLabel = new Label("");
emptyLabel.setStyleName("ytb-sep");
emptyLabel.addStyleName("k-toolbar-sep");
- horPanel.add(emptyLabel);
+ this.add(emptyLabel);
}
public void addSpacer() {
final Label emptyLabel = new Label("");
emptyLabel.setStyleName("ytb-spacer");
- horPanel.add(emptyLabel);
+ this.add(emptyLabel);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -23,6 +23,7 @@
private final RoundedPanel roundedTitle;
private final RoundedPanel roundedBottom;
private final DefaultBorderLayout containerWrap;
+ private WsTheme previousTheme;
public EntityWorkspace() {
final Panel titles = new Panel();
@@ -121,12 +122,21 @@
public void setTheme(final WsTheme theme) {
final String themeS = theme.toString();
- super.setCls("k-entityworkspace-" + theme);
+ if (previousTheme != null) {
+ final String previousThemeS = previousTheme.toString();
+ title.removeStyleDependentName(previousThemeS);
+ subTitle.removeStyleDependentName(previousThemeS);
+ bottom.removeStyleDependentName(previousThemeS);
+ super.removeStyle("k-entityworkspace-" + previousThemeS);
+ container.removeStyleName("k-entity-container-" + previousThemeS);
+ }
+ super.addStyle("k-entityworkspace-" + theme);
roundedTitle.setCornerStyleName("k-entity-title-rd-" + theme);
roundedBottom.setCornerStyleName("k-entity-bottom-rd-" + theme);
title.addStyleDependentName(themeS);
subTitle.addStyleDependentName(themeS);
bottom.addStyleDependentName(themeS);
- container.setStyleName("k-entity-container-" + theme);
+ container.addStyleName("k-entity-container-" + theme);
+ previousTheme = theme;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -2,6 +2,7 @@
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import com.gwtext.client.core.EventObject;
import com.gwtext.client.widgets.ToolbarButton;
import com.gwtext.client.widgets.menu.BaseItem;
import com.gwtext.client.widgets.menu.Menu;
@@ -19,7 +20,8 @@
item.setText(theme.toString());
menu.addItem(item);
item.addListener(new BaseItemListenerAdapter() {
- public void onActivate(final BaseItem item) {
+ @Override
+ public void onClick(final BaseItem item, final EventObject e) {
ws.setTheme(theme);
}
});
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePanel.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePanel.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,68 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.title;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.TitleBar;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Label;
+
+public class EntitySubTitlePanel implements EntitySubTitleView {
+ private final Label subTitleLeftLabel;
+ private final Label subTitleRightLabel;
+
+ public EntitySubTitlePanel(final EntitySubTitlePresenter presenter, final I18nTranslationService i18n,
+ final WorkspaceSkeleton ws) {
+ subTitleLeftLabel = new Label();
+ subTitleRightLabel = new Label();
+
+ final TitleBar wsSubTitle = ws.getEntityWorkspace().getSubTitle();
+ wsSubTitle.add(subTitleLeftLabel);
+ wsSubTitle.addFill();
+ wsSubTitle.add(subTitleRightLabel);
+
+ subTitleRightLabel.setText(i18n.t("Language:"));
+
+ subTitleLeftLabel.addStyleName("kune-Margin-Large-l");
+ subTitleLeftLabel.addStyleName("kune-ft15px");
+ subTitleRightLabel.addStyleName("kune-Margin-Large-r");
+ subTitleRightLabel.addStyleName("kune-ft12px");
+ }
+
+ public void setContentSubTitleLeft(final String subTitle) {
+ subTitleLeftLabel.setText(subTitle);
+ }
+
+ public void setContentSubTitleLeftVisible(final boolean visible) {
+ subTitleLeftLabel.setVisible(visible);
+ }
+
+ public void setContentSubTitleRight(final String subTitle) {
+ subTitleRightLabel.setText(subTitle);
+
+ }
+
+ public void setContentSubTitleRightVisible(final boolean visible) {
+ subTitleRightLabel.setVisible(visible);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitlePresenter.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,65 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.title;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+
+public class EntitySubTitlePresenter {
+
+ private EntitySubTitleView view;
+ private final I18nTranslationService i18n;
+
+ public EntitySubTitlePresenter(final I18nTranslationService i18n) {
+ this.i18n = i18n;
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final EntitySubTitleView view) {
+ this.view = view;
+ }
+
+ public void setContentLanguage(final String langName) {
+ view.setContentSubTitleRight(i18n.t("Language: [%s]", langName));
+ }
+
+ public void setState(final StateDTO state) {
+ if (state.hasDocument()) {
+ view.setContentSubTitleLeft(i18n.tWithNT("by: [%s]", "used in a list of authors", state.getAuthors().get(0)
+ .getName()));
+ view.setContentSubTitleLeftVisible(true);
+ } else {
+ view.setContentSubTitleLeftVisible(false);
+ }
+ if (state.getLanguage() != null) {
+ final String langName = state.getLanguage().getEnglishName();
+ setContentLanguage(langName);
+ view.setContentSubTitleRightVisible(true);
+ } else {
+ view.setContentSubTitleRightVisible(false);
+ }
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitleView.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntitySubTitleView.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -0,0 +1,34 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.title;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EntitySubTitleView extends View {
+
+ void setContentSubTitleLeft(String subTitle);
+
+ void setContentSubTitleRight(String subTitle);
+
+ void setContentSubTitleLeftVisible(boolean visible);
+
+ void setContentSubTitleRightVisible(boolean visible);
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -24,7 +24,6 @@
import org.ourproject.kune.platf.client.ui.EditableIconLabel;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.TitleBar;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import com.google.gwt.user.client.ui.Label;
@@ -48,8 +47,6 @@
titleLabel.addStyleName("kune-ft17px");
dateLabel.addStyleName("kune-Margin-Large-r");
dateLabel.addStyleName("kune-ft12px");
- titleLabel.addStyleName("kune-ContentTitleBar-l");
- dateLabel.addStyleName("kune-ContentTitleBar-r");
}
public void restoreOldTitle() {
@@ -70,10 +67,6 @@
public void setDateVisible(final boolean visible) {
dateLabel.setVisible(visible);
-
}
- public void setTheme(final WsTheme theme) {
-
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -31,7 +31,6 @@
import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -90,10 +89,6 @@
}
}
- public void setTheme(final WsTheme theme) {
- view.setTheme(theme);
- }
-
private void setContentDate(final Date publishedOn) {
final DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy, Z");
view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java 2008-07-07 14:10:21 UTC (rev 793)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java 2008-07-09 23:43:14 UTC (rev 794)
@@ -21,7 +21,6 @@
package org.ourproject.kune.workspace.client.ui.newtmp.title;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
public interface EntityTitleView extends View {
@@ -35,6 +34,4 @@
void setDateVisible(boolean visible);
- void setTheme(WsTheme theme);
-
}
1
0
Author: vjrj
Date: 2008-07-07 16:10:21 +0200 (Mon, 07 Jul 2008)
New Revision: 793
Added:
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java
Modified:
trunk/pom.xml
trunk/script/css-update.sh
trunk/script/deploy_gwt.cmd
trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/chat.css
trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css
trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
trunk/src/main/webapp/WEB-INF/web.xml
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
Log:
gwt-ext workspace refactorization
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/pom.xml 2008-07-07 14:10:21 UTC (rev 793)
@@ -272,17 +272,12 @@
<dependency>
<groupId>com.calclab.emite</groupId>
<artifactId>emite</artifactId>
- <version>0.2.8</version>
+ <version>0.3.0</version>
</dependency>
<dependency>
- <groupId>com.calclab.emite</groupId>
- <artifactId>emiteuimodule</artifactId>
- <version>0.2.8</version>
- </dependency>
- <dependency>
<groupId>com.calclab</groupId>
<artifactId>suco</artifactId>
- <version>0.2.8</version>
+ <version>0.3.0</version>
</dependency>
</dependencies>
<!-- http://gwt-maven.googlecode.com/svn/docs/maven-googlewebtoolkit2-plugin/ind… -->
Modified: trunk/script/css-update.sh
===================================================================
--- trunk/script/css-update.sh 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/script/css-update.sh 2008-07-07 14:10:21 UTC (rev 793)
@@ -3,7 +3,7 @@
WEBAPP=src/main/webapp/gwt/org.ourproject.kune.app.Kune
TARGET=target/kune-0.0.4/org.ourproject.kune.app.Kune
-$PWD/script/css-compact-and-tidy.css
+#$PWD/script/css-compact-and-tidy.css
rsync -aC $APPPUB/Kune.html $WEBAPP/Kune.html
rsync -aC $APPPUB/js/ $WEBAPP/js
Modified: trunk/script/deploy_gwt.cmd
===================================================================
--- trunk/script/deploy_gwt.cmd 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/script/deploy_gwt.cmd 2008-07-07 14:10:21 UTC (rev 793)
@@ -1 +1 @@
-copy target\org.ourproject.kune-0.0.4\org.ourproject.kune.Main\* src\main\webapp\gwt\org.ourproject.kune
+copy target\kune-0.0.4\org.ourproject.kune.Main\* src\main\webapp\gwt\org.ourproject.kune
Modified: trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2008-07-07 14:10:21 UTC (rev 793)
@@ -3,18 +3,20 @@
<inherits name='com.google.gwt.user.User' />
<inherits name="org.cafesip.gwtcomp.GWTComponents" />
- <!-- gxt
- <inherits name='com.extjs.gxt.ui.GXT' />
- <stylesheet src="css/ext-all.css" />
- <stylesheet src="css/xtheme-gray.css" />
- -->
-
<!-- gwt-ext -->
<inherits name='com.gwtext.GwtExt' />
<script src="js/ext/adapter/ext/ext-base.js" />
<script src="js/ext/ext-all.js" />
-
+ <!-- kune css -->
+ <!-- when build a unique css with csstidy use all.css -->
+ <!-- <stylesheet src="css/all.css" /> -->
+ <stylesheet src="css/workspace.css" />
+ <stylesheet src="css/chat.css" />
+ <stylesheet src="css/docs.css" />
+ <stylesheet src="css/kune.css" />
+ <stylesheet src="css/kune-new.css" />
+
<inherits name="com.calclab.suco.Suco" />
<inherits name='org.ourproject.kune.platf.Kune-Platform' />
Modified: trunk/src/main/java/org/ourproject/kune/app/public/Kune.html
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/Kune.html 2008-07-07 14:10:21 UTC (rev 793)
@@ -17,7 +17,6 @@
<link rel="stylesheet" type="text/css" href="css/kune.css">
-->
-<link rel="stylesheet" type="text/css" href="css/all.css">
<link rel="shortcut icon" href="images/favicon.ico" />
<title>Kune</title>
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -33,6 +33,6 @@
-moz-opacity: 0.2;
opacity: 0.2;
}
-*/.kune-NavigationBar .topBar .gwt-Image{margin:0 2px 0 5px;}.kune-NavigationBar .Items{margin:2px 0;}.kune-NavigationBar .Items .gwt-Image{margin:2px 0;vertical-align:middle;}.kune-NavigationBar .Items .gwt-Hyperlink a{color:green;/* FIXME: other color */}.kune-NavigationBar .topBar .topBar-margin{margin-left:5px;}.kune-NavigationBar .pathMenu{vertical-align:middle;}.kune-NavigationBar .pathMenu .gwt-MenuItem{background:transparent url(img/button-bg-hard.gif) repeat-x 0 0;border-left:1px solid #AAA;border-right:1px solid #AAA;color:#999;cursor:pointer;white-space:nowrap;padding:3px 6px;}.kune-NavigationBar .pathMenu .gwt-MenuItem-selected{background:transparent url(img/button-bg-soft.gif) repeat-x 0 0;color:#000;}.kune-NavigationBar .kune-IconHyperlink{vertical-align:middle;margin-left:5px;}.kune-NavigationBar .kune-IconHyperlink a{color:green;text-decoration:none;}.kune-NavigationBar .kune-IconHyperlink .gwt-Image{margin-right:3px;vertical-align:middle;}/* Social Network */.kune-StackedDropDownPanel{}.kune-StackedDropDownPanel .gwt-StackPanelItem{border-top:1px solid #CCC;border-bottom:1px solid #CCC;background-color:#EFA;cursor:pointer;padding:1px 3px 0 6px;owerflow:hidden;}.kune-StackedDropDownPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-StackedDropDownPanel .kune-DropDownInner table{width:100%;}.kune-StackedDropDownPanel .gwt-StackPanelItem-selected{}.kune-StackedDropDownPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-StackedDropDownPanel .kune-DropDownInner{padding:0;}/* StackedDropDownPanel Members */.kune-StackSubItemLabel{overflow:hidden;}.kune-StackSubItemLabel .gwt-MenuItem{white-space:nowrap;cursor:pointer;border-bottom:1px solid #F2F2F2;}.kune-StackSubItemLabel table{width:100%;}.kune-StackSubItemLabel .gwt-MenuItem img{vertical-align:middle;margin-top:1px;margin-bottom:1px;margin-left:5px;margin-right:3px;}.kune-StackSubItemLabel .gwt-MenuItem-selected{background-color:#FFE6D5;}.kune-StackSubItemActions{background-color:#F2F2F2;border:1px solid #999;vertical-align:middle;padding:5px 0;margin-left:-120px;margin-top:-2px;}.kune-StackSubItemActions .gwt-MenuItem{cursor:pointer;padding:1px 10px;white-space:nowrap;}.kune-StackSubItemActions .gwt-MenuItem img{vertical-align:middle;margin-right:3px;}.kune-StackSubItemActions .gwt-MenuItem-selected{background-color:#FFB958;}/* AccessList */.kune-AccessListSubLabel{font-style:italic;}.kune-AccessList{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel-open{width:100%;}.kune-AccessList .gwt-DisclosurePanel-closed{width:100%;}.kune-AccessList .header{margin:0 0 3px;text-decoration:none;width:100%;background-color:#8DD35F;}.kune-AccessList .header table{margin:0 5px 0 0;width:100%;color:#FFF;}.kune-AccessList .header img{margin:0 3px 0 0;}.kune-AccessList .content{margin:0 0 0 7px;width:100%;}.kune-AccessList .content table{margin-bottom:5px;width:100%;}/* Rate */.kune-RatePanel-Label{white-space:nowrap;vertical-align:middle;}.kune-RatePanel-Stars{margin-left:5px;vertical-align:middle;}.kune-RatePanel-Stars-RateIt{cursor:pointer;}/* Licenses */.kune-License-CC-Header{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}.kune-License-CC-Header .gwt-Label{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}/* Theme */.kune-IconBottomPanel .gwt-MenuItem{cursor:pointer;background-color:#FFF;margin:2px 2px 2px 5px;}.kune-IconBottomPanel .gwt-MenuItem-selected{background-color:#F2F2F2;}.gwt-MenuBar-bottomMenu{margin-left:-60px;margin-top:-120px;}/* i18n */.kune-I18nTranslatorCell{white-space:normal;}.kune-i18nTranslator-recommend{margin:10px;}.kune-i18nTranslator-recommend h1{font-size:131%;font-weight:700;}.kune-i18nTranslator-recommend h2{font-size:116%;font-weight:700;}.kune-i18nTranslator-recommend h3{font-size:108%;font-weight:700;font-style:italic;}.kune-i18nTranslator-recommend em{font-weight:700;}.kune-i18nTranslator-recommend strong{font-weight:700;}/* Admin Context */.kune-AdminContextPanel{margin:6px;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem{background:transparent url(img/arrow-right-white.gif) no-repeat scroll 3px 2px;cursor:pointer;padding:3px 10px 1px 20px;owerflow:hidden;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-AdminContextPanel .gwt-StackPanelItem-selected{background:transparent url(img/arrow-down-white.gif) no-repeat scroll 3px 2px;background-color:#DEE3DB;}.kune-AdminContextPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-AdminContextPanel-inner{background-color:#FFF;}.kune-AdminContextPanel-inner-wrap{margin:5px;}.kune-EditableLabel{}.kune-EditableLabel .kune-EditableLabel-editable{}.kune-EditableLabel-high{background-color:#FFFBC1;cursor:pointer;}.kune-EditableLabel-high span{background-color:#FFFBC1;}.kune-EditableLabel a{margin-left:5px;}.kune-EditableLabel a:link{color:green;}.kune-EditableLabel a:hover{text-decoration:underline;}.kune-EditableLabel a:visited{color:olive;}.kune-EditableLabel img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable span{margin:3px;}.kune-EditableLabel span{margin:3px;}.kune-BottomIconsTrayPanel{width:165px;height:21px;vertical-align:middle;background-color:#EFEFEF;}.kune-TagsPanel-tag{float:left;margin-right:5px;cursor:pointer;}.kune-Content-Main{margin:5px;}/* Yahoo ui base.css */.kune-Content-Main h1{font-size:138.5%;}.kune-Content-Main h2{font-size:123.099998%;}.kune-Content-Main h3{font-size:108%;}.kune-Content-Main h1{margin:1em 0;}.kune-Content-Main h2{margin:1em 0;}.kune-Content-Main h3{margin:1em 0;}.kune-Content-Main h1{font-weight:700;}.kune-Content-Main h2{font-weight:700;}.kune-Content-Main h3{font-weight:700;}.kune-Content-Main h4{font-weight:700;}.kune-Content-Main h5{font-weight:700;}.kune-Content-Main h6{font-weight:700;}.kune-Content-Main strong{font-weight:700;}.kune-Content-Main abbr{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main acronym{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main em{font-style:italic;}.kune-Content-Main blockquote{margin:1em;}.kune-Content-Main ul{margin:1em;}.kune-Content-Main ol{margin:1em;}.kune-Content-Main dl{margin:1em;}.kune-Content-Main ol{margin-left:2em;}.kune-Content-Main ul{margin-left:2em;}.kune-Content-Main dl{margin-left:2em;}.kune-Content-Main ol{list-style:decimal outside;}.kune-Content-Main li{list-style:decimal outside;}.kune-Content-Main li{list-style:disc outside;}.kune-Content-Main ul{list-style:disc outside;}.kune-Content-Main dl{margin-left:1em;}.kune-Content-Main dd{margin-left:1em;}.kune-Content-Main th{border:1px solid #000;padding:.5em;font-weight:700;text-align:center;}.kune-Content-Main td{border:1px solid #000;padding:.5em;}.kune-Content-Main caption{margin-bottom:.5em;text-align:center;}.kune-Content-Main p{margin-bottom:1em;}.kune-Content-Main fieldset{margin-bottom:1em;}.kune-Content-Main table{margin-bottom:1em;}.kune-Content-Main pre{margin-bottom:1em;}.kune-Content-Main input[type=text]{width:12.25em;width:11.9em;}.kune-Content-Main input[type=password]{width:12.25em;width:11.9em;}.kune-Content-Main textarea{width:12.25em;width:11.9em;}.search-icon{background-image:url(img/search.gif)!important;}.i18n-icon{background-image:url(img/language.gif)!important;}.chat-icon{background-image:url(img/chat.gif)!important;}.group-icon{background-image:url(img/group.gif)!important;}.user-icon{background-image:url(img/user.gif)!important;}.userf-icon{background-image:url(img/userf.gif)!important;}.kune-RoomPanel-HorizDelimiter{white-space:nowrap;color:#B3B3B3;}.kune-MultiRoomPanel-Subject{font-size:108%;color:#2E5492;}.kune-MultiRoomPanel-User{}.kune-MultiRoomPanel-User .kune-IconLabel{overflow:hidden;white-space:nowrap;}.kune-RoomPanel-Conversation{}.kune-RoomPanel-Message{margin:0 7px;}.kune-RoomPanel-EventMessage{font-style:italic;color:#69C;margin:0 5px;}.kune-MultiRoomPanel-EmoticonPalette{background-color:#FFF;border:1px solid #AAA;margin:1px solid red;z-index:10000;position:absolute;}.kune-MultiRoomPanel-EmoticonPalette td{width:30px;height:30px;}/* RTE Text editor */.kune-TexEditorPanel-TextArea{margin:3px;}.gwt-RichTextArea{/* border: 1px solid #000;
+*/.kune-NavigationBar .topBar .gwt-Image{margin:0 2px 0 5px;}.kune-NavigationBar .Items{margin:2px 0;}.kune-NavigationBar .Items .gwt-Image{margin:2px 0;vertical-align:middle;}.kune-NavigationBar .Items .gwt-Hyperlink a{color:green;/* FIXME: other color */}.kune-NavigationBar .topBar .topBar-margin{margin-left:5px;}.kune-NavigationBar .pathMenu{vertical-align:middle;}.kune-NavigationBar .pathMenu .gwt-MenuItem{background:transparent url(img/button-bg-hard.gif) repeat-x 0 0;border-left:1px solid #AAA;border-right:1px solid #AAA;color:#999;cursor:pointer;white-space:nowrap;padding:3px 6px;}.kune-NavigationBar .pathMenu .gwt-MenuItem-selected{background:transparent url(img/button-bg-soft.gif) repeat-x 0 0;color:#000;}.kune-NavigationBar .kune-IconHyperlink{vertical-align:middle;margin-left:5px;}.kune-NavigationBar .kune-IconHyperlink a{color:green;text-decoration:none;}.kune-NavigationBar .kune-IconHyperlink .gwt-Image{margin-right:3px;vertical-align:middle;}/* Social Network */.kune-StackedDropDownPanel{}.kune-StackedDropDownPanel .gwt-StackPanelItem{border-top:1px solid #CCC;border-bottom:1px solid #CCC;background-color:#EFA;cursor:pointer;padding:1px 3px 0 6px;overflow:hidden;}.kune-StackedDropDownPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-StackedDropDownPanel .kune-DropDownInner table{width:100%;}.kune-StackedDropDownPanel .gwt-StackPanelItem-selected{}.kune-StackedDropDownPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-StackedDropDownPanel .kune-DropDownInner{padding:0;}/* StackedDropDownPanel Members */.kune-StackSubItemLabel{overflow:hidden;}.kune-StackSubItemLabel .gwt-MenuItem{white-space:nowrap;cursor:pointer;border-bottom:1px solid #F2F2F2;}.kune-StackSubItemLabel table{width:100%;}.kune-StackSubItemLabel .gwt-MenuItem img{vertical-align:middle;margin-top:1px;margin-bottom:1px;margin-left:5px;margin-right:3px;}.kune-StackSubItemLabel .gwt-MenuItem-selected{background-color:#FFE6D5;}.kune-StackSubItemActions{background-color:#F2F2F2;border:1px solid #999;vertical-align:middle;padding:5px 0;margin-left:-120px;margin-top:-2px;}.kune-StackSubItemActions .gwt-MenuItem{cursor:pointer;padding:1px 10px;white-space:nowrap;}.kune-StackSubItemActions .gwt-MenuItem img{vertical-align:middle;margin-right:3px;}.kune-StackSubItemActions .gwt-MenuItem-selected{background-color:#FFB958;}/* AccessList */.kune-AccessListSubLabel{font-style:italic;}.kune-AccessList{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel{margin:5px;width:100%;}.kune-AccessList .gwt-DisclosurePanel-open{width:100%;}.kune-AccessList .gwt-DisclosurePanel-closed{width:100%;}.kune-AccessList .header{margin:0 0 3px;text-decoration:none;width:100%;background-color:#8DD35F;}.kune-AccessList .header table{margin:0 5px 0 0;width:100%;color:#FFF;}.kune-AccessList .header img{margin:0 3px 0 0;}.kune-AccessList .content{margin:0 0 0 7px;width:100%;}.kune-AccessList .content table{margin-bottom:5px;width:100%;}/* Rate */.kune-RatePanel-Label{white-space:nowrap;vertical-align:middle;}.kune-RatePanel-Stars{margin-left:5px;vertical-align:middle;}.kune-RatePanel-Stars-RateIt{cursor:pointer;}/* Licenses */.kune-License-CC-Header{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}.kune-License-CC-Header .gwt-Label{color:#15428B;font-weight:700;font-size:85%;margin-top:5px;}/* Theme */.kune-IconBottomPanel .gwt-MenuItem{cursor:pointer;background-color:#FFF;margin:2px 2px 2px 5px;}.kune-IconBottomPanel .gwt-MenuItem-selected{background-color:#F2F2F2;}.gwt-MenuBar-bottomMenu{margin-left:-60px;margin-top:-120px;}/* i18n */.kune-I18nTranslatorCell{white-space:normal;}.kune-i18nTranslator-recommend{margin:10px;}.kune-i18nTranslator-recommend h1{font-size:131%;font-weight:700;}.kune-i18nTranslator-recommend h2{font-size:116%;font-weight:700;}.kune-i18nTranslator-recommend h3{font-size:108%;font-weight:700;font-style:italic;}.kune-i18nTranslator-recommend em{font-weight:700;}.kune-i18nTranslator-recommend strong{font-weight:700;}/* Admin Context */.kune-AdminContextPanel{margin:6px;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem{background:transparent url(img/arrow-right-white.gif) no-repeat scroll 3px 2px;cursor:pointer;padding:3px 10px 1px 20px;owerflow:hidden;width:100%;}.kune-AdminContextPanel .gwt-StackPanelItem img{margin:0 0 0 3px;vertical-align:middle;}.kune-AdminContextPanel .gwt-StackPanelItem-selected{background:transparent url(img/arrow-down-white.gif) no-repeat scroll 3px 2px;background-color:#DEE3DB;}.kune-AdminContextPanelLink{background-color:#E6E6E6;border-top:1px solid #CCC;border-bottom:1px solid #F2F2F2;/* white-space: nowrap; */cursor:pointer;}.kune-AdminContextPanel-inner{background-color:#FFF;}.kune-AdminContextPanel-inner-wrap{margin:5px;}.kune-EditableLabel{}.kune-EditableLabel .kune-EditableLabel-editable{}.kune-EditableLabel-high{background-color:#FFFBC1;cursor:pointer;}.kune-EditableLabel-high span{background-color:#FFFBC1;}.kune-EditableLabel a{margin-left:5px;}.kune-EditableLabel a:link{color:green;}.kune-EditableLabel a:hover{text-decoration:underline;}.kune-EditableLabel a:visited{color:olive;}.kune-EditableLabel img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable img{margin-right:4px;vertical-align:middle;}.kune-EditableLabel-editable span{margin:3px;}.kune-EditableLabel span{margin:3px;}.kune-BottomIconsTrayPanel{width:165px;height:21px;vertical-align:middle;background-color:#EFEFEF;}.kune-TagsPanel-tag{float:left;margin-right:5px;cursor:pointer;}.kune-Content-Main{margin:5px;}/* Yahoo ui base.css */.kune-Content-Main h1{font-size:138.5%;}.kune-Content-Main h2{font-size:123.099998%;}.kune-Content-Main h3{font-size:108%;}.kune-Content-Main h1{margin:1em 0;}.kune-Content-Main h2{margin:1em 0;}.kune-Content-Main h3{margin:1em 0;}.kune-Content-Main h1{font-weight:700;}.kune-Content-Main h2{font-weight:700;}.kune-Content-Main h3{font-weight:700;}.kune-Content-Main h4{font-weight:700;}.kune-Content-Main h5{font-weight:700;}.kune-Content-Main h6{font-weight:700;}.kune-Content-Main strong{font-weight:700;}.kune-Content-Main abbr{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main acronym{border-bottom:1px dotted #000;cursor:help;}.kune-Content-Main em{font-style:italic;}.kune-Content-Main blockquote{margin:1em;}.kune-Content-Main ul{margin:1em;}.kune-Content-Main ol{margin:1em;}.kune-Content-Main dl{margin:1em;}.kune-Content-Main ol{margin-left:2em;}.kune-Content-Main ul{margin-left:2em;}.kune-Content-Main dl{margin-left:2em;}.kune-Content-Main ol{list-style:decimal outside;}.kune-Content-Main li{list-style:decimal outside;}.kune-Content-Main li{list-style:disc outside;}.kune-Content-Main ul{list-style:disc outside;}.kune-Content-Main dl{margin-left:1em;}.kune-Content-Main dd{margin-left:1em;}.kune-Content-Main th{border:1px solid #000;padding:.5em;font-weight:700;text-align:center;}.kune-Content-Main td{border:1px solid #000;padding:.5em;}.kune-Content-Main caption{margin-bottom:.5em;text-align:center;}.kune-Content-Main p{margin-bottom:1em;}.kune-Content-Main fieldset{margin-bottom:1em;}.kune-Content-Main table{margin-bottom:1em;}.kune-Content-Main pre{margin-bottom:1em;}.kune-Content-Main input[type=text]{width:12.25em;width:11.9em;}.kune-Content-Main input[type=password]{width:12.25em;width:11.9em;}.kune-Content-Main textarea{width:12.25em;width:11.9em;}.search-icon{background-image:url(img/search.gif)!important;}.i18n-icon{background-image:url(img/language.gif)!important;}.chat-icon{background-image:url(img/chat.gif)!important;}.group-icon{background-image:url(img/group.gif)!important;}.user-icon{background-image:url(img/user.gif)!important;}.userf-icon{background-image:url(img/userf.gif)!important;}.kune-RoomPanel-HorizDelimiter{white-space:nowrap;color:#B3B3B3;}.kune-MultiRoomPanel-Subject{font-size:108%;color:#2E5492;}.kune-MultiRoomPanel-User{}.kune-MultiRoomPanel-User .kune-IconLabel{overflow:hidden;white-space:nowrap;}.kune-RoomPanel-Conversation{}.kune-RoomPanel-Message{margin:0 7px;}.kune-RoomPanel-EventMessage{font-style:italic;color:#69C;margin:0 5px;}.kune-MultiRoomPanel-EmoticonPalette{background-color:#FFF;border:1px solid #AAA;margin:1px solid red;z-index:10000;position:absolute;}.kune-MultiRoomPanel-EmoticonPalette td{width:30px;height:30px;}/* RTE Text editor */.kune-TexEditorPanel-TextArea{margin:3px;}.gwt-RichTextArea{/* border: 1px solid #000;
background-color: #FFF; */border:1px solid #4D4D4D;background-color:#FFF;margin:5px 0 5px 10px;}.gwt-RichTextToolbar{/* background-color: #F2F2F2;
padding: 5px; */height:24px;vertical-align:middle;}.gwt-RichTextToolbar table{vertical-align:middle;}.gwt-RichTextToolbar .gwt-ToggleButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton{float:left;margin-top:2px;}.gwt-RichTextToolbar .gwt-PushButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-PushButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-PushButton-down{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-PushButton-down-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-up{margin-right:2px;border:1px solid #F2F2F2;}.gwt-RichTextToolbar .gwt-ToggleButton-up-hovering{margin-right:2px;border:1px solid #C3D9FF;border-color:#E8F1FF #9daecd #9daecd #e8f1ff;}.gwt-RichTextToolbar .gwt-ToggleButton-down{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .gwt-ToggleButton-down-hovering{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.gwt-RichTextToolbar .x-btn{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lSpace{float:left;}.gwt-RichTextToolbar .kune-Button-Large-lrSpace{float:left;}.RichTextToolbar-menu{float:left;margin-top:2px;}.RichTextToolbar-menu table{border-collapse:collapse;border-spacing:0;margin:0;}.RichTextToolbar-menu .gwt-MenuItem{margin-right:2px;border:1px solid #F2F2F2;}.RichTextToolbar-menu .gwt-MenuItem-selected{margin-right:2px;background-color:#E8F1FF;border:1px solid #C3D9FF;border-color:#9DAECD #e8f1ff #e8f1ff #9daecd;}.RichTextToolbar-submenu{background-color:#FFFCD5;border:1px solid #D38D5F;cursor:default;}.RichTextToolbar-submenu .gwt-MenuItem{cursor:default;white-space:nowrap;border:1px solid #FFFCD5;padding:0 4px;}.RichTextToolbar-submenu .gwt-MenuItem-selected{background-color:#FFB958;border:1px solid #C83737;}.kune-WebSafePalette{background-color:#FFF;border:1px solid #AAA;margin:1px solid red;}.kune-WebSafePalette td{width:12px;height:10px;}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/chat.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/chat.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/chat.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -1,46 +0,0 @@
-.kune-RoomPanel-HorizDelimiter {
- white-space: nowrap;
- color: #B3B3B3;
-}
-
-.kune-MultiRoomPanel-Subject {
- font-size: 108%;
- color: #2E5492;
-}
-
-.kune-MultiRoomPanel-User {
-
-}
-
-.kune-MultiRoomPanel-User .kune-IconLabel {
- overflow: hidden;
- white-space: nowrap;
-}
-
-.kune-RoomPanel-Conversation {
-
-}
-
-.kune-RoomPanel-Message {
- margin: 0 7px;
-}
-
-.kune-RoomPanel-EventMessage {
- font-style: italic;
- color: rgb(102, 153, 204);
- margin: 0 5px;
-}
-
-.kune-MultiRoomPanel-EmoticonPalette {
- background-color: #FFF;
- border: 1px solid #AAA;
- margin: 1px solid red;
- z-index:10000;
- position:absolute;
-}
-
-.kune-MultiRoomPanel-EmoticonPalette td {
- width: 30px;
- height: 30px;
-}
-
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/docs.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -135,7 +135,7 @@
.kune-WebSafePalette {
background-color: #FFF;
border: 1px solid #AAA;
- margin: 1px solid red;
+ margin: 1px;
}
.kune-WebSafePalette td {
Added: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,182 @@
+.k-site-traybar {
+ background: #FFF none repeat scroll 0% 50%;
+}
+
+.k-sitebar {
+ white-space: nowrap;
+}
+
+.k-entity-summary {
+ border-left-color: #FFF;
+ border-left-width: 5px;
+}
+
+.k-EntityTextLogo {
+ border: 2px solid #F2F2F2;
+ height: 60px;
+ margin-bottom: 4px;
+ overflow: hidden;
+ width: 468px;
+}
+
+.k-entitytextlogo .gwt-Label {
+ font-size: 167%;
+ font-weight: 700;
+ margin: 5px;
+ height: 27px;
+}
+
+.k-entitytextlogo-def .gwt-Label {
+ color: #69312F;
+}
+
+.k-entitytextlogo-green .gwt-Label {
+ color: #000080;
+}
+
+.k-entitytextlogo .gwt-Hyperlink a {
+ color: #CCC;
+ font-size: 85%;
+ margin: 5px;
+ text-decoration: underline;
+ white-space: nowrap;
+ background-color: #FFF;
+}
+
+.k-entity-def .x-layout-split {
+ background: #DD8A3D none repeat scroll 0% 50%;
+}
+
+.k-entity-green .x-layout-split {
+ background: #5FD35F none repeat scroll 0% 50%;
+}
+
+.k-entityworkspace .x-layout-split {
+ background: transparent none repeat scroll 0% 50%;
+}
+
+.k-entityworkspace-def .x-layout-split {
+ background: #DEAA87 none repeat scroll 0% 50%;
+}
+
+.k-entityworkspace-green .x-layout-split {
+ background: #DCE8AB none repeat scroll 0% 50%;
+}
+
+.k-entity-title {
+ line-height: 22px;
+ border-left-style: solid;
+ border-left-width: 2px;
+}
+
+.k-entity-title div {
+ white-space: nowrap;
+}
+
+.k-entity-subtitle {
+ line-height: 2em;
+}
+
+.k-entity-subtitle div {
+ white-space: nowrap;
+}
+
+.k-entity-title-rd-def {
+ background: #DD8A3D;
+}
+
+.k-entity-title-rd-green {
+ background: #5FD35F;
+}
+
+.k-entity-title-def {
+ background: #F1BB59 none repeat scroll 0% 50%;
+ color: #69312F;
+ border-left-color: #DD8A3D;
+}
+
+.k-entity-title-green {
+ background: #AFA none repeat scroll 0% 50%;
+ color: #250;
+ border-left-color: #5FD35F;
+}
+
+.k-entity-subtitle-def {
+ background: #DD8A3D none repeat scroll 0% 50%;
+ color: #FFF;
+}
+
+.k-entity-subtitle-green {
+ background: #5FD35F none repeat scroll 0% 50%;
+ color: #FFF;
+}
+
+.k-entity-bottom-rd-def {
+ background: #DD8A3D;
+}
+
+.k-entity-bottom-rd-green {
+ background: #5FD35F;
+}
+
+.k-entity-container-def div {
+ background: #FFD09D none repeat scroll 0% 50%;
+}
+
+.k-entity-container-green div {
+ background: #CFA none repeat scroll 0% 50%;
+}
+
+.k-entity-bottom {
+ line-height: 2em;
+}
+
+.k-entity-bottom-def {
+ background: #DD8A3D;
+ color: #FFF;
+}
+
+.k-entity-bottom-green {
+ background: #5FD35F;
+ color: #FFF;
+}
+
+.k-toolbar-top-line {
+ border-top-color: rgb( 208, 208, 208 );
+ border-top-style: solid;
+ border-top-width: 1px;
+}
+
+.k-toolbar-bottom-line {
+ border-bottom-color: rgb( 208, 208, 208 );
+ border-bottom-style: solid;
+ border-bottom-width: 1px;
+}
+
+.x-toolbar td, .x-toolbar span, .x-toolbar input, .x-toolbar div, .x-toolbar select, .x-toolbar label {
+ white-space: nowrap;
+ font: normal 13px arial, sans;
+ line-height: 19px;
+}
+
+.k-toolbar-sep {
+ padding-top: 4px;
+}
+
+.ytb-sep {
+ background-image: url(../js/ext/resources/images/default/grid/grid-split.gif);
+ background-position: center;
+ background-repeat: no-repeat;
+ display: block;
+ font-size: 1px;
+ height: 16px;
+ width: 4px;
+ overflow: hidden;
+ cursor: default;
+ margin: 0 2px 0;
+ border: 0;
+}
+
+.ytb-spacer {
+ width: 2px;
+}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -175,13 +175,13 @@
.kune-CustomPushButton-up-disabled {
background: transparent url(img/button-bg-soft.gif) repeat-x 0 0;
color: #E0E0E0;
- cursor: normal;
+ cursor: default;
}
.kune-CustomPushButton-down-disabled {
background: transparent url(img/button-bg-soft.gif) repeat-x 0 0;
color: #E0E0E0;
- cursor: normal;
+ cursor: default;
}
.kune-Button-Large-lrSpace {
@@ -396,7 +396,7 @@
.kune-Margin-Large-tb {
margin-top: 10px;
- margin-bottom: : 10px;
+ margin-bottom: 10px;
}
.kune-Margin-Large-t {
@@ -568,5 +568,5 @@
}
.kune-ft26px {
- font-size: 197 %
+ font-size: 197%
}
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-07-07 14:10:21 UTC (rev 793)
@@ -127,31 +127,6 @@
border-right: 3px solid #DD8A3D;
}
-.kune-EntityTextLogo {
- border: 2px solid #F2F2F2;
- height: 60px;
- margin-bottom: 4px;
- overflow: hidden;
- width: 468px;
-}
-
-.kune-EntityTextLogo .gwt-Label {
- color: #AA4400;
- font-size: 167%;
- font-weight: 700;
- margin: 5px;
- height: 27;
-}
-
-.kune-EntityTextLogo .gwt-Hyperlink a {
- color: #CCC;
- font-size: 85%;
- margin: 5px;
- text-decoration: underline;
- white-space: nowrap;
- background-color: #FFF;
-}
-
.kune-GroupSummaryPanel {
margin: 5px 0 0 5px;
width: 100%;
@@ -383,7 +358,7 @@
background-color: #EEFFAA;
cursor: pointer;
padding: 1px 3px 0 6px;
- owerflow: hidden;
+ overflow: hidden;
}
.kune-StackedDropDownPanel .gwt-StackPanelItem img {
@@ -601,7 +576,7 @@
background: transparent url(img/arrow-right-white.gif) no-repeat scroll 3px 2px;
cursor: pointer;
padding: 3px 10px 1px 20px;
- owerflow: hidden;
+ overflow: hidden;
width: 100%;
}
@@ -853,19 +828,12 @@
}
.kune-Content-Main input[type=text] {
- width: 12.25em; *
- width: 11.9em;
-}
+ width: 12.25em;*width: 11.9em;}
.kune-Content-Main input[type=password] {
- width: 12.25em; *
- width: 11.9em;
-}
+ width: 12.25em;*width: 11.9em;}
-.kune-Content-Main textarea {
- width: 12.25em; *
- width: 11.9em;
-}
+.kune-Content-Main textarea {width: 12.25em;*width: 11.9em;}
.search-icon {
background-image: url(img/search.gif) !important;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -38,10 +38,14 @@
import org.ourproject.kune.workspace.client.WorkspaceClientModule;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
import com.calclab.emiteuimodule.client.EmiteUIModule;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.WindowCloseListener;
+import com.google.gwt.user.client.ui.Label;
public class ApplicationBuilder {
@@ -62,6 +66,28 @@
final Application application = kune.getInstance(Application.class);
final I18nUITranslationService i18n = kune.getI18N();
+ // Temporary new ws
+ final WorkspaceManager wmanager = kune.getInstance(WorkspaceManager.class);
+ final WorkspaceSkeleton ws = kune.getInstance(WorkspaceSkeleton.class);
+ // final com.gwtext.client.widgets.Window dialog = new
+ // com.gwtext.client.widgets.Window("gwt-ext new ws 3", 640,
+ // 480);
+ // final Panel panel = new Panel();
+ // panel.setPaddings(5);
+ // panel.setLayout(new FitLayout());
+ // panel.add(((WorkspaceSkeleton) wsmanager.getView()).getPanel());
+ // new Viewport(panel);
+ // wsnew.getPanel().setWidth(640);
+ // wsnew.getPanel().setHeight(460);
+ // panel.setWidth(640);
+ // panel.setHeight(460);
+ // dialog.add(panel);
+ // dialog.show();
+ ws.setTheme(WsTheme.def);
+ ws.show();
+ ws.getEntityWorkspace().getContentTopBar().add(new Label("Sorry, kune workspace under heavy refactorization"));
+ wmanager.setTheme(WsTheme.def);
+
// Testing providers:
platform.install(new PlatformClientModule(session, kune.getProvider(StateManager.class)));
platform.install(new WorkspaceClientModule(session, stateManager, application.getWorkspace(), i18n));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -18,6 +18,14 @@
import org.ourproject.kune.platf.client.state.StateManagerDefault;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
+import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
+import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel;
import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.modules.Module;
@@ -48,10 +56,10 @@
builder.registerProvider(I18nUITranslationService.class, new Provider<I18nUITranslationService>() {
public I18nUITranslationService get() {
- final I18nUITranslationService translationService = new I18nUITranslationService();
- translationService.setCurrentLanguage(initialLang.getCode());
- translationService.setLexicon(lexicon);
- return translationService;
+ final I18nUITranslationService i18n = new I18nUITranslationService();
+ i18n.setCurrentLanguage(initialLang.getCode());
+ i18n.setLexicon(lexicon);
+ return i18n;
}
}, SingletonScope.class);
@@ -61,16 +69,16 @@
}
}, SingletonScope.class);
+ final I18nUITranslationService i18n = builder.getInstance(I18nUITranslationService.class);
builder.registerProvider(KuneErrorHandler.class, new Provider<KuneErrorHandler>() {
public KuneErrorHandler get() {
- return new KuneErrorHandler(builder.getInstance(Session.class), builder
- .getInstance(I18nUITranslationService.class));
+ return new KuneErrorHandler(builder.getInstance(Session.class), i18n);
}
}, SingletonScope.class);
final KuneErrorHandler errorHandler = builder.getInstance(KuneErrorHandler.class);
AsyncCallbackSimple.init(errorHandler);
- Site.init(builder.getInstance(I18nUITranslationService.class));
+ Site.init(i18n);
builder.registerProvider(ColorTheme.class, new Provider<ColorTheme>() {
public ColorTheme get() {
@@ -95,24 +103,66 @@
final Session session = builder.getInstance(Session.class);
final ExtensibleWidgetsManager extensionPointManager = builder
.getInstance(ExtensibleWidgetsManager.class);
- return new ApplicationDefault(session, extensionPointManager, builder
- .getInstance(I18nUITranslationService.class), builder.getInstance(ColorTheme.class), builder
+ return new ApplicationDefault(session, extensionPointManager, i18n, builder
+ .getInstance(ColorTheme.class), builder.getInstance(KuneErrorHandler.class));
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(WorkspaceSkeleton.class, new Provider<WorkspaceSkeleton>() {
+ public WorkspaceSkeleton get() {
+ return new WorkspaceSkeleton();
+ }
+ }, SingletonScope.class);
+
+ final WorkspaceSkeleton ws = builder.getInstance(WorkspaceSkeleton.class);
+
+ builder.registerProvider(EntityLogo.class, new Provider<EntityLogo>() {
+ public EntityLogo get() {
+ return new EntityLogoPanel(i18n, ws);
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(WsThemePresenter.class, new Provider<WsThemePresenter>() {
+ public WsThemePresenter get() {
+ final WsThemePresenter presenter = new WsThemePresenter();
+ final WsThemePanel panel = new WsThemePanel(ws);
+ presenter.init(panel);
+ return presenter;
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(EntityTitlePresenter.class, new Provider<EntityTitlePresenter>() {
+ public EntityTitlePresenter get() {
+ final EntityTitlePresenter presenter = new EntityTitlePresenter(i18n, builder
.getInstance(KuneErrorHandler.class));
+ final EntityTitlePanel panel = new EntityTitlePanel(ws, presenter);
+ presenter.init(panel);
+ return presenter;
}
}, SingletonScope.class);
+ builder.registerProvider(WorkspaceManager.class, new Provider<WorkspaceManager>() {
+ public WorkspaceManager get() {
+ final WorkspaceManager presenter = new WorkspaceManager(builder.getInstance(EntityLogo.class), builder
+ .getInstance(EntityTitlePresenter.class), builder.getInstance(WsThemePresenter.class));
+ return presenter;
+ }
+ }, SingletonScope.class);
+
builder.registerProvider(StateManager.class, new Provider<StateManager>() {
public StateManager get() {
final Session session = builder.getInstance(Session.class);
final ContentProviderImpl provider = new ContentProviderImpl(ContentService.App.getInstance());
final HistoryWrapper historyWrapper = new HistoryWrapperImpl();
final Application application = builder.getInstance(Application.class);
+ final WorkspaceManager wm = builder.getInstance(WorkspaceManager.class);
final StateManagerDefault stateManager = new StateManagerDefault(provider, application, session,
- historyWrapper);
+ historyWrapper, wm);
History.addHistoryListener(stateManager);
return stateManager;
}
}, SingletonScope.class);
}
+
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -33,6 +33,7 @@
import org.ourproject.kune.platf.client.tool.ClientTool;
import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
import org.ourproject.kune.workspace.client.workspace.Workspace;
public class StateManagerDefault implements StateManager {
@@ -43,37 +44,39 @@
private String lastTheme;
private final Session session;
private final HistoryWrapper history;
+ private final WorkspaceManager ws;
public StateManagerDefault(final ContentProvider provider, final Application app, final Session session,
- final HistoryWrapper history) {
- this.provider = provider;
- this.app = app;
- this.session = session;
- this.history = history;
- this.workspace = app.getWorkspace();
- this.oldState = null;
+ final HistoryWrapper history, final WorkspaceManager ws) {
+ this.provider = provider;
+ this.app = app;
+ this.session = session;
+ this.history = history;
+ this.ws = ws;
+ this.workspace = app.getWorkspace();
+ this.oldState = null;
}
public void onHistoryChanged(final String historyToken) {
- String oldStateEncoded = "";
- if (oldState != null) {
- oldStateEncoded = oldState.getStateToken().getEncoded();
- }
- if (historyToken.equals(Site.NEWGROUP_TOKEN)) {
- Site.doNewGroup(oldStateEncoded);
- } else if (historyToken.equals(Site.LOGIN_TOKEN)) {
- Site.doLogin(oldStateEncoded);
- } else if (historyToken.equals(Site.TRANSLATE_TOKEN)) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
- } else if (historyToken.equals(Site.FIXME_TOKEN)) {
- if (oldState == null) {
- onHistoryChanged(new StateToken());
- } else {
- loadContent(oldState);
- }
- } else {
- onHistoryChanged(new StateToken(historyToken));
- }
+ String oldStateEncoded = "";
+ if (oldState != null) {
+ oldStateEncoded = oldState.getStateToken().getEncoded();
+ }
+ if (historyToken.equals(Site.NEWGROUP_TOKEN)) {
+ Site.doNewGroup(oldStateEncoded);
+ } else if (historyToken.equals(Site.LOGIN_TOKEN)) {
+ Site.doLogin(oldStateEncoded);
+ } else if (historyToken.equals(Site.TRANSLATE_TOKEN)) {
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null);
+ } else if (historyToken.equals(Site.FIXME_TOKEN)) {
+ if (oldState == null) {
+ onHistoryChanged(new StateToken());
+ } else {
+ loadContent(oldState);
+ }
+ } else {
+ onHistoryChanged(new StateToken(historyToken));
+ }
}
/**
@@ -82,104 +85,106 @@
* </p>
*/
public void reload() {
- onHistoryChanged(history.getToken());
+ onHistoryChanged(history.getToken());
}
public void reloadContextAndTitles() {
- provider.getContent(session.getUserHash(), new StateToken(history.getToken()),
- new AsyncCallbackSimple<StateDTO>() {
- public void onSuccess(final StateDTO newStateDTO) {
- loadContextOnly(newStateDTO);
- oldState = newStateDTO;
- workspace.getContentTitleComponent().setState(oldState);
- workspace.getContentSubTitleComponent().setState(oldState);
- Site.hideProgress();
- }
- });
+ provider.getContent(session.getUserHash(), new StateToken(history.getToken()),
+ new AsyncCallbackSimple<StateDTO>() {
+ public void onSuccess(final StateDTO newStateDTO) {
+ loadContextOnly(newStateDTO);
+ oldState = newStateDTO;
+ workspace.getContentTitleComponent().setState(oldState);
+ workspace.getContentSubTitleComponent().setState(oldState);
+ Site.hideProgress();
+ }
+ });
}
public void setRetrievedState(final StateDTO content) {
- final StateToken state = content.getStateToken();
- provider.cache(state, content);
- setState(state);
+ final StateToken state = content.getStateToken();
+ provider.cache(state, content);
+ setState(state);
}
public void setSocialNetwork(final SocialNetworkResultDTO socialNet) {
- StateDTO state;
- if (session != null && (state = session.getCurrentState()) != null) {
- // After a SN operation, usually returns a SocialNetworkResultDTO
- // with new SN data and we refresh the state
- // to avoid to reload() again the state
- SocialNetworkDTO groupMembers = socialNet.getGroupMembers();
- ParticipationDataDTO userParticipation = socialNet.getUserParticipation();
- state.setGroupMembers(groupMembers);
- state.setParticipation(userParticipation);
- setSocialNetwork(state);
- }
+ StateDTO state;
+ if (session != null && (state = session.getCurrentState()) != null) {
+ // After a SN operation, usually returns a SocialNetworkResultDTO
+ // with new SN data and we refresh the state
+ // to avoid to reload() again the state
+ final SocialNetworkDTO groupMembers = socialNet.getGroupMembers();
+ final ParticipationDataDTO userParticipation = socialNet.getUserParticipation();
+ state.setGroupMembers(groupMembers);
+ state.setParticipation(userParticipation);
+ setSocialNetwork(state);
+ }
}
public void setState(final StateToken state) {
- history.newItem(state.getEncoded());
+ history.newItem(state.getEncoded());
}
private void loadContent(final StateDTO state) {
- session.setCurrent(state);
- final GroupDTO group = state.getGroup();
- app.setGroupState(group.getShortName());
- boolean isAdmin = state.getGroupRights().isAdministrable();
- if (isAdmin) {
- workspace.getThemeMenuComponent().setVisible(true);
- } else {
- workspace.getThemeMenuComponent().setVisible(false);
- }
- setWsTheme(group);
- workspace.showGroup(group, isAdmin);
- final String toolName = state.getToolName();
- workspace.setTool(toolName);
+ session.setCurrent(state);
+ final GroupDTO group = state.getGroup();
+ app.setGroupState(group.getShortName());
+ final boolean isAdmin = state.getGroupRights().isAdministrable();
+ if (isAdmin) {
+ workspace.getThemeMenuComponent().setVisible(true);
+ } else {
+ workspace.getThemeMenuComponent().setVisible(false);
+ }
+ setWsTheme(group);
+ workspace.showGroup(group, isAdmin);
- Site.sitebar.setState(state);
- final ClientTool clientTool = app.getTool(toolName);
- clientTool.setContent(state);
- clientTool.setContext(state);
- workspace.getContentTitleComponent().setState(state);
- workspace.getContentSubTitleComponent().setState(state);
- workspace.getContentBottomToolBarComponent().setRate(state, session.isLogged());
- workspace.setContent(clientTool.getContent());
- workspace.setContext(clientTool.getContext());
- workspace.getLicenseComponent().setLicense(state);
- workspace.getTagsComponent().setState(state);
- setSocialNetwork(state);
- workspace.getGroupSummaryComponent().setGroupSummary(state);
- Site.hideProgress();
+ final String toolName = state.getToolName();
+ workspace.setTool(toolName);
+
+ Site.sitebar.setState(state);
+ final ClientTool clientTool = app.getTool(toolName);
+ clientTool.setContent(state);
+ clientTool.setContext(state);
+ ws.setState(state);
+ workspace.getContentTitleComponent().setState(state);
+ workspace.getContentSubTitleComponent().setState(state);
+ workspace.getContentBottomToolBarComponent().setRate(state, session.isLogged());
+ workspace.setContent(clientTool.getContent());
+ workspace.setContext(clientTool.getContext());
+ workspace.getLicenseComponent().setLicense(state);
+ workspace.getTagsComponent().setState(state);
+ setSocialNetwork(state);
+ workspace.getGroupSummaryComponent().setGroupSummary(state);
+ Site.hideProgress();
}
private void loadContextOnly(final StateDTO state) {
- session.setCurrent(state);
- final String toolName = state.getToolName();
- final ClientTool clientTool = app.getTool(toolName);
- clientTool.setContext(state);
- workspace.setContext(clientTool.getContext());
+ session.setCurrent(state);
+ final String toolName = state.getToolName();
+ final ClientTool clientTool = app.getTool(toolName);
+ clientTool.setContext(state);
+ workspace.setContext(clientTool.getContext());
}
private void onHistoryChanged(final StateToken newState) {
- provider.getContent(session.getUserHash(), newState, new AsyncCallbackSimple<StateDTO>() {
- public void onSuccess(final StateDTO newStateDTO) {
- loadContent(newStateDTO);
- oldState = newStateDTO;
- }
- });
+ provider.getContent(session.getUserHash(), newState, new AsyncCallbackSimple<StateDTO>() {
+ public void onSuccess(final StateDTO newStateDTO) {
+ loadContent(newStateDTO);
+ oldState = newStateDTO;
+ }
+ });
}
private void setSocialNetwork(final StateDTO state) {
- workspace.getGroupMembersComponent().setGroupMembers(state);
- workspace.getParticipationComponent().setParticipation(state);
+ workspace.getGroupMembersComponent().setGroupMembers(state);
+ workspace.getParticipationComponent().setParticipation(state);
}
private void setWsTheme(final GroupDTO group) {
- String nextTheme = group.getWorkspaceTheme();
- if (lastTheme == null || !lastTheme.equals(nextTheme)) {
- workspace.setTheme(nextTheme);
- }
- lastTheme = nextTheme;
+ final String nextTheme = group.getWorkspaceTheme();
+ if (lastTheme == null || !lastTheme.equals(nextTheme)) {
+ workspace.setTheme(nextTheme);
+ }
+ lastTheme = nextTheme;
}
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultBorderLayout.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,125 @@
+package org.ourproject.kune.platf.client.ui;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.core.RegionPosition;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Toolbar;
+import com.gwtext.client.widgets.layout.BorderLayout;
+import com.gwtext.client.widgets.layout.BorderLayoutData;
+
+public class DefaultBorderLayout {
+
+ public enum Position {
+ NORTH, CENTER, SOUTH, EAST, WEST
+ }
+
+ public static final int DEF_TOOLBAR_HEIGHT = 26;
+
+ private static final int NO_SIZE = -1;
+
+ private static RegionPosition[] regionPositions = new RegionPosition[] { RegionPosition.NORTH,
+ RegionPosition.CENTER, RegionPosition.SOUTH, RegionPosition.EAST, RegionPosition.WEST };
+
+ private final Panel mainPanel;
+
+ public DefaultBorderLayout() {
+ mainPanel = new Panel();
+ mainPanel.setLayout(new BorderLayout());
+ mainPanel.setBorder(false);
+ }
+
+ public void add(final Panel panel, final Position position) {
+ add(panel, position, false);
+ }
+
+ public void add(final Panel panel, final Position position, final boolean split) {
+ add(panel, position, split, NO_SIZE);
+ }
+
+ public void add(final Panel panel, final Position position, final boolean split, final int size) {
+ final RegionPosition regionPosition = regionPositions[position.ordinal()];
+ final BorderLayoutData borderLayoutData = new BorderLayoutData(regionPosition);
+ borderLayoutData.setSplit(split);
+ if (split) {
+ borderLayoutData.setUseSplitTips(true);
+ borderLayoutData.setCollapseModeMini(true);
+ }
+ if (size != NO_SIZE) {
+ switch (position) {
+ case NORTH:
+ case SOUTH:
+ panel.setHeight(size);
+ break;
+ case EAST:
+ case WEST:
+ panel.setWidth(size);
+ }
+ }
+ mainPanel.add(panel, borderLayoutData);
+ doLayoutIfNeeded();
+ }
+
+ public void add(final Panel panel, final Position position, final int size) {
+ add(panel, position, false, size);
+ }
+
+ public void add(final Panel panel, final Widget widget) {
+ panel.add(widget);
+ if (panel.isRendered()) {
+ panel.syncSize();
+ panel.doLayout();
+ }
+ doLayoutIfNeeded();
+ }
+
+ public Toolbar createBottomBar(final Panel panel) {
+ return createBottomBar(panel, null);
+ }
+
+ public Toolbar createBottomBar(final Panel panel, final String cssStyle) {
+ final Toolbar bottomToolbar = new Toolbar();
+ bottomToolbar.setHeight(DEF_TOOLBAR_HEIGHT);
+ if (cssStyle != null) {
+ bottomToolbar.setCls(cssStyle);
+ }
+ panel.setBottomToolbar(bottomToolbar);
+ return bottomToolbar;
+ }
+
+ public Toolbar createTopBar(final Panel panel) {
+ return createTopBar(panel, null);
+ }
+
+ public Toolbar createTopBar(final Panel panel, final String cssStyle) {
+ final Toolbar topToolbar = new Toolbar();
+ topToolbar.setHeight(DEF_TOOLBAR_HEIGHT);
+ if (cssStyle != null) {
+ topToolbar.setCls(cssStyle);
+ }
+ panel.setTopToolbar(topToolbar);
+ return topToolbar;
+ }
+
+ public void doLayoutIfNeeded() {
+ if (mainPanel.isRendered()) {
+ mainPanel.doLayout();
+ }
+ }
+
+ public Panel getPanel() {
+ return mainPanel;
+ }
+
+ public void setBorder(final boolean border) {
+ mainPanel.setBorder(border);
+ }
+
+ public void setCls(final String style) {
+ mainPanel.setCls(style);
+ }
+
+ public void setPanel(final Panel panel, final Widget widget) {
+ panel.clear();
+ add(panel, widget);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,486 @@
+/*
+ * Copyright 2007 Hilbrand Bouwkamp, hs(a)bouwkamp.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.ourproject.kune.platf.client.ui;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * The <code>RoundedPanel</code> class adds similar rounded corners, as seen
+ * in other Google applications, to a widget. This is done by adding several
+ * <code>div</code> Elements around a Widget. The HTML code roughly for a
+ * corner height 2 looks as follows:
+ *
+ * <pre>
+ * <div>
+ * <div style="margin:0 2px"></div>
+ * <div style="margin:0 1px"></div>
+ * <div>your widget</div>
+ * <div style="margin:0 1px"></div>
+ * <div style="margin:0 2px"></div>
+ * </div>
+ * </pre>
+ *
+ * To add the rounded corners to a widget start simply wrap your own widget in
+ * the <code>RoundedPanel</code> class, for example with all corners rounded:
+ *
+ * <pre>
+ * // all 4 corners are rounded.
+ * RoundedPanel rp = new RoundedPanel(yourWidget);
+ * // use rp where you would use 'yourWidget' otherwise
+ * </pre>
+ *
+ * Or with custom set corners, like only on the left:
+ *
+ * <pre>
+ * // custom set corners
+ * RoundedPanel rp = new RoundedPanel(yourWidget, RoundedPanel.LEFT);
+ * // use rp where you would use 'yourWidget' otherwise
+ * </pre>
+ *
+ * By default the height of the corners is 2px. It is possible to set a
+ * different height at construction time. The height can be a value between and
+ * including 1 and 9. This value doesn't correspond exactly with the height,
+ * e.g. 9 is 12px heigh.
+ *
+ * <pre>
+ * // all 4 corners are rounded and height index 5
+ * RoundedPanel rp = new RoundedPanel(yourWidget, ALL, 5);
+ * // use rp where you would use 'yourWidget' otherwise
+ * </pre>
+ *
+ * Programmatically set the color of the corners with
+ * {@link #setCornerColor(String)}:
+ *
+ * <pre>
+ * // all 4 corners are rounded.
+ * RoundedPanel rp = new RoundedPanel(yourWidget);
+ * rp.setCornerColor("red");
+ * </pre>
+ *
+ * Default the css style name of the rounded corner divs is <code>cbg-RP</code>.
+ * Use it to set the colors of the corner. For example:
+ *
+ * <pre>
+ * .cbg-RP { background-color:#c3d9ff; }
+ * </pre>
+ *
+ * A custom style might be needed when the corners are visible only when a panel
+ * is selected (see the KitchenSink example modification below). Use the
+ * <code>setCornerStyleName</code> method to set the custom style name. For
+ * example set a custom style <code>my-RP</code> and add something like the
+ * following to the stylesheet:
+ *
+ * <pre>
+ * .selected .my-RP { background-color:#c3d9ff; }
+ * </pre>
+ *
+ * <h3>Adding rounded corners to DialogBox widgets</h3>
+ * Adding rounded corners to a <code>DialogBox</code> is somewhat more
+ * complicated. The problem with <code>DialogBox</code> is that it uses a
+ * private panel and the <code>RoundedPanel</code> should be applied to this
+ * private <code>Panel</code>. To add the rounded corners to a
+ * <code>DialogBox</code> you have to rewrite the implementation of the
+ * <code>DialogBox</code>. For the <code>DialogBox</code> widget this can
+ * be done as follows. First create a new class like
+ * <code>RoundedDialogBox</code> and copy the code from the original
+ * <code>DialogBox</code> (Please take the copyright of this class into
+ * account). Next make the following changes to the code:
+ *
+ * <pre>
+ * // Private variable for RoundedPanel
+ * private RoundedPanel rp;
+ * </pre>
+ *
+ * In the constructor change:
+ *
+ * <pre>
+ * super.add(panel);
+ * </pre>
+ *
+ * into:
+ *
+ * <pre>
+ * rp = new RoundedPanel(panel);
+ * super.add(rp);
+ * </pre>
+ *
+ * Next change the style, otherwise the style of the dialog box is applied to
+ * the rounded lines too. Do this by changing the following line:
+ *
+ * <pre>
+ * setStyleName("gwt-DialogBox");
+ * </pre>
+ *
+ * into:
+ *
+ * <pre>
+ * panel.setStyleName("gwt-DialogBox");
+ * </pre>
+ *
+ * In your css add the color of the border, something like:
+ *
+ * <pre>
+ * .cbg-RP { background-color:#AAAAAA; }
+ * </pre>
+ *
+ * There seems to be a problem with the width under IE. The RoundedPanel divs
+ * don't follow the width of the dialog. To fix this change the
+ * <code>show</code> method as follows:
+ *
+ * <pre>
+ * public void show() {
+ * super.show();
+ * // (The width must be set after the super.show() otherwise it will be 0).
+ * // NOTE: As of GWT 1.1 the .getOffsetWidth() returns 0 at this point.
+ * // This is different with earlier versions of GWT. Disable the line will make
+ * // the rounded corners work in at least Firefox 1.5, but not in IE.
+ * // I'm looking into this issue.
+ * rp.setWidth(panel.getOffsetWidth() + "px");
+ * }
+ * </pre>
+ *
+ * Now by extending your own dialog class on this <code>RoundedDialogBox</code>
+ * instead of the original <code>DialogBox</code> you will have rounded
+ * corners around your dialog.
+ *
+ *
+ * @author Hilbrand Bouwkamp(hs(a)bouwkamp.com)
+ * @version 1.3
+ */
+public class RoundedPanel extends SimplePanel {
+
+ /**
+ * <code>TOPLEFT</code> top left rounded corner
+ */
+ public final static int TOPLEFT = 1;
+
+ /**
+ * <code>TOPRIGHT</code> top right rounded corner
+ */
+ public final static int TOPRIGHT = 2;
+
+ /**
+ * <code>BOTTOMLEFT</code> bottom left rounded corner
+ */
+ public final static int BOTTOMLEFT = 4;
+
+ /**
+ * <code>BOTTOMRIGHT</code> bottom right rounded corner
+ */
+ public final static int BOTTOMRIGHT = 8;
+
+ /**
+ * <code>BOTTOM</code> rounded corners at the top
+ */
+ public final static int TOP = TOPLEFT | TOPRIGHT;
+
+ /**
+ * <code>TOP</code> rounded corners at the bottom
+ */
+ public final static int BOTTOM = BOTTOMLEFT | BOTTOMRIGHT;
+
+ /**
+ * <code>LEFT</code> rounded corners on the left side
+ */
+ public final static int LEFT = TOPLEFT | BOTTOMLEFT;
+
+ /**
+ * <code>RIGHT</code> rounded corners on the right side
+ */
+ public final static int RIGHT = TOPRIGHT | BOTTOMRIGHT;
+
+ /**
+ * <code>ALL</code> rounded corners on all sides
+ */
+ public final static int ALL = TOP | BOTTOM;
+
+ /**
+ * Default border style
+ */
+ private final static String RPSTYLE = "cbg-RP";
+
+ /**
+ * Lookup table for corner border width
+ */
+ private final static String[][] CORNERBORDER = { { "1px" }, { "1px", "1px" }, { "1px", "1px", "1px" },
+ { "1px", "1px", "1px", "1px" }, { "1px", "1px", "1px", "2px", "1px" },
+ { "1px", "1px", "1px", "1px", "2px", "1px" }, { "1px", "1px", "1px", "1px", "1px", "2px", "1px" },
+ { "1px", "1px", "1px", "1px", "1px", "2px", "2px", "1px" },
+ { "1px", "1px", "1px", "1px", "1px", "1px", "2px", "3px", "1px" } };
+
+ /**
+ * Lookup table for corner height
+ */
+ private final static String[][] CORNERHEIGHT = { { "1px" }, { "1px", "1px" }, { "1px", "1px", "1px" },
+ { "1px", "1px", "1px", "1px" }, { "2px", "1px", "1px", "1px", "1px" },
+ { "2px", "1px", "1px", "1px", "1px", "1px" }, { "2px", "1px", "1px", "1px", "1px", "1px", "1px" },
+ { "2px", "1px", "1px", "1px", "1px", "1px", "1px", "1px" },
+ { "3px", "2px", "1px", "1px", "1px", "1px", "1px", "1px", "1px" } };
+
+ /**
+ * Lookup table for corner margin
+ */
+ private final static String[][] CORNERMARGIN = { { "1px" }, { "1px", "2px" }, { "1px", "2px", "3px" },
+ { "1px", "2px", "3px", "4px" }, { "1px", "2px", "3px", "4px", "6px" },
+ { "1px", "2px", "3px", "4px", "5px", "7px" }, { "1px", "2px", "3px", "4px", "5px", "6px", "8px" },
+ { "1px", "2px", "3px", "4px", "5px", "6px", "8px", "10px" },
+ { "1px", "2px", "3px", "4px", "5px", "6px", "7px", "9px", "12px" }, };
+
+ /**
+ * Element array containing all div elements of the top corner div's.
+ */
+ protected final Element[] divt;
+
+ /**
+ * Element array containing all div elements of the bottom corner div's.
+ */
+ protected final Element[] divb;
+
+ /**
+ * Index of the corner height.
+ */
+ protected final int cornerHeight;
+
+ /**
+ * Index of which corners are set.
+ */
+ protected final int corners;
+
+ private final Element body; // body of widget
+ private final Element divElement; // div element containing widget
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with all corners rounded and
+ * height of corners 2px. Use <code>setWidget</code> to add the widget.
+ */
+ public RoundedPanel() {
+ this(ALL, 2);
+ }
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with custom rounding and height
+ * of corners 2px but with no widget set. Use <code>setWidget</code> to
+ * add widget.
+ *
+ * Every combination of corners can be set via <code>corners</code>. Use
+ * the static constants to set the corners. For example, to create a panel
+ * with only rounded corners at the left, use:
+ *
+ * <code>new RoundedPanel(yourWidget, RoundedPanel.LEFT);</code>
+ *
+ * @param corners
+ * set custom rounded corners
+ */
+ public RoundedPanel(final int corners) {
+ this(corners, 2);
+ }
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with custom rounding and custom
+ * height of the corners but with no widget set. Height can be value from 1
+ * to 9. The height for a value 5 or higher is actually larger, e.g. for 5
+ * the height is 6px. Use {@link #setWidget(Widget)} to add widget.
+ *
+ * @param corners
+ * set custom rounded corners
+ * @param cornerHeight
+ * height index between and including 1 and 9
+ * @throws IndexOutOfBoundsException
+ * when cornerHeight below 1 or above 9
+ */
+ public RoundedPanel(final int corners, final int cornerHeight) {
+ super(DOM.createDiv());
+ body = getElement();
+ if (cornerHeight < 1 || cornerHeight > 9) {
+ throw new IndexOutOfBoundsException("RoundedPanel height range between and including 1 and 9");
+ }
+ this.cornerHeight = cornerHeight;
+ divt = new Element[cornerHeight];
+ divb = new Element[cornerHeight];
+ this.corners = corners;
+ if (inMask(corners, TOP)) {
+ final int ct = corners & TOP;
+
+ for (int i = 0; i < cornerHeight; ++i) {
+ divt[i] = addLine(ct, cornerHeight - (i + 1));
+ }
+ }
+ divElement = DOM.createDiv();
+ DOM.appendChild(body, divElement);
+ if (inMask(corners, BOTTOM)) {
+ final int cb = corners & BOTTOM;
+
+ for (int i = cornerHeight - 1; i >= 0; --i) {
+ divb[i] = addLine(cb, cornerHeight - (i + 1));
+ }
+ }
+ setCornerStyleName(RPSTYLE);
+ }
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with all corners rounded and
+ * height 2px on the widget <code>w</code>.
+ *
+ * @param w
+ * widget to add corners to
+ */
+ public RoundedPanel(final Widget w) {
+ this(w, ALL);
+ }
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with custom rounded corners and
+ * height 2px on the widget <code>w</code>.
+ *
+ * @param w
+ * widget to add corners to
+ * @param corners
+ * set custom rounded corners
+ */
+ public RoundedPanel(final Widget w, final int corners) {
+ this(w, corners, 2);
+ }
+
+ /**
+ * Creates a new <code>RoundedPanel</code> with custom rounded corners and
+ * custom height on widget <code>w</code>.
+ *
+ * @param w
+ * widget to add corners to
+ * @param corners
+ * set custom rounded corners
+ * @param cornerHeight
+ * height index between and including 1 and 9
+ */
+ public RoundedPanel(final Widget w, final int corners, final int cornerHeight) {
+ this(corners, cornerHeight);
+ setWidget(w);
+ }
+
+ /**
+ * <p>
+ * Set the bolder color of the rounded corner by setting the background
+ * color of the div's.
+ * </p>
+ *
+ * @param borderColor
+ * border color
+ */
+ public void setCornerColor(final String borderColor) {
+ if (null != divt[0]) {
+ for (int i = 0; i < cornerHeight; ++i) {
+ DOM.setStyleAttribute(divt[i], "backgroundColor", borderColor);
+ }
+ }
+ if (null != divb[0]) {
+ for (int i = 0; i < cornerHeight; ++i) {
+ DOM.setStyleAttribute(divb[i], "backgroundColor", borderColor);
+ }
+ }
+ }
+
+ /**
+ * Set the css style name of the rounded corners div's. Default the css
+ * stylename is <code>cbg-RP</code>. Use it to set the colors of the
+ * corner. For example: <code>.cbg-RP { background-color:#c3d9ff; }</code>.
+ *
+ * A custom style might be needed when the corners are visible only when a
+ * panel is selected. Use this method to set the custom style name and add
+ * something like the following to the stylesheet:
+ *
+ * <code>.selected .cbg-RP { background-color:#c3d9ff; }</code> Setting
+ * the color is also possible via the method {@link #setCornerColor(String)}.
+ *
+ * @param style
+ * css style name
+ */
+ public void setCornerStyleName(final String style) {
+ if (null != divt[0]) {
+ for (int i = 0; i < cornerHeight; ++i) {
+ DOM.setElementProperty(divt[i], "className", style);
+ }
+ }
+ if (null != divb[0]) {
+ for (int i = 0; i < cornerHeight; ++i) {
+ DOM.setElementProperty(divb[i], "className", style);
+ }
+ }
+ }
+
+ /**
+ * Set the style of the RoundedPanel. In most cases this is not necessary
+ * and setting the style on the widget to which the
+ * <code>RoundedPanel</code> is applied should be set, as is done when not
+ * using the <code>RoundedPanel</code>
+ *
+ * @param style
+ * css style name
+ */
+ public void setStyleName(final String style) {
+ DOM.setElementProperty(body, "className", style);
+ }
+
+ /**
+ * Overwrite of parent getContainerElement()
+ */
+ protected Element getContainerElement() {
+ return divElement;
+ }
+
+ /**
+ * Convenience method to check if given <code>input</code> is with the
+ * <code>mask</code>.
+ *
+ * @param input
+ * input to check
+ * @param mask
+ * mask to check against
+ * @return true if input within mask
+ */
+ protected boolean inMask(final int input, final int mask) {
+ return (input & mask) > 0;
+ }
+
+ /**
+ * Creates div element representing part of the rounded corner.
+ *
+ * @param corner
+ * corner mask to set rounded corner
+ * @param heightIndex
+ * margin width for line
+ */
+ private Element addLine(final int corner, final int heightIndex) {
+ // margin 2 fields : top/bottom right/left => "0 <width>px"
+ // margin 4 fields : top right bottom left => "0 <width>px 0 <width>px"
+ final String margin = corner == TOP || corner == BOTTOM ? "0 "
+ + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] : inMask(corner, LEFT) ? "0 0 0 "
+ + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] : "0 "
+ + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] + " 0 0";
+ final Element div = DOM.createDiv();
+
+ DOM.setStyleAttribute(div, "fontSize", "0px");
+ DOM.setStyleAttribute(div, "height", RoundedPanel.CORNERHEIGHT[cornerHeight - 1][heightIndex]);
+ DOM.setStyleAttribute(div, "borderWidth", "0 " + RoundedPanel.CORNERBORDER[cornerHeight - 1][heightIndex]);
+ DOM.setStyleAttribute(div, "lineHeight", RoundedPanel.CORNERHEIGHT[cornerHeight - 1][heightIndex]);
+ DOM.setStyleAttribute(div, "margin", margin);
+ DOM.setInnerHTML(div, " ");
+ DOM.appendChild(body, div);
+ return div;
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -40,97 +40,100 @@
private final Timer saveTimer;
private final I18nTranslationService i18n;
+ @Deprecated
public TextEditorPanel(final TextEditorPresenter presenter, final I18nTranslationService i18n) {
- this.presenter = presenter;
- this.i18n = i18n;
- gwtRTarea = new RichTextArea();
- textEditorToolbar = new TextEditorToolbar(gwtRTarea, presenter, i18n);
- initWidget(gwtRTarea);
+ this.presenter = presenter;
+ this.i18n = i18n;
+ gwtRTarea = new RichTextArea();
+ textEditorToolbar = new TextEditorToolbar(gwtRTarea, presenter, i18n);
+ initWidget(gwtRTarea);
- gwtRTarea.setWidth("97%");
- gwtRTarea.addStyleName("kune-TexEditorPanel-TextArea");
- adjustSize("" + (Window.getClientHeight() - 265));
- Window.addWindowResizeListener(new WindowResizeListener() {
- public void onWindowResized(final int arg0, final int arg1) {
- adjustSize("" + (Window.getClientHeight() - 265));
- }
- });
- saveTimer = new Timer() {
- public void run() {
- presenter.onSave();
- }
- };
+ gwtRTarea.setWidth("97%");
+ gwtRTarea.addStyleName("kune-TexEditorPanel-TextArea");
+ adjustSize("" + (Window.getClientHeight() - 265));
+ Window.addWindowResizeListener(new WindowResizeListener() {
+ public void onWindowResized(final int arg0, final int arg1) {
+ adjustSize("" + (Window.getClientHeight() - 265));
+ }
+ });
+ saveTimer = new Timer() {
+ public void run() {
+ presenter.onSave();
+ }
+ };
}
public void editHTML(final boolean edit) {
- textEditorToolbar.editHTML(edit);
+ textEditorToolbar.editHTML(edit);
}
public String getHTML() {
- return gwtRTarea.getHTML();
+ return gwtRTarea.getHTML();
}
public String getText() {
- return gwtRTarea.getText();
+ return gwtRTarea.getText();
}
public View getToolBar() {
- return this.textEditorToolbar;
+ return this.textEditorToolbar;
}
public void saveTimerCancel() {
- saveTimer.cancel();
+ saveTimer.cancel();
}
public void scheduleSave(final int delayMillis) {
- saveTimer.schedule(delayMillis);
+ saveTimer.schedule(delayMillis);
}
public void setEnabled(final boolean enabled) {
- final String bgColor = enabled ? BACKCOLOR_ENABLED : BACKCOLOR_DISABLED;
- DOM.setStyleAttribute(gwtRTarea.getElement(), "backgroundColor", bgColor);
- gwtRTarea.setEnabled(enabled);
+ final String bgColor = enabled ? BACKCOLOR_ENABLED : BACKCOLOR_DISABLED;
+ DOM.setStyleAttribute(gwtRTarea.getElement(), "backgroundColor", bgColor);
+ gwtRTarea.setEnabled(enabled);
}
public void setEnabledCancelButton(final boolean enabled) {
- textEditorToolbar.setEnabledCloseButton(enabled);
+ textEditorToolbar.setEnabledCloseButton(enabled);
}
public void setEnabledSaveButton(final boolean enabled) {
- textEditorToolbar.setEnabledSaveButton(enabled);
+ textEditorToolbar.setEnabledSaveButton(enabled);
}
public void setHeight(final String height) {
- gwtRTarea.setHeight(height);
+ gwtRTarea.setHeight(height);
}
public void setHTML(final String html) {
- gwtRTarea.setHTML(html);
+ gwtRTarea.setHTML(html);
}
public void setText(final String text) {
- gwtRTarea.setText(text);
+ gwtRTarea.setText(text);
}
public void setTextSaveButton(final String text) {
- textEditorToolbar.setTextSaveButton(text);
+ textEditorToolbar.setTextSaveButton(text);
}
public void showSaveBeforeDialog() {
- MessageBox.confirm(i18n.t("Save confirmation"), i18n.t("Save before close?"), new MessageBox.ConfirmCallback() {
- public void execute(final String btnID) {
- if (btnID.equals("yes")) {
- presenter.onSaveAndClose();
- } else {
- presenter.onCancelConfirmed();
- }
- }
- });
+ MessageBox.confirm(i18n.t("Save confirmation"), i18n.t("Save before close?"), new MessageBox.ConfirmCallback() {
+ public void execute(final String btnID) {
+ if (btnID.equals("yes")) {
+ presenter.onSaveAndClose();
+ } else {
+ presenter.onCancelConfirmed();
+ }
+ }
+ });
}
+ @Deprecated
private void adjustSize(final String height) {
- gwtRTarea.setHeight(height);
+ // While refactoring
+ // gwtRTarea.setHeight(height);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -95,344 +95,344 @@
private final I18nTranslationService i18n;
public SiteBarPanel(final SiteBarPresenter initPresenter, final I18nTranslationService i18n) {
- this.i18n = i18n;
- img = Images.App.getInstance();
+ this.i18n = i18n;
+ img = Images.App.getInstance();
- // Initialize
- siteBarHP = new HorizontalPanel();
+ // Initialize
+ siteBarHP = new HorizontalPanel();
- initWidget(siteBarHP);
- this.presenter = initPresenter;
+ initWidget(siteBarHP);
+ this.presenter = initPresenter;
- progressPanel = RootPanel.get("kuneprogresspanel");
- progressText = RootPanel.get("kuneprogresstext");
+ progressPanel = RootPanel.get("kuneprogresspanel");
+ progressText = RootPanel.get("kuneprogresstext");
- publicHP = new HorizontalPanel();
- gotoPublic = new IconLabel(img.anybody(), i18n.t("Go to Public Space"), false);
- contentNoPublic = new IconLabel(img.anybody(), i18n.t("This content is not public"));
+ publicHP = new HorizontalPanel();
+ gotoPublic = new IconLabel(img.anybody(), i18n.t("Go to Public Space"), false);
+ contentNoPublic = new IconLabel(img.anybody(), i18n.t("This content is not public"));
- final Label expandLabel = new Label("");
- newGroupHyperlink = new Hyperlink();
- final HTML pipeSeparatorHtml = new HTML();
- pipeSeparatorHtml2 = new HTML();
- loginHyperlink = new Hyperlink();
- loggedUserHyperlink = new Hyperlink();
- logoutLabel = new Label();
- HTML spaceSeparator1 = new HTML("<b></b>");
- MenuBar options = new MenuBar();
- optionsSubmenu = new MenuBar(true);
- yourGroupsSubmenu = new MenuBar(true);
- RoundedBorderDecorator optionsButton = new RoundedBorderDecorator(options, RoundedBorderDecorator.ALL,
- RoundedBorderDecorator.SIMPLE);
- HTML spaceSeparator2 = new HTML("<b></b>");
- logoImage = new Image();
+ final Label expandLabel = new Label("");
+ newGroupHyperlink = new Hyperlink();
+ final HTML pipeSeparatorHtml = new HTML();
+ pipeSeparatorHtml2 = new HTML();
+ loginHyperlink = new Hyperlink();
+ loggedUserHyperlink = new Hyperlink();
+ logoutLabel = new Label();
+ final HTML spaceSeparator1 = new HTML("<b></b>");
+ final MenuBar options = new MenuBar();
+ optionsSubmenu = new MenuBar(true);
+ yourGroupsSubmenu = new MenuBar(true);
+ final RoundedBorderDecorator optionsButton = new RoundedBorderDecorator(options, RoundedBorderDecorator.ALL,
+ RoundedBorderDecorator.SIMPLE);
+ final HTML spaceSeparator2 = new HTML("<b></b>");
+ logoImage = new Image();
- // Layout
- siteBarHP.add(publicHP);
- publicHP.add(gotoPublic);
- publicHP.add(contentNoPublic);
- siteBarHP.add(expandLabel);
- siteBarHP.add(loginHyperlink);
- siteBarHP.add(loggedUserHyperlink);
- siteBarHP.add(pipeSeparatorHtml);
- siteBarHP.add(logoutLabel);
- siteBarHP.add(pipeSeparatorHtml2);
- siteBarHP.add(newGroupHyperlink);
- siteBarHP.add(spaceSeparator1);
- siteBarHP.add(optionsButton);
- siteBarHP.add(spaceSeparator2);
- createSearchBox();
- siteBarHP.add(logoImage);
+ // Layout
+ siteBarHP.add(publicHP);
+ publicHP.add(gotoPublic);
+ publicHP.add(contentNoPublic);
+ siteBarHP.add(expandLabel);
+ siteBarHP.add(loginHyperlink);
+ siteBarHP.add(loggedUserHyperlink);
+ siteBarHP.add(pipeSeparatorHtml);
+ siteBarHP.add(logoutLabel);
+ siteBarHP.add(pipeSeparatorHtml2);
+ siteBarHP.add(newGroupHyperlink);
+ siteBarHP.add(spaceSeparator1);
+ siteBarHP.add(optionsButton);
+ siteBarHP.add(spaceSeparator2);
+ createSearchBox();
+ siteBarHP.add(logoImage);
- // Set properties
- siteBarHP.addStyleName("kune-SiteBarPanel");
- siteBarHP.setCellWidth(expandLabel, "100%");
- showProgress(i18n.t("Processing"));
- gotoPublic.addStyleName("kune-Margin-Medium-r");
- setContentPublic(true);
- gotoPublic.addClickListener(new ClickListener() {
- public void onClick(final Widget sender) {
- gotoPublic();
- }
- });
- gotoPublic.setTitle(i18n.t("Leave the workspace and go to the public space of this group")
- + Site.IN_DEVELOPMENT);
- gotoPublic.addStyleName("kune-SiteBarPanel-LabelLink");
- contentNoPublic.addStyleName("kune-Margin-Medium-r");
- newGroupHyperlink.setText(i18n.t("Create New Group"));
- newGroupHyperlink.setTargetHistoryToken(Site.NEWGROUP_TOKEN);
- loggedUserHyperlink.setVisible(false);
- pipeSeparatorHtml.setHTML("|");
- pipeSeparatorHtml.setStyleName("kune-SiteBarPanel-Separator");
- pipeSeparatorHtml2.setHTML("|");
- pipeSeparatorHtml2.setStyleName("kune-SiteBarPanel-Separator");
- loginHyperlink.setText(i18n.t("Sign in to collaborate"));
- loginHyperlink.setTargetHistoryToken(Site.LOGIN_TOKEN);
- logoutLabel.setText(i18n.t("Sign out"));
- logoutLabel.addStyleName("kune-SiteBarPanel-LabelLink");
- options.addItem(i18n.t("Options"), true, optionsSubmenu);
- options.setStyleName("kune-MenuBar");
- optionsButton.setColor("AAA");
- optionsButton.setHeight("16px");
- createOptionsSubmenu();
- addDefaultItemsToOptions();
+ // Set properties
+ siteBarHP.addStyleName("kune-SiteBarPanel");
+ siteBarHP.setCellWidth(expandLabel, "100%");
+ showProgress(i18n.t("Processing"));
+ gotoPublic.addStyleName("kune-Margin-Medium-r");
+ setContentPublic(true);
+ gotoPublic.addClickListener(new ClickListener() {
+ public void onClick(final Widget sender) {
+ gotoPublic();
+ }
+ });
+ gotoPublic.setTitle(i18n.t("Leave the workspace and go to the public space of this group")
+ + Site.IN_DEVELOPMENT);
+ gotoPublic.addStyleName("kune-SiteBarPanel-LabelLink");
+ contentNoPublic.addStyleName("kune-Margin-Medium-r");
+ newGroupHyperlink.setText(i18n.t("Create New Group"));
+ newGroupHyperlink.setTargetHistoryToken(Site.NEWGROUP_TOKEN);
+ loggedUserHyperlink.setVisible(false);
+ pipeSeparatorHtml.setHTML("|");
+ pipeSeparatorHtml.setStyleName("kune-SiteBarPanel-Separator");
+ pipeSeparatorHtml2.setHTML("|");
+ pipeSeparatorHtml2.setStyleName("kune-SiteBarPanel-Separator");
+ loginHyperlink.setText(i18n.t("Sign in to collaborate"));
+ loginHyperlink.setTargetHistoryToken(Site.LOGIN_TOKEN);
+ logoutLabel.setText(i18n.t("Sign out"));
+ logoutLabel.addStyleName("kune-SiteBarPanel-LabelLink");
+ options.addItem(i18n.t("Options"), true, optionsSubmenu);
+ options.setStyleName("kune-MenuBar");
+ optionsButton.setColor("AAA");
+ optionsButton.setHeight("16px");
+ createOptionsSubmenu();
+ addDefaultItemsToOptions();
- spaceSeparator1.setStyleName("kune-SiteBarPanel-SpaceSeparator");
- spaceSeparator2.setStyleName("kune-SiteBarPanel-SpaceSeparator");
+ spaceSeparator1.setStyleName("kune-SiteBarPanel-SpaceSeparator");
+ spaceSeparator2.setStyleName("kune-SiteBarPanel-SpaceSeparator");
- createListeners();
+ createListeners();
- // TODO: externalize this
- img.kuneLogo16px().applyTo(logoImage);
- this.hideProgress();
- extRootBody = new ExtElement(RootPanel.getBodyElement());
+ // TODO: externalize this
+ img.kuneLogo16px().applyTo(logoImage);
+ this.hideProgress();
+ extRootBody = new ExtElement(RootPanel.getBodyElement());
}
public void centerLoginDialog() {
- loginPanel.center();
+ loginPanel.center();
}
public void centerNewGroupDialog() {
- newGroupPanel.center();
+ newGroupPanel.center();
}
public void clearSearchText() {
- searchTextBox.setText("");
+ searchTextBox.setText("");
}
public void clearUserName() {
- loginHyperlink.setText(i18n.t("Sign in to collaborate"));
+ loginHyperlink.setText(i18n.t("Sign in to collaborate"));
}
public void gotoPublic() {
- Window.open(publicUrl, "_blank", "");
+ Window.open(publicUrl, "_blank", "");
}
public void hideLoginDialog() {
- loginPanel.hide();
+ loginPanel.hide();
}
public void hideNewGroupDialog() {
- newGroupPanel.hide();
+ newGroupPanel.hide();
}
public void hideProgress() {
- timeProgressMaxTime.cancel();
- progressPanel.setVisible(false);
- publicHP.setVisible(true);
+ timeProgressMaxTime.cancel();
+ progressPanel.setVisible(false);
+ publicHP.setVisible(true);
}
public void mask() {
- extRootBody.mask();
+ extRootBody.mask();
}
public void mask(final String message) {
- extRootBody.mask(message, "x-mask-loading");
+ extRootBody.mask(message, "x-mask-loading");
}
public void resetOptionsSubmenu() {
- optionsSubmenu.clearItems();
- addDefaultItemsToOptions();
+ optionsSubmenu.clearItems();
+ addDefaultItemsToOptions();
}
public void restoreLoginLink() {
- loginHyperlink.setVisible(true);
- loggedUserHyperlink.setVisible(false);
- loginHyperlink.setTargetHistoryToken(Site.LOGIN_TOKEN);
+ loginHyperlink.setVisible(true);
+ loggedUserHyperlink.setVisible(false);
+ loginHyperlink.setTargetHistoryToken(Site.LOGIN_TOKEN);
}
public void setContentGotoPublicUrl(final String publicUrl) {
- this.publicUrl = publicUrl;
+ this.publicUrl = publicUrl;
}
public void setContentPublic(boolean visible) {
- gotoPublic.setVisible(visible);
- contentNoPublic.setVisible(!visible);
+ gotoPublic.setVisible(visible);
+ contentNoPublic.setVisible(!visible);
}
public void setDefaultTextSearch() {
- searchTextBox.setText(i18n.t("Search"));
+ searchTextBox.setText(i18n.t("Search"));
}
public void setGroupsIsMember(final List<LinkDTO> groupsIsAdmin, final List<LinkDTO> groupsIsCollab) {
- optionsSubmenu.clearItems();
- yourGroupsSubmenu.clearItems();
+ optionsSubmenu.clearItems();
+ yourGroupsSubmenu.clearItems();
- int isAdminCount = groupsIsAdmin.size();
- int isCollabCount = groupsIsCollab.size();
- if (isAdminCount > 0 || isCollabCount > 0) {
- optionsSubmenu.addItem(i18n.t("My Groups") + " »", yourGroupsSubmenu);
- for (int i = 0; i < isAdminCount; i++) {
- final LinkDTO link = groupsIsAdmin.get(i);
- addItemToYourGroupSubmenu(link);
- }
- for (int i = 0; i < isCollabCount; i++) {
- final LinkDTO link = groupsIsCollab.get(i);
- addItemToYourGroupSubmenu(link);
- }
- }
- addDefaultItemsToOptions();
+ final int isAdminCount = groupsIsAdmin.size();
+ final int isCollabCount = groupsIsCollab.size();
+ if (isAdminCount > 0 || isCollabCount > 0) {
+ optionsSubmenu.addItem(i18n.t("My Groups") + " »", yourGroupsSubmenu);
+ for (int i = 0; i < isAdminCount; i++) {
+ final LinkDTO link = groupsIsAdmin.get(i);
+ addItemToYourGroupSubmenu(link);
+ }
+ for (int i = 0; i < isCollabCount; i++) {
+ final LinkDTO link = groupsIsCollab.get(i);
+ addItemToYourGroupSubmenu(link);
+ }
+ }
+ addDefaultItemsToOptions();
}
public void setLogo(final Image logo) {
- // TODO
+ // TODO
}
public void setLogoutLinkVisible(final boolean visible) {
- logoutLabel.setVisible(visible);
- pipeSeparatorHtml2.setVisible(visible);
+ logoutLabel.setVisible(visible);
+ pipeSeparatorHtml2.setVisible(visible);
}
public void setSearchText(final String text) {
- searchTextBox.setText(text);
+ searchTextBox.setText(text);
}
public void setTextSearchBig() {
- searchTextBox.setWidth(SEARCH_TEXT_WIDTH_BIG);
+ searchTextBox.setWidth(SEARCH_TEXT_WIDTH_BIG);
}
public void setTextSearchSmall() {
- searchTextBox.setWidth(SEARCH_TEXT_WIDTH_SMALL);
+ searchTextBox.setWidth(SEARCH_TEXT_WIDTH_SMALL);
}
public void showAlertMessage(final String message) {
- MessageBox.alert(i18n.t("Alert"), message, new MessageBox.AlertCallback() {
- public void execute() {
- // Do nothing
- }
- });
+ MessageBox.alert(i18n.t("Alert"), message, new MessageBox.AlertCallback() {
+ public void execute() {
+ // Do nothing
+ }
+ });
}
public void showLoggedUserName(final String name, final String homePage) {
- loginHyperlink.setVisible(false);
- loggedUserHyperlink.setVisible(true);
- loggedUserHyperlink.setText(name);
- loggedUserHyperlink.setTargetHistoryToken(homePage);
+ loginHyperlink.setVisible(false);
+ loggedUserHyperlink.setVisible(true);
+ loggedUserHyperlink.setText(name);
+ loggedUserHyperlink.setTargetHistoryToken(homePage);
}
public void showLoginDialog() {
- final Login login = SiteBarFactory.getLoginForm(presenter);
- loginPanel = (LoginPanel) login.getView();
- loginPanel.show();
+ final Login login = SiteBarFactory.getLoginForm(presenter);
+ loginPanel = (LoginPanel) login.getView();
+ loginPanel.show();
}
public void showNewGroupDialog() {
- final NewGroup newGroupForm = SiteBarFactory.getNewGroupForm(presenter);
- newGroupPanel = (NewGroupPanel) newGroupForm.getView();
- newGroupPanel.show();
- Site.hideProgress();
+ final NewGroup newGroupForm = SiteBarFactory.getNewGroupForm(presenter);
+ newGroupPanel = (NewGroupPanel) newGroupForm.getView();
+ newGroupPanel.show();
+ Site.hideProgress();
}
public void showProgress(final String text) {
- if (timeProgressMaxTime == null) {
- timeProgressMaxTime = new Timer() {
- public void run() {
- hideProgress();
- }
- };
- }
- timeProgressMaxTime.schedule(MAX_TIME_PROGRESS_BAR);
- publicHP.setVisible(false);
- progressPanel.setVisible(true);
- DOM.setInnerText(progressText.getElement(), text);
+ if (timeProgressMaxTime == null) {
+ timeProgressMaxTime = new Timer() {
+ public void run() {
+ hideProgress();
+ }
+ };
+ }
+ timeProgressMaxTime.schedule(MAX_TIME_PROGRESS_BAR);
+ publicHP.setVisible(false);
+ progressPanel.setVisible(true);
+ DOM.setInnerText(progressText.getElement(), text);
}
public void showSearchPanel(final String termToSearch) {
- final SearchSite search = SiteBarFactory.getSearch();
- search.doSearch(termToSearch);
- searchPanel = (SearchSitePanel) search.getView();
- searchPanel.show();
- Site.hideProgress();
+ final SearchSite search = SiteBarFactory.getSearch();
+ search.doSearch(termToSearch);
+ searchPanel = (SearchSitePanel) search.getView();
+ searchPanel.show();
+ Site.hideProgress();
}
public void unMask() {
- extRootBody.unmask();
+ extRootBody.unmask();
}
private void addDefaultItemsToOptions() {
- optionsSubmenu.addItem(linkHelpInTrans);
- optionsSubmenu.addItem(linkKuneBugs);
+ optionsSubmenu.addItem(linkHelpInTrans);
+ optionsSubmenu.addItem(linkKuneBugs);
}
private void addItemToYourGroupSubmenu(final LinkDTO link) {
- yourGroupsSubmenu.addItem(link.getShortName(), true, new Command() {
- public void execute() {
- presenter.changeState(new StateToken(link.getLink()));
- }
- });
+ yourGroupsSubmenu.addItem(link.getShortName(), true, new Command() {
+ public void execute() {
+ presenter.changeState(new StateToken(link.getLink()));
+ }
+ });
}
private void createListeners() {
- searchButton.addClickListener(new ClickListener() {
- public void onClick(final Widget arg0) {
- Site.showProgressProcessing();
- presenter.doSearch(searchTextBox.getText());
- }
- });
- logoutLabel.addClickListener(new ClickListener() {
- public void onClick(final Widget arg0) {
- Site.showProgressProcessing();
- presenter.doLogout();
- }
- });
- searchTextBox.addKeyboardListener(new KeyboardListener() {
- public void onKeyDown(final Widget arg0, final char arg1, final int arg2) {
- }
+ searchButton.addClickListener(new ClickListener() {
+ public void onClick(final Widget arg0) {
+ Site.showProgressProcessing();
+ presenter.doSearch(searchTextBox.getText());
+ }
+ });
+ logoutLabel.addClickListener(new ClickListener() {
+ public void onClick(final Widget arg0) {
+ Site.showProgressProcessing();
+ presenter.doLogout();
+ }
+ });
+ searchTextBox.addKeyboardListener(new KeyboardListener() {
+ public void onKeyDown(final Widget arg0, final char arg1, final int arg2) {
+ }
- public void onKeyPress(final Widget arg0, final char arg1, final int arg2) {
- }
+ public void onKeyPress(final Widget arg0, final char arg1, final int arg2) {
+ }
- public void onKeyUp(final Widget widget, final char key, final int mod) {
- if (key == KEY_ENTER) {
- if (searchTextBox.getText().length() > 0) {
- Site.showProgressProcessing();
- presenter.doSearch(searchTextBox.getText());
- }
- }
- }
- });
+ public void onKeyUp(final Widget widget, final char key, final int mod) {
+ if (key == KEY_ENTER) {
+ if (searchTextBox.getText().length() > 0) {
+ Site.showProgressProcessing();
+ presenter.doSearch(searchTextBox.getText());
+ }
+ }
+ }
+ });
}
private void createOptionsSubmenu() {
- linkHelpInTrans = new MenuItem(img.language().getHTML() + i18n.t("Help with the translation"), true,
- new Command() {
- public void execute() {
- presenter.onHelpInTranslation();
- }
- });
- linkKuneBugs = new MenuItem(img.kuneIcon16().getHTML() + i18n.t("Report kune bugs"), true, new Command() {
- public void execute() {
- Window.open("http://code.google.com/p/kune/issues/list", "_blank", null);
- }
- });
- // linkHelp = new MenuItem(img.kuneIcon16().getHTML() +
- // i18n.t("Help"), true, new Command() {
- // public void execute() {
- // presenter.changeState(new StateToken("site.docs"));
- // }
- // });
+ linkHelpInTrans = new MenuItem(img.language().getHTML() + i18n.t("Help with the translation"), true,
+ new Command() {
+ public void execute() {
+ presenter.onHelpInTranslation();
+ }
+ });
+ linkKuneBugs = new MenuItem(img.kuneIcon16().getHTML() + i18n.t("Report kune bugs"), true, new Command() {
+ public void execute() {
+ Window.open("http://code.google.com/p/kune/issues/list", "_blank", null);
+ }
+ });
+ // linkHelp = new MenuItem(img.kuneIcon16().getHTML() +
+ // i18n.t("Help"), true, new Command() {
+ // public void execute() {
+ // presenter.changeState(new StateToken("site.docs"));
+ // }
+ // });
}
private void createSearchBox() {
- searchButton = new PushButton(img.kuneSearchIco().createImage(), img.kuneSearchIcoPush().createImage());
- searchTextBox = new TextBox();
+ searchButton = new PushButton(img.kuneSearchIco().createImage(), img.kuneSearchIcoPush().createImage());
+ searchTextBox = new TextBox();
- siteBarHP.add(searchButton);
- siteBarHP.add(searchTextBox);
+ siteBarHP.add(searchButton);
+ siteBarHP.add(searchTextBox);
- setTextSearchSmall();
- setDefaultTextSearch();
- searchTextBox.addFocusListener(new FocusListener() {
+ setTextSearchSmall();
+ setDefaultTextSearch();
+ searchTextBox.addFocusListener(new FocusListener() {
- public void onFocus(final Widget arg0) {
- presenter.onSearchFocus();
- }
+ public void onFocus(final Widget arg0) {
+ presenter.onSearchFocus();
+ }
- public void onLostFocus(final Widget arg0) {
- presenter.onSearchLostFocus(searchTextBox.getText());
- }
- });
+ public void onLostFocus(final Widget arg0) {
+ presenter.onSearchLostFocus(searchTextBox.getText());
+ }
+ });
}
}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,37 @@
+package org.ourproject.kune.workspace.client.ui.newtmp;
+
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter;
+import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter;
+import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo;
+
+public class WorkspaceManager {
+
+ private final EntityLogo entityLogo;
+ private final EntityTitlePresenter entityTitlePresenter;
+ private final WsThemePresenter wsThemePresenter;
+
+ public WorkspaceManager(final EntityLogo entityLogo, final EntityTitlePresenter entityTitlePresenter,
+ final WsThemePresenter wsThemePresenter) {
+ this.entityLogo = entityLogo;
+ this.entityTitlePresenter = entityTitlePresenter;
+ this.wsThemePresenter = wsThemePresenter;
+ }
+
+ public void setState(final StateDTO state) {
+ final GroupDTO group = state.getGroup();
+ final boolean isAdmin = state.getGroupRights().isAdministrable();
+ entityLogo.setLogo(group.getLongName());
+ entityLogo.setPutYourLogoVisible(isAdmin);
+ entityTitlePresenter.setState(state);
+ // Only for probes:
+ wsThemePresenter.setVisible(true);
+ }
+
+ public void setTheme(final WsTheme theme) {
+ entityLogo.setTheme(theme);
+ entityTitlePresenter.setTheme(theme);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/AbstractBar.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,40 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+
+public class AbstractBar extends Composite {
+ private final HorizontalPanel horPanel;
+
+ public AbstractBar() {
+ horPanel = new HorizontalPanel();
+ horPanel.setWidth("100%");
+ initWidget(horPanel);
+ }
+
+ public void add(final Widget widget) {
+ horPanel.add(widget);
+ }
+
+ public void addFill() {
+ final Label emptyLabel = new Label("");
+ horPanel.add(emptyLabel);
+ horPanel.setCellWidth(emptyLabel, "100%");
+ }
+
+ public void addSeparator() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-sep");
+ emptyLabel.addStyleName("k-toolbar-sep");
+ horPanel.add(emptyLabel);
+ }
+
+ public void addSpacer() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-spacer");
+ horPanel.add(emptyLabel);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Entity.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,40 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.gwtext.client.widgets.Panel;
+
+public class Entity extends DefaultBorderLayout {
+
+ private final EntityWorkspace entityWorkspace;
+ private final EntitySummary entitySummary;
+ private final Panel entityMainHeader;
+
+ public Entity() {
+ entityMainHeader = new Panel();
+ entityMainHeader.setBorder(false);
+ entitySummary = new EntitySummary();
+ entityWorkspace = new EntityWorkspace();
+ add(entityMainHeader, DefaultBorderLayout.Position.NORTH, 65);
+ add(entityWorkspace.getPanel(), DefaultBorderLayout.Position.CENTER);
+ add(entitySummary.getPanel(), DefaultBorderLayout.Position.EAST, true, 150);
+ }
+
+ public Panel getEntityMainHeader() {
+ return entityMainHeader;
+ }
+
+ public EntitySummary getEntitySummary() {
+ return entitySummary;
+ }
+
+ public EntityWorkspace getEntityWorkspace() {
+ return entityWorkspace;
+ }
+
+ public void setTheme(final WsTheme theme) {
+ super.setCls("k-entity-" + theme);
+ entityWorkspace.setTheme(theme);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntitySummary.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,47 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Toolbar;
+
+public class EntitySummary {
+ private final Panel entityTools;
+ private final Panel entitySummary;
+ private final DefaultBorderLayout mainPanel;
+ private final Toolbar trayBar;
+
+ public EntitySummary() {
+ mainPanel = new DefaultBorderLayout();
+ entityTools = new Panel();
+ entitySummary = new Panel();
+ entitySummary.setCls("k-entity-summary");
+ entityTools.setBorder(false);
+ entitySummary.setBorder(false);
+ entityTools.setAutoScroll(false);
+ entitySummary.setAutoScroll(true);
+ trayBar = mainPanel.createBottomBar(entitySummary, "k-site-traybar");
+ mainPanel.add(entityTools, DefaultBorderLayout.Position.NORTH, 30);
+ mainPanel.add(entitySummary, DefaultBorderLayout.Position.CENTER);
+ }
+
+ public void addInSummary(final Widget widget) {
+ entitySummary.add(widget);
+ mainPanel.doLayoutIfNeeded();
+ }
+
+ public void addInTools(final Widget widget) {
+ entityTools.add(widget);
+ mainPanel.doLayoutIfNeeded();
+ }
+
+ public Panel getPanel() {
+ return mainPanel.getPanel();
+ }
+
+ public Toolbar getSiteTraybar() {
+ return trayBar;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/EntityWorkspace.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,132 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+import org.ourproject.kune.platf.client.ui.RoundedPanel;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.layout.AnchorLayout;
+import com.gwtext.client.widgets.layout.AnchorLayoutData;
+
+public class EntityWorkspace extends DefaultBorderLayout {
+ private final Panel content;
+ private final Panel container;
+ private final TitleBar title;
+ private final TitleBar subTitle;
+ private final TitleBar bottom;
+ private final Toolbar contentTopBar;
+ private final Toolbar contentBottomBar;
+ private final Toolbar containerTopBar;
+ private final Toolbar containerBottomBar;
+ private final RoundedPanel roundedTitle;
+ private final RoundedPanel roundedBottom;
+ private final DefaultBorderLayout containerWrap;
+
+ public EntityWorkspace() {
+ final Panel titles = new Panel();
+ titles.setBorder(false);
+ titles.setLayout(new AnchorLayout());
+ final Panel bottomPanel = new Panel();
+ bottomPanel.setBorder(false);
+ bottomPanel.setLayout(new AnchorLayout());
+
+ title = new TitleBar();
+ title.setHeight("" + (DEF_TOOLBAR_HEIGHT - 2));
+ title.setStylePrimaryName("k-entity-title");
+ subTitle = new TitleBar();
+ subTitle.setStylePrimaryName("k-entity-subtitle");
+ bottom = new TitleBar();
+ bottom.setHeight("" + (DEF_TOOLBAR_HEIGHT - 2));
+ bottom.setStylePrimaryName("k-entity-bottom");
+
+ roundedTitle = new RoundedPanel(title, RoundedPanel.TOPLEFT, 2);
+ roundedBottom = new RoundedPanel(bottom, RoundedPanel.BOTTOMLEFT, 2);
+
+ titles.add(roundedTitle, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+ titles.add(subTitle, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+ bottomPanel.add(roundedBottom, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+
+ final DefaultBorderLayout contentWrap = new DefaultBorderLayout();
+ containerWrap = new DefaultBorderLayout();
+ contentWrap.setBorder(true);
+ containerWrap.setBorder(true);
+ content = new Panel();
+ container = new Panel();
+ content.setBorder(false);
+ container.setBorder(false);
+ container.setCollapsible(true);
+ content.setPaddings(5);
+ container.setPaddings(5);
+ content.setAutoScroll(true);
+ container.setAutoScroll(true);
+
+ contentTopBar = new Toolbar();
+ contentBottomBar = new Toolbar();
+ containerTopBar = new Toolbar();
+ containerBottomBar = new Toolbar();
+ contentTopBar.addClass("k-toolbar-bottom-line");
+ contentBottomBar.addClass("k-toolbar-top-line");
+ containerTopBar.addClass("k-toolbar-bottom-line");
+ containerBottomBar.addClass("k-toolbar-top-line");
+ contentWrap.add(contentTopBar.getPanel(), Position.NORTH, false, DEF_TOOLBAR_HEIGHT);
+ containerWrap.add(containerTopBar.getPanel(), Position.NORTH, false, DEF_TOOLBAR_HEIGHT);
+ contentWrap.add(content, Position.CENTER);
+ containerWrap.add(container, Position.CENTER);
+ contentWrap.add(contentBottomBar.getPanel(), Position.SOUTH, false, DEF_TOOLBAR_HEIGHT);
+ containerWrap.add(containerBottomBar.getPanel(), Position.SOUTH, false, DEF_TOOLBAR_HEIGHT);
+
+ add(titles, DefaultBorderLayout.Position.NORTH, DEF_TOOLBAR_HEIGHT * 2);
+ add(contentWrap.getPanel(), DefaultBorderLayout.Position.CENTER);
+ add(containerWrap.getPanel(), DefaultBorderLayout.Position.EAST, true, 175);
+ add(bottomPanel, DefaultBorderLayout.Position.SOUTH, DEF_TOOLBAR_HEIGHT);
+ }
+
+ public TitleBar getBottomTitle() {
+ return bottom;
+ }
+
+ public Toolbar getContainerBottomBar() {
+ return containerBottomBar;
+ }
+
+ public Toolbar getContainerTopBar() {
+ return containerTopBar;
+ }
+
+ public Toolbar getContentBottomBar() {
+ return contentBottomBar;
+ }
+
+ public Toolbar getContentTopBar() {
+ return contentTopBar;
+ }
+
+ public TitleBar getSubTitle() {
+ return subTitle;
+ }
+
+ public TitleBar getTitle() {
+ return title;
+ }
+
+ public void setContainer(final View view) {
+ setPanel(container, (Widget) view);
+ }
+
+ public void setContent(final View view) {
+ setPanel(content, (Widget) view);
+ }
+
+ public void setTheme(final WsTheme theme) {
+ final String themeS = theme.toString();
+ super.setCls("k-entityworkspace-" + theme);
+ roundedTitle.setCornerStyleName("k-entity-title-rd-" + theme);
+ roundedBottom.setCornerStyleName("k-entity-bottom-rd-" + theme);
+ title.addStyleDependentName(themeS);
+ subTitle.addStyleDependentName(themeS);
+ bottom.addStyleDependentName(themeS);
+ container.setStyleName("k-entity-container-" + theme);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/SiteBar.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,33 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+
+public class SiteBar extends Panel {
+
+ private final TitleBar titleBar;
+
+ public SiteBar() {
+ super.setBorder(false);
+ titleBar = new TitleBar();
+ titleBar.setStyleName("k-sitebar");
+ super.add(titleBar);
+ }
+
+ public void add(final Widget widget) {
+ titleBar.add(widget);
+ }
+
+ public void addFill() {
+ titleBar.addFill();
+ }
+
+ public void addSeparator() {
+ titleBar.addSeparator();
+ }
+
+ public void addSpacer() {
+ titleBar.addSpacer();
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/TitleBar.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+public class TitleBar extends AbstractBar {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/Toolbar.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,52 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+
+public class Toolbar {
+ private final Panel container;
+ private final AbstractBar horPanel;
+
+ public Toolbar() {
+ container = new Panel();
+ container.setBorder(false);
+ container.setBodyBorder(false);
+ container.setHeight(DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
+ container.setWidth("100%");
+ container.setHeader(false);
+ container.setBaseCls("x-toolbar");
+ container.addClass("x-panel");
+ horPanel = new AbstractBar();
+ container.add(horPanel);
+ }
+
+ public void add(final Widget widget) {
+ horPanel.add(widget);
+ if (container.isRendered()) {
+ container.doLayout(false);
+ }
+ }
+
+ public void addClass(final String cls) {
+ container.addClass(cls);
+ }
+
+ public void addFill() {
+ horPanel.addFill();
+ }
+
+ public void addSeparator() {
+ horPanel.addSeparator();
+ }
+
+ public void addSpacer() {
+ horPanel.addSpacer();
+ }
+
+ public Panel getPanel() {
+ return container;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/skel/WorkspaceSkeleton.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,58 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.skel;
+
+import org.ourproject.kune.platf.client.ui.DefaultBorderLayout;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.Toolbar;
+import com.gwtext.client.widgets.Viewport;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class WorkspaceSkeleton {
+ private final Entity entity;
+ private final SiteBar sitebar;
+ private final DefaultBorderLayout mainPanel;
+ private final Panel container;
+
+ public WorkspaceSkeleton() {
+ container = new Panel();
+ container.setLayout(new FitLayout());
+ container.setBorder(false);
+ container.setPaddings(5);
+ mainPanel = new DefaultBorderLayout();
+ sitebar = new SiteBar();
+ entity = new Entity();
+ mainPanel.add(sitebar, DefaultBorderLayout.Position.NORTH, DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
+ mainPanel.add(entity.getPanel(), DefaultBorderLayout.Position.CENTER);
+ container.add(mainPanel.getPanel());
+ }
+
+ public Panel getEntityMainHeader() {
+ return entity.getEntityMainHeader();
+ }
+
+ public EntitySummary getEntitySummary() {
+ return entity.getEntitySummary();
+ }
+
+ public EntityWorkspace getEntityWorkspace() {
+ return entity.getEntityWorkspace();
+ }
+
+ public SiteBar getSiteBar() {
+ return sitebar;
+ }
+
+ public Toolbar getSiteTraybar() {
+ return entity.getEntitySummary().getSiteTraybar();
+ }
+
+ public void setTheme(final WsTheme theme) {
+ entity.setTheme(theme);
+ }
+
+ public void show() {
+ new Viewport(container);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsTheme.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+
+public enum WsTheme {
+ def, green, blue, grey, purple, red
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,36 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.menu.BaseItem;
+import com.gwtext.client.widgets.menu.Menu;
+import com.gwtext.client.widgets.menu.MenuItem;
+import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
+
+public class WsThemePanel extends ToolbarButton implements WsThemeView {
+
+ private final Menu menu;
+
+ public WsThemePanel(final WorkspaceSkeleton ws) {
+ menu = new Menu();
+ for (final WsTheme theme : WsTheme.values()) {
+ final MenuItem item = new MenuItem();
+ item.setText(theme.toString());
+ menu.addItem(item);
+ item.addListener(new BaseItemListenerAdapter() {
+ public void onActivate(final BaseItem item) {
+ ws.setTheme(theme);
+ }
+ });
+ }
+ menu.setDefaultAlign("br-tr");
+ super.setMenu(menu);
+ ws.getSiteTraybar().addButton(this);
+ }
+
+ public void setVisible(final boolean visible) {
+ menu.setVisible(visible);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,14 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+
+public class WsThemePresenter {
+
+ private WsThemeView view;
+
+ public void init(final WsThemeView view) {
+ this.view = view;
+ }
+
+ public void setVisible(final boolean visible) {
+ view.setVisible(visible);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemeView.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.workspace.client.ui.newtmp.themes;
+
+public interface WsThemeView {
+
+ void setVisible(boolean visible);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,79 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.title;
+
+import org.ourproject.kune.platf.client.ui.EditableClickListener;
+import org.ourproject.kune.platf.client.ui.EditableIconLabel;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.TitleBar;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Label;
+
+public class EntityTitlePanel implements EntityTitleView {
+ private final EditableIconLabel titleLabel;
+ private final Label dateLabel;
+
+ public EntityTitlePanel(final WorkspaceSkeleton ws, final EntityTitlePresenter presenter) {
+ titleLabel = new EditableIconLabel(new EditableClickListener() {
+ public void onEdited(final String text) {
+ presenter.onTitleRename(text);
+ }
+ });
+ dateLabel = new Label();
+
+ final TitleBar wsTitle = ws.getEntityWorkspace().getTitle();
+ wsTitle.add(titleLabel);
+ wsTitle.addFill();
+ wsTitle.add(dateLabel);
+ titleLabel.addStyleName("kune-Margin-Large-l");
+ titleLabel.addStyleName("kune-ft17px");
+ dateLabel.addStyleName("kune-Margin-Large-r");
+ dateLabel.addStyleName("kune-ft12px");
+ titleLabel.addStyleName("kune-ContentTitleBar-l");
+ dateLabel.addStyleName("kune-ContentTitleBar-r");
+ }
+
+ public void restoreOldTitle() {
+ titleLabel.restoreOldText();
+ }
+
+ public void setContentDate(final String date) {
+ dateLabel.setText(date);
+ }
+
+ public void setContentTitle(final String title) {
+ titleLabel.setText(title);
+ }
+
+ public void setContentTitleEditable(final boolean editable) {
+ titleLabel.setEditable(editable);
+ }
+
+ public void setDateVisible(final boolean visible) {
+ dateLabel.setVisible(visible);
+
+ }
+
+ public void setTheme(final WsTheme theme) {
+
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitlePresenter.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,111 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.title;
+
+import java.util.Date;
+
+import org.ourproject.kune.docs.client.actions.DocsEvents;
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.rpc.ParamCallback;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.KuneErrorHandler;
+import org.ourproject.kune.workspace.client.WorkspaceEvents;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public class EntityTitlePresenter {
+
+ private EntityTitleView view;
+ private final I18nTranslationService i18n;
+ private final KuneErrorHandler errorHandler;
+
+ public EntityTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler) {
+ this.i18n = i18n;
+ this.errorHandler = errorHandler;
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(final EntityTitleView view) {
+ this.view = view;
+ }
+
+ public void onTitleRename(final String text) {
+ Site.showProgressSaving();
+ final AsyncCallback<String> callback = new AsyncCallback<String>() {
+ public void onFailure(final Throwable caught) {
+ view.restoreOldTitle();
+ errorHandler.process(caught);
+ }
+
+ public void onSuccess(final String result) {
+ Site.hideProgress();
+ view.setContentTitle(result);
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.RELOAD_CONTEXT, null);
+ }
+ };
+ DefaultDispatcher.getInstance().fire(DocsEvents.RENAME_CONTENT,
+ new ParamCallback<String, String>(text, callback));
+ }
+
+ public void setState(final StateDTO state) {
+ if (state.hasDocument()) {
+ setContentTitle(state.getTitle(), state.getContentRights().isEditable());
+ setContentDateVisible(true);
+ setContentDate(state.getPublishedOn());
+ } else {
+ if (state.getFolder().getParentFolderId() == null) {
+ // We translate root folder names (documents, chat room,
+ // etcetera)
+ setContentTitle(i18n.t(state.getTitle()), false);
+ } else {
+ setContentTitle(state.getTitle(), state.getContentRights().isEditable());
+ }
+ setContentDateVisible(false);
+ }
+ }
+
+ public void setTheme(final WsTheme theme) {
+ view.setTheme(theme);
+ }
+
+ private void setContentDate(final Date publishedOn) {
+ final DateTimeFormat fmt = DateTimeFormat.getFormat("MM/dd/yyyy, Z");
+ view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
+ }
+
+ private void setContentDateVisible(final boolean visible) {
+ view.setDateVisible(visible);
+ }
+
+ private void setContentTitle(final String title, final boolean editable) {
+ view.setContentTitle(title);
+ view.setContentTitleEditable(editable);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/title/EntityTitleView.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,40 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.ui.newtmp.title;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+public interface EntityTitleView extends View {
+
+ void restoreOldTitle();
+
+ void setContentDate(String date);
+
+ void setContentTitle(String title);
+
+ void setContentTitleEditable(boolean editable);
+
+ void setDateVisible(boolean visible);
+
+ void setTheme(WsTheme theme);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogo.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,17 @@
+package org.ourproject.kune.workspace.client.workspace.ui;
+
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.ui.Image;
+
+public interface EntityLogo {
+
+ public abstract void setLogo(final Image image);
+
+ public abstract void setLogo(final String groupName);
+
+ public abstract void setPutYourLogoVisible(final boolean visible);
+
+ public abstract void setTheme(final WsTheme theme);
+
+}
\ No newline at end of file
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/EntityLogoPanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -0,0 +1,120 @@
+/*
+ *
+ * Copyright (C) 2007-2008 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.workspace.ui;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Hyperlink;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class EntityLogoPanel extends SimplePanel implements EntityLogo {
+ class EntityTextLogo extends VerticalPanel {
+
+ private static final int GROUP_NAME_LIMIT_SIZE = 90;
+ private static final String LOGO_SMALL_FONT_SIZE = "108%";
+ private static final String LOGO_DEFAULT_FONT_SIZE = "167%";
+ private final Label defTextLogoLabel;
+ private final Hyperlink defTextPutYourLogoHL;
+ private final HorizontalPanel putYourLogoHP;
+
+ public EntityTextLogo() {
+ // Initialize
+ super();
+ defTextLogoLabel = new Label();
+ final HTML expandCell = new HTML("<b></b>");
+ putYourLogoHP = new HorizontalPanel();
+ defTextPutYourLogoHL = new Hyperlink();
+
+ // Layout
+ add(defTextLogoLabel);
+ add(putYourLogoHP);
+ putYourLogoHP.add(expandCell);
+ putYourLogoHP.add(defTextPutYourLogoHL);
+
+ // Set properties
+ // TODO: Put your logo here functionality
+ defTextPutYourLogoHL.setText(i18n.t("Put Your Logo Here"));
+ expandCell.setWidth("100%");
+ putYourLogoHP.setCellWidth(expandCell, "100%");
+ // TODO: link to configure the logo
+ setStylePrimaryName("k-entitytextlogo");
+ setDefaultText("");
+ }
+
+ public void setDefaultText(final String text) {
+ if (text.length() > GROUP_NAME_LIMIT_SIZE) {
+ DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_SMALL_FONT_SIZE);
+ } else {
+ DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_DEFAULT_FONT_SIZE);
+ }
+ defTextLogoLabel.setText(text);
+
+ }
+
+ public void setPutYourLogoVisible(final boolean visible) {
+ putYourLogoHP.setVisible(visible);
+ }
+
+ }
+
+ private EntityTextLogo entityTextLogo;
+ private final I18nTranslationService i18n;
+
+ public EntityLogoPanel(final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
+ this.i18n = i18n;
+ ws.getEntityMainHeader().add(this);
+ }
+
+ public void setLogo(final Image image) {
+ clear();
+ add(image);
+ }
+
+ public void setLogo(final String groupName) {
+ clear();
+ add(getEntityTextLogo());
+ entityTextLogo.setDefaultText(groupName);
+ }
+
+ public void setPutYourLogoVisible(final boolean visible) {
+ getEntityTextLogo().setPutYourLogoVisible(visible);
+ }
+
+ public void setTheme(final WsTheme theme) {
+ getEntityTextLogo().addStyleDependentName(theme.toString());
+ }
+
+ private EntityTextLogo getEntityTextLogo() {
+ if (entityTextLogo == null) {
+ this.entityTextLogo = new EntityTextLogo();
+ }
+ return entityTextLogo;
+ }
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/GroupLogoPanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -1,122 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 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.workspace.ui;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Hyperlink;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-class GroupLogoPanel extends SimplePanel {
- class EntityTextLogo extends VerticalPanel {
-
- private static final int GROUP_NAME_LIMIT_SIZE = 90;
- private static final String LOGO_SMALL_FONT_SIZE = "108%";
- private static final String LOGO_DEFAULT_FONT_SIZE = "167%";
- private Label defTextLogoLabel = null;
- private Hyperlink defTextPutYourLogoHL = null;
- private final HorizontalPanel putYourLogoHP;
-
- public EntityTextLogo() {
- // Initialize
- super();
- defTextLogoLabel = new Label();
- HTML expandCell = new HTML("<b></b>");
- putYourLogoHP = new HorizontalPanel();
- defTextPutYourLogoHL = new Hyperlink();
-
- // Layout
- add(defTextLogoLabel);
- add(putYourLogoHP);
- putYourLogoHP.add(expandCell);
- putYourLogoHP.add(defTextPutYourLogoHL);
-
- // Set properties
- // TODO: Put your logo here functionality
- defTextPutYourLogoHL.setText(i18n.t("Put Your Logo Here"));
- expandCell.setWidth("100%");
- putYourLogoHP.setCellWidth(expandCell, "100%");
- // TODO: link to configure the logo
- addStyleName("kune-EntityTextLogo");
- setDefaultText("");
- }
-
- public void setDefaultText(final String text) {
- if (text.length() > GROUP_NAME_LIMIT_SIZE) {
- DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_SMALL_FONT_SIZE);
- } else {
- DOM.setStyleAttribute(defTextLogoLabel.getElement(), "fontSize", LOGO_DEFAULT_FONT_SIZE);
- }
- defTextLogoLabel.setText(text);
-
- }
-
- public void setPutYourLogoVisible(final boolean visible) {
- putYourLogoHP.setVisible(visible);
-
- }
-
- public void setTextColor(final String color) {
- DOM.setStyleAttribute(defTextLogoLabel.getElement(), "color", color);
- }
- }
-
- private EntityTextLogo entityTextLogo;
- private final I18nTranslationService i18n;
-
- public GroupLogoPanel(final I18nTranslationService i18n) {
- this.i18n = i18n;
- }
-
- public void setLogo(final Image image) {
- clear();
- add(image);
- }
-
- public void setLogo(final String groupName) {
- clear();
- add(getEntityTextLogo());
- entityTextLogo.setDefaultText(groupName);
- }
-
- public void setPutYourLogoVisible(final boolean visible) {
- entityTextLogo.setPutYourLogoVisible(visible);
-
- }
-
- public void setTextColor(final String color) {
- this.entityTextLogo.setTextColor(color);
- }
-
- private EntityTextLogo getEntityTextLogo() {
- if (entityTextLogo == null) {
- this.entityTextLogo = new EntityTextLogo();
- }
- return entityTextLogo;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -51,7 +51,7 @@
private static final int DEF_CONTEXT_WIDTH = 175;
private static final Images img = Images.App.getInstance();
- private final GroupLogoPanel groupLogoPanel;
+ // private final EntityLogoPanel groupLogoPanel;
private final HorizontalPanel contentTitleBarHP;
private final HorizontalPanel contentSubTitleBarHP;
private final GroupToolsBar groupToolsBar;
@@ -83,288 +83,288 @@
private final WorkspacePresenter presenter;
public WorkspacePanel(final WorkspacePresenter presenter, final I18nTranslationService i18n,
- final ColorTheme colorTheme) {
- this.presenter = presenter;
- this.colorTheme = colorTheme;
- // Initialize
- final VerticalPanel generalVP = new VerticalPanel();
- initWidget(generalVP);
- groupLogoPanel = new GroupLogoPanel(i18n);
- final HorizontalPanel generalHP = new HorizontalPanel();
- cntcxtVP = new VerticalPanel();
- final VerticalPanel groupNavBarVP = new VerticalPanel();
- groupToolsBar = new GroupToolsBar(colorTheme);
- bottomIconsTrayPanel = new BottomIconsTrayPanel();
- groupDropDownsSP = new ScrollPanel();
- groupDropDownsVP = new VerticalPanel();
- contentTitleBarHP = new HorizontalPanel();
- contentTitleBarBorderDec = new RoundedBorderDecorator(contentTitleBarHP, RoundedBorderDecorator.TOPLEFT);
- contentSubTitleBarHP = new HorizontalPanel();
- contentToolBarHP = new HorizontalPanel();
- cntcxtHSP = new CustomHorizontalSplitPanel(new HorizontalSplitPanelImages() {
- public AbstractImagePrototype horizontalSplitPanelThumb() {
- return img.splitterVertBar();
- }
- });
- cntcxtHSP.addChangeListener(new ChangeListener() {
- public void onChange(final Widget sender) {
- adjustSizeContentSP();
- saveCurrentRightWidgetWidth(cntcxtHSP.getRightWidgetAvailableWidth());
- }
- });
- cntcxtHSP.addSplitterListener(new SplitterListener() {
- public void onStartResizing(final Widget sender) {
- presenter.onSplitterStartResizing(sender);
- }
+ final ColorTheme colorTheme) {
+ this.presenter = presenter;
+ this.colorTheme = colorTheme;
+ // Initialize
+ final VerticalPanel generalVP = new VerticalPanel();
+ initWidget(generalVP);
+ // groupLogoPanel = new EntityLogoPanel(i18n);
+ final HorizontalPanel generalHP = new HorizontalPanel();
+ cntcxtVP = new VerticalPanel();
+ final VerticalPanel groupNavBarVP = new VerticalPanel();
+ groupToolsBar = new GroupToolsBar(colorTheme);
+ bottomIconsTrayPanel = new BottomIconsTrayPanel();
+ groupDropDownsSP = new ScrollPanel();
+ groupDropDownsVP = new VerticalPanel();
+ contentTitleBarHP = new HorizontalPanel();
+ contentTitleBarBorderDec = new RoundedBorderDecorator(contentTitleBarHP, RoundedBorderDecorator.TOPLEFT);
+ contentSubTitleBarHP = new HorizontalPanel();
+ contentToolBarHP = new HorizontalPanel();
+ cntcxtHSP = new CustomHorizontalSplitPanel(new HorizontalSplitPanelImages() {
+ public AbstractImagePrototype horizontalSplitPanelThumb() {
+ return img.splitterVertBar();
+ }
+ });
+ cntcxtHSP.addChangeListener(new ChangeListener() {
+ public void onChange(final Widget sender) {
+ adjustSizeContentSP();
+ saveCurrentRightWidgetWidth(cntcxtHSP.getRightWidgetAvailableWidth());
+ }
+ });
+ cntcxtHSP.addSplitterListener(new SplitterListener() {
+ public void onStartResizing(final Widget sender) {
+ presenter.onSplitterStartResizing(sender);
+ }
- public void onStopResizing(final Widget sender) {
- presenter.onSplitterStopResizing(sender);
- }
- });
- contentVP = new VerticalPanel();
- contextVP = new VerticalPanel();
- contentSP = new ScrollPanel();
- contentBottomToolBarHP = new HorizontalPanel();
- contentBottomBarHP = new HorizontalPanel();
- bottomBorderDecorator = new RoundedBorderDecorator(contentBottomBarHP, RoundedBorderDecorator.BOTTOMLEFT);
+ public void onStopResizing(final Widget sender) {
+ presenter.onSplitterStopResizing(sender);
+ }
+ });
+ contentVP = new VerticalPanel();
+ contextVP = new VerticalPanel();
+ contentSP = new ScrollPanel();
+ contentBottomToolBarHP = new HorizontalPanel();
+ contentBottomBarHP = new HorizontalPanel();
+ bottomBorderDecorator = new RoundedBorderDecorator(contentBottomBarHP, RoundedBorderDecorator.BOTTOMLEFT);
- // Layout
- generalVP.add(groupLogoPanel);
- generalVP.add(generalHP);
- generalHP.add(cntcxtVP);
- generalHP.add(groupNavBarVP);
- groupNavBarVP.add(groupToolsBar);
- groupNavBarVP.add(groupDropDownsSP);
- groupNavBarVP.add(bottomIconsTrayPanel);
- groupDropDownsSP.add(groupDropDownsVP);
- cntcxtVP.add(contentTitleBarBorderDec);
- cntcxtVP.add(contentSubTitleBarHP);
- cntcxtVP.add(cntcxtHSP);
- cntcxtHSP.setLeftWidget(contentVP);
- cntcxtHSP.setRightWidget(contextVP);
- cntcxtVP.add(bottomBorderDecorator);
- contentVP.add(contentToolBarHP);
- contentVP.add(contentSP);
- contentVP.add(contentBottomToolBarHP);
+ // Layout
+ // generalVP.add(groupLogoPanel);
+ generalVP.add(generalHP);
+ generalHP.add(cntcxtVP);
+ generalHP.add(groupNavBarVP);
+ groupNavBarVP.add(groupToolsBar);
+ groupNavBarVP.add(groupDropDownsSP);
+ groupNavBarVP.add(bottomIconsTrayPanel);
+ groupDropDownsSP.add(groupDropDownsVP);
+ cntcxtVP.add(contentTitleBarBorderDec);
+ cntcxtVP.add(contentSubTitleBarHP);
+ cntcxtVP.add(cntcxtHSP);
+ cntcxtHSP.setLeftWidget(contentVP);
+ cntcxtHSP.setRightWidget(contextVP);
+ cntcxtVP.add(bottomBorderDecorator);
+ contentVP.add(contentToolBarHP);
+ contentVP.add(contentSP);
+ contentVP.add(contentBottomToolBarHP);
- contentVP.addStyleName("kune-WorkspacePanel-Content");
- contextVP.addStyleName("kune-WorkspacePanel-Context");
- contentVP.setWidth("100%");
- contextVP.setWidth("100%");
- contextVP.setHeight("100%");
+ contentVP.addStyleName("kune-WorkspacePanel-Content");
+ contextVP.addStyleName("kune-WorkspacePanel-Context");
+ contentVP.setWidth("100%");
+ contextVP.setWidth("100%");
+ contextVP.setHeight("100%");
- // Set properties
- addStyleName("kune-WorkspacePanel");
- setGroupLogo("");
- generalHP.addStyleName("GeneralHP");
- contentTitleBarBorderDec.setColor(colorTheme.getContentMainBorder());
- contentTitleBarHP.setWidth("100%");
- contentSubTitleBarHP.setWidth("100%");
- contentTitleBarHP.addStyleName("kune-ContentTitleBar");
- contentSubTitleBarHP.addStyleName("kune-ContentSubTitleBar");
- contentToolBarHP.setWidth("100%");
- cntcxtVP.addStyleName("ContextPanel");
- cntcxtVP.setCellVerticalAlignment(contentTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
- cntcxtVP.setCellVerticalAlignment(contentSubTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
- cntcxtVP.setCellVerticalAlignment(bottomBorderDecorator, VerticalPanel.ALIGN_MIDDLE);
- contentTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- contentSubTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- contentBottomToolBarHP.setWidth("100%");
- contentBottomBarHP.addStyleName("kune-ContentBottomBar");
- contentBottomBarHP.addStyleName("kune-ft12px");
- groupDropDownsVP.addStyleName("kune-GroupSummaryPanel");
- bottomBorderDecorator.setColor(colorTheme.getContentMainBorder());
- bottomIconsTrayPanel.addStyleName("kune-Margin-Medium-l");
- bottomIconsTrayPanel.addStyleName("kune-BottomIconsTrayPanel");
- bottomIconsTrayPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
- bottomIconsTrayPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
- previousRightWidgetWidth = DEF_CONTEXT_WIDTH;
+ // Set properties
+ addStyleName("kune-WorkspacePanel");
+ setGroupLogo("");
+ generalHP.addStyleName("GeneralHP");
+ contentTitleBarBorderDec.setColor(colorTheme.getContentMainBorder());
+ contentTitleBarHP.setWidth("100%");
+ contentSubTitleBarHP.setWidth("100%");
+ contentTitleBarHP.addStyleName("kune-ContentTitleBar");
+ contentSubTitleBarHP.addStyleName("kune-ContentSubTitleBar");
+ contentToolBarHP.setWidth("100%");
+ cntcxtVP.addStyleName("ContextPanel");
+ cntcxtVP.setCellVerticalAlignment(contentTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
+ cntcxtVP.setCellVerticalAlignment(contentSubTitleBarHP, VerticalPanel.ALIGN_MIDDLE);
+ cntcxtVP.setCellVerticalAlignment(bottomBorderDecorator, VerticalPanel.ALIGN_MIDDLE);
+ contentTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+ contentSubTitleBarHP.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+ contentBottomToolBarHP.setWidth("100%");
+ contentBottomBarHP.addStyleName("kune-ContentBottomBar");
+ contentBottomBarHP.addStyleName("kune-ft12px");
+ groupDropDownsVP.addStyleName("kune-GroupSummaryPanel");
+ bottomBorderDecorator.setColor(colorTheme.getContentMainBorder());
+ bottomIconsTrayPanel.addStyleName("kune-Margin-Medium-l");
+ bottomIconsTrayPanel.addStyleName("kune-BottomIconsTrayPanel");
+ bottomIconsTrayPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
+ bottomIconsTrayPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
+ previousRightWidgetWidth = DEF_CONTEXT_WIDTH;
}
public void addBottomIconComponent(final View view) {
- bottomIconsTrayPanel.add((Widget) view);
+ bottomIconsTrayPanel.add((Widget) view);
}
public void addTab(final ToolTrigger trigger) {
- groupToolsBar.addItem(trigger);
+ groupToolsBar.addItem(trigger);
}
public void adjustSize(final int windowWidth, final int windowHeight) {
- final int contentWidth = windowWidth - 184;
- final int contentHeight = windowHeight - 176;
+ final int contentWidth = windowWidth - 184;
+ final int contentHeight = windowHeight - 176;
- // FireLog.debug("w1: " + windowWidth + ", h1: " + windowHeight);
- // FireLog.debug("w2: " + contentWidth + ", h2: " + contentHeight);
- // FireLog.debug("sp1: " + previousRightWidgetWidth);
- cntcxtHSP.setSize("" + contentWidth + "px", "" + contentHeight + "px");
- if (contentWidth > previousRightWidgetWidth) {
- cntcxtHSP.setSplitPosition("" + (contentWidth - previousRightWidgetWidth - 6) + "px");
- saveCurrentRightWidgetWidth(previousRightWidgetWidth);
- } else {
- setDefaultSplitterPosition();
- }
- adjustSizeContentSP();
+ // FireLog.debug("w1: " + windowWidth + ", h1: " + windowHeight);
+ // FireLog.debug("w2: " + contentWidth + ", h2: " + contentHeight);
+ // FireLog.debug("sp1: " + previousRightWidgetWidth);
+ cntcxtHSP.setSize("" + contentWidth + "px", "" + contentHeight + "px");
+ if (contentWidth > previousRightWidgetWidth) {
+ cntcxtHSP.setSplitPosition("" + (contentWidth - previousRightWidgetWidth - 6) + "px");
+ saveCurrentRightWidgetWidth(previousRightWidgetWidth);
+ } else {
+ setDefaultSplitterPosition();
+ }
+ adjustSizeContentSP();
- final int bottomMarginForTray = 35;
- final int distanceFromTop = 89;
- final int groupDropDownsHeight = windowHeight - groupToolsBar.getOffsetHeight() - distanceFromTop
- - bottomMarginForTray;
- groupDropDownsSP.setHeight("" + groupDropDownsHeight + "px");
+ final int bottomMarginForTray = 35;
+ final int distanceFromTop = 89;
+ final int groupDropDownsHeight = windowHeight - groupToolsBar.getOffsetHeight() - distanceFromTop
+ - bottomMarginForTray;
+ groupDropDownsSP.setHeight("" + groupDropDownsHeight + "px");
}
public void registerUIExtensionPoints() {
- presenter.registerExtensibleWidgets(contentToolBarPanel.getExtensionPoints());
- presenter.registerExtensibleWidget(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, bottomIconsTrayPanel);
+ presenter.registerExtensibleWidgets(contentToolBarPanel.getExtensionPoints());
+ presenter.registerExtensibleWidget(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, bottomIconsTrayPanel);
}
public void setBottom(final View view) {
- bottomPanel = (LicensePanel) view;
- contentBottomBarHP.add(bottomPanel);
- contentBottomBarHP.setCellVerticalAlignment(bottomPanel, VerticalPanel.ALIGN_MIDDLE);
+ bottomPanel = (LicensePanel) view;
+ contentBottomBarHP.add(bottomPanel);
+ contentBottomBarHP.setCellVerticalAlignment(bottomPanel, VerticalPanel.ALIGN_MIDDLE);
}
public void setComponents(final WorkspaceUIComponents components) {
- setContentTitle(components.getContentTitleComponent().getView());
- setContentSubTitle(components.getContentSubTitleComponent().getView());
- setContentToolBar(components.getContentToolBarComponent().getView());
- setContentBottomToolBar(components.getContentBottomToolBarComponent().getView());
- setBottom(components.getLicenseComponent().getView());
- setGroupMembers(components.getGroupMembersComponent().getView());
- setParticipation(components.getParticipationComponent().getView());
- setTags(components.getTagsComponent().getView());
- setSummary(components.getGroupSummaryComponent().getView());
- addBottomIconComponent(components.getThemeMenuComponent().getView());
+ setContentTitle(components.getContentTitleComponent().getView());
+ setContentSubTitle(components.getContentSubTitleComponent().getView());
+ setContentToolBar(components.getContentToolBarComponent().getView());
+ setContentBottomToolBar(components.getContentBottomToolBarComponent().getView());
+ setBottom(components.getLicenseComponent().getView());
+ setGroupMembers(components.getGroupMembersComponent().getView());
+ setParticipation(components.getParticipationComponent().getView());
+ setTags(components.getTagsComponent().getView());
+ setSummary(components.getGroupSummaryComponent().getView());
+ addBottomIconComponent(components.getThemeMenuComponent().getView());
}
public void setContent(final View content) {
- contentSP.clear();
- final Widget widget = (Widget) content;
- contentSP.add(widget);
+ contentSP.clear();
+ final Widget widget = (Widget) content;
+ contentSP.add(widget);
}
public void setContentBottomToolBar(final View view) {
- contentBottomToolBarPanel = (ContentBottomToolBarPanel) view;
- contentBottomToolBarHP.add(contentBottomToolBarPanel);
- contentBottomToolBarHP.setCellVerticalAlignment(contentBottomToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
+ contentBottomToolBarPanel = (ContentBottomToolBarPanel) view;
+ contentBottomToolBarHP.add(contentBottomToolBarPanel);
+ contentBottomToolBarHP.setCellVerticalAlignment(contentBottomToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
}
public void setContentSubTitle(final View view) {
- contentSubTitlePanel = (ContentSubTitlePanel) view;
- contentSubTitleBarHP.add(contentSubTitlePanel);
- contentSubTitleBarHP.setCellVerticalAlignment(contentSubTitlePanel, VerticalPanel.ALIGN_MIDDLE);
+ contentSubTitlePanel = (ContentSubTitlePanel) view;
+ contentSubTitleBarHP.add(contentSubTitlePanel);
+ contentSubTitleBarHP.setCellVerticalAlignment(contentSubTitlePanel, VerticalPanel.ALIGN_MIDDLE);
}
public void setContentTitle(final View view) {
- contentTitlePanel = (ContentTitlePanel) view;
- contentTitleBarHP.add(contentTitlePanel);
- contentTitleBarHP.setCellVerticalAlignment(contentTitlePanel, VerticalPanel.ALIGN_MIDDLE);
+ contentTitlePanel = (ContentTitlePanel) view;
+ contentTitleBarHP.add(contentTitlePanel);
+ contentTitleBarHP.setCellVerticalAlignment(contentTitlePanel, VerticalPanel.ALIGN_MIDDLE);
}
public void setContentToolBar(final View view) {
- contentToolBarPanel = (ContentToolBarPanel) view;
- contentToolBarHP.add(contentToolBarPanel);
- contentToolBarHP.setCellVerticalAlignment(contentToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
+ contentToolBarPanel = (ContentToolBarPanel) view;
+ contentToolBarHP.add(contentToolBarPanel);
+ contentToolBarHP.setCellVerticalAlignment(contentToolBarPanel, VerticalPanel.ALIGN_MIDDLE);
}
public void setContext(final View contextMenu) {
- contextVP.clear();
- final Widget widget = (Widget) contextMenu;
- contextVP.add(widget);
- widget.setHeight("100%");
- widget.setWidth("100%");
- contextVP.setCellWidth(widget, "100%");
- contextVP.setCellHeight(widget, "100%");
+ contextVP.clear();
+ final Widget widget = (Widget) contextMenu;
+ contextVP.add(widget);
+ widget.setHeight("100%");
+ widget.setWidth("100%");
+ contextVP.setCellWidth(widget, "100%");
+ contextVP.setCellHeight(widget, "100%");
}
public void setGroupLogo(final Image image) {
- groupLogoPanel.setLogo(image);
+ // groupLogoPanel.setLogo(image);
}
public void setGroupLogo(final String groupName) {
- groupLogoPanel.setLogo(groupName);
+ // groupLogoPanel.setLogo(groupName);
}
public void setGroupMembers(final View view) {
- groupMembersPanel = (DropDownPanel) view;
- AddDropDown(groupMembersPanel, colorTheme.getGroupMembersDD());
+ groupMembersPanel = (DropDownPanel) view;
+ AddDropDown(groupMembersPanel, colorTheme.getGroupMembersDD());
}
public void setParticipation(final View view) {
- participationPanel = (DropDownPanel) view;
- AddDropDown(participationPanel, colorTheme.getParticipationDD());
+ participationPanel = (DropDownPanel) view;
+ AddDropDown(participationPanel, colorTheme.getParticipationDD());
}
public void setPutYourLogoVisible(final boolean visible) {
- groupLogoPanel.setPutYourLogoVisible(visible);
+ // groupLogoPanel.setPutYourLogoVisible(visible);
}
public void setSummary(final View view) {
- groupSummaryPanel = (DropDownPanel) view;
- AddDropDown(groupSummaryPanel, colorTheme.getSummaryDD());
+ groupSummaryPanel = (DropDownPanel) view;
+ AddDropDown(groupSummaryPanel, colorTheme.getSummaryDD());
}
public void setTags(final View view) {
- tagsPanel = (DropDownPanel) view;
- AddDropDown(tagsPanel, colorTheme.getTagsDD());
+ tagsPanel = (DropDownPanel) view;
+ AddDropDown(tagsPanel, colorTheme.getTagsDD());
}
public void setTheme(final String theme) {
- colorTheme.setTheme(theme);
- final String mainColor = colorTheme.getContentMainBorder();
- groupLogoPanel.setTextColor(colorTheme.getContentTitleText());
- contentTitleBarBorderDec.setColor(mainColor);
- bottomBorderDecorator.setColor(mainColor);
- DOM.setStyleAttribute(cntcxtVP.getElement(), "borderRightColor", mainColor);
- contentTitlePanel.setColors(colorTheme.getContentTitle(), colorTheme.getContentTitleText());
- contentSubTitlePanel.setColors(mainColor, colorTheme.getContentSubTitleText());
- DOM.setStyleAttribute(contentTitleBarHP.getElement(), "borderLeftColor", mainColor);
- DOM.setStyleAttribute(contentTitleBarHP.getElement(), "backgroundColor", colorTheme.getContentTitle());
- DOM.setStyleAttribute(contentSubTitleBarHP.getElement(), "backgroundColor", mainColor);
- DOM.setStyleAttribute(contentBottomBarHP.getElement(), "backgroundColor", mainColor);
- DOM.setStyleAttribute(cntcxtHSP.getRightWidget().getElement(), "backgroundColor", colorTheme.getContext());
- DOM.setStyleAttribute(DOM.getChild(DOM.getChild(cntcxtHSP.getElement(), 0), 1), "backgroundColor", colorTheme
- .getSplitter());
- DOM.setStyleAttribute(contentBottomBarHP.getWidget(0).getElement(), "color", colorTheme.getContentBottomText());
- groupMembersPanel.setColor(colorTheme.getGroupMembersDD());
- participationPanel.setColor(colorTheme.getParticipationDD());
- groupSummaryPanel.setColor(colorTheme.getSummaryDD());
- tagsPanel.setColor(colorTheme.getTagsDD());
- groupToolsBar.setTabsColors(colorTheme.getToolSelected(), colorTheme.getToolUnselected());
+ colorTheme.setTheme(theme);
+ final String mainColor = colorTheme.getContentMainBorder();
+ // groupLogoPanel.setTextColor(colorTheme.getContentTitleText());
+ contentTitleBarBorderDec.setColor(mainColor);
+ bottomBorderDecorator.setColor(mainColor);
+ DOM.setStyleAttribute(cntcxtVP.getElement(), "borderRightColor", mainColor);
+ contentTitlePanel.setColors(colorTheme.getContentTitle(), colorTheme.getContentTitleText());
+ contentSubTitlePanel.setColors(mainColor, colorTheme.getContentSubTitleText());
+ DOM.setStyleAttribute(contentTitleBarHP.getElement(), "borderLeftColor", mainColor);
+ DOM.setStyleAttribute(contentTitleBarHP.getElement(), "backgroundColor", colorTheme.getContentTitle());
+ DOM.setStyleAttribute(contentSubTitleBarHP.getElement(), "backgroundColor", mainColor);
+ DOM.setStyleAttribute(contentBottomBarHP.getElement(), "backgroundColor", mainColor);
+ DOM.setStyleAttribute(cntcxtHSP.getRightWidget().getElement(), "backgroundColor", colorTheme.getContext());
+ DOM.setStyleAttribute(DOM.getChild(DOM.getChild(cntcxtHSP.getElement(), 0), 1), "backgroundColor", colorTheme
+ .getSplitter());
+ DOM.setStyleAttribute(contentBottomBarHP.getWidget(0).getElement(), "color", colorTheme.getContentBottomText());
+ groupMembersPanel.setColor(colorTheme.getGroupMembersDD());
+ participationPanel.setColor(colorTheme.getParticipationDD());
+ groupSummaryPanel.setColor(colorTheme.getSummaryDD());
+ tagsPanel.setColor(colorTheme.getTagsDD());
+ groupToolsBar.setTabsColors(colorTheme.getToolSelected(), colorTheme.getToolUnselected());
}
public void setTool(final String toolName) {
- groupToolsBar.selectItem(toolName);
+ groupToolsBar.selectItem(toolName);
}
public void setVisible(final boolean visible) {
- // false: Used when the app stops
- super.setVisible(visible);
+ // false: Used when the app stops
+ super.setVisible(visible);
}
private void AddDropDown(final DropDownPanel panel, final String color) {
- groupDropDownsVP.add(panel);
- panel.setWidth("145px");
- panel.setColor(color);
+ groupDropDownsVP.add(panel);
+ panel.setWidth("145px");
+ panel.setColor(color);
}
private void adjustSizeContentSP() {
- final int width = cntcxtHSP.getLeftWidgetAvailableWidth() - 2;
- final int height = cntcxtHSP.getOffsetHeight() - 29 - contentToolBarHP.getOffsetHeight();
- if (width > 0 && height > 0) {
- contentSP.setSize("" + width + "px", "" + height + "px");
- } else {
- Log.debug("Can't resize ScrollPanel now");
- }
+ final int width = cntcxtHSP.getLeftWidgetAvailableWidth() - 2;
+ final int height = cntcxtHSP.getOffsetHeight() - 29 - contentToolBarHP.getOffsetHeight();
+ if (width > 0 && height > 0) {
+ contentSP.setSize("" + width + "px", "" + height + "px");
+ } else {
+ Log.debug("Can't resize ScrollPanel now");
+ }
}
private void saveCurrentRightWidgetWidth(final int newRightWidgetWidth) {
- previousRightWidgetWidth = newRightWidgetWidth;
+ previousRightWidgetWidth = newRightWidgetWidth;
}
private void setDefaultSplitterPosition() {
- final int newLefttWidgetWidth = (int) (cntcxtHSP.getOffsetWidth() * 0.7);
- cntcxtHSP.setSplitPosition(newLefttWidgetWidth + "px");
- saveCurrentRightWidgetWidth(cntcxtHSP.getLeftWidgetAvailableWidth());
+ final int newLefttWidgetWidth = (int) (cntcxtHSP.getOffsetWidth() * 0.7);
+ cntcxtHSP.setSplitPosition(newLefttWidgetWidth + "px");
+ saveCurrentRightWidgetWidth(cntcxtHSP.getLeftWidgetAvailableWidth());
}
// private void logSplitter(final String count) {
Modified: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/main/webapp/WEB-INF/web.xml 2008-07-07 14:10:21 UTC (rev 793)
@@ -38,7 +38,7 @@
</init-param>
<init-param>
<param-name>remotePort</param-name>
- <param-value>8383</param-value>
+ <param-value>5280</param-value>
</init-param>
</servlet>
<servlet-mapping>
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-07-06 13:51:18 UTC (rev 792)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-07-07 14:10:21 UTC (rev 793)
@@ -6,39 +6,41 @@
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.HistoryWrapper;
import org.ourproject.kune.workspace.client.sitebar.Site;
+import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager;
public class StateManagerTest {
private StateManager stateManager;
private HistoryWrapper history;
- @Before
- public void init() {
- ContentProvider contentProvider = EasyMock.createStrictMock(ContentProvider.class);
- Application application = EasyMock.createStrictMock(Application.class);
- Session session = EasyMock.createStrictMock(Session.class);
- history = EasyMock.createStrictMock(HistoryWrapper.class);
- stateManager = new StateManagerDefault(contentProvider, application, session, history);
- }
-
@Test
- public void normalStartLoggedUser() {
- // When a user enter reload state, also if the application is starting
- // (and the user was logged)
- EasyMock.expect(history.getToken()).andReturn("");
- EasyMock.replay(history);
- stateManager.reload();
- EasyMock.verify(history);
+ public void fixmeToken() {
+ stateManager.onHistoryChanged(Site.FIXME_TOKEN);
}
@Test
public void getDefGroup() {
- stateManager.onHistoryChanged("site.docs");
+ stateManager.onHistoryChanged("site.docs");
}
+ @Before
+ public void init() {
+ final ContentProvider contentProvider = EasyMock.createStrictMock(ContentProvider.class);
+ final Application application = EasyMock.createStrictMock(Application.class);
+ final Session session = EasyMock.createStrictMock(Session.class);
+ history = EasyMock.createStrictMock(HistoryWrapper.class);
+ final WorkspaceManager ws = EasyMock.createStrictMock(WorkspaceManager.class);
+ stateManager = new StateManagerDefault(contentProvider, application, session, history, ws);
+ }
+
@Test
- public void fixmeToken() {
- stateManager.onHistoryChanged(Site.FIXME_TOKEN);
+ public void normalStartLoggedUser() {
+ // When a user enter reload state, also if the application is starting
+ // (and the user was logged)
+ EasyMock.expect(history.getToken()).andReturn("");
+ EasyMock.replay(history);
+ stateManager.reload();
+ EasyMock.verify(history);
}
}
1
0
Author: vjrj
Date: 2008-07-06 15:51:18 +0200 (Sun, 06 Jul 2008)
New Revision: 792
Added:
trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserParams.java
Modified:
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/errors/DefaultException.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialogGxt.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
trunk/src/main/resources/db/update-0007-i18n.sql
trunk/src/main/resources/db/update-0008-i18n.sql
trunk/src/test/java/org/ourproject/kune/platf/integration/DatabaseInitializationTest.java
Log:
Incomplete - task 2: Tags in groups (UI, server)
Incomplete - task 1: User parameters Server
Complete - task 4: Group def content with description
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/pom.xml 2008-07-06 13:51:18 UTC (rev 792)
@@ -41,11 +41,13 @@
</dependency>
<!-- Use new repo -->
<!-- http://code.google.com/p/gwt-ext/issues/detail?id=180 -->
+ <!--
<dependency>
<groupId>com.extjs</groupId>
<artifactId>gxt</artifactId>
<version>1.0-beta2</version>
</dependency>
+ -->
<dependency>
<groupId>com.gwtext</groupId>
<artifactId>gwtext</artifactId>
Modified: trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -21,10 +21,10 @@
package org.ourproject.kune.docs.server;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.server.content.ContainerManager;
import org.ourproject.kune.platf.server.content.ContentManager;
-import org.ourproject.kune.platf.server.content.ContainerManager;
+import org.ourproject.kune.platf.server.domain.Container;
import org.ourproject.kune.platf.server.domain.Content;
-import org.ourproject.kune.platf.server.domain.Container;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.ToolConfiguration;
import org.ourproject.kune.platf.server.domain.User;
@@ -48,44 +48,45 @@
@Inject
public DocumentServerTool(final ContentManager contentManager, final ContainerManager containerManager,
- final ToolConfigurationManager configurationManager, final I18nTranslationService translationService) {
- this.contentManager = contentManager;
- this.containerManager = containerManager;
- this.configurationManager = configurationManager;
- this.i18n = translationService;
+ final ToolConfigurationManager configurationManager, final I18nTranslationService translationService) {
+ this.contentManager = contentManager;
+ this.containerManager = containerManager;
+ this.configurationManager = configurationManager;
+ this.i18n = translationService;
}
- @Inject
- public void register(final ToolRegistry registry) {
- registry.register(this);
+ public String getName() {
+ return NAME;
}
- public String getName() {
- return NAME;
+ public Group initGroup(final User user, final Group group) {
+ final ToolConfiguration config = new ToolConfiguration();
+ final Container container = containerManager.createRootFolder(group, NAME, ROOT_NAME, TYPE_ROOT);
+ config.setRoot(container);
+ group.setToolConfig(NAME, config);
+ configurationManager.persist(config);
+ final String longName = group.getLongName();
+ final String publicDesc = group.getPublicDesc();
+ final Content descriptor = contentManager.createContent(i18n.t("About") + longName, publicDesc == null ? ""
+ : publicDesc, user, container);
+ descriptor.addAuthor(user);
+ descriptor.setLanguage(user.getLanguage());
+ descriptor.setTypeId(TYPE_DOCUMENT);
+ group.setDefaultContent(descriptor);
+ return group;
}
public void onCreateContainer(final Container container, final Container parent) {
- container.setTypeId(TYPE_FOLDER);
+ container.setTypeId(TYPE_FOLDER);
}
public void onCreateContent(final Content content, final Container parent) {
- content.setTypeId(TYPE_DOCUMENT);
+ content.setTypeId(TYPE_DOCUMENT);
}
- public Group initGroup(final User user, final Group group) {
- ToolConfiguration config = new ToolConfiguration();
- Container container = containerManager.createRootFolder(group, NAME, ROOT_NAME, TYPE_ROOT);
- config.setRoot(container);
- group.setToolConfig(NAME, config);
- configurationManager.persist(config);
- Content descriptor = contentManager.createContent(i18n.t("Welcome"), i18n.t("This is an example of document. "
- + "You can modify it if you are a group's collaborator and/or delete it if you are admin."), user,
- container);
- descriptor.addAuthor(user);
- descriptor.setLanguage(user.getLanguage());
- descriptor.setTypeId(TYPE_DOCUMENT);
- group.setDefaultContent(descriptor);
- return group;
+ @Inject
+ public void register(final ToolRegistry registry) {
+ registry.register(this);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationBuilder.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -31,9 +31,7 @@
import org.ourproject.kune.platf.client.dispatch.ActionEvent;
import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.services.Kune;
-import org.ourproject.kune.platf.client.services.KuneErrorHandler;
import org.ourproject.kune.platf.client.services.KuneModule;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -54,9 +52,6 @@
final Kune kune = Kune.create(new KuneModule(initialLang, lexicon), new EmiteUIModule(),
new DocumentClientNewModule(), new ChatClientNewModule());
- KuneErrorHandler errorHandler = kune.getInstance(KuneErrorHandler.class);
- AsyncCallbackSimple.init(errorHandler);
-
final Session session = kune.getSession();
Site.showProgressLoading();
@@ -65,7 +60,7 @@
final KunePlatform platform = kune.getPlatform();
final StateManager stateManager = kune.getStateManager();
final Application application = kune.getInstance(Application.class);
- I18nUITranslationService i18n = kune.getI18N();
+ final I18nUITranslationService i18n = kune.getI18N();
// Testing providers:
platform.install(new PlatformClientModule(session, kune.getProvider(StateManager.class)));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -39,181 +39,190 @@
private Long defaultContentId;
private LicenseDTO defaultLicense;
private String workspaceTheme;
+ private String tags;
public GroupDTO() {
- this(null, null, null, ORGANIZATION);
+ this(null, null, null, ORGANIZATION);
}
public GroupDTO(final String shortName, final String longName, final String publicDesc, final String type) {
- this.shortName = shortName;
- this.longName = longName;
- this.publicDesc = publicDesc;
- this.type = type;
+ this.shortName = shortName;
+ this.longName = longName;
+ this.publicDesc = publicDesc;
+ this.type = type;
}
- public Long getId() {
- return id;
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ final GroupDTO other = (GroupDTO) obj;
+ if (defaultContentId == null) {
+ if (other.defaultContentId != null) {
+ return false;
+ }
+ } else if (!defaultContentId.equals(other.defaultContentId)) {
+ return false;
+ }
+ if (defaultFolderId == null) {
+ if (other.defaultFolderId != null) {
+ return false;
+ }
+ } else if (!defaultFolderId.equals(other.defaultFolderId)) {
+ return false;
+ }
+ if (defaultLicense == null) {
+ if (other.defaultLicense != null) {
+ return false;
+ }
+ } else if (!defaultLicense.equals(other.defaultLicense)) {
+ return false;
+ }
+ if (defaultToolName == null) {
+ if (other.defaultToolName != null) {
+ return false;
+ }
+ } else if (!defaultToolName.equals(other.defaultToolName)) {
+ return false;
+ }
+ if (id == null) {
+ if (other.id != null) {
+ return false;
+ }
+ } else if (!id.equals(other.id)) {
+ return false;
+ }
+ if (longName == null) {
+ if (other.longName != null) {
+ return false;
+ }
+ } else if (!longName.equals(other.longName)) {
+ return false;
+ }
+ if (publicDesc == null) {
+ if (other.publicDesc != null) {
+ return false;
+ }
+ } else if (!publicDesc.equals(other.publicDesc)) {
+ return false;
+ }
+ if (shortName == null) {
+ if (other.shortName != null) {
+ return false;
+ }
+ } else if (!shortName.equals(other.shortName)) {
+ return false;
+ }
+ if (type != other.type) {
+ return false;
+ }
+ return true;
}
- public String getLongName() {
- return longName;
+ public Long getDefaultContentId() {
+ return defaultContentId;
}
- public String getPublicDesc() {
- return publicDesc;
+ public Long getDefaultFolderId() {
+ return defaultFolderId;
}
- public String getShortName() {
- return shortName;
+ public LicenseDTO getDefaultLicense() {
+ return defaultLicense;
}
- public String getType() {
- return type;
+ public String getDefaultToolName() {
+ return defaultToolName;
}
- public void setId(final Long id) {
- this.id = id;
+ public Long getId() {
+ return id;
}
- public void setLongName(final String name) {
- this.longName = name;
+ public String getLongName() {
+ return longName;
}
- public void setPublicDesc(final String publicDesc) {
- this.publicDesc = publicDesc;
+ public String getPublicDesc() {
+ return publicDesc;
}
- public void setShortName(final String shortName) {
- this.shortName = shortName;
+ public String getShortName() {
+ return shortName;
}
- public void setType(final String type) {
- this.type = type;
+ public String getTags() {
+ return tags;
}
- public Long getDefaultFolderId() {
- return defaultFolderId;
+ public String getType() {
+ return type;
}
- public void setDefaultFolderId(final Long defaultFolderId) {
- this.defaultFolderId = defaultFolderId;
+ public String getWorkspaceTheme() {
+ return workspaceTheme;
}
- public Long getDefaultContentId() {
- return defaultContentId;
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (defaultContentId == null ? 0 : defaultContentId.hashCode());
+ result = prime * result + (defaultFolderId == null ? 0 : defaultFolderId.hashCode());
+ result = prime * result + (defaultLicense == null ? 0 : defaultLicense.hashCode());
+ result = prime * result + (defaultToolName == null ? 0 : defaultToolName.hashCode());
+ result = prime * result + (id == null ? 0 : id.hashCode());
+ result = prime * result + (longName == null ? 0 : longName.hashCode());
+ result = prime * result + (publicDesc == null ? 0 : publicDesc.hashCode());
+ result = prime * result + (shortName == null ? 0 : shortName.hashCode());
+ result = prime * result + (type == null ? 0 : type.hashCode());
+ return result;
}
public void setDefaultContentId(final Long defaultContentId) {
- this.defaultContentId = defaultContentId;
+ this.defaultContentId = defaultContentId;
}
- public String getDefaultToolName() {
- return defaultToolName;
+ public void setDefaultFolderId(final Long defaultFolderId) {
+ this.defaultFolderId = defaultFolderId;
}
+ public void setDefaultLicense(final LicenseDTO defaultLicense) {
+ this.defaultLicense = defaultLicense;
+ }
+
public void setDefaultToolName(final String defaultToolName) {
- this.defaultToolName = defaultToolName;
+ this.defaultToolName = defaultToolName;
}
- public LicenseDTO getDefaultLicense() {
- return defaultLicense;
+ public void setId(final Long id) {
+ this.id = id;
}
- public void setDefaultLicense(final LicenseDTO defaultLicense) {
- this.defaultLicense = defaultLicense;
+ public void setLongName(final String name) {
+ this.longName = name;
}
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + (defaultContentId == null ? 0 : defaultContentId.hashCode());
- result = prime * result + (defaultFolderId == null ? 0 : defaultFolderId.hashCode());
- result = prime * result + (defaultLicense == null ? 0 : defaultLicense.hashCode());
- result = prime * result + (defaultToolName == null ? 0 : defaultToolName.hashCode());
- result = prime * result + (id == null ? 0 : id.hashCode());
- result = prime * result + (longName == null ? 0 : longName.hashCode());
- result = prime * result + (publicDesc == null ? 0 : publicDesc.hashCode());
- result = prime * result + (shortName == null ? 0 : shortName.hashCode());
- result = prime * result + (type == null ? 0 : type.hashCode());
- return result;
+ public void setPublicDesc(final String publicDesc) {
+ this.publicDesc = publicDesc;
}
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- final GroupDTO other = (GroupDTO) obj;
- if (defaultContentId == null) {
- if (other.defaultContentId != null) {
- return false;
- }
- } else if (!defaultContentId.equals(other.defaultContentId)) {
- return false;
- }
- if (defaultFolderId == null) {
- if (other.defaultFolderId != null) {
- return false;
- }
- } else if (!defaultFolderId.equals(other.defaultFolderId)) {
- return false;
- }
- if (defaultLicense == null) {
- if (other.defaultLicense != null) {
- return false;
- }
- } else if (!defaultLicense.equals(other.defaultLicense)) {
- return false;
- }
- if (defaultToolName == null) {
- if (other.defaultToolName != null) {
- return false;
- }
- } else if (!defaultToolName.equals(other.defaultToolName)) {
- return false;
- }
- if (id == null) {
- if (other.id != null) {
- return false;
- }
- } else if (!id.equals(other.id)) {
- return false;
- }
- if (longName == null) {
- if (other.longName != null) {
- return false;
- }
- } else if (!longName.equals(other.longName)) {
- return false;
- }
- if (publicDesc == null) {
- if (other.publicDesc != null) {
- return false;
- }
- } else if (!publicDesc.equals(other.publicDesc)) {
- return false;
- }
- if (shortName == null) {
- if (other.shortName != null) {
- return false;
- }
- } else if (!shortName.equals(other.shortName)) {
- return false;
- }
- if (type != other.type) {
- return false;
- }
- return true;
+ public void setShortName(final String shortName) {
+ this.shortName = shortName;
}
- public String getWorkspaceTheme() {
- return workspaceTheme;
+ public void setTags(final String tags) {
+ this.tags = tags;
}
+ public void setType(final String type) {
+ this.type = type;
+ }
+
public void setWorkspaceTheme(final String workspaceTheme) {
- this.workspaceTheme = workspaceTheme;
+ this.workspaceTheme = workspaceTheme;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/errors/DefaultException.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/errors/DefaultException.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/errors/DefaultException.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -1,14 +1,20 @@
package org.ourproject.kune.platf.client.errors;
import com.google.gwt.user.client.rpc.IsSerializable;
+import com.google.gwt.user.client.rpc.StatusCodeException;
-public class DefaultException extends Exception implements IsSerializable {
+public class DefaultException extends StatusCodeException implements IsSerializable {
private static final long serialVersionUID = 1L;
public DefaultException() {
+ this(0, "");
}
- public DefaultException(final String arg0) {
- super(arg0);
+ public DefaultException(final int statusCode, final String message) {
+ super(statusCode, message);
}
+
+ public DefaultException(final String message) {
+ this(0, message);
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -35,59 +35,51 @@
import com.google.gwt.core.client.GWT;
public class KuneErrorHandler {
- private static KuneErrorHandler instance;
-
- @Deprecated
- public static KuneErrorHandler getInstance() {
- return instance;
- }
-
private final Session session;
private final I18nTranslationService i18n;
public KuneErrorHandler(final Session session, final I18nTranslationService i18n) {
- this.session = session;
- this.i18n = i18n;
- instance = this;
+ this.session = session;
+ this.i18n = i18n;
}
public void process(final Throwable caught) {
- Site.hideProgress();
- try {
- throw caught;
- } catch (final AccessViolationException e) {
- Site.error(i18n.t("You don't have rights to do that"));
- } catch (final SessionExpiredException e) {
- doSessionExpired();
- } catch (final UserMustBeLoggedException e) {
- if (session.isLogged()) {
- doSessionExpired();
- } else {
- Site.important(i18n.t("Please sign in or register to collaborate"));
- }
- } catch (final GroupNotFoundException e) {
- Site.error(i18n.t("Group not found"));
- DefaultDispatcher.getInstance().fire(PlatformEvents.GOTO, "");
- } catch (final ContentNotFoundException e) {
- Site.error(i18n.t("Content not found"));
- DefaultDispatcher.getInstance().fire(PlatformEvents.GOTO, "");
- } catch (final LastAdminInGroupException e) {
- Site.showAlertMessage(i18n.t("Sorry, you are the last admin of this group."
- + " Look for someone to substitute you appropriately as admin before unjoin this group."));
- } catch (final AlreadyGroupMemberException e) {
- Site.error(i18n.t("This group is already a group member"));
- } catch (final AlreadyUserMemberException e) {
- Site.error(i18n.t("This user is already a member of this group"));
- } catch (final Throwable e) {
- Site.error(i18n.t("Error performing operation"));
- GWT.log("Other kind of exception in StateManagerDefault/processErrorException", null);
- throw new RuntimeException();
- }
+ Site.hideProgress();
+ try {
+ throw caught;
+ } catch (final AccessViolationException e) {
+ Site.error(i18n.t("You don't have rights to do that"));
+ } catch (final SessionExpiredException e) {
+ doSessionExpired();
+ } catch (final UserMustBeLoggedException e) {
+ if (session.isLogged()) {
+ doSessionExpired();
+ } else {
+ Site.important(i18n.t("Please sign in or register to collaborate"));
+ }
+ } catch (final GroupNotFoundException e) {
+ Site.error(i18n.t("Group not found"));
+ DefaultDispatcher.getInstance().fire(PlatformEvents.GOTO, "");
+ } catch (final ContentNotFoundException e) {
+ Site.error(i18n.t("Content not found"));
+ DefaultDispatcher.getInstance().fire(PlatformEvents.GOTO, "");
+ } catch (final LastAdminInGroupException e) {
+ Site.showAlertMessage(i18n.t("Sorry, you are the last admin of this group."
+ + " Look for someone to substitute you appropriately as admin before unjoin this group."));
+ } catch (final AlreadyGroupMemberException e) {
+ Site.error(i18n.t("This group is already a group member"));
+ } catch (final AlreadyUserMemberException e) {
+ Site.error(i18n.t("This user is already a member of this group"));
+ } catch (final Throwable e) {
+ Site.error(i18n.t("Error performing operation"));
+ GWT.log("Other kind of exception in StateManagerDefault/processErrorException", null);
+ throw new RuntimeException();
+ }
}
private void doSessionExpired() {
- Site.doLogout();
- Site.showAlertMessage(i18n.t("Your session has expired. Please login again."));
+ Site.doLogout();
+ Site.showAlertMessage(i18n.t("Your session has expired. Please login again."));
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -9,6 +9,7 @@
import org.ourproject.kune.platf.client.app.HistoryWrapperImpl;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ContentService;
import org.ourproject.kune.platf.client.state.ContentProviderImpl;
import org.ourproject.kune.platf.client.state.Session;
@@ -54,8 +55,6 @@
}
}, SingletonScope.class);
- Site.init(builder.getInstance(I18nUITranslationService.class));
-
builder.registerProvider(Session.class, new Provider<Session>() {
public Session get() {
return new SessionImpl(Cookies.getCookie("userHash"), initialLang);
@@ -69,6 +68,10 @@
}
}, SingletonScope.class);
+ final KuneErrorHandler errorHandler = builder.getInstance(KuneErrorHandler.class);
+ AsyncCallbackSimple.init(errorHandler);
+ Site.init(builder.getInstance(I18nUITranslationService.class));
+
builder.registerProvider(ColorTheme.class, new Provider<ColorTheme>() {
public ColorTheme get() {
return new ColorTheme();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialogGxt.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialogGxt.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialogGxt.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -20,45 +20,48 @@
package org.ourproject.kune.platf.client.ui.dialogs;
-import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
-import com.extjs.gxt.ui.client.Style.Scroll;
-import com.extjs.gxt.ui.client.widget.Window;
-
-public class BasicDialogGxt extends Window {
-
- public BasicDialogGxt(final String caption, final boolean modal) {
- this(caption, modal, Scroll.AUTO);
- }
-
- public BasicDialogGxt(final String caption, final boolean modal, final Scroll scroll) {
- setAutoWidth(true);
- // Param values
- setTitle(caption);
- setModal(modal);
- setScrollMode(scroll);
- // Def values
- setShadow(true);
- setPlain(true);
- setClosable(true);
- setCollapsible(true);
- setResizable(true);
- setButtonAlign(HorizontalAlignment.RIGHT);
- }
-
- public BasicDialogGxt(final String caption, final boolean modal, final Scroll scroll, final int width,
- final int height) {
- this(caption, modal, scroll, width, height, width, height);
- }
-
- public BasicDialogGxt(final String caption, final boolean modal, final Scroll scroll, final int width,
- final int height, final int minWidth, final int minHeight) {
- this(caption, modal, scroll);
- setAutoWidth(false);
- // Param values
- setWidth(width);
- setHeight(height);
- setMinWidth(minWidth);
- setMinHeight(minHeight);
- }
-
-}
+// import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
+// import com.extjs.gxt.ui.client.Style.Scroll;
+// import com.extjs.gxt.ui.client.widget.Window;
+//
+// public class BasicDialogGxt extends Window {
+//
+// public BasicDialogGxt(final String caption, final boolean modal) {
+// this(caption, modal, Scroll.AUTO);
+// }
+//
+// public BasicDialogGxt(final String caption, final boolean modal, final Scroll
+// scroll) {
+// setAutoWidth(true);
+// // Param values
+// setTitle(caption);
+// setModal(modal);
+// setScrollMode(scroll);
+// // Def values
+// setShadow(true);
+// setPlain(true);
+// setClosable(true);
+// setCollapsible(true);
+// setResizable(true);
+// setButtonAlign(HorizontalAlignment.RIGHT);
+// }
+//
+// public BasicDialogGxt(final String caption, final boolean modal, final Scroll
+// scroll, final int width,
+// final int height) {
+// this(caption, modal, scroll, width, height, width, height);
+// }
+//
+// public BasicDialogGxt(final String caption, final boolean modal, final Scroll
+// scroll, final int width,
+// final int height, final int minWidth, final int minHeight) {
+// this(caption, modal, scroll);
+// setAutoWidth(false);
+// // Param values
+// setWidth(width);
+// setHeight(height);
+// setMinWidth(minWidth);
+// setMinHeight(minHeight);
+// }
+//
+// }
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/User.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -42,8 +42,6 @@
import org.hibernate.validator.NotNull;
import org.hibernate.validator.Pattern;
-import com.calclab.emite.client.im.roster.RosterManager;
-import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
import com.google.inject.name.Named;
import com.wideplay.warp.persist.dao.Finder;
@@ -56,10 +54,8 @@
// Never expect or return null
public static final User UNKNOWN_USER = new User();
- private static final String DEF_CHAT_COLOR = "green";
-
public static boolean isKnownUser(final User user) {
- return user != UNKNOWN_USER;
+ return user != UNKNOWN_USER;
}
@Id
@@ -102,157 +98,111 @@
@NotNull
private TimeZone timezone;
- private String avatar;
-
- @NotNull
- private boolean publishRoster;
-
- @NotNull
- private SubscriptionMode subscriptionMode;
-
- @NotNull
- private String chatColor;
-
public User() {
- this(null, null, null, null, null, null, null);
+ this(null, null, null, null, null, null, null);
}
public User(final String shortName, final String longName, final String email, final String passwd,
- final I18nLanguage language, final I18nCountry country, final TimeZone timezone) {
- this.shortName = shortName;
- this.name = longName;
- this.email = email;
- this.password = passwd;
- this.userGroup = Group.NO_GROUP;
- this.language = language;
- this.country = country;
- this.timezone = timezone;
- this.publishRoster = true;
- this.subscriptionMode = SubscriptionMode.manual;
- this.chatColor = DEF_CHAT_COLOR;
+ final I18nLanguage language, final I18nCountry country, final TimeZone timezone) {
+ this.shortName = shortName;
+ this.name = longName;
+ this.email = email;
+ this.password = passwd;
+ this.userGroup = Group.NO_GROUP;
+ this.language = language;
+ this.country = country;
+ this.timezone = timezone;
}
@Finder(query = "from User")
public List<User> getAll() {
- return null;
+ return null;
}
- public String getAvatar() {
- return avatar;
- }
-
@Finder(query = "from User where email = :email")
public User getByEmail(@Named("email")
final String email) {
- return null;
+ return null;
}
@Finder(query = "from User where shortName = :shortName")
public User getByShortName(@Named("shortName")
final String shortName) {
- return null;
+ return null;
}
- public String getChatColor() {
- return chatColor;
- }
-
public I18nCountry getCountry() {
- return country;
+ return country;
}
public String getEmail() {
- return email;
+ return email;
}
public Long getId() {
- return id;
+ return id;
}
public I18nLanguage getLanguage() {
- return language;
+ return language;
}
public String getName() {
- return name;
+ return name;
}
public String getPassword() {
- return password;
+ return password;
}
public String getShortName() {
- return shortName;
+ return shortName;
}
- public RosterManager.SubscriptionMode getSubscriptionMode() {
- return subscriptionMode;
- }
-
public TimeZone getTimezone() {
- return timezone;
+ return timezone;
}
public Group getUserGroup() {
- return userGroup;
+ return userGroup;
}
- public boolean isPublishRoster() {
- return publishRoster;
- }
-
- public void setAvatar(final String avatar) {
- this.avatar = avatar;
- }
-
- public void setChatColor(final String chatColor) {
- this.chatColor = chatColor;
- }
-
public void setCountry(final I18nCountry country) {
- this.country = country;
+ this.country = country;
}
public void setEmail(final String email) {
- this.email = email;
+ this.email = email;
}
public void setId(final Long id) {
- this.id = id;
+ this.id = id;
}
public void setLanguage(final I18nLanguage language) {
- this.language = language;
+ this.language = language;
}
public void setName(final String name) {
- this.name = name;
+ this.name = name;
}
public void setPassword(final String password) {
- this.password = password;
- // http://www.dynamic.net.au/christos/crypt/
- // Use UnixCrypt (jetty)
+ this.password = password;
+ // http://www.dynamic.net.au/christos/crypt/
+ // Use UnixCrypt (jetty)
}
- public void setPublishRoster(final boolean publishRoster) {
- this.publishRoster = publishRoster;
- }
-
public void setShortName(final String shortName) {
- this.shortName = shortName;
+ this.shortName = shortName;
}
- public void setSubscriptionMode(final RosterManager.SubscriptionMode subscriptionMode) {
- this.subscriptionMode = subscriptionMode;
- }
-
public void setTimezone(final TimeZone timezone) {
- this.timezone = timezone;
+ this.timezone = timezone;
}
public void setUserGroup(final Group userGroup) {
- this.userGroup = userGroup;
+ this.userGroup = userGroup;
}
}
Added: trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserParams.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserParams.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/UserParams.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -0,0 +1,80 @@
+package org.ourproject.kune.platf.server.domain;
+
+import javax.persistence.Entity;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+import org.hibernate.search.annotations.DocumentId;
+import org.hibernate.search.annotations.Indexed;
+import org.hibernate.validator.NotNull;
+
+import com.calclab.emite.client.im.roster.RosterManager;
+import com.calclab.emite.client.im.roster.RosterManager.SubscriptionMode;
+
+@Entity
+@Indexed
+@Table(name = "usersparams")
+public class UserParams {
+
+ @Id
+ @DocumentId
+ @GeneratedValue
+ private Long id;
+
+ private String avatar;
+
+ @NotNull
+ private boolean publishRoster;
+
+ @NotNull
+ private SubscriptionMode subscriptionMode;
+
+ @NotNull
+ private String chatColor;
+
+ public UserParams(final String avatar, final boolean publishRoster, final SubscriptionMode subscriptionMode,
+ final String chatColor) {
+ this.avatar = avatar;
+ this.publishRoster = publishRoster;
+ this.subscriptionMode = subscriptionMode;
+ this.chatColor = chatColor;
+ }
+
+ public String getAvatar() {
+ return avatar;
+ }
+
+ public String getChatColor() {
+ return chatColor;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public RosterManager.SubscriptionMode getSubscriptionMode() {
+ return subscriptionMode;
+ }
+
+ public boolean isPublishRoster() {
+ return publishRoster;
+ }
+
+ public void setAvatar(final String avatar) {
+ this.avatar = avatar;
+ }
+
+ public void setChatColor(final String chatColor) {
+ this.chatColor = chatColor;
+ }
+
+ public void setPublishRoster(final boolean publishRoster) {
+ this.publishRoster = publishRoster;
+ }
+
+ public void setSubscriptionMode(final RosterManager.SubscriptionMode subscriptionMode) {
+ this.subscriptionMode = subscriptionMode;
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -30,6 +30,7 @@
import org.ourproject.kune.platf.server.access.AccessType;
import org.ourproject.kune.platf.server.auth.Authenticated;
import org.ourproject.kune.platf.server.auth.Authorizated;
+import org.ourproject.kune.platf.server.content.ContentManager;
import org.ourproject.kune.platf.server.domain.Group;
import org.ourproject.kune.platf.server.domain.User;
import org.ourproject.kune.platf.server.manager.GroupManager;
@@ -47,12 +48,14 @@
private final Mapper mapper;
private final GroupManager groupManager;
private final Provider<UserSession> userSessionProvider;
+ private final ContentManager contentManager;
@Inject
public GroupRPC(final Provider<UserSession> userSessionProvider, final GroupManager groupManager,
- final Mapper mapper) {
+ final ContentManager contentManager, final Mapper mapper) {
this.userSessionProvider = userSessionProvider;
this.groupManager = groupManager;
+ this.contentManager = contentManager;
this.mapper = mapper;
}
@@ -76,6 +79,8 @@
final User user = userSession.getUser();
final Group group = mapper.map(groupDTO, Group.class);
final Group newGroup = groupManager.createGroup(group, user);
+ final Long defContentId = newGroup.getDefaultContent().getId();
+ contentManager.setTags(user, defContentId, groupDTO.getTags());
return new StateToken(newGroup.getDefaultContent().getStateToken());
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -42,6 +42,7 @@
import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.core.Position;
import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.ToolTip;
import com.gwtext.client.widgets.form.Field;
import com.gwtext.client.widgets.form.FieldSet;
import com.gwtext.client.widgets.form.FormPanel;
@@ -58,6 +59,7 @@
private static final String LONGNAME_FIELD = "long_name";
private static final String PUBLICDESC_FIELD = "public_desc";
private static final String TYPEOFGROUP_FIELD = "type_of_group";
+ private static final String TAGS_FIELD = "tags";
private final FormPanel newGroupInitialDataForm;
private Radio projectRadio;
@@ -71,282 +73,292 @@
private LicenseChoose licenseChoosePanel;
private final SiteMessagePanel messagesPanel;
private final I18nTranslationService i18n;
+ private TextField tags;
public NewGroupPanel(final NewGroupPresenter presenter, final I18nTranslationService i18n) {
- super(i18n.t("Register a new Group"), true, false, 460, 480, new WizardListener() {
- public void onBack() {
- presenter.onBack();
- }
+ super(i18n.t("Register a new Group"), true, false, 460, 480, new WizardListener() {
+ public void onBack() {
+ presenter.onBack();
+ }
- public void onCancel() {
- presenter.onCancel();
- }
+ public void onCancel() {
+ presenter.onCancel();
+ }
- public void onClose() {
- presenter.onClose();
- }
+ public void onClose() {
+ presenter.onClose();
+ }
- public void onFinish() {
- presenter.onFinish();
- }
+ public void onFinish() {
+ presenter.onFinish();
+ }
- public void onNext() {
- presenter.onNext();
- }
- }, i18n);
- this.i18n = i18n;
- Field.setMsgTarget("side");
- final Panel centerPanel = new Panel();
- centerPanel.setLayout(new FitLayout());
- deck = new DeckPanel();
- newGroupInitialDataForm = createNewGroupInitialDataForm(presenter);
- createChooseLicensePanel();
- final VerticalPanel newGroupInitialDataVP = new VerticalPanel();
- final HorizontalPanel newGroupInitialDataHP = new HorizontalPanel();
- final VerticalPanel chooseLicenseVP = new VerticalPanel();
- final HorizontalPanel chooseLicenseHP = new HorizontalPanel();
- final Images img = Images.App.getInstance();
- newGroupInitialDataHP.add(img.step1().createImage());
- final Label step1Label = new Label(i18n
- .t("Please fill this form and follow the next steps to register a new group:"));
- newGroupInitialDataHP.add(step1Label);
- newGroupInitialDataVP.add(newGroupInitialDataHP);
- newGroupInitialDataVP.add(newGroupInitialDataForm);
- chooseLicenseHP.add(img.step2().createImage());
- final HTML step2Label = new HTML(i18n.t("Select a license to share your group contents with other people. "
- + "We recomend [%s] licenses for practical works.", KuneStringUtils.generateHtmlLink(
- "http://en.wikipedia.org/wiki/Copyleft", "copyleft")));
- chooseLicenseHP.add(step2Label);
- final Label licenseTypeLabel = new Label(i18n.t("Choose a license type:"));
- chooseLicenseVP.add(chooseLicenseHP);
- chooseLicenseVP.add(licenseTypeLabel);
+ public void onNext() {
+ presenter.onNext();
+ }
+ }, i18n);
+ this.i18n = i18n;
+ Field.setMsgTarget("side");
+ final Panel centerPanel = new Panel();
+ centerPanel.setLayout(new FitLayout());
+ deck = new DeckPanel();
+ newGroupInitialDataForm = createNewGroupInitialDataForm(presenter);
+ createChooseLicensePanel();
+ final VerticalPanel newGroupInitialDataVP = new VerticalPanel();
+ final HorizontalPanel newGroupInitialDataHP = new HorizontalPanel();
+ final VerticalPanel chooseLicenseVP = new VerticalPanel();
+ final HorizontalPanel chooseLicenseHP = new HorizontalPanel();
+ final Images img = Images.App.getInstance();
+ newGroupInitialDataHP.add(img.step1().createImage());
+ final Label step1Label = new Label(i18n
+ .t("Please fill this form and follow the next steps to register a new group:"));
+ newGroupInitialDataHP.add(step1Label);
+ newGroupInitialDataVP.add(newGroupInitialDataHP);
+ newGroupInitialDataVP.add(newGroupInitialDataForm);
+ chooseLicenseHP.add(img.step2().createImage());
+ final HTML step2Label = new HTML(i18n.t("Select a license to share your group contents with other people. "
+ + "We recomend [%s] licenses for practical works.", KuneStringUtils.generateHtmlLink(
+ "http://en.wikipedia.org/wiki/Copyleft", "copyleft")));
+ chooseLicenseHP.add(step2Label);
+ final Label licenseTypeLabel = new Label(i18n.t("Choose a license type:"));
+ chooseLicenseVP.add(chooseLicenseHP);
+ chooseLicenseVP.add(licenseTypeLabel);
- newGroupInitialDataHP.addStyleName("kune-Margin-Medium-b");
- step1Label.addStyleName("kune-Margin-Large-l");
- step2Label.addStyleName("kune-Margin-Large-l");
- step1Label.addStyleName("kune-Margin-Medium-b");
- step2Label.addStyleName("kune-Margin-Medium-b");
+ newGroupInitialDataHP.addStyleName("kune-Margin-Medium-b");
+ step1Label.addStyleName("kune-Margin-Large-l");
+ step2Label.addStyleName("kune-Margin-Large-l");
+ step1Label.addStyleName("kune-Margin-Medium-b");
+ step2Label.addStyleName("kune-Margin-Medium-b");
- messagesPanel = new SiteMessagePanel(null, false);
- messagesPanel.setWidth("425");
- messagesPanel.setMessage("", SiteErrorType.info, SiteErrorType.error);
- newGroupInitialDataVP.add(messagesPanel);
+ messagesPanel = new SiteMessagePanel(null, false);
+ messagesPanel.setWidth("425");
+ messagesPanel.setMessage("", SiteErrorType.info, SiteErrorType.error);
+ newGroupInitialDataVP.add(messagesPanel);
- chooseLicenseVP.add((Widget) licenseChoosePanel.getView());
- deck.add(newGroupInitialDataVP);
- deck.add(chooseLicenseVP);
- centerPanel.add(deck);
- super.add(centerPanel);
- deck.showWidget(0);
- initBottomButtons();
- // newGroupInitialDataVP.addStyleName("kune-Default-Form");
- deck.addStyleName("kune-Default-Form");
- licenseTypeLabel.addStyleName("kune-License-CC-Header");
- newGroupInitialDataVP.setHeight("10"); // Ext set this to 100% ...
- chooseLicenseVP.setHeight("10"); // (same here)
- super.setFinishText(i18n.t("Register"));
+ chooseLicenseVP.add((Widget) licenseChoosePanel.getView());
+ deck.add(newGroupInitialDataVP);
+ deck.add(chooseLicenseVP);
+ centerPanel.add(deck);
+ super.add(centerPanel);
+ deck.showWidget(0);
+ initBottomButtons();
+ // newGroupInitialDataVP.addStyleName("kune-Default-Form");
+ deck.addStyleName("kune-Default-Form");
+ licenseTypeLabel.addStyleName("kune-License-CC-Header");
+ newGroupInitialDataVP.setHeight("10"); // Ext set this to 100% ...
+ chooseLicenseVP.setHeight("10"); // (same here)
+ super.setFinishText(i18n.t("Register"));
}
public void clearData() {
- deck.showWidget(0);
- newGroupInitialDataForm.getForm().reset();
- ((LicenseChoosePanel) licenseChoosePanel.getView()).reset();
- showNewGroupInitialDataForm();
- initBottomButtons();
- shortNameField.focus(false);
+ deck.showWidget(0);
+ newGroupInitialDataForm.getForm().reset();
+ ((LicenseChoosePanel) licenseChoosePanel.getView()).reset();
+ showNewGroupInitialDataForm();
+ initBottomButtons();
+ shortNameField.focus(false);
}
public LicenseDTO getLicense() {
- return licenseChoosePanel.getLicense();
+ return licenseChoosePanel.getLicense();
}
public String getLongName() {
- return longNameField.getValueAsString();
+ return longNameField.getValueAsString();
}
public String getPublicDesc() {
- return publicDescField.getValueAsString();
+ return publicDescField.getValueAsString();
}
public String getShortName() {
- return shortNameField.getValueAsString();
+ return shortNameField.getValueAsString();
}
public void hideMessage() {
- messagesPanel.hide();
+ messagesPanel.hide();
}
public boolean isCommunity() {
- return communityRadio.getValue();
+ return communityRadio.getValue();
}
public boolean isFormValid() {
- return newGroupInitialDataForm.getForm().isValid();
+ return newGroupInitialDataForm.getForm().isValid();
}
public boolean isOrganization() {
- return orgRadio.getValue();
+ return orgRadio.getValue();
}
public boolean isOrphanedProject() {
- return orphanedProjectRadio.getValue();
+ return orphanedProjectRadio.getValue();
}
public boolean isProject() {
- return projectRadio.getValue();
+ return projectRadio.getValue();
}
public void setMessage(final String message, final SiteErrorType type) {
- messagesPanel.setMessage(message, type, type);
- messagesPanel.show();
+ messagesPanel.setMessage(message, type, type);
+ messagesPanel.show();
}
public void showLicenseForm() {
- deck.showWidget(1);
+ deck.showWidget(1);
}
public void showNewGroupInitialDataForm() {
- deck.showWidget(0);
+ deck.showWidget(0);
}
private void createChooseLicensePanel() {
- licenseChoosePanel = SiteBarFactory.createLicenseChoose();
+ licenseChoosePanel = SiteBarFactory.createLicenseChoose();
}
private FormPanel createNewGroupInitialDataForm(final NewGroupPresenter presenter) {
- final FormPanel form = new FormPanel();
- form.setBorder(false);
- form.setWidth(420);
- form.setLabelWidth(100);
- form.setLabelAlign(Position.RIGHT);
- form.setButtonAlign(Position.RIGHT);
+ final FormPanel form = new FormPanel();
+ form.setBorder(false);
+ form.setWidth(420);
+ form.setLabelWidth(100);
+ form.setLabelAlign(Position.RIGHT);
+ form.setButtonAlign(Position.RIGHT);
- shortNameField = new TextField();
- shortNameField.setFieldLabel(i18n.t("Short name"));
- shortNameField.
+ shortNameField = new TextField();
+ shortNameField.setFieldLabel(i18n.t("Short name"));
+ shortNameField.
- setName(SHORTNAME_FIELD);
- shortNameField.setWidth(175);
- shortNameField.setMinLength(3);
- shortNameField.setMaxLength(15);
- shortNameField.setAllowBlank(false);
- shortNameField.setRegex("^[a-z0-9_\\-]+$");
- shortNameField.setMinLengthText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
- shortNameField.setMaxLengthText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
- shortNameField.setRegexText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
- shortNameField.setValidationDelay(1000);
+ setName(SHORTNAME_FIELD);
+ shortNameField.setWidth(175);
+ shortNameField.setMinLength(3);
+ shortNameField.setMaxLength(15);
+ shortNameField.setAllowBlank(false);
+ shortNameField.setRegex("^[a-z0-9_\\-]+$");
+ shortNameField.setMinLengthText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameField.setMaxLengthText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameField.setRegexText(i18n.t(MUST_BE_BETWEEN_3_AND_15));
+ shortNameField.setValidationDelay(1000);
- form.add(shortNameField);
+ form.add(shortNameField);
- longNameField = new TextField();
- longNameField.setFieldLabel(i18n.t("Long name"));
- longNameField.setName(LONGNAME_FIELD);
- longNameField.setWidth(300);
- longNameField.setAllowBlank(false);
+ longNameField = new TextField();
+ longNameField.setFieldLabel(i18n.t("Long name"));
+ longNameField.setName(LONGNAME_FIELD);
+ longNameField.setWidth(300);
+ longNameField.setAllowBlank(false);
- longNameField.setMinLength(3);
- longNameField.setMaxLength(50);
- longNameField.setValidationDelay(1000);
- form.add(longNameField);
+ longNameField.setMinLength(3);
+ longNameField.setMaxLength(50);
+ longNameField.setValidationDelay(1000);
+ form.add(longNameField);
- publicDescField = new TextArea();
- publicDescField.setFieldLabel(i18n.t("Public description"));
- publicDescField.setName(PUBLICDESC_FIELD);
- publicDescField.setWidth(300);
- publicDescField.setAllowBlank(false);
- publicDescField.setMinLength(10);
- publicDescField.setMaxLength(255);
- publicDescField.setValidationDelay(1000);
+ publicDescField = new TextArea();
+ publicDescField.setFieldLabel(i18n.t("Public description"));
+ publicDescField.setName(PUBLICDESC_FIELD);
+ publicDescField.setWidth(300);
+ publicDescField.setAllowBlank(false);
+ publicDescField.setMinLength(10);
+ publicDescField.setMaxLength(255);
+ publicDescField.setValidationDelay(1000);
+ form.add(publicDescField);
- form.add(publicDescField);
+ tags = new TextField();
+ tags.setFieldLabel(i18n.t("Group tags"));
+ tags.setName(TAGS_FIELD);
+ tags.setWidth(300);
+ tags.setAllowBlank(false);
+ final ToolTip fieldToolTip = new ToolTip(i18n.t("Some words related to this group (separated with spaces)."));
+ fieldToolTip.applyTo(tags);
+ tags.setValidationDelay(1000);
+ form.add(tags);
- final FieldSet groupTypeFieldSet = new FieldSet(i18n.t("Type of group"));
- groupTypeFieldSet.setStyle("margin-left: 105px");
+ final FieldSet groupTypeFieldSet = new FieldSet(i18n.t("Type of group"));
+ groupTypeFieldSet.setStyle("margin-left: 105px");
- form.add(groupTypeFieldSet);
+ form.add(groupTypeFieldSet);
- projectRadio = new Radio();
- createRadio(groupTypeFieldSet, projectRadio, "Project",
- "A project is a kind of group in which new members inclusion "
- + "is moderated by the project administrators. "
- + "An administrator is the person who creates the project "
- + "and other people she/he choose in the future as administrator too.");
- projectRadio.setChecked(true);
+ projectRadio = new Radio();
+ createRadio(groupTypeFieldSet, projectRadio, "Project",
+ "A project is a kind of group in which new members inclusion "
+ + "is moderated by the project administrators. "
+ + "An administrator is the person who creates the project "
+ + "and other people she/he choose in the future as administrator too.");
+ projectRadio.setChecked(true);
- orgRadio = new Radio();
- createRadio(groupTypeFieldSet, orgRadio, "Organization", "An organization is like a project, "
- + "but organizations must be a legal entity.");
+ orgRadio = new Radio();
+ createRadio(groupTypeFieldSet, orgRadio, "Organization", "An organization is like a project, "
+ + "but organizations must be a legal entity.");
- communityRadio = new Radio();
- createRadio(groupTypeFieldSet, communityRadio, "Community", "Communities are social group of persons "
- + "with shared interests and they are open to new members "
- + "(for instance the environmental community or the LGBT community). "
- + "Normally they aren't a legal entity.");
+ communityRadio = new Radio();
+ createRadio(groupTypeFieldSet, communityRadio, "Community", "Communities are social group of persons "
+ + "with shared interests and they are open to new members "
+ + "(for instance the environmental community or the LGBT community). "
+ + "Normally they aren't a legal entity.");
- orphanedProjectRadio = new Radio();
- createRadio(groupTypeFieldSet, orphanedProjectRadio, "Orphaned Project",
- "If you have an idea but you don't have " + "capacity/possibilities/resources to work on it, "
- + "just register a orphaned project, and permit others to work and develop it.");
+ orphanedProjectRadio = new Radio();
+ createRadio(groupTypeFieldSet, orphanedProjectRadio, "Orphaned Project",
+ "If you have an idea but you don't have " + "capacity/possibilities/resources to work on it, "
+ + "just register a orphaned project, and permit others to work and develop it.");
- groupTypeFieldSet.setCollapsible(false);
+ groupTypeFieldSet.setCollapsible(false);
- shortNameField.addListener(new TextFieldListenerAdapter() {
- public void onChange(final Field field, final Object newVal, final Object oldVal) {
- presenter.onChange();
- }
- });
+ shortNameField.addListener(new TextFieldListenerAdapter() {
+ public void onChange(final Field field, final Object newVal, final Object oldVal) {
+ presenter.onChange();
+ }
+ });
- longNameField.addListener(new TextFieldListenerAdapter() {
- public void onChange(final Field field, final Object newVal, final Object oldVal) {
- presenter.onChange();
- }
- });
+ longNameField.addListener(new TextFieldListenerAdapter() {
+ public void onChange(final Field field, final Object newVal, final Object oldVal) {
+ presenter.onChange();
+ }
+ });
- publicDescField.addListener(new TextFieldListenerAdapter() {
- public void onChange(final Field field, final Object newVal, final Object oldVal) {
- presenter.onChange();
- }
- });
+ publicDescField.addListener(new TextFieldListenerAdapter() {
+ public void onChange(final Field field, final Object newVal, final Object oldVal) {
+ presenter.onChange();
+ }
+ });
- return form;
+ return form;
}
private void createRadio(final FieldSet fieldSet, final Radio radio, final String radioLabel, final String radioTip) {
- radio.setName(TYPEOFGROUP_FIELD);
- radio.setBoxLabel(KuneUiUtils.genQuickTipLabel(i18n.t(radioLabel), null, i18n.t(radioTip), INFO_IMAGE));
- radio.setAutoCreate(true);
- radio.setHideLabel(true);
- fieldSet.add(radio);
- // ToolTip fieldToolTip = new ToolTip("Tooltip on a Field.");
- // fieldToolTip.applyTo(captchaField);
- // Image info = new Image("images/silk/information.gif");
- //
- // ToolTip tooltip = new ToolTip();
- // tooltip.setHtml("A <b>CAPTCHA</b> is a challenge-response test to
- // determine whether " +
- // "the user is human.");
- // tooltip.setWidth(150);
- // tooltip.applyTo(info.getElement());
+ radio.setName(TYPEOFGROUP_FIELD);
+ radio.setBoxLabel(KuneUiUtils.genQuickTipLabel(i18n.t(radioLabel), null, i18n.t(radioTip), INFO_IMAGE));
+ radio.setAutoCreate(true);
+ radio.setHideLabel(true);
+ fieldSet.add(radio);
+ // ToolTip fieldToolTip = new ToolTip("Tooltip on a Field.");
+ // fieldToolTip.applyTo(captchaField);
+ // Image info = new Image("images/silk/information.gif");
+ //
+ // ToolTip tooltip = new ToolTip();
+ // tooltip.setHtml("A <b>CAPTCHA</b> is a challenge-response test to
+ // determine whether " +
+ // "the user is human.");
+ // tooltip.setWidth(150);
+ // tooltip.applyTo(info.getElement());
- // Tested:
- // Set tooltip
- // Image info = new Image();
- // ChatIcons.App.getInstance().info().applyTo(info);
- // ToolTip tooltip = new ToolTip();
- // tooltip.setHtml(i18n.t("Note that the 'Jabber Id' sometimes is the
- // same as the email "
- // + "(in gmail accounts for instance)."));
- // tooltip.setWidth(250);
- // tooltip.applyTo(info.getElement());
- // jidPanel.addToRow(info, new ColumnLayoutData(1));
- //
- // formPanel.add(jidPanel);
+ // Tested:
+ // Set tooltip
+ // Image info = new Image();
+ // ChatIcons.App.getInstance().info().applyTo(info);
+ // ToolTip tooltip = new ToolTip();
+ // tooltip.setHtml(i18n.t("Note that the 'Jabber Id' sometimes is the
+ // same as the email "
+ // + "(in gmail accounts for instance)."));
+ // tooltip.setWidth(250);
+ // tooltip.applyTo(info.getElement());
+ // jidPanel.addToRow(info, new ColumnLayoutData(1));
+ //
+ // formPanel.add(jidPanel);
}
private void initBottomButtons() {
- super.setEnabledBackButton(false);
- super.setEnabledFinishButton(false);
- super.setEnabledNextButton(true);
+ super.setEnabledBackButton(false);
+ super.setEnabledFinishButton(false);
+ super.setEnabledNextButton(true);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -35,56 +35,54 @@
public static final int MIN_HEIGHT = 480;
- public void showError(Throwable caught);
+ public void adjustSize(int windowWidth, int clientHeight);
- public void showGroup(GroupDTO group, boolean isAdmin);
+ public void attachToExtensibleWidget(ExtensibleWidgetChild ext);
- public void setTool(String toolName);
+ public void attachTools(Iterator<ClientTool> iterator);
- public void setContext(WorkspaceComponent contextComponent);
+ public int calculateHeight(int clientHeight);
- public void setContent(WorkspaceComponent contentComponent);
+ public int calculateWidth(int clientWidth);
- public void attachTools(Iterator<ClientTool> iterator);
+ public void clearExtensibleWidget(String extId);
- public void adjustSize(int windowWidth, int clientHeight);
+ public void detachFromExtensibleWidget(ExtensibleWidgetChild ext);
- public LicenseComponent getLicenseComponent();
+ public ContentBottomToolBarComponent getContentBottomToolBarComponent();
+ public ContentSubTitleComponent getContentSubTitleComponent();
+
public ContentTitleComponent getContentTitleComponent();
- public ContentSubTitleComponent getContentSubTitleComponent();
+ public GroupLiveSearchComponent getGroupLiveSearchComponent();
public GroupMembersComponent getGroupMembersComponent();
- public ParticipationComponent getParticipationComponent();
-
public GroupSummaryComponent getGroupSummaryComponent();
- public GroupLiveSearchComponent getGroupLiveSearchComponent();
+ public I18nTranslatorComponent getI18nTranslatorComponent();
- public UserLiveSearchComponent getUserLiveSearchComponent();
+ public LicenseComponent getLicenseComponent();
+ public ParticipationComponent getParticipationComponent();
+
public TagsComponent getTagsComponent();
- public void setTheme(String theme);
-
public ThemeMenuComponent getThemeMenuComponent();
- public void setVisible(boolean visible);
+ public UserLiveSearchComponent getUserLiveSearchComponent();
- public ContentBottomToolBarComponent getContentBottomToolBarComponent();
+ public void setContent(WorkspaceComponent contentComponent);
- public void attachToExtensibleWidget(ExtensibleWidgetChild ext);
+ public void setContext(WorkspaceComponent contextComponent);
- public void detachFromExtensibleWidget(ExtensibleWidgetChild ext);
+ public void setTheme(String theme);
- public I18nTranslatorComponent getI18nTranslatorComponent();
+ public void setTool(String toolName);
- public int calculateWidth(int clientWidth);
+ public void setVisible(boolean visible);
- public int calculateHeight(int clientHeight);
+ public void showGroup(GroupDTO group, boolean isAdmin);
- public void clearExtensibleWidget(String extId);
-
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -47,159 +47,155 @@
public WorkspacePresenter(final Session session) {
}
- public void init(final WorkspaceView view, final ExtensibleWidgetsManager extensionPointManager) {
- this.view = view;
- this.extensionPointManager = extensionPointManager;
- this.components = new WorkspaceUIComponents(this);
- view.setComponents(components);
- view.registerUIExtensionPoints();
+ public void adjustSize(final int windowWidth, final int clientHeight) {
+ view.adjustSize(windowWidth, clientHeight);
}
- public void showError(final Throwable caught) {
-
+ public void attachToExtensibleWidget(final ExtensibleWidgetChild child) {
+ extensionPointManager.attachToExtensible(child);
}
- public void showGroup(final GroupDTO group, final boolean isAdmin) {
- view.setGroupLogo(group.getLongName());
- view.setPutYourLogoVisible(isAdmin);
+ public void attachTools(final Iterator<ClientTool> iterator) {
+ ClientTool clientTool;
+ while (iterator.hasNext()) {
+ clientTool = iterator.next();
+ view.addTab(clientTool.getTrigger());
+ }
}
- public void attachTools(final Iterator<ClientTool> iterator) {
- ClientTool clientTool;
- while (iterator.hasNext()) {
- clientTool = iterator.next();
- view.addTab(clientTool.getTrigger());
- }
+ /**
+ * Calculates Workspaceheight depending of the client Window size but with a
+ * limit
+ */
+ public int calculateHeight(final int clientHeight) {
+ // 15 is the size of scrollbar
+ return clientHeight <= MIN_HEIGHT ? MIN_HEIGHT - 15 : clientHeight;
}
- public void setTool(final String toolName) {
- view.setTool(toolName);
+ /**
+ * Calculates Workspace width depending of the client Window size but with a
+ * limit
+ */
+ public int calculateWidth(final int clientWidth) {
+ return clientWidth <= MIN_WIDTH ? MIN_WIDTH - 15 : clientWidth;
}
- public void setContext(final WorkspaceComponent contextComponent) {
- if (context != null) {
- context.detach();
- }
- context = contextComponent;
- context.attach();
- view.setContext(context.getView());
+ public void clearExtensibleWidget(final String id) {
+ extensionPointManager.detachAll(id);
}
- public void setContent(final WorkspaceComponent contentComponent) {
- if (content != null) {
- content.detach();
- }
- content = contentComponent;
- content.attach();
- view.setContent(content.getView());
+ public void detachFromExtensibleWidget(final ExtensibleWidgetChild child) {
+ extensionPointManager.detachFromExtensible(child);
}
- public View getView() {
- return view;
+ public ContentBottomToolBarComponent getContentBottomToolBarComponent() {
+ return components.getContentBottomToolBarComponent();
}
- public LicenseComponent getLicenseComponent() {
- return components.getLicenseComponent();
+ public ContentSubTitleComponent getContentSubTitleComponent() {
+ return components.getContentSubTitleComponent();
}
public ContentTitleComponent getContentTitleComponent() {
- return components.getContentTitleComponent();
+ return components.getContentTitleComponent();
}
- public ContentSubTitleComponent getContentSubTitleComponent() {
- return components.getContentSubTitleComponent();
+ public GroupLiveSearchComponent getGroupLiveSearchComponent() {
+ return components.getGroupLiveSearchComponent();
}
public GroupMembersComponent getGroupMembersComponent() {
- return components.getGroupMembersComponent();
+ return components.getGroupMembersComponent();
}
- public ParticipationComponent getParticipationComponent() {
- return components.getParticipationComponent();
+ public GroupSummaryComponent getGroupSummaryComponent() {
+ return components.getGroupSummaryComponent();
}
- public GroupSummaryComponent getGroupSummaryComponent() {
- return components.getGroupSummaryComponent();
+ public I18nTranslatorComponent getI18nTranslatorComponent() {
+ return components.getI18nTranslatorComponent();
}
- public ThemeMenuComponent getThemeMenuComponent() {
- return components.getThemeMenuComponent();
+ public LicenseComponent getLicenseComponent() {
+ return components.getLicenseComponent();
}
- public ContentBottomToolBarComponent getContentBottomToolBarComponent() {
- return components.getContentBottomToolBarComponent();
+ public ParticipationComponent getParticipationComponent() {
+ return components.getParticipationComponent();
}
public TagsComponent getTagsComponent() {
- return components.getTagsComponent();
+ return components.getTagsComponent();
}
- public GroupLiveSearchComponent getGroupLiveSearchComponent() {
- return components.getGroupLiveSearchComponent();
+ public ThemeMenuComponent getThemeMenuComponent() {
+ return components.getThemeMenuComponent();
}
public UserLiveSearchComponent getUserLiveSearchComponent() {
- return components.getUserLiveSearchComponent();
+ return components.getUserLiveSearchComponent();
}
- public I18nTranslatorComponent getI18nTranslatorComponent() {
- return components.getI18nTranslatorComponent();
+ public View getView() {
+ return view;
}
- public void setTheme(final String theme) {
- view.setTheme(theme);
+ public void init(final WorkspaceView view, final ExtensibleWidgetsManager extensionPointManager) {
+ this.view = view;
+ this.extensionPointManager = extensionPointManager;
+ this.components = new WorkspaceUIComponents(this);
+ view.setComponents(components);
+ view.registerUIExtensionPoints();
}
- public void setVisible(final boolean visible) {
- view.setVisible(visible);
+ public void onSplitterStartResizing(final Widget sender) {
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, null);
}
- public void attachToExtensibleWidget(final ExtensibleWidgetChild child) {
- extensionPointManager.attachToExtensible(child);
+ public void onSplitterStopResizing(final Widget sender) {
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, null);
}
- public void detachFromExtensibleWidget(final ExtensibleWidgetChild child) {
- extensionPointManager.detachFromExtensible(child);
+ public void registerExtensibleWidget(final String id, final ExtensibleWidget extensibleWidget) {
+ extensionPointManager.registerExtensibleWidget(id, extensibleWidget);
}
- public void onSplitterStartResizing(final Widget sender) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, null);
+ public void registerExtensibleWidgets(final HashMap<String, ExtensibleWidget> extensibleWidget) {
+ extensionPointManager.registerExtensibleWidgets(extensibleWidget);
}
- public void onSplitterStopResizing(final Widget sender) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, null);
+ public void setContent(final WorkspaceComponent contentComponent) {
+ if (content != null) {
+ content.detach();
+ }
+ content = contentComponent;
+ content.attach();
+ view.setContent(content.getView());
}
- /**
- * Calculates Workspaceheight depending of the client Window size but with a
- * limit
- */
- public int calculateHeight(final int clientHeight) {
- // 15 is the size of scrollbar
- return clientHeight <= MIN_HEIGHT ? MIN_HEIGHT - 15 : clientHeight;
+ public void setContext(final WorkspaceComponent contextComponent) {
+ if (context != null) {
+ context.detach();
+ }
+ context = contextComponent;
+ context.attach();
+ view.setContext(context.getView());
}
- /**
- * Calculates Workspace width depending of the client Window size but with a
- * limit
- */
- public int calculateWidth(final int clientWidth) {
- return clientWidth <= MIN_WIDTH ? MIN_WIDTH - 15 : clientWidth;
+ public void setTheme(final String theme) {
+ view.setTheme(theme);
}
- public void adjustSize(final int windowWidth, final int clientHeight) {
- view.adjustSize(windowWidth, clientHeight);
+ public void setTool(final String toolName) {
+ view.setTool(toolName);
}
- public void registerExtensibleWidgets(final HashMap<String, ExtensibleWidget> extensibleWidget) {
- extensionPointManager.registerExtensibleWidgets(extensibleWidget);
+ public void setVisible(final boolean visible) {
+ view.setVisible(visible);
}
- public void registerExtensibleWidget(final String id, final ExtensibleWidget extensibleWidget) {
- extensionPointManager.registerExtensibleWidget(id, extensibleWidget);
+ public void showGroup(final GroupDTO group, final boolean isAdmin) {
+ view.setGroupLogo(group.getLongName());
+ view.setPutYourLogoVisible(isAdmin);
}
-
- public void clearExtensibleWidget(final String id) {
- extensionPointManager.detachAll(id);
- }
}
Modified: trunk/src/main/resources/db/update-0007-i18n.sql
===================================================================
--- trunk/src/main/resources/db/update-0007-i18n.sql 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/resources/db/update-0007-i18n.sql 2008-07-06 13:51:18 UTC (rev 792)
@@ -35,8 +35,6 @@
INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','Created, now you can edit the document','Created, now you can edit the document','kune_core',1819);
INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','Sorry, this functionality is currently in development','Sorry, this functionality is currently in development','kune_core',1819);
INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','This is an orphaned project, if you are interested please request to join to work on it','This is an orphaned project, if you are interested please request to join to work on it','kune_core',1819);
-INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','Bienvenido','Welcome','kune_core',5889);
-INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','Este es un ejemplo de documento. Puede modificar si es colaborador/a de este grupo y/o borrarlo si es administrador/a de este grupo.',"This is an example of document. You can modify it if you are a group\'s collaborator and/or delete it if you are admin.",'kune_core',5889);
INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','Borrar','Delete [%NT used in button]','kune_core',5889);
INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','Translate','Translate [%NT used in button]','kune_core',5889);
INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','Solicitar el participar en este grupo','Request to participate in this group','kune_core',5889);
Modified: trunk/src/main/resources/db/update-0008-i18n.sql
===================================================================
--- trunk/src/main/resources/db/update-0008-i18n.sql 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/main/resources/db/update-0008-i18n.sql 2008-07-06 13:51:18 UTC (rev 792)
@@ -1,6 +1,4 @@
INSERT INTO `globalize_languages` VALUES (7597,'pt-br','ltr','Brazilian Portuguese','','','',NULL,NULL,'\0','português do Brasil','','pt-br','c == 1 ? 1 : 2','','L');
-INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','Welcome','Welcome','kune_core',1819);
-INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'',"This is an example of document. You can modify it if you are a group\'s collaborator and/or delete it if you are admin.","This is an example of document. You can modify it if you are a group\'s collaborator and/or delete it if you are admin.",'kune_core',1819);
INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','Content not found','Content not found','kune_core',1819);
INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','Double click to rename','Double click to rename','kune_core',1819);
INSERT INTO `globalize_translations` VALUES (NULL,'',NULL,1,'','Contenido no encontrado','Content not found','kune_core',5889);
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/DatabaseInitializationTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/DatabaseInitializationTest.java 2008-07-06 13:47:37 UTC (rev 791)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/DatabaseInitializationTest.java 2008-07-06 13:51:18 UTC (rev 792)
@@ -36,39 +36,39 @@
@Before
public void init() {
- new IntegrationTestHelper(this);
- defaultGroup = groupManager.getDefaultGroup();
+ new IntegrationTestHelper(this);
+ defaultGroup = groupManager.getDefaultGroup();
}
@Test
- public void testToolConfiguration() {
- assertNotNull(defaultGroup);
- ToolConfiguration docToolConfig = defaultGroup.getToolConfiguration(DocumentServerTool.NAME);
- assertNotNull(docToolConfig);
- ToolConfiguration chatToolConfig = defaultGroup.getToolConfiguration(ChatServerTool.NAME);
- assertNotNull(chatToolConfig);
+ public void testDefaultContentAndLicenses() {
+ assertNotNull(defaultGroup.getDefaultContent());
+ assertTrue(licenseManager.getAll().size() > 0);
+ assertNotNull(defaultGroup.getDefaultLicense());
}
@Test
public void testDefaultDocumentContent() {
- Content content = defaultGroup.getDefaultContent();
- assertEquals(DocumentServerTool.TYPE_DOCUMENT, content.getTypeId());
- Container rootDocFolder = content.getContainer();
- assertEquals(true, rootDocFolder.isRoot());
+ final Content content = defaultGroup.getDefaultContent();
+ assertEquals(DocumentServerTool.TYPE_DOCUMENT, content.getTypeId());
+ final Container rootDocFolder = content.getContainer();
+ assertEquals(true, rootDocFolder.isRoot());
}
@Test
- public void testDefaultContentAndLicenses() {
- assertNotNull(defaultGroup.getDefaultContent());
- assertTrue(licenseManager.getAll().size() > 0);
- assertNotNull(defaultGroup.getDefaultLicense());
+ public void testI18n() {
+ assertNotNull(countryManager.find(new Long(75)));
+ assertNotNull(languageManager.findByCode("en"));
+ assertNotNull(languageManager.find(new Long(1819)));
}
@Test
- public void testI18n() {
- assertNotNull(countryManager.find(new Long(75)));
- assertNotNull(languageManager.findByCode("en"));
- assertNotNull(languageManager.find(new Long(1819)));
+ public void testToolConfiguration() {
+ assertNotNull(defaultGroup);
+ final ToolConfiguration docToolConfig = defaultGroup.getToolConfiguration(DocumentServerTool.NAME);
+ assertNotNull(docToolConfig);
+ final ToolConfiguration chatToolConfig = defaultGroup.getToolConfiguration(ChatServerTool.NAME);
+ assertNotNull(chatToolConfig);
}
}
1
0
Author: vjrj
Date: 2008-07-06 15:47:37 +0200 (Sun, 06 Jul 2008)
New Revision: 791
Added:
sandbox3/src/main/java/org/op/public/arrow_in.png
sandbox3/src/main/java/org/op/public/arrow_out.png
Log:
more ext probes
Added: sandbox3/src/main/java/org/op/public/arrow_in.png
===================================================================
(Binary files differ)
Property changes on: sandbox3/src/main/java/org/op/public/arrow_in.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: sandbox3/src/main/java/org/op/public/arrow_out.png
===================================================================
(Binary files differ)
Property changes on: sandbox3/src/main/java/org/op/public/arrow_out.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
Author: vjrj
Date: 2008-07-06 14:48:58 +0200 (Sun, 06 Jul 2008)
New Revision: 790
Modified:
sandbox3/src/main/java/org/op/client/Sandbox.java
sandbox3/src/main/java/org/op/public/css/sandbox.css
Log:
more ext probes
Modified: sandbox3/src/main/java/org/op/client/Sandbox.java
===================================================================
--- sandbox3/src/main/java/org/op/client/Sandbox.java 2008-07-06 12:42:07 UTC (rev 789)
+++ sandbox3/src/main/java/org/op/client/Sandbox.java 2008-07-06 12:48:58 UTC (rev 790)
@@ -137,6 +137,14 @@
wk.getEntityWorkspace().getSubTitle().addFill();
wk.getEntityWorkspace().getSubTitle().add(new LabelWrapper("Subtitle"));
wk.getSiteBar().add(new LabelWrapper("sitebar-left"));
+ wk.getSiteBar().addSpacer();
+ wk.getSiteBar().add(new LabelWrapper("sitebar-left"));
+ wk.getSiteBar().addSpacer();
+ wk.getSiteBar().add(new LabelWrapper("sitebar-left"));
+ wk.getSiteBar().addSpacer();
+ wk.getSiteBar().add(new LabelWrapper("sitebar-left"));
+ wk.getSiteBar().addSpacer();
+ wk.getSiteBar().add(new LabelWrapper("sitebar-left"));
wk.getSiteBar().addFill();
wk.getSiteBar().addSeparator();
wk.getSiteBar().add(new LabelWrapper("sitebar-right"));
Modified: sandbox3/src/main/java/org/op/public/css/sandbox.css
===================================================================
--- sandbox3/src/main/java/org/op/public/css/sandbox.css 2008-07-06 12:42:07 UTC (rev 789)
+++ sandbox3/src/main/java/org/op/public/css/sandbox.css 2008-07-06 12:48:58 UTC (rev 790)
@@ -5,7 +5,7 @@
}
.k-sitebar {
- white-space: nowrap;
+ white-space: nowrap;
}
.k-entity-summary {
@@ -139,3 +139,6 @@
border: 0;
}
+.ytb-spacer {
+ width: 2px;
+}
1
0