[kune-commits] r1355 - in trunk/src/main/java/cc/kune: chat/client/actions core/client/resources core/client/sitebar/search core/client/sn/actions

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Fri May 6 16:45:24 CEST 2011


Author: vjrj_
Date: 2011-05-06 16:45:24 +0200 (Fri, 06 May 2011)
New Revision: 1355

Modified:
   trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java
   trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.java
   trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java
   trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPresenter.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java
Log:
Add buddie action workaround

Modified: trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java	2011-05-06 14:30:34 UTC (rev 1354)
+++ trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java	2011-05-06 14:45:24 UTC (rev 1355)
@@ -28,6 +28,7 @@
 import cc.kune.common.client.actions.PropertyChangeListener;
 import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
 import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.resources.CoreMessages;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateChangedEvent;
@@ -71,7 +72,7 @@
           }
         }
       });
-      putValue(Action.NAME, i18n.t("Add as a buddie"));
+      putValue(Action.NAME, i18n.t(CoreMessages.ADD_AS_A_BUDDIE));
       putValue(Action.SMALL_ICON, img.addGreen());
     }
 

Modified: trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.java	2011-05-06 14:30:34 UTC (rev 1354)
+++ trunk/src/main/java/cc/kune/core/client/resources/CoreMessages.java	2011-05-06 14:45:24 UTC (rev 1355)
@@ -20,25 +20,26 @@
 package cc.kune.core.client.resources;
 
 public final class CoreMessages {
-    public final static String BUDDIES_NOT_PUBLIC = "The social network of this user is not public";
-    public final static String EMAIL_IN_USE = "This email address is being used by another user. Please, try with another one";
-    public final static String ENT_LOGO_SELECTOR_NORMAL_TITLE = "Logo";
-    public final static String ENT_LOGO_SELECTOR_PERSON_TITLE = "Avatar";
-    public final static String FIELD_MUST_BE_BETWEEN_3_AND_15 = "The name must be between 3 and 15 lowercase characters. It can only contain Western characters and numbers";
-    public final static String GROUP_OPTIONS_DIALOG_TITLE = "Group options";
-    public final static String INCORRECT_NICKNAME_EMAIL_OR_PASSWORD = "The nickname/email/password is incorrect";
-    public final static String MEMBERS_NOT_PUBLIC = "The members of this group are not public";
-    public final static String NAME_IN_ALREADY_IN_USE = "This name is already in use. Please try with a different name";
-    public final static String NAME_IN_USE = "This name in already in use. Please try with a different name";
-    public final static String PASSWD_MUST_BE_BETWEEN_6_AND_40 = "The password must be between 6 and 40 characters";
-    public final static String REGISTER_A_NEW_GROUP_TITLE = "Register a new Group";
-    public final static String REGISTER_TITLE = "Register";
-    public final static String REGISTER_TO_CREATE_A_GROUP = "Please, sign in or register to create a group";
-    public final static String SIGN_IN_TITLE = "Sign in";
-    public final static String USER_DOESN_T_HAVE_A_HOMEPAGE = "This user does not have a homepage";
-    public final static String USER_OPTIONS_DIALOG_TITLE = "User options";
-    public final static String YOUR_HOMEPAGE = "Your homepage";
+  public final static String ADD_AS_A_BUDDIE = "Add as a buddie";
+  public final static String BUDDIES_NOT_PUBLIC = "The social network of this user is not public";
+  public final static String EMAIL_IN_USE = "This email address is being used by another user. Please, try with another one";
+  public final static String ENT_LOGO_SELECTOR_NORMAL_TITLE = "Logo";
+  public final static String ENT_LOGO_SELECTOR_PERSON_TITLE = "Avatar";
+  public final static String FIELD_MUST_BE_BETWEEN_3_AND_15 = "The name must be between 3 and 15 lowercase characters. It can only contain Western characters and numbers";
+  public final static String GROUP_OPTIONS_DIALOG_TITLE = "Group options";
+  public final static String INCORRECT_NICKNAME_EMAIL_OR_PASSWORD = "The nickname/email/password is incorrect";
+  public final static String MEMBERS_NOT_PUBLIC = "The members of this group are not public";
+  public final static String NAME_IN_ALREADY_IN_USE = "This name is already in use. Please try with a different name";
+  public final static String NAME_IN_USE = "This name in already in use. Please try with a different name";
+  public final static String PASSWD_MUST_BE_BETWEEN_6_AND_40 = "The password must be between 6 and 40 characters";
+  public final static String REGISTER_A_NEW_GROUP_TITLE = "Register a new Group";
+  public final static String REGISTER_TITLE = "Register";
+  public final static String REGISTER_TO_CREATE_A_GROUP = "Please, sign in or register to create a group";
+  public final static String SIGN_IN_TITLE = "Sign in";
+  public final static String USER_DOESN_T_HAVE_A_HOMEPAGE = "This user does not have a homepage";
+  public final static String USER_OPTIONS_DIALOG_TITLE = "User options";
+  public final static String YOUR_HOMEPAGE = "Your homepage";
 
-    private CoreMessages() {
-    }
+  private CoreMessages() {
+  }
 }

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java	2011-05-06 14:30:34 UTC (rev 1354)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java	2011-05-06 14:45:24 UTC (rev 1355)
@@ -110,6 +110,11 @@
   }
 
   @Override
+  public void focus() {
+    searchTextBox.setFocus(true);
+  }
+
+  @Override
   public HasClickHandlers getButton() {
     return searchButton;
   }

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPresenter.java	2011-05-06 14:30:34 UTC (rev 1354)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPresenter.java	2011-05-06 14:45:24 UTC (rev 1355)
@@ -49,6 +49,8 @@
 
     void clearSearchText();
 
+    void focus();
+
     HasClickHandlers getButton();
 
     HasAllFocusHandlers getFocus();
@@ -83,6 +85,10 @@
     getView().setTextSearchSmall();
   }
 
+  public void focus() {
+    getView().focus();
+  }
+
   @Override
   protected void onBind() {
     super.onBind();

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java	2011-05-06 14:30:34 UTC (rev 1354)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java	2011-05-06 14:45:24 UTC (rev 1355)
@@ -4,26 +4,33 @@
 import cc.kune.common.client.actions.Action;
 import cc.kune.common.client.actions.ActionEvent;
 import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.core.client.resources.CoreMessages;
 import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.sitebar.search.SitebarSearchPresenter;
 import cc.kune.core.shared.i18n.I18nTranslationService;
 
 import com.google.inject.Inject;
+import com.google.inject.Provider;
 
 public class AddNewBuddiesAction extends AbstractExtendedAction {
 
-    private final I18nTranslationService i18n;
+  private final I18nTranslationService i18n;
+  private final Provider<SitebarSearchPresenter> searcher;
 
-    @Inject
-    public AddNewBuddiesAction(final I18nTranslationService i18n, final CoreResources res) {
-        this.i18n = i18n;
-        putValue(Action.NAME, i18n.t("Add a new buddy"));
-        putValue(Action.SMALL_ICON, res.addGreen());
-    }
+  @Inject
+  public AddNewBuddiesAction(final I18nTranslationService i18n, final CoreResources res,
+      final Provider<SitebarSearchPresenter> searcher) {
+    this.i18n = i18n;
+    this.searcher = searcher;
+    putValue(Action.NAME, i18n.t("Add a new buddy"));
+    putValue(Action.SMALL_ICON, res.addGreen());
+  }
 
-    @Override
-    public void actionPerformed(final ActionEvent event) {
-        NotifyUser.info(i18n.t(TextUtils.IN_DEVELOPMENT));
-    }
+  @Override
+  public void actionPerformed(final ActionEvent event) {
+    NotifyUser.info(i18n.t("Search the user you want to add and in his/her homepage press '"
+        + CoreMessages.ADD_AS_A_BUDDIE + "'"));
+    searcher.get().focus();
+  }
 
 }




More information about the kune-commits mailing list