james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r834974 - in /james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp: IMAPMessageListPresenter.java IMAPMessageListView.java place/IMAPMessageListPresenterPlace.java
Date Wed, 11 Nov 2009 17:19:04 GMT
Author: norman
Date: Wed Nov 11 17:19:04 2009
New Revision: 834974

URL: http://svn.apache.org/viewvc?rev=834974&view=rev
Log:
better handling of history updates

Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/IMAPMessageListPresenterPlace.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java?rev=834974&r1=834973&r2=834974&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java
Wed Nov 11 17:19:04 2009
@@ -264,7 +264,7 @@
             public void onFolderSelectionEvent(FolderSelectionEvent event) {
                 folder = event.getFolder();
                 user = event.getUser();
-                firePresenterRevealedEvent(true);
+                firePresenterChangedEvent();
             }
             
         }));
@@ -296,14 +296,16 @@
         registerHandler(new HandlerRegistrationAdapter(display.getDataTablePageChange().addPageChangeHandler(new
PageChangeHandler() {
 
             public void onPageChange(PageChangeEvent event) {
-                firePresenterRevealedEvent(true);
+                //firePresenterRevealedEvent(true);
+                firePresenterChangedEvent();
             }
             
         })));
         registerHandler(display.getRowsPerPageChange().addChangeHandler(new ChangeHandler()
{
 
             public void onChange(ChangeEvent event) {
-                firePresenterRevealedEvent(true);
+                //firePresenterRevealedEvent(true);
+                firePresenterChangedEvent();
             }
             
         }));
@@ -361,16 +363,17 @@
 
     @Override
     protected void onRevealDisplay() {
-        display.reloadData();
-        
+        display.reloadData();  
     }
     
     public void revealDisplay(User user, IMAPFolder folder) {
         this.user = user;
+       
         if (this.folder == null || this.folder.getFullName().equals(folder.getFullName())
== false) {
             display.reset();
             display.deselectAllMessages();
         }
+        
         this.folder = folder;
         revealDisplay();
     }

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java?rev=834974&r1=834973&r2=834974&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java
Wed Nov 11 17:19:04 2009
@@ -21,9 +21,7 @@
 
 import java.util.ArrayList;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 
 import org.apache.hupa.client.HupaConstants;
 import org.apache.hupa.client.HupaMessages;
@@ -32,8 +30,8 @@
 import org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display;
 import org.apache.hupa.client.widgets.ConfirmDialogBox;
 import org.apache.hupa.client.widgets.DragRefetchPagingScrollTable;
-import org.apache.hupa.client.widgets.HasDialog;
 import org.apache.hupa.client.widgets.EnableButton;
+import org.apache.hupa.client.widgets.HasDialog;
 import org.apache.hupa.client.widgets.PagingOptions;
 import org.apache.hupa.client.widgets.DragRefetchPagingScrollTable.DragHandlerFactory;
 import org.apache.hupa.shared.data.Message;
@@ -71,8 +69,6 @@
 import com.google.gwt.gen2.table.event.client.PageLoadHandler;
 import com.google.gwt.gen2.table.event.client.RowCountChangeEvent;
 import com.google.gwt.gen2.table.event.client.RowCountChangeHandler;
-import com.google.gwt.gen2.table.event.client.RowSelectionEvent;
-import com.google.gwt.gen2.table.event.client.RowSelectionHandler;
 import com.google.gwt.i18n.client.DateTimeFormat;
 import com.google.gwt.user.client.Window;
 import com.google.gwt.user.client.ui.Composite;
@@ -688,7 +684,9 @@
      * @see org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display#goToPage(int)
      */
     public void goToPage(int page) {
-        mailTable.gotoPage(page, false);
+        if (page != mailTable.getCurrentPage()) {
+            mailTable.gotoPage(page, false);
+        }
     }
     
     /*
@@ -720,11 +718,13 @@
      * @see org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display#setRowsPerPageIndex(int)
      */
     public void setRowsPerPageIndex(int index) {
-        if (pageBox.getItemCount() < index) {
-            index = 0;
+        if (pageBox.getItemCount() >= index) {
+            if (index != pageBox.getSelectedIndex()) {
+                pageBox.setSelectedIndex(index);
+                mailTable.setPageSize(Integer.parseInt(pageBox.getItemText(index)));
+            }
         }             
-        pageBox.setSelectedIndex(index);
-        mailTable.setPageSize(Integer.parseInt(pageBox.getItemText(index)));
+        
     }
 
     /*

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/IMAPMessageListPresenterPlace.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/IMAPMessageListPresenterPlace.java?rev=834974&r1=834973&r2=834974&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/IMAPMessageListPresenterPlace.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/place/IMAPMessageListPresenterPlace.java
Wed Nov 11 17:19:04 2009
@@ -47,6 +47,9 @@
         int page = 0;
         try {
             page = Integer.parseInt(request.getParameter(PAGE, "0"));
+            if (page < 0 ) {
+                page = 0;
+            }
         } catch (NumberFormatException e) {
             // ignore
         }
@@ -55,6 +58,9 @@
         int rowsPerPageIndex = 0;
         try {
             rowsPerPageIndex = Integer.parseInt(request.getParameter(ROWS_PER_PAGE_INDEX,
"0"));
+            if (rowsPerPageIndex < 0) {
+                rowsPerPageIndex = 0;
+            }
         } catch (NumberFormatException e) {
             // ignore
         }



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