[kune-commits] r1247 - in trunk: . src/main/java/cc/kune/client src/main/java/cc/kune/core/client src/main/java/cc/kune/core/client/ui src/main/java/cc/kune/core/client/ui/footer src/main/java/cc/kune/core/client/ui/footer/license src/main/java/cc/kune/core/public src/main/java/cc/kune/gspace/client/resources src/main/java/org/ourproject/kune/workspace/client src/main/resources

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Fri Feb 11 19:17:57 CET 2011


Author: vjrj_
Date: 2011-02-11 19:17:57 +0100 (Fri, 11 Feb 2011)
New Revision: 1247

Added:
   trunk/src/main/java/cc/kune/core/client/ui/footer/
   trunk/src/main/java/cc/kune/core/client/ui/footer/license/
Removed:
   trunk/src/main/java/cc/kune/core/client/ui/footer/license/EntityLicenseView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/
Modified:
   trunk/TODO
   trunk/src/main/java/cc/kune/client/KuneGinjector.java
   trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
   trunk/src/main/java/cc/kune/core/client/CoreParts.java
   trunk/src/main/java/cc/kune/core/client/ui/footer/license/EntityLicensePanel.java
   trunk/src/main/java/cc/kune/core/client/ui/footer/license/EntityLicensePresenter.java
   trunk/src/main/java/cc/kune/core/public/ws.css
   trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css
   trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
   trunk/src/main/resources/wave-server.properties
Log:
few changes in licenses

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2011-02-11 04:00:24 UTC (rev 1246)
+++ trunk/TODO	2011-02-11 18:17:57 UTC (rev 1247)
@@ -11,6 +11,7 @@
    Use org-mode in emacs to easy manage this file
 
 * SHORT-TERM (URGENT)
+** >> Delete host/room conf in ws.html
 ** HelloWord with samples of extensions: sitebar, sitebar options menu, siteuseroptions, sn, ...
 ** TODO Register of "reserved words" not permitted for groups/users names (in server and in client)
 ** TODO WIAB under proxies

Modified: trunk/src/main/java/cc/kune/client/KuneGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneGinjector.java	2011-02-11 04:00:24 UTC (rev 1246)
+++ trunk/src/main/java/cc/kune/client/KuneGinjector.java	2011-02-11 18:17:57 UTC (rev 1247)
@@ -42,6 +42,7 @@
 import cc.kune.core.client.sn.GroupMembersPresenter;
 import cc.kune.core.client.state.SiteTokenListeners;
 import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.ui.footer.license.EntityLicensePresenter;
 import cc.kune.core.client.ws.CorePresenter;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 import cc.kune.pspace.client.PSpaceGinModule;
@@ -70,6 +71,8 @@
 
     Provider<CorePresenter> getCorePresenter();
 
+    AsyncProvider<EntityLicensePresenter> getEntityLicensePresenter();
+
     ErrorHandler getErrorHandler();
 
     EventBus getEventBus();

Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2011-02-11 04:00:24 UTC (rev 1246)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2011-02-11 18:17:57 UTC (rev 1247)
@@ -84,6 +84,8 @@
 import cc.kune.core.client.state.SiteTokenListeners;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.client.state.StateManagerDefault;
+import cc.kune.core.client.ui.footer.license.EntityLicensePanel;
+import cc.kune.core.client.ui.footer.license.EntityLicensePresenter;
 import cc.kune.core.client.ws.CorePresenter;
 import cc.kune.core.client.ws.CoreViewImpl;
 import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -135,6 +137,8 @@
                 NewGroupPresenter.NewGroupProxy.class);
         bindPresenter(GroupMembersPresenter.class, GroupMembersPresenter.GroupMembersView.class,
                 GroupMembersPanel.class, GroupMembersPresenter.GroupMembersProxy.class);
+        bindPresenter(EntityLicensePresenter.class, EntityLicensePresenter.EntityLicenseView.class,
+                EntityLicensePanel.class, EntityLicensePresenter.EntityLicenseProxy.class);
 
         bind(UserPassAutocompleteManager.class).to(UserPassAutocompleteManagerImpl.class).in(Singleton.class);
         bindPresenter(SignInPresenter.class, SignInView.class, SignInPanel.class, SignInPresenter.SignInProxy.class);

Modified: trunk/src/main/java/cc/kune/core/client/CoreParts.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreParts.java	2011-02-11 04:00:24 UTC (rev 1246)
+++ trunk/src/main/java/cc/kune/core/client/CoreParts.java	2011-02-11 18:17:57 UTC (rev 1247)
@@ -5,6 +5,7 @@
 import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
 import cc.kune.core.client.sn.GroupMembersPresenter;
 import cc.kune.core.client.state.Session;
+import cc.kune.core.client.ui.footer.license.EntityLicensePresenter;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -13,12 +14,13 @@
 
     @Inject
     public CoreParts(final Session session, final Provider<GroupMembersPresenter> grouMembersPresenter,
-            final Provider<SiteUserOptionsPresenter> userOptions) {
+            final Provider<SiteUserOptionsPresenter> userOptions, final Provider<EntityLicensePresenter> licenseFooter) {
         session.onInitDataReceived(new AppStartHandler() {
             @Override
             public void onAppStart(final AppStartEvent event) {
                 grouMembersPresenter.get();
                 userOptions.get();
+                licenseFooter.get();
             }
         });
     }

Copied: trunk/src/main/java/cc/kune/core/client/ui/footer/license (from rev 1244, trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot)

Modified: trunk/src/main/java/cc/kune/core/client/ui/footer/license/EntityLicensePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java	2011-02-10 18:28:58 UTC (rev 1244)
+++ trunk/src/main/java/cc/kune/core/client/ui/footer/license/EntityLicensePanel.java	2011-02-11 18:17:57 UTC (rev 1247)
@@ -17,97 +17,115 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-package org.ourproject.kune.workspace.client.licensefoot;
+package cc.kune.core.client.ui.footer.license;
 
-import org.ourproject.kune.platf.client.ui.SimpleToolbar;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.adamtacy.client.ui.effects.examples.Fade;
+import org.adamtacy.client.ui.effects.examples.Show;
 
 import cc.kune.common.client.ui.KuneWindowUtils;
+import cc.kune.core.client.ui.footer.license.EntityLicensePresenter.EntityLicenseView;
 import cc.kune.core.shared.dto.LicenseDTO;
 import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.WsArmor;
 
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.HasClickHandlers;
 import com.google.gwt.event.dom.client.MouseOutEvent;
 import com.google.gwt.event.dom.client.MouseOutHandler;
 import com.google.gwt.event.dom.client.MouseOverEvent;
 import com.google.gwt.event.dom.client.MouseOverHandler;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.FlowPanel;
 import com.google.gwt.user.client.ui.Image;
 import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.gwtext.client.core.Ext;
-import com.gwtext.client.core.ExtElement;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.ViewImpl;
 
-public class EntityLicensePanel implements EntityLicenseView {
+public class EntityLicensePanel extends ViewImpl implements EntityLicenseView {
     public static final String LICENSE_LABEL = "k-elp-lic-lab";
+    private final I18nTranslationService i18n;
+    private final Element labelElement;
+    private final FlowPanel licenseBar;
     private final Image licenseImage;
     private final Label licenseLabel;
-    private final I18nTranslationService i18n;
-    private final SimpleToolbar licenseBar;
-    private final WorkspaceSkeleton ws;
-    private final ExtElement labelElement;
 
-    public EntityLicensePanel(final EntityLicensePresenter presenter, final I18nTranslationService i18n,
-            final WorkspaceSkeleton ws) {
+    @Inject
+    public EntityLicensePanel(final I18nTranslationService i18n, final WsArmor armor) {
         this.i18n = i18n;
-        this.ws = ws;
         licenseImage = new Image();
         licenseLabel = new Label("", false);
 
-        licenseBar = new SimpleToolbar();
-        licenseBar.addSpacer();
-        licenseBar.add(licenseImage, VerticalPanel.ALIGN_TOP);
+        licenseBar = new FlowPanel();
+        licenseBar.add(licenseImage);
         licenseBar.add(licenseLabel);
-
-        final ClickHandler clickListener = new ClickHandler() {
-            public void onClick(final ClickEvent event) {
-                presenter.onLicenseClick();
-            }
-        };
-
-        // licenseLabel.addClickHandler(clickListener);
-        licenseImage.addClickHandler(clickListener);
-
         licenseImage.addMouseOutHandler(new MouseOutHandler() {
+            @Override
             public void onMouseOut(final MouseOutEvent event) {
                 // fade(false);
             }
         });
         licenseImage.addMouseOverHandler(new MouseOverHandler() {
+            @Override
             public void onMouseOver(final MouseOverEvent event) {
-                fade(true);
+                show();
             }
         });
+        licenseImage.addStyleName("k-footer-license-img");
+        licenseLabel.addStyleName("k-footer-license-label");
+        armor.getEntityFooter().add(licenseBar);
+        labelElement = licenseLabel.getElement();
+    }
 
-        licenseLabel.addStyleName("kune-Margin-Large-l");
-        licenseLabel.setStyleName("k-elp-limg");
-        licenseImage.setStyleName("k-elp-limg");
-        ws.getEntityWorkspace().getBottomTitle().add(licenseBar);
-        labelElement = Ext.get(licenseLabel.getElement());
+    @Override
+    public Widget asWidget() {
+        return null;
     }
 
+    @Override
     public void attach() {
         licenseBar.setVisible(true);
     }
 
+    @Override
     public void detach() {
         licenseBar.setVisible(false);
     }
 
+    private void fade() {
+        final Fade fade = new Fade(labelElement);
+        fade.setDuration(.5);
+        fade.play();
+    }
+
+    @Override
+    public HasClickHandlers getImage() {
+        return licenseImage;
+    }
+
+    @Override
+    public HasClickHandlers getLabel() {
+        return licenseLabel;
+    }
+
+    @Override
     public void openWindow(final String url) {
         KuneWindowUtils.open(url);
     }
 
+    private void show() {
+        if ("0".equals(labelElement.getStyle().getOpacity())) {
+            final Show show = new Show(labelElement);
+            show.setDuration(.5);
+            show.play();
+        }
+    }
+
+    @Override
     public void showLicense(final String groupName, final LicenseDTO licenseDTO) {
         final String licenseText = i18n.t("© [%s], under license: [%s]", groupName, licenseDTO.getLongName());
         licenseLabel.setText(licenseText);
         // KuneUiUtils.setQuickTip(licenseLabel, licenseText);
         licenseImage.setUrl(licenseDTO.getImageUrl());
-        fade(false);
+        fade();
     }
-
-    private void fade(final boolean in) {
-        labelElement.setOpacity(in ? 1 : 0, true);
-        ws.getEntityWorkspace().refreshBottomTitle();
-    }
 }

Modified: trunk/src/main/java/cc/kune/core/client/ui/footer/license/EntityLicensePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePresenter.java	2011-02-10 18:28:58 UTC (rev 1244)
+++ trunk/src/main/java/cc/kune/core/client/ui/footer/license/EntityLicensePresenter.java	2011-02-11 18:17:57 UTC (rev 1247)
@@ -17,49 +17,84 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-package org.ourproject.kune.workspace.client.licensefoot;
+package cc.kune.core.client.ui.footer.license;
 
-import org.ourproject.kune.platf.client.View;
-
+import cc.kune.core.client.state.StateChangedEvent;
+import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.dto.LicenseDTO;
 import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.dto.StateContainerDTO;
 
-import com.calclab.suco.client.events.Listener;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.HasClickHandlers;
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.View;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
 
-public class EntityLicensePresenter {
+public class EntityLicensePresenter extends
+        Presenter<EntityLicensePresenter.EntityLicenseView, EntityLicensePresenter.EntityLicenseProxy> {
 
-    private EntityLicenseView view;
+    @ProxyCodeSplit
+    public interface EntityLicenseProxy extends Proxy<EntityLicensePresenter> {
+    }
+    public interface EntityLicenseView extends View {
+        void attach();
+
+        void detach();
+
+        HasClickHandlers getImage();
+
+        HasClickHandlers getLabel();
+
+        void openWindow(String url);
+
+        void showLicense(String groupName, LicenseDTO licenseDTO);
+
+    }
+
     private LicenseDTO license;
 
-    public EntityLicensePresenter(final StateManager stateManager) {
-        stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
-            public void onEvent(final StateAbstractDTO state) {
+    @Inject
+    public EntityLicensePresenter(final EventBus eventBus, final EntityLicenseView view,
+            final EntityLicenseProxy proxy, final StateManager stateManager) {
+        super(eventBus, view, proxy);
+        stateManager.onStateChanged(new StateChangedHandler() {
+
+            @Override
+            public void onStateChanged(final StateChangedEvent event) {
+                final StateAbstractDTO state = event.getState();
                 if (state instanceof StateContainerDTO) {
                     setLicense((StateContainerDTO) state);
                 } else {
-                    view.detach();
+                    getView().detach();
                 }
             }
         });
-    }
+        final ClickHandler clickHandler = new ClickHandler() {
 
-    public View getView() {
-        return view;
+            @Override
+            public void onClick(final ClickEvent event) {
+                getView().openWindow(license.getUrl());
+            }
+        };
+        getView().getImage().addClickHandler(clickHandler);
+        getView().getLabel().addClickHandler(clickHandler);
     }
 
-    public void init(final EntityLicenseView view) {
-        this.view = view;
+    @Override
+    protected void revealInParent() {
+        RevealRootContentEvent.fire(this, this);
     }
 
-    public void onLicenseClick() {
-        view.openWindow(license.getUrl());
-    }
-
     private void setLicense(final StateContainerDTO state) {
         this.license = state.getLicense();
-        view.showLicense(state.getGroup().getLongName(), license);
-        view.attach();
+        getView().showLicense(state.getGroup().getShortName(), license);
+        getView().attach();
     }
 }

Deleted: trunk/src/main/java/cc/kune/core/client/ui/footer/license/EntityLicenseView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicenseView.java	2011-02-10 18:28:58 UTC (rev 1244)
+++ trunk/src/main/java/cc/kune/core/client/ui/footer/license/EntityLicenseView.java	2011-02-11 18:17:57 UTC (rev 1247)
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.licensefoot;
-
-import org.ourproject.kune.platf.client.View;
-
-import cc.kune.core.shared.dto.LicenseDTO;
-
-public interface EntityLicenseView extends View {
-
-    void attach();
-
-    void detach();
-
-    void openWindow(String url);
-
-    void showLicense(String groupName, LicenseDTO licenseDTO);
-
-}

Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css	2011-02-11 04:00:24 UTC (rev 1246)
+++ trunk/src/main/java/cc/kune/core/public/ws.css	2011-02-11 18:17:57 UTC (rev 1247)
@@ -913,4 +913,23 @@
 .k-maxsize {
     width: 100%;
     height: 100%;
+}
+
+.k-footer-license-label {
+    float: right;
+    margin-top: 8px;
+    cursor: pointer;
+    font-weight: bold;
+    font-size: 16px;
+    color: #784421;
+}
+.k-footer-license-label-title {
+    margin-right: 5px;
+    color: #280b0b;
+}
+
+.k-footer-license-img {
+    float: right;
+    margin: 10px 15px 0px 5px;
+    cursor: pointer;
 }
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css	2011-02-11 04:00:24 UTC (rev 1246)
+++ trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css	2011-02-11 18:17:57 UTC (rev 1247)
@@ -33,7 +33,7 @@
   -moz-border-radius-bottomleft: 10px;
   border-top-bottom-radius: 10px;
   background-color: #f7ebe3;
-  padding: 7px 10px 0px 17px;
+  /* padding: 7px 10px 0px 17px; */
   overflow: hidden;
 }
 
@@ -120,6 +120,7 @@
   border-bottom-right-radius: 7px;
   padding: 7px 7px 0 7px;
   overflow: hidden;
+  border-collapse:separate;
 }
 
 .docFooter span {
@@ -161,6 +162,7 @@
 .entityToolsSouth {
   border-top: 2px solid #FFF;
   padding: 10px;
+  border-collapse: separate;
 }
 
 .entityToolsSouth span {

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java	2011-02-11 04:00:24 UTC (rev 1246)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java	2011-02-11 18:17:57 UTC (rev 1247)
@@ -82,8 +82,6 @@
 import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPanel;
 import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPresenter;
 import org.ourproject.kune.workspace.client.i18n.LanguageSelectorView;
-import org.ourproject.kune.workspace.client.licensefoot.EntityLicensePanel;
-import org.ourproject.kune.workspace.client.licensefoot.EntityLicensePresenter;
 import org.ourproject.kune.workspace.client.licensewizard.LicenseChangeAction;
 import org.ourproject.kune.workspace.client.licensewizard.LicenseWizard;
 import org.ourproject.kune.workspace.client.licensewizard.LicenseWizardPanel;
@@ -448,16 +446,19 @@
             }
         });
 
-        register(ApplicationComponentGroup.class, new Factory<EntityLicensePresenter>(EntityLicensePresenter.class) {
-            @Override
-            public EntityLicensePresenter create() {
-                final EntityLicensePresenter presenter = new EntityLicensePresenter(i(StateManager.class));
-                final EntityLicensePanel panel = new EntityLicensePanel(presenter, i(I18nUITranslationService.class),
-                        i(WorkspaceSkeleton.class));
-                presenter.init(panel);
-                return presenter;
-            }
-        });
+        // register(ApplicationComponentGroup.class, new
+        // Factory<EntityLicensePresenter>(EntityLicensePresenter.class) {
+        // @Override
+        // public EntityLicensePresenter create() {
+        // final EntityLicensePresenter presenter = new
+        // EntityLicensePresenter(i(StateManager.class));
+        // final EntityLicensePanel panel = new EntityLicensePanel(presenter,
+        // i(I18nUITranslationService.class),
+        // i(WorkspaceSkeleton.class));
+        // presenter.init(panel);
+        // return presenter;
+        // }
+        // });
 
         register(ApplicationComponentGroup.class, new Factory<RateIt>(RateIt.class) {
             @Override

Modified: trunk/src/main/resources/wave-server.properties
===================================================================
--- trunk/src/main/resources/wave-server.properties	2011-02-11 04:00:24 UTC (rev 1246)
+++ trunk/src/main/resources/wave-server.properties	2011-02-11 18:17:57 UTC (rev 1247)
@@ -39,7 +39,7 @@
 account_store_directory = _accounts
 
 # Currently supported delta store types: memory, file
-delta_store_type = file
+delta_store_type = memory
 
 # The location where deltas are stored on disk. This should be changed.
 # Note: This is only used when using the file delta store. It is ignored




More information about the kune-commits mailing list