Author: dongxu
Date: Thu Sep 12 03:15:43 2013
New Revision: 1522180

URL: http://svn.apache.org/r1522180
Log:
remove gwt-incubator dependency in Messages List Model; 
make activities singleton, seems better

Modified:
    
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageListActivity.java
    
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ioc/AppGinModule.java
    
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/IMAPMessageListView.java

Modified: 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageListActivity.java
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageListActivity.java?rev=1522180&r1=1522179&r2=1522180&view=diff
==============================================================================
--- 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageListActivity.java
 (original)
+++ 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/IMAPMessageListActivity.java
 Thu Sep 12 03:15:43 2013
@@ -382,6 +382,7 @@ package org.apache.hupa.client.activity;
 =======
 >>>>>>> try to fetch messages, yet can not fire the login event in ModelTable 
 >>>>>>> such that just get a NullPointerException in it.
 
+<<<<<<< HEAD
 import java.util.ArrayList;
 
 <<<<<<< HEAD
@@ -392,6 +393,8 @@ import net.customware.gwt.dispatch.clien
 =======
 >>>>>>> Make chechsession and login work with RF, with refactoring fetch 
 >>>>>>> folders.
 import org.apache.hupa.client.HandlerRegistrationAdapter;
+=======
+>>>>>>> remove gwt-incubator dependency in Messages List Model; 
 import org.apache.hupa.client.activity.MessageSendActivity.Type;
 import org.apache.hupa.client.place.MailFolderPlace;
 import org.apache.hupa.client.place.MessageSendPlace;
@@ -402,7 +405,6 @@ import org.apache.hupa.client.rf.MoveMes
 import org.apache.hupa.client.rf.SetFlagRequest;
 import org.apache.hupa.client.ui.WidgetDisplayable;
 import org.apache.hupa.client.widgets.HasDialog;
-import org.apache.hupa.shared.data.MessageImpl;
 import org.apache.hupa.shared.data.MessageImpl.IMAPFlag;
 import org.apache.hupa.shared.domain.DeleteMessageAllAction;
 import org.apache.hupa.shared.domain.DeleteMessageByUidAction;
@@ -414,7 +416,6 @@ import org.apache.hupa.shared.domain.Mov
 import org.apache.hupa.shared.domain.SetFlagAction;
 import org.apache.hupa.shared.domain.User;
 import org.apache.hupa.shared.events.DecreaseUnseenEvent;
-import org.apache.hupa.shared.events.ExpandMessageEvent;
 import org.apache.hupa.shared.events.FolderSelectionEvent;
 import org.apache.hupa.shared.events.FolderSelectionEventHandler;
 import org.apache.hupa.shared.events.IncreaseUnseenEvent;
@@ -503,6 +504,7 @@ import com.google.gwt.event.dom.client.C
 import com.google.gwt.event.dom.client.HasChangeHandlers;
 import com.google.gwt.event.dom.client.HasClickHandlers;
 import com.google.gwt.event.shared.EventBus;
+<<<<<<< HEAD
 import com.google.gwt.gen2.table.event.client.HasPageChangeHandlers;
 import com.google.gwt.gen2.table.event.client.HasPageLoadHandlers;
 import com.google.gwt.gen2.table.event.client.HasRowSelectionHandlers;
@@ -519,16 +521,15 @@ import com.google.gwt.gen2.table.event.c
 >>>>>>> Change to new mvp framework - first step
 =======
 >>>>>>> 
+=======
+>>>>>>> remove gwt-incubator dependency in Messages List Model; 
 import com.google.gwt.place.shared.PlaceController;
 import com.google.gwt.user.client.ui.AcceptsOneWidget;
 import com.google.gwt.user.client.ui.HasValue;
-import com.google.gwt.user.client.ui.SourcesTableEvents;
-import com.google.gwt.user.client.ui.TableListener;
 import com.google.inject.Inject;
 import com.google.inject.Provider;
 import com.google.web.bindery.requestfactory.shared.Receiver;
 
-@SuppressWarnings("deprecation")
 public class IMAPMessageListActivity extends AbstractActivity {
 
 <<<<<<< HEAD
@@ -1240,10 +1241,6 @@ public class IMAPMessageListActivity ext
        }
 
        public interface Displayable extends WidgetDisplayable {
-               public HasRowSelectionHandlers getDataTableSelection();
-               public HasPageLoadHandlers getDataTableLoad();
-               public void addTableListener(TableListener listener);
-               public void removeTableListener(TableListener listener);
                public void setPostFetchMessageCount(int count);
                public HasClickHandlers getNewClick();
                public Message getData(int rowIndex);
@@ -1268,7 +1265,6 @@ public class IMAPMessageListActivity ext
                public HasEnable getMarkUnseenEnable();
                public HasClickHandlers getRefreshClick();
                public void redraw();
-               public HasPageChangeHandlers getDataTablePageChange();
                public void goToPage(int page);
                public int getCurrentPage();
                public int getRowsPerPageIndex();

Modified: 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ioc/AppGinModule.java
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ioc/AppGinModule.java?rev=1522180&r1=1522179&r2=1522180&view=diff
==============================================================================
--- 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ioc/AppGinModule.java
 (original)
+++ 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ioc/AppGinModule.java
 Thu Sep 12 03:15:43 2013
@@ -390,6 +390,7 @@ public class AppGinModule extends Abstra
 <<<<<<< HEAD
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
 =======
 =======
                bind(TopActivity.Displayable.class).to(TopView.class);
@@ -412,7 +413,16 @@ public class AppGinModule extends Abstra
 >>>>>>> forward and reply message to use RF
 
                bind(WestActivity.class).in(Singleton.class);
+=======
+               
+               bind(LoginActivity.class).in(Singleton.class);
+>>>>>>> remove gwt-incubator dependency in Messages List Model; 
                bind(TopActivity.class).in(Singleton.class);
+               bind(WestActivity.class).in(Singleton.class);
+               bind(IMAPMessageListActivity.class).in(Singleton.class);
+               bind(MessageSendActivity.class).in(Singleton.class);
+               bind(IMAPMessageActivity.class).in(Singleton.class);
+
 
                
bind(PagingScrollTableRowDragController.class).in(Singleton.class);
                bind(MessageTableModel.class).in(Singleton.class);

Modified: 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/IMAPMessageListView.java
URL: 
http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/IMAPMessageListView.java?rev=1522180&r1=1522179&r2=1522180&view=diff
==============================================================================
--- 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/IMAPMessageListView.java
 (original)
+++ 
james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/IMAPMessageListView.java
 Thu Sep 12 03:15:43 2013
@@ -22,6 +22,7 @@ package org.apache.hupa.client.ui;
 <<<<<<< HEAD
 <<<<<<< HEAD
 <<<<<<< HEAD
+<<<<<<< HEAD
 import java.util.List;
 import java.util.Set;
 =======
@@ -34,6 +35,8 @@ import java.util.ArrayList;
 =======
 >>>>>>> clean some code. Pager issue remain
 import java.util.Date;
+=======
+>>>>>>> remove gwt-incubator dependency in Messages List Model; 
 import java.util.List;
 >>>>>>> Change to new mvp framework - first step
 
@@ -82,12 +85,10 @@ import org.apache.hupa.client.rf.FetchMe
 import org.apache.hupa.client.rf.HupaRequestFactory;
 import org.apache.hupa.client.widgets.CommandsBar;
 import org.apache.hupa.client.widgets.ConfirmDialogBox;
-import org.apache.hupa.client.widgets.DragRefetchPagingScrollTable;
 import org.apache.hupa.client.widgets.EnableButton;
 import org.apache.hupa.client.widgets.HasDialog;
 import org.apache.hupa.shared.data.ImapFolderImpl;
 import org.apache.hupa.shared.data.MessageImpl;
-import org.apache.hupa.shared.data.MessageImpl.IMAPFlag;
 import org.apache.hupa.shared.domain.FetchMessagesAction;
 import org.apache.hupa.shared.domain.FetchMessagesResult;
 import org.apache.hupa.shared.domain.ImapFolder;
@@ -106,7 +107,6 @@ import org.apache.hupa.shared.events.Log
 import org.apache.hupa.shared.events.MessagesReceivedEvent;
 import org.apache.hupa.widgets.ui.HasEnable;
 import org.apache.hupa.widgets.ui.Loading;
-import org.apache.hupa.widgets.ui.PagingOptions;
 import org.cobogw.gwt.user.client.ui.Button;
 import org.cobogw.gwt.user.client.ui.ButtonBar;
 
@@ -125,6 +125,7 @@ import com.google.gwt.cell.client.TextCe
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.core.client.Scheduler;
 import com.google.gwt.core.client.Scheduler.ScheduledCommand;
+<<<<<<< HEAD
 >>>>>>> use CellTable to deal with MessageTableModel, even a few issues
 =======
 >>>>>>> fix the CellTable display
@@ -135,6 +136,8 @@ import com.google.gwt.core.client.Schedu
 >>>>>>> clean some code. Pager issue remain
 import com.google.gwt.event.dom.client.ChangeEvent;
 import com.google.gwt.event.dom.client.ChangeHandler;
+=======
+>>>>>>> remove gwt-incubator dependency in Messages List Model; 
 import com.google.gwt.event.dom.client.HasChangeHandlers;
 import com.google.gwt.event.dom.client.HasClickHandlers;
 import com.google.gwt.event.dom.client.KeyCodes;
@@ -145,6 +148,10 @@ import com.google.gwt.event.dom.client.K
 <<<<<<< HEAD
 import com.google.gwt.event.shared.EventBus;
 <<<<<<< HEAD
+<<<<<<< HEAD
+=======
+import com.google.gwt.user.cellview.client.ColumnSortEvent.ListHandler;
+>>>>>>> remove gwt-incubator dependency in Messages List Model; 
 import com.google.gwt.user.cellview.client.SimplePager;
 import com.google.gwt.user.cellview.client.SimplePager.TextLocation;
 import com.google.gwt.user.client.ui.Anchor;
@@ -155,6 +162,10 @@ import com.google.gwt.user.client.ui.Hor
 import com.google.gwt.user.client.ui.ListBox;
 import com.google.gwt.user.client.ui.MultiWordSuggestOracle;
 import com.google.gwt.user.client.ui.SuggestBox;
+<<<<<<< HEAD
+=======
+import com.google.gwt.user.client.ui.VerticalPanel;
+>>>>>>> remove gwt-incubator dependency in Messages List Model; 
 import com.google.gwt.user.client.ui.Widget;
 import com.google.gwt.view.client.CellPreviewEvent;
 import com.google.gwt.view.client.CellPreviewEvent.Handler;
@@ -1606,11 +1617,6 @@ public class IMAPMessageListView extends
        @SuppressWarnings("unused") private HupaMessages messages;
        private HupaImageBundle imageBundle;
 
-//     private PagingOptions pagingBar;
-//     private DragRefetchPagingScrollTable<Message> mailTable;
-//     private CachedTableModel<Message> cTableModel;
-
-       private FixedWidthGrid dataTable = createDataTable();
        private EnableButton deleteMailButton;
        private Button newMailButton;
        private Button deleteAllMailButton;
@@ -1873,100 +1879,6 @@ public class IMAPMessageListView extends
                initWidget(msgListContainer);
        }
 
-       /**
-        * @return the newly created data table.
-        */
-       private FixedWidthGrid createDataTable() {
-               FixedWidthGrid dataTable = new FixedWidthGrid();
-               dataTable.setSelectionPolicy(SelectionPolicy.CHECKBOX);
-               return dataTable;
-       }
-
-       
-       /**
-        * ColumnDefination which display if the message contains an attachment
-        * 
-        * @author Norman
-        * 
-        */
-       private static final class AttachmentColumnDefination extends 
AbstractColumnDefinition<Message, Boolean> {
-
-               @Override
-               public Boolean getCellValue(Message rowValue) {
-                       return rowValue.hasAttachment();
-               }
-
-               @Override
-               public void setCellValue(Message rowValue, Boolean cellValue) {
-               }
-
-       }
-
-       /**
-        * ColumnDefination which display the From
-        * 
-        */
-       private static final class FromColumnDefination extends 
AbstractColumnDefinition<Message, String> {
-
-               @Override
-               public String getCellValue(Message rowValue) {
-                       return rowValue.getFrom();
-               }
-
-               @Override
-               public void setCellValue(Message rowValue, String cellValue) {
-                       rowValue.setFrom(cellValue);
-               }
-
-       }
-
-       /**
-        * ColumnDefination which display the Subject
-        * 
-        */
-       private static final class SubjectColumnDefination extends 
AbstractColumnDefinition<Message, String> {
-
-               @Override
-               public String getCellValue(Message rowValue) {
-                       return rowValue.getSubject();
-               }
-
-               @Override
-               public void setCellValue(Message rowValue, String cellValue) {
-                       rowValue.setSubject(cellValue);
-
-               }
-
-       }
-
-       /**
-        * ColumnDefination which display the Date
-        * 
-        */
-       private static final class DateColumnDefination extends 
AbstractColumnDefinition<Message, Date> {
-
-               @Override
-               public Date getCellValue(Message rowValue) {
-                       return rowValue.getReceivedDate();
-               }
-
-               @Override
-               public void setCellValue(Message rowValue, Date cellValue) {
-                       rowValue.setReceivedDate(cellValue);
-               }
-
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display#
-        * getDataTableSelection()
-        */
-       public HasRowSelectionHandlers getDataTableSelection() {
-               return null;
-       }
-
        public void reloadData() {
        }
 
@@ -1982,17 +1894,6 @@ public class IMAPMessageListView extends
        /*
         * (non-Javadoc)
         * 
-        * @see
-        * 
org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display#getDataTableLoad
-        * ()
-        */
-       public HasPageLoadHandlers getDataTableLoad() {
-               return null;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
         * @see 
net.customware.gwt.presenter.client.widget.WidgetDisplay#asWidget()
         */
        public Widget asWidget() {
@@ -2020,32 +1921,6 @@ public class IMAPMessageListView extends
                return newMailButton;
        }
 
-       /**
-        * Renderer which fill empty rows with a whitespace
-        * 
-        * @param <E> RowType
-        */
-       private static final class WhiteSpaceCellRenderer<E> implements 
CellRenderer<E, String> {
-
-               /*
-                * (non-Javadoc)
-                * 
-                * @see
-                * 
com.google.gwt.gen2.table.client.CellRenderer#renderRowValue(java
-                * .lang.Object, 
com.google.gwt.gen2.table.client.ColumnDefinition,
-                * 
com.google.gwt.gen2.table.client.TableDefinition.AbstractCellView)
-                */
-               public void renderRowValue(E rowValue, ColumnDefinition<E, 
String> columnDef, AbstractCellView<E> view) {
-                       String cellValue = columnDef.getCellValue(rowValue);
-                       if (cellValue == null || cellValue.length() < 1) {
-                               view.setHTML("&nbsp");
-                       } else {
-                               view.setHTML(cellValue);
-                       }
-               }
-
-       }
-
        /*
         * (non-Javadoc)
         * 
@@ -2163,27 +2038,6 @@ public class IMAPMessageListView extends
        /*
         * (non-Javadoc)
         * 
-        * @see
-        * 
org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display#addTableListener
-        * (com.google.gwt.user.client.ui.TableListener)
-        */
-       public void addTableListener(TableListener listener) {
-               dataTable.addTableListener(listener);
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display#
-        * removeTableListener(com.google.gwt.user.client.ui.TableListener)
-        */
-       public void removeTableListener(TableListener listener) {
-               dataTable.removeTableListener(listener);
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
         * @see org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display#
         * setPostFetchMessageCount(int)
         */
@@ -2302,16 +2156,6 @@ public class IMAPMessageListView extends
         * (non-Javadoc)
         * 
         * @see org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display#
-        * getDataTablePageChange()
-        */
-       public HasPageChangeHandlers getDataTablePageChange() {
-               return null;
-       }
-
-       /*
-        * (non-Javadoc)
-        * 
-        * @see org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display#
         * getRowsPerPageIndex()
         */
        public int getRowsPerPageIndex() {



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

Reply via email to