Author: dongxu Date: Thu Sep 12 02:49:47 2013 New Revision: 1522147 URL: http://svn.apache.org/r1522147 Log: At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same.
Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/CachingDispatchAsync.java 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/activity/LoginActivity.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/WestActivity.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/mvp/CachingWestActivityMapper.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainContentActivityMapper.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/place/MailInboxPlace.java Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/CachingDispatchAsync.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/CachingDispatchAsync.java?rev=1522147&r1=1522146&r2=1522147&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/CachingDispatchAsync.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/CachingDispatchAsync.java Thu Sep 12 02:49:47 2013 @@ -85,6 +85,7 @@ public class CachingDispatchAsync extend } else { running.add(clz); <<<<<<< HEAD +<<<<<<< HEAD ======= // if (action instanceof FetchMessages) { // new RuntimeException().printStackTrace(); @@ -170,6 +171,11 @@ public class CachingDispatchAsync extend return; } else { running.add(clz); +======= +// if (action instanceof FetchMessages) { +// new RuntimeException().printStackTrace(); +// } +>>>>>>> At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same. super.execute(action, new AsyncCallback<R>() { public void onFailure(Throwable caught) { running.remove(clz); 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=1522147&r1=1522146&r2=1522147&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 02:49:47 2013 @@ -509,6 +509,7 @@ public class IMAPMessageListActivity ext private final EventBus eventBus; private final PlaceController placeController; <<<<<<< HEAD +<<<<<<< HEAD private DispatchAsync dispatcher; private final Provider<MessageSendPlace> messageSendPlaceProvider; @@ -531,15 +532,16 @@ public class IMAPMessageListActivity ext private void bind(){ ======= private final Provider<MailInboxPlace> mailInboxPlaceProvider; +======= +>>>>>>> At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same. private DispatchAsync dispatcher; @Inject public IMAPMessageListActivity(Displayable display, EventBus eventBus, PlaceController placeController, - Provider<MailInboxPlace> mailInboxPlaceProvider, DispatchAsync dispatcher){ + DispatchAsync dispatcher){ this.display = display; this.eventBus = eventBus; this.placeController = placeController; - this.mailInboxPlaceProvider = mailInboxPlaceProvider; this.dispatcher = dispatcher; @@ -777,8 +779,8 @@ public class IMAPMessageListActivity ext } @Override public void start(AcceptsOneWidget container, EventBus eventBus) { - revealDisplay(user, folder, searchValue); bind(); + revealDisplay(user, folder, searchValue); container.setWidget(display.asWidget()); } @@ -997,10 +999,15 @@ public class IMAPMessageListActivity ext } }); } - public IMAPMessageListActivity with(User user){ + public IMAPMessageListActivity with(User user, IMAPFolder imapFolder, String string){ this.user = user; +<<<<<<< HEAD this.folder = new IMAPFolder(user.getSettings().getInboxFolderName()); >>>>>>> Change to new mvp framework - first step +======= + this.folder = imapFolder; + this.searchValue = string; +>>>>>>> At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same. return this; } Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LoginActivity.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LoginActivity.java?rev=1522147&r1=1522146&r2=1522147&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LoginActivity.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LoginActivity.java Thu Sep 12 02:49:47 2013 @@ -147,7 +147,6 @@ public class LoginActivity extends Abstr private final Displayable display; private final EventBus eventBus; private final PlaceController placeController; - private final Provider<MailInboxPlace> mailInboxPlaceProvider; private DispatchAsync dispatcher; private HupaConstants constants = GWT.create(HupaConstants.class); @@ -158,12 +157,15 @@ public class LoginActivity extends Abstr >>>>>>> change the LOGIN progress using native MVP instead of gwt-presenter ======= public LoginActivity(Displayable display, EventBus eventBus, PlaceController placeController, +<<<<<<< HEAD Provider<MailInboxPlace> mailInboxPlaceProvider, DispatchAsync dispatcher) { >>>>>>> Change to new mvp framework - first step +======= + DispatchAsync dispatcher) { +>>>>>>> At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same. this.display = display; this.eventBus = eventBus; this.placeController = placeController; - this.mailInboxPlaceProvider = mailInboxPlaceProvider; this.dispatcher = dispatcher; <<<<<<< HEAD <<<<<<< HEAD @@ -327,8 +329,13 @@ public class LoginActivity extends Abstr >>>>>>> change the LOGIN progress using native MVP instead of gwt-presenter ======= // eventBus.fireEvent(new LoginEvent(result.getUser())); +<<<<<<< HEAD LoginActivity.this.placeController.goTo(mailInboxPlaceProvider.get().with(result.getUser())); >>>>>>> Change to new mvp framework - first step +======= +// LoginActivity.this.placeController.goTo(mailInboxPlaceProvider.get().with(result.getUser())); + LoginActivity.this.placeController.goTo(new MailInboxPlace("!").with(result.getUser())); +>>>>>>> At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same. doReset(); } Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/WestActivity.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/WestActivity.java?rev=1522147&r1=1522146&r2=1522147&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/WestActivity.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/WestActivity.java Thu Sep 12 02:49:47 2013 @@ -398,6 +398,7 @@ public class WestActivity extends Abstra private final PlaceController placeController; <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD private final Provider<IMAPMessagePlace> IMAPMessagePlaceProvider; private final Provider<MessageSendPlace> messageSendPlaceProvider; private final Provider<IMAPMessagePlace> messagePlaceProvider; @@ -421,6 +422,8 @@ public class WestActivity extends Abstra ======= ======= private final Provider<MailInboxPlace> mailInboxPlaceProvider; +======= +>>>>>>> At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same. private final Provider<IMAPMessagePlace> IMAPMessagePlaceProvider; private final Provider<MessageSendPlace> messageSendPlaceProvider; >>>>>>> @@ -435,17 +438,22 @@ public class WestActivity extends Abstra @Inject public WestActivity(Displayable display, EventBus eventBus, PlaceController placeController, <<<<<<< HEAD +<<<<<<< HEAD DispatchAsync dispatcher){ >>>>>>> Change to new mvp framework - first step ======= DispatchAsync dispatcher,Provider<MailInboxPlace> mailInboxPlaceProvider,Provider<IMAPMessagePlace> IMAPMessagePlaceProvider,Provider<MessageSendPlace> messageSendPlaceProvider){ >>>>>>> +======= + DispatchAsync dispatcher,Provider<IMAPMessagePlace> IMAPMessagePlaceProvider,Provider<MessageSendPlace> messageSendPlaceProvider){ +>>>>>>> At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same. this.dispatcher = dispatcher; this.display = display; this.eventBus = eventBus; this.placeController = placeController; <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD this.IMAPMessagePlaceProvider = IMAPMessagePlaceProvider; this.messageSendPlaceProvider = messageSendPlaceProvider; this.messagePlaceProvider = messagePlaceProvider; @@ -453,6 +461,8 @@ public class WestActivity extends Abstra >>>>>>> Change to new mvp framework - first step ======= this.mailInboxPlaceProvider = mailInboxPlaceProvider; +======= +>>>>>>> At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same. this.IMAPMessagePlaceProvider = IMAPMessagePlaceProvider; this.messageSendPlaceProvider = messageSendPlaceProvider; >>>>>>> @@ -839,8 +849,12 @@ public class WestActivity extends Abstra ======= folder = new IMAPFolder(user.getSettings().getInboxFolderName());; searchValue = null; +<<<<<<< HEAD showMessageTable(user, folder, searchValue); >>>>>>> +======= +// showMessageTable(user, folder, searchValue); +>>>>>>> At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same. } }); @@ -930,7 +944,10 @@ public class WestActivity extends Abstra this.user = user; this.folder = folder; this.searchValue = searchValue; - placeController.goTo(mailInboxPlaceProvider.get().with(user)); + placeController.goTo(new MailInboxPlace().with(user,folder, searchValue)); +// placeController.goTo(mailInboxPlaceProvider.get().with(user)); +// System.out.println("111"); +// placeController.goTo(new MailInboxPlace(folder.getName()).with(user)); } private void showMessage(User user, IMAPFolder folder, Message message, MessageDetails details) { 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=1522147&r1=1522146&r2=1522147&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 02:49:47 2013 @@ -129,9 +129,13 @@ import org.apache.hupa.client.activity.W import org.apache.hupa.client.dnd.PagingScrollTableRowDragController; import org.apache.hupa.client.mvp.AppPlaceHistoryMapper; import org.apache.hupa.client.mvp.CachingTopActivityMapper; +import org.apache.hupa.client.mvp.CachingWestActivityMapper; import org.apache.hupa.client.mvp.MainContentActivityMapper; +<<<<<<< HEAD import org.apache.hupa.client.mvp.WestActivityMapper; >>>>>>> Change to new mvp framework - first step +======= +>>>>>>> At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same. import org.apache.hupa.client.place.DefaultPlace; import org.apache.hupa.client.ui.AppLayout; import org.apache.hupa.client.ui.AppLayoutImpl; @@ -423,11 +427,15 @@ public class AppGinModule extends Abstra @Provides @Singleton @Named("WestRegion") +<<<<<<< HEAD public ActivityManager getVerticalMasterRegionActivityMapper(WestActivityMapper activityMapper, >>>>>>> Change to new mvp framework - first step ======= public ActivityManager getWestRegionActivityMapper(WestActivityMapper activityMapper, >>>>>>> introduce the top activity +======= + public ActivityManager getWestRegionActivityMapper(CachingWestActivityMapper activityMapper, +>>>>>>> At first make the inbox work, but only when click the refresh button. The page also be working, the other folder will be like the same. EventBus eventBus) { return new ActivityManager(activityMapper, eventBus); } Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/CachingWestActivityMapper.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/CachingWestActivityMapper.java?rev=1522147&r1=1522146&r2=1522147&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/CachingWestActivityMapper.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/CachingWestActivityMapper.java Thu Sep 12 02:49:47 2013 @@ -20,7 +20,7 @@ public class CachingWestActivityMapper i FilteredActivityMapper.Filter filter = new FilteredActivityMapper.Filter() { @Override public Place filter(Place place) { - return place instanceof DefaultPlace ? place : new MailInboxPlace(null); // FIXME with user + return place instanceof MailInboxPlace ? new MailInboxPlace("!").with(((MailInboxPlace)place).getUser()): place; // FIXME with user } }; Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainContentActivityMapper.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainContentActivityMapper.java?rev=1522147&r1=1522146&r2=1522147&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainContentActivityMapper.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainContentActivityMapper.java Thu Sep 12 02:49:47 2013 @@ -25,7 +25,14 @@ public class MainContentActivityMapper i public Activity getActivity(Place place) { if (place instanceof MailInboxPlace) { - return messageListActivityProvider.get().with(((MailInboxPlace) place).getUser()); +// return messageListActivityProvider.get().with(((MailInboxPlace) place).getUser()); + + MailInboxPlace p = ((MailInboxPlace)place); + if(p.getMailId().equalsIgnoreCase("inbox")){ + return messageListActivityProvider.get().with(p.getUser(),p.getFolder(), p.getSearchValue()); + } else if(p.getMailId().equalsIgnoreCase("trash")){ + return messageListActivityProvider.get().with(p.getUser(),p.getFolder(), p.getSearchValue()); + } } else if (place instanceof DefaultPlace) { return loginActivityProvider.get(); } Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/place/MailInboxPlace.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/place/MailInboxPlace.java?rev=1522147&r1=1522146&r2=1522147&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/place/MailInboxPlace.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/place/MailInboxPlace.java Thu Sep 12 02:49:47 2013 @@ -1,5 +1,6 @@ package org.apache.hupa.client.place; +import org.apache.hupa.shared.data.IMAPFolder; import org.apache.hupa.shared.data.User; import com.google.gwt.place.shared.Place; @@ -12,15 +13,13 @@ public class MailInboxPlace extends Plac private User user; private String mailId; - public MailInboxPlace(){ - this.mailId = ""; - } public MailInboxPlace(String token){ this.mailId = token; } public String getMailId(){ return mailId; } + public MailInboxPlace(){} /** * equality test based on Class type, to let different instance of this @@ -30,18 +29,18 @@ public class MailInboxPlace extends Plac * the place to compare with * @return true if this place and otherPlace are of the same Class type */ - @Override - public boolean equals(Object otherPlace) { - return this == otherPlace || (otherPlace != null && getClass() == otherPlace.getClass()); - } - - @Override - public int hashCode() { - return PREFIX.hashCode(); - } +// @Override +// public boolean equals(Object otherPlace) { +// return this == otherPlace || (otherPlace != null && getClass() == otherPlace.getClass()); +// } +// +// @Override +// public int hashCode() { +// return (PREFIX+mailId).hashCode(); +// } public String toString() { - return this.getClass().getName() + "->[Inbox]"; + return this.getClass().getName() + "->[Inbox]" + mailId; } public MailInboxPlace with(User user) { @@ -66,4 +65,20 @@ public class MailInboxPlace extends Plac return place.getMailId(); } } + private IMAPFolder folder; + private String searchValue; + + public IMAPFolder getFolder() { + return folder; + } + public String getSearchValue() { + return searchValue; + } + public MailInboxPlace with(User user, IMAPFolder folder, String searchValue) { + this.folder = folder; + this.searchValue = searchValue; + this.user = user; + this.mailId = folder.getName(); + return this; + } } --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org