[kune-commits] r1804 - in trunk: . src/main/java/cc/kune/common src/main/java/cc/kune/common/client/ui src/main/java/cc/kune/common/client/ui/dialogs src/main/java/cc/kune/core/client/auth src/main/java/cc/kune/core/client/groups/newgroup src/main/java/cc/kune/core/client/state src/main/java/cc/kune/core/client/state/impl src/main/java/cc/kune/wave/client

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Wed Mar 28 19:58:29 CEST 2012


Author: vjrj_
Date: 2012-03-28 19:58:28 +0200 (Wed, 28 Mar 2012)
New Revision: 1804

Added:
   trunk/src/main/java/cc/kune/common/client/ui/Animations.java
Modified:
   trunk/.classpath
   trunk/pom.xml
   trunk/src/main/java/cc/kune/common/KuneCommon.gwt.xml
   trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
   trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
   trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.java
   trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java
   trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
   trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
   trunk/src/main/java/cc/kune/core/client/state/StateManager.java
   trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java
   trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
Log:
CLOSED - # 227: New group close button does not work 
http://kune.ourproject.org/issues/ticket/227

Animations via GwtQuery

Modified: trunk/.classpath
===================================================================
--- trunk/.classpath	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/.classpath	2012-03-28 17:58:28 UTC (rev 1804)
@@ -76,6 +76,7 @@
   <classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-mvp-client/0.5/gwtp-mvp-client-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-mvp-client/0.5/gwtp-mvp-client-0.5-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-processors/0.5/gwtp-processors-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-processors/0.5/gwtp-processors-0.5-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-tester/0.5/gwtp-tester-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-tester/0.5/gwtp-tester-0.5-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/com/googlecode/gwtquery/gwtquery/1.1.0/gwtquery-1.1.0-2.1.0.jar" sourcepath="M2_REPO/com/googlecode/gwtquery/gwtquery/1.1.0/gwtquery-1.1.0-2.1.0-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/com/googlecode/gwtupload/gwtupload/0.6.3-compat/gwtupload-0.6.3-compat.jar" sourcepath="M2_REPO/com/googlecode/gwtupload/gwtupload/0.6.3-compat/gwtupload-0.6.3-compat-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/com/extjs/gxt/2.2.1/gxt-2.2.1.jar"/>
   <classpathentry kind="var" path="M2_REPO/com/h2database/h2/1.0.20070617/h2-1.0.20070617.jar"/>

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/pom.xml	2012-03-28 17:58:28 UTC (rev 1804)
@@ -551,13 +551,13 @@
       <artifactId>box-src</artifactId>
       <version>${wiab.version}</version>
     </dependency>
-  <dependency>
-    <groupId>org.waveprotocol</groupId>
-    <artifactId>waveinabox-server-0.3</artifactId>
-    <version>${wiab.version}</version>
-  </dependency>
     <dependency>
       <groupId>org.waveprotocol</groupId>
+      <artifactId>waveinabox-server-0.3</artifactId>
+      <version>${wiab.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.waveprotocol</groupId>
       <artifactId>gwt-util-src</artifactId>
       <version>${wiab.version}</version>
     </dependency>
@@ -709,6 +709,15 @@
       <artifactId>ical4j</artifactId>
       <version>1.0.2</version>
     </dependency>
+    <dependency>
+      <groupId>com.googlecode.gwtquery</groupId>
+      <artifactId>gwtquery</artifactId>
+      <version>1.1.0</version>
+      <!-- If you are using old versions of gwt, uncomment the appropriate 
+        line -->
+      <classifier>2.1.0</classifier>
+      <scope>provided</scope>
+    </dependency>
     <!-- openfire auth integration -->
     <!-- <dependency> -->
     <!-- <groupId>org.igniterealtime</groupId> -->

Modified: trunk/src/main/java/cc/kune/common/KuneCommon.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/common/KuneCommon.gwt.xml	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/src/main/java/cc/kune/common/KuneCommon.gwt.xml	2012-03-28 17:58:28 UTC (rev 1804)
@@ -4,7 +4,7 @@
   <inherits name='com.google.gwt.user.User'/>
   <!-- Other module inherits -->
   <!-- Specify the app entry point class. -->
-  <!-- <entry-point class='cc.kune.msgs.client.KuneMessagesSampleEntryPoint'
+  <!-- <entry-point class='cc.kune.msgs.client.KuneMessagesSampleEntryPoint' 
     /> -->
   <!-- Specify the paths for translatable code -->
   <source path="shared"/>
@@ -14,5 +14,6 @@
   <inherits name='org.cobogw.gwt.user.User'/>
   <inherits name='com.google.gwt.inject.Inject'/>
   <inherits name="com.extjs.gxt.ui.GXT"/>
+  <inherits name='com.google.gwt.query.Query'/>
   <stylesheet src="kune-common.css"/>
 </module>
\ No newline at end of file

Added: trunk/src/main/java/cc/kune/common/client/ui/Animations.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/Animations.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/common/client/ui/Animations.java	2012-03-28 17:58:28 UTC (rev 1804)
@@ -0,0 +1,28 @@
+/*
+ *
+ * Copyright (C) 2007-2012 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+package cc.kune.common.client.ui;
+
+import com.google.inject.Singleton;
+
+ at Singleton
+public class Animations {
+  public static boolean enabled = true;
+}

Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java	2012-03-28 17:58:28 UTC (rev 1804)
@@ -19,10 +19,13 @@
  */
 package cc.kune.common.client.ui.dialogs;
 
+import static com.google.gwt.query.client.GQuery.$;
+import static com.google.gwt.query.client.GQuery.Effects;
 import cc.kune.common.client.events.EventBusInstance;
 import cc.kune.common.client.shortcuts.OnEscapePressedEvent;
 import cc.kune.common.client.shortcuts.OnEscapePressedEvent.OnEscapePressedHandler;
 import cc.kune.common.client.tooltip.Tooltip;
+import cc.kune.common.client.ui.Animations;
 import cc.kune.common.client.ui.PopupTopPanel;
 import cc.kune.common.shared.utils.TextUtils;
 import cc.kune.core.client.i18n.I18n;
@@ -34,6 +37,7 @@
 import com.google.gwt.event.logical.shared.ResizeHandler;
 import com.google.gwt.event.shared.HandlerRegistration;
 import com.google.gwt.i18n.client.HasDirection.Direction;
+import com.google.gwt.query.client.Function;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.PopupPanel;
 import com.google.gwt.user.client.ui.UIObject;
@@ -182,7 +186,18 @@
   }
 
   public void hide() {
-    popup.hide();
+    if (popup.isShowing()) {
+      if (Animations.enabled) {
+        $(popup).as(Effects).slideUp(new Function() {
+          @Override
+          public void f() {
+            popup.hide();
+          }
+        });
+      } else {
+        popup.hide();
+      }
+    }
   }
 
   public void recalculateSize() {
@@ -197,7 +212,7 @@
         @Override
         public void onOnEscapePressed(final OnEscapePressedEvent event) {
           if (popup.isShowing()) {
-            popup.hide();
+            hide();
           }
         }
       });
@@ -205,7 +220,7 @@
         closeClickHandler = super.getCloseBtn().addClickHandler(new ClickHandler() {
           @Override
           public void onClick(final ClickEvent event) {
-            popup.hide();
+            hide();
           }
         });
       }
@@ -274,10 +289,24 @@
 
   public void showCentered() {
     Tooltip.hideCurrent();
+    showEffect();
     popup.showCentered();
   }
 
+  private void showEffect() {
+    if (Animations.enabled) {
+      $(popup).stop(true).show();
+      // $(popup).stop(true).hide().as(Effects).slideDown(new Function() {
+      // @Override
+      // public void f() {
+      // }
+      // });
+    }
+  }
+
   public void showRelativeTo(final UIObject object) {
+    showEffect();
     popup.showRelativeTo(object);
   }
+
 }

Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/src/main/java/cc/kune/core/client/auth/RegisterPresenter.java	2012-03-28 17:58:28 UTC (rev 1804)
@@ -106,10 +106,9 @@
     if (!session.isLogged()) {
       NotifyUser.showProgress();
       getView().show();
-      // getView().center();
       NotifyUser.hideProgress();
     } else {
-      stateManager.restorePreviousToken();
+      stateManager.restorePreviousToken(false);
     }
   }
 

Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.java	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.java	2012-03-28 17:58:28 UTC (rev 1804)
@@ -36,10 +36,10 @@
 public abstract class SignInAbstractPresenter<V extends View, Proxy_ extends Proxy<?>> extends
     Presenter<View, Proxy<?>> {
 
-  protected final LoginRememberManager loginRemember;
   protected final CookiesManager cookiesManager;
   private String gotoTokenOnCancel;
   protected final I18nUITranslationService i18n;
+  protected final LoginRememberManager loginRemember;
   protected final Session session;
   protected final StateManager stateManager;
 
@@ -81,7 +81,7 @@
         stateManager.gotoHistoryToken(gotoTokenOnCancel);
         gotoTokenOnCancel = null;
       } else {
-        stateManager.redirectOrRestorePreviousToken();
+        stateManager.redirectOrRestorePreviousToken(false);
       }
     }
   }
@@ -96,7 +96,6 @@
     session.setCurrentLanguage(language);
     i18n.changeToLanguageIfNecessary(language.getCode(), language.getEnglishName(), true,
         new I18nLanguageChangeNeeded() {
-
           @Override
           public void onChangeNeeded() {
           }
@@ -106,7 +105,7 @@
             if (gotoHomePage) {
               stateManager.gotoStateToken(new StateToken(userInfoDTO.getHomePage()).clearDocument());
             } else {
-              stateManager.redirectOrRestorePreviousToken();
+              stateManager.redirectOrRestorePreviousToken(false);
             }
           }
         });

Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java	2012-03-28 17:58:28 UTC (rev 1804)
@@ -248,7 +248,7 @@
     registerProvider.get().hide();
     registerProvider.get().setGotoTokenOnCancel(this.getGotoTokenOnCancel());
     if (session.isLogged()) {
-      stateManager.restorePreviousToken();
+      stateManager.restorePreviousToken(false);
     } else {
       eventBus.fireEvent(new ProgressShowEvent());
       getView().show();

Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java	2012-03-28 17:58:28 UTC (rev 1804)
@@ -76,9 +76,10 @@
 
   private TextField<String> shortNameField;
   private TextField<String> tag1;
-  private TextField<String> tag2;
-  private TextField<String> tag3;
 
+  // private TextField<String> tag2;
+  // private TextField<String> tag3;
+
   @Inject
   public NewGroupPanel(final I18nTranslationService i18n, final NotifyLevelImages img,
       final MaskWidgetView mask, final GroupFieldFactory groupFieldFactory) {
@@ -251,7 +252,6 @@
   @Override
   public void hide() {
     dialog.hide();
-
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java	2012-03-28 17:58:28 UTC (rev 1804)
@@ -67,6 +67,7 @@
   private final GroupOptions groupOptions;
   private final Provider<GroupServiceAsync> groupService;
   private final I18nTranslationService i18n;
+  private boolean justCreatedAGroup;
   private final Session session;
   private final Provider<SignIn> signIn;
   private final StateManager stateManager;
@@ -87,6 +88,7 @@
 
   @Override
   public void doNewGroup() {
+    justCreatedAGroup = false;
     session.check(new AsyncCallbackSimple<Void>() {
       @Override
       public void onSuccess(final Void result) {
@@ -96,7 +98,6 @@
           getView().focusOnShorName();
           NotifyUser.hideProgress();
         } else {
-          // stateManager.restorePreviousToken();
           signIn.get().setErrorMessage(i18n.t(CoreMessages.REGISTER_TO_CREATE_A_GROUP), NotifyLevel.info);
           signIn.get().showSignInDialog();
         }
@@ -142,11 +143,14 @@
 
   public void onCancel() {
     getView().hide();
-    stateManager.redirectOrRestorePreviousToken();
+    getView().unMask();
   }
 
   public void onClose() {
     reset();
+    if (!justCreatedAGroup) {
+      stateManager.redirectOrRestorePreviousToken(false);
+    }
   }
 
   private void onRegister() {
@@ -189,9 +193,9 @@
 
         @Override
         public void onSuccess(final StateAbstractDTO state) {
+          justCreatedAGroup = true;
           stateManager.setRetrievedStateAndGo(state);
           getView().hide();
-          reset();
           getView().unMask();
           // Add the new group to your info
           session.getCurrentUserInfo().getGroupsIsAdmin().add(state.getGroup());

Modified: trunk/src/main/java/cc/kune/core/client/state/StateManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManager.java	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManager.java	2012-03-28 17:58:28 UTC (rev 1804)
@@ -73,7 +73,7 @@
 
   void onToolChanged(boolean fireNow, ToolChangedEvent.ToolChangedHandler handler);
 
-  void redirectOrRestorePreviousToken();
+  void redirectOrRestorePreviousToken(boolean fireChange);
 
   void refreshCurrentState();
 
@@ -87,10 +87,18 @@
 
   void removeSiteToken(String token);
 
-  void restorePreviousToken();
+  /**
+   * Restore previous token
+   * 
+   * @param fireChange
+   *          if only change the browser #token or also fire the event
+   */
+  void restorePreviousToken(boolean fireChange);
 
   void resumeTokenChange();
 
+  void setHistoryStateToken(StateToken newToken);
+
   void setRetrievedState(StateAbstractDTO state);
 
   void setRetrievedStateAndGo(StateAbstractDTO state);

Modified: trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java	2012-03-28 17:58:28 UTC (rev 1804)
@@ -404,20 +404,20 @@
   }
 
   @Override
-  public void redirectOrRestorePreviousToken() {
+  public void redirectOrRestorePreviousToken(final boolean fireChange) {
     final String token = history.getToken();
     if (tokenMatcher.hasRedirect(token)) {
       // URL of the form signin(group.tool)
       final String previousToken = tokenMatcher.getRedirect(token).getRight();
       if (previousToken.equals(SiteTokens.WAVE_INBOX) && session.isNotLogged()) {
         // signin(inbox) && cancel
-        restorePreviousToken();
+        restorePreviousToken(fireChange);
       } else {
         history.newItem(previousToken); // FIXMEKK
       }
     } else {
       // No redirect then restore previous token
-      restorePreviousToken();
+      restorePreviousToken(fireChange);
     }
   }
 
@@ -468,9 +468,13 @@
   }
 
   @Override
-  public void restorePreviousToken() {
+  public void restorePreviousToken(final boolean fireChange) {
     if (previousGroupToken != null) {
-      gotoStateToken(previousGroupToken);
+      if (fireChange) {
+        gotoStateToken(previousGroupToken);
+      } else {
+        setHistoryStateToken(previousGroupToken);
+      }
     }
   }
 
@@ -485,6 +489,12 @@
   }
 
   @Override
+  public void setHistoryStateToken(final StateToken newToken) {
+    Log.debug("StateManager: history goto-token: " + newToken + ", previous: " + previousGroupToken);
+    history.newItem(newToken.getEncoded(), false);
+  }
+
+  @Override
   public void setRetrievedState(final StateAbstractDTO newState) {
     contentCache.cache(newState.getStateToken(), newState);
   }

Modified: trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	2012-03-28 13:41:51 UTC (rev 1803)
+++ trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	2012-03-28 17:58:28 UTC (rev 1804)
@@ -86,7 +86,7 @@
   @Inject
   public WaveStatusIndicator(final SitebarActionsPresenter sitebar, final WaveStatusAction action) {
     final IconLabelDescriptor status = new IconLabelDescriptor(action);
-    status.setPosition(1);
+    status.setPosition(0);
     sitebar.getRightToolbar().add(status);
   }
 }




More information about the kune-commits mailing list