james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From don...@apache.org
Subject svn commit: r1522418 - 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:56:29 GMT
Author: dongxu
Date: Thu Sep 12 04:56:28 2013
New Revision: 1522418

URL: http://svn.apache.org/r1522418
Log:
fixed issue#74, finished to add search feature

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/SearchBoxActivity.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessageListView.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessagesCellTable.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SearchBoxView.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=1522418&r1=1522417&r2=1522418&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:56:28 2013
@@ -388,6 +388,7 @@ public class MessageListActivity extends
 		eventBus.addHandler(RefreshMessagesEvent.TYPE, new RefreshMessagesEventHandler(){
 			@Override
 			public void onRefresh(RefreshMessagesEvent event) {
+				display.setSearchValue(event.getSearchValue());
 				display.refresh();
 			}
 		});
@@ -426,6 +427,8 @@ public class MessageListActivity extends
 		List<Long> getSelectedMessagesIds();
 
 		Set<Message> getSelectedMessages();
+
+		void setSearchValue(String searchValue);
 	}
 
 	private void antiSelectMessages(Collection<Message> c) {

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/SearchBoxActivity.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/SearchBoxActivity.java?rev=1522418&r1=1522417&r2=1522418&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/SearchBoxActivity.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/SearchBoxActivity.java
Thu Sep 12 04:56:28 2013
@@ -23,15 +23,21 @@ import java.util.List;
 
 import org.apache.hupa.shared.domain.Message;
 <<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> fixed issue#74, finished to add search feature
 import org.apache.hupa.shared.events.MessagesReceivedEvent;
 import org.apache.hupa.shared.events.MessagesReceivedEventHandler;
 import org.apache.hupa.shared.events.RefreshMessagesEvent;
 
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
+<<<<<<< HEAD
 =======
 
 >>>>>>> prepare to add search feature
+=======
+>>>>>>> fixed issue#74, finished to add search feature
 import com.google.gwt.event.dom.client.HasClickHandlers;
 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.user.client.ui.AcceptsOneWidget;
@@ -44,6 +50,7 @@ public class SearchBoxActivity extends A
 	@Override
 	public void start(AcceptsOneWidget container, EventBus eventBus) {
 <<<<<<< HEAD
+<<<<<<< HEAD
 		bindTo(eventBus);
 		container.setWidget(display.asWidget());
 		
@@ -76,6 +83,36 @@ public class SearchBoxActivity extends A
 =======
 		container.setWidget(display.asWidget());
 >>>>>>> prepare to add search feature
+=======
+		bindTo(eventBus);
+		container.setWidget(display.asWidget());
+		
+	}
+
+	private void bindTo(final EventBus eventBus) {
+
+        registerHandler(display.getSearchClick().addClickHandler(new ClickHandler() {
+
+            public void onClick(ClickEvent event) {
+                String searchValue = null;
+                if (display.getSearchValue().getValue().trim().length() > 0) {
+                    searchValue = display.getSearchValue().getValue().trim();
+                }
+                eventBus.fireEvent(new RefreshMessagesEvent(searchValue));
+            }
+
+        }));
+
+        registerHandler(eventBus.addHandler(MessagesReceivedEvent.TYPE, new MessagesReceivedEventHandler()
{
+
+            public void onMessagesReceived(MessagesReceivedEvent event) {
+
+                // fill the oracle
+                display.fillSearchOracle(event.getMessages());
+            }
+
+        }));
+>>>>>>> fixed issue#74, finished to add search feature
 	}
 
 	@Inject private Displayable display;

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessageListView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessageListView.java?rev=1522418&r1=1522417&r2=1522418&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessageListView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessageListView.java Thu
Sep 12 04:56:28 2013
@@ -284,6 +284,12 @@ public class MessageListView extends Com
     public void onResize() {
         grid.onResize();
     }
+    
+    @Override
+    public void setSearchValue(String searchValue){
+    	grid.setSearchValue(searchValue);
+    	
+    }
 
 >>>>>>> Fix grid not resizing since we werent implementing RequiresResize
in its container. In fact we could get rid of its container
 }

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessagesCellTable.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessagesCellTable.java?rev=1522418&r1=1522417&r2=1522418&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessagesCellTable.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/MessagesCellTable.java
Thu Sep 12 04:56:28 2013
@@ -517,6 +517,7 @@ import org.apache.hupa.shared.domain.Fet
 import org.apache.hupa.shared.domain.FetchMessagesResult;
 import org.apache.hupa.shared.domain.ImapFolder;
 import org.apache.hupa.shared.domain.Message;
+import org.apache.hupa.shared.events.MessagesReceivedEvent;
 
 import com.google.gwt.cell.client.Cell.Context;
 import com.google.gwt.cell.client.CheckboxCell;
@@ -674,6 +675,7 @@ public class MessagesCellTable extends D
 					Scheduler.get().scheduleDeferred(new ScheduledCommand() {
 						public void execute() {
 							cacheContacts(response.getMessages());
+							eventBus.fireEvent(new MessagesReceivedEvent(f, response.getMessages()));
 						}
 					});
 				}
@@ -690,6 +692,10 @@ public class MessagesCellTable extends D
 		}
 
 	}
+	
+	public void setSearchValue(String searchValue){
+		this.searchValue = searchValue;
+	}
 
 	public final class CheckboxHeader extends Header<Boolean> {
 

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SearchBoxView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SearchBoxView.java?rev=1522418&r1=1522417&r2=1522418&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SearchBoxView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/SearchBoxView.java Thu
Sep 12 04:56:28 2013
@@ -77,9 +77,15 @@ public class SearchBoxView extends Compo
 	private Button searchButton = new Button("Search");
 	@UiField protected HorizontalPanel thisPanel;
 
+	@SuppressWarnings("deprecation")
 	public SearchBoxView() {
 		initWidget(binder.createAndBindUi(this));
 
+//        searchBox.addStyleName(HupaCSS.C_msg_search);
+        
+        searchBox.setAnimationEnabled(true);
+        searchBox.setAutoSelectEnabled(false);
+        searchBox.setLimit(20);
 		searchBox.addKeyUpHandler(new KeyUpHandler() {
 			public void onKeyUp(KeyUpEvent event) {
 				if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {

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=1522418&r1=1522417&r2=1522418&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:56:28 2013
@@ -22,6 +22,9 @@ package org.apache.hupa.shared.events;
 import com.google.gwt.event.shared.GwtEvent;
 
 <<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> fixed issue#74, finished to add search feature
 public class RefreshMessagesEvent extends GwtEvent<RefreshMessagesEventHandler> {
 	public final static Type<RefreshMessagesEventHandler> TYPE = new Type<RefreshMessagesEventHandler>();
 
@@ -45,6 +48,7 @@ public class RefreshMessagesEvent extend
 	public com.google.gwt.event.shared.GwtEvent.Type<RefreshMessagesEventHandler> getAssociatedType()
{
 		return TYPE;
 	}
+<<<<<<< HEAD
 =======
 public class RefreshMessagesEvent extends GwtEvent<RefreshMessagesEventHandler>{
     public final static Type<RefreshMessagesEventHandler> TYPE = new Type<RefreshMessagesEventHandler>();
@@ -58,5 +62,7 @@ public class RefreshMessagesEvent extend
         return TYPE;
     }
 >>>>>>> fixed issue#81, add refresh event handler
+=======
+>>>>>>> fixed issue#74, finished to add search feature
 
 }



---------------------------------------------------------------------
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