[kune-commits] r794 - in trunk/src/main/java/org/ourproject/kune: app/public/css platf/client/services platf/client/ui workspace/client/ui/newtmp workspace/client/ui/newtmp/licensefoot workspace/client/ui/newtmp/sitebar workspace/client/ui/newtmp/skel workspace/client/ui/newtmp/themes workspace/client/ui/newtmp/title

vjrj vjrj at ourproject.org
Thu Jul 10 01:43:25 CEST 2008


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);
-
 }




More information about the kune-commits mailing list