james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From don...@apache.org
Subject svn commit: r1522410 - in /james/hupa/trunk: client/src/main/java/org/apache/hupa/client/activity/ client/src/main/java/org/apache/hupa/client/ui/ shared/src/main/java/org/apache/hupa/shared/events/
Date Thu, 12 Sep 2013 04:53:34 GMT
Author: dongxu
Date: Thu Sep 12 04:53:34 2013
New Revision: 1522410

URL: http://svn.apache.org/r1522410
Log:
fixed issue#81, add refresh event handler

Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/MessageListActivity.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ToolBarActivity.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.java
    james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/RefreshMessagesEvent.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/MessageListActivity.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/MessageListActivity.java?rev=1522410&r1=1522409&r2=1522410&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/MessageListActivity.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/MessageListActivity.java
Thu Sep 12 04:53:34 2013
@@ -299,7 +299,10 @@ import org.apache.hupa.shared.domain.Use
 import org.apache.hupa.shared.events.DeleteClickEvent;
 import org.apache.hupa.shared.events.DeleteClickEventHandler;
 import org.apache.hupa.shared.events.ExpandMessageEvent;
+import org.apache.hupa.shared.events.RefreshMessagesEvent;
+import org.apache.hupa.shared.events.RefreshMessagesEventHandler;
 import org.apache.hupa.shared.events.RefreshUnreadEvent;
+import org.apache.hupa.shared.events.RefreshUnreadEventHandler;
 
 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.user.client.ui.AcceptsOneWidget;
@@ -382,6 +385,13 @@ public class MessageListActivity extends
 				deleteSelectedMessages();
 			}
 		});
+		
+		eventBus.addHandler(RefreshMessagesEvent.TYPE, new RefreshMessagesEventHandler(){
+			@Override
+			public void onRefresh(RefreshMessagesEvent event) {
+				display.refresh();
+			}
+		});
 
 	}
 

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ToolBarActivity.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ToolBarActivity.java?rev=1522410&r1=1522409&r2=1522410&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ToolBarActivity.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/ToolBarActivity.java
Thu Sep 12 04:53:34 2013
@@ -28,6 +28,7 @@ import java.util.List;
 
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
 import org.apache.hupa.client.place.FolderPlace;
 =======
 =======
@@ -44,6 +45,8 @@ import org.apache.hupa.client.place.Mail
 =======
 >>>>>>> fixed issue#57 - really disable the tools in toolbar
 =======
+=======
+>>>>>>> fixed issue#81, add refresh event handler
 import org.apache.hupa.client.place.FolderPlace;
 >>>>>>> try to make messages list better for user experience
 import org.apache.hupa.client.rf.SetFlagRequest;
@@ -72,6 +75,7 @@ public class ToolBarActivity extends App
 	@Inject private Displayable display;
 	@Inject private MessagesCellTable table;
 	@Inject private MessageListActivity.Displayable messagesDisplay;
+<<<<<<< HEAD
 	private String folderName;
 
 	@Override
@@ -212,6 +216,8 @@ public class ToolBarActivity extends App
 	@Inject private MessagesCellTable table;
 	@Inject private MessageListActivity.Displayable messagesDisplay;
 	@Inject private HupaController hupaController;
+=======
+>>>>>>> fixed issue#81, add refresh event handler
 	private String folderName;
 
 	@Override
@@ -233,16 +239,20 @@ public class ToolBarActivity extends App
 	}
 
 <<<<<<< HEAD
+<<<<<<< HEAD
 	@Inject private Displayable display;
 	
 	public interface Displayable extends WidgetDisplayable {}
 >>>>>>> integrate all of the views to their corresponding activities
and mappers
 =======
 	private void bindTo(EventBus eventBus) {
+=======
+	private void bindTo(final EventBus eventBus) {
+>>>>>>> fixed issue#81, add refresh event handler
 		registerHandler(display.getMarkRead().addClickHandler(new ClickHandler() {
 			@Override
 			public void onClick(ClickEvent event) {
-				hupaController.showTopLoading("Loading");
+				hc.showTopLoading("Loading");
 				toMarkRead(true);
 				display.getPopup().hide();
 			}
@@ -250,11 +260,20 @@ public class ToolBarActivity extends App
 		registerHandler(display.getMarkUnread().addClickHandler(new ClickHandler() {
 			@Override
 			public void onClick(ClickEvent event) {
-				hupaController.showTopLoading("Loading");
+				hc.showTopLoading("Loading");
 				toMarkRead(false);
 				display.getPopup().hide();
 			}
 		}));
+
+		registerHandler(display.getRefresh().addClickHandler(new ClickHandler() {
+			@Override
+			public void onClick(ClickEvent event) {
+				hc.showTopLoading("Loading");
+				eventBus.fireEvent(new RefreshMessagesEvent());
+				eventBus.fireEvent(new RefreshUnreadEvent());
+			}
+		}));
 	}
 
 	protected void toMarkRead(boolean read) {
@@ -278,7 +297,7 @@ public class ToolBarActivity extends App
 			public void onSuccess(GenericResult response) {
 				eventBus.fireEvent(new RefreshUnreadEvent());
 				messagesDisplay.refresh();
-				hupaController.hideTopLoading();
+				hc.hideTopLoading();
 			}
 		});
 	}
@@ -297,6 +316,8 @@ public class ToolBarActivity extends App
 		void enableSendingTools(boolean is);
 		void enableDealingTools(boolean is);
 		void enableAllTools(boolean is);
+
+		HasClickHandlers getRefresh();
 		HasClickHandlers getReply();
 		HasClickHandlers getReplyAll();
 		HasClickHandlers getForward();

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.java?rev=1522410&r1=1522409&r2=1522410&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/ToolBarView.java Thu Sep
12 04:53:34 2013
@@ -744,16 +744,21 @@ public class ToolBarView extends Composi
 
 	private static ToolBarUiBinder binder = GWT.create(ToolBarUiBinder.class);
 <<<<<<< HEAD
+<<<<<<< HEAD
 
 <<<<<<< HEAD
 <<<<<<< HEAD
 <<<<<<< HEAD
 <<<<<<< HEAD
 <<<<<<< HEAD
+=======
+
+>>>>>>> fixed issue#81, add refresh event handler
 	@Override
 	public HasClickHandlers getRefresh() {
 		return refresh;
 	}
+<<<<<<< HEAD
 =======
 >>>>>>> make login page as one part of the overall layout & splite
layout to little one
 =======
@@ -796,4 +801,6 @@ public class ToolBarView extends Composi
 >>>>>>> scrub code
 =======
 >>>>>>> done issue#72, get back the unread count
+=======
+>>>>>>> fixed issue#81, add refresh event handler
 }

Modified: james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/RefreshMessagesEvent.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/RefreshMessagesEvent.java?rev=1522410&r1=1522409&r2=1522410&view=diff
==============================================================================
--- james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/RefreshMessagesEvent.java
(original)
+++ james/hupa/trunk/shared/src/main/java/org/apache/hupa/shared/events/RefreshMessagesEvent.java
Thu Sep 12 04:53:34 2013
@@ -21,6 +21,7 @@ package org.apache.hupa.shared.events;
 
 import com.google.gwt.event.shared.GwtEvent;
 
+<<<<<<< HEAD
 public class RefreshMessagesEvent extends GwtEvent<RefreshMessagesEventHandler> {
 	public final static Type<RefreshMessagesEventHandler> TYPE = new Type<RefreshMessagesEventHandler>();
 
@@ -44,5 +45,18 @@ public class RefreshMessagesEvent extend
 	public com.google.gwt.event.shared.GwtEvent.Type<RefreshMessagesEventHandler> getAssociatedType()
{
 		return TYPE;
 	}
+=======
+public class RefreshMessagesEvent extends GwtEvent<RefreshMessagesEventHandler>{
+    public final static Type<RefreshMessagesEventHandler> TYPE = new Type<RefreshMessagesEventHandler>();
+    @Override
+    protected void dispatch(RefreshMessagesEventHandler handler) {
+        handler.onRefresh(this);
+    }
+
+    @Override
+    public com.google.gwt.event.shared.GwtEvent.Type<RefreshMessagesEventHandler> getAssociatedType()
{
+        return TYPE;
+    }
+>>>>>>> fixed issue#81, add refresh event handler
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message