Author: dongxu Date: Thu Sep 12 04:25:13 2013 New Revision: 1522344 URL: http://svn.apache.org/r1522344 Log: make a notification timer to be able to schedule the notice with millis time.
Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaController.java 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/ui/FoldersTreeViewModel.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/NotificationView.ui.xml Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaController.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaController.java?rev=1522344&r1=1522343&r2=1522344&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaController.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/HupaController.java Thu Sep 12 04:25:13 2013 @@ -24,9 +24,13 @@ package org.apache.hupa.client; <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD import org.apache.hupa.client.activity.NotificationActivity; import org.apache.hupa.client.activity.ToolBarActivity; import org.apache.hupa.client.activity.TopBarActivity; +======= +import org.apache.hupa.client.activity.NotificationActivity; +>>>>>>> make a notification timer to be able to schedule the notice with millis time. import org.apache.hupa.client.mapper.ActivityManagerInitializer; import org.apache.hupa.client.place.ComposePlace; <<<<<<< HEAD @@ -92,6 +96,7 @@ import com.google.gwt.place.shared.Place import com.google.gwt.place.shared.PlaceHistoryHandler; <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.RootLayoutPanel; import com.google.inject.Inject; @@ -121,6 +126,9 @@ public class HupaController { this.eventBus = eventBus; ======= ======= +======= +import com.google.gwt.safehtml.shared.SafeHtml; +>>>>>>> make a notification timer to be able to schedule the notice with millis time. import com.google.gwt.user.client.Timer; >>>>>>> fixed issue#48, and add the original IdleTimer import com.google.gwt.user.client.ui.RootLayoutPanel; @@ -136,6 +144,7 @@ public class HupaController { @Inject private HupaLayoutable hupaLayout; @Inject private HupaRequestFactory requestFactory; @Inject private LoginLayoutable loginLayout; + @Inject private NotificationActivity.Displayable noticeRegion; private EventBus eventBus; private Timer noopTimer = new IdleTimer(); @@ -369,6 +378,18 @@ public class HupaController { }); } + public void showNotice(SafeHtml html, int millis){ + noticeRegion.notice(html); + if (millis > 0) + hideNotice.schedule(millis); + } + + private final Timer hideNotice = new Timer() { + public void run() { + noticeRegion.hideNotification(); + } + }; + private class IdleTimer extends Timer { boolean running = false; 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=1522344&r1=1522343&r2=1522344&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:25:13 2013 @@ -380,12 +380,12 @@ public class MessageListActivity extends assert result != null; display.getGrid().setRowCount(result.getRealCount()); display.getGrid().setRowData(start, result.getMessages()); -// Scheduler.get().scheduleDeferred(new ScheduledCommand() { -// @Override -// public void execute() { -// topBar.hideLoading(); -// } -// }); + Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override + public void execute() { + topBar.hideLoading(); + } + }); } @Override Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/FoldersTreeViewModel.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/FoldersTreeViewModel.java?rev=1522344&r1=1522343&r2=1522344&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/FoldersTreeViewModel.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/FoldersTreeViewModel.java Thu Sep 12 04:25:13 2013 @@ -21,6 +21,7 @@ package org.apache.hupa.client.ui; import java.util.List; +import org.apache.hupa.client.HupaController; import org.apache.hupa.client.activity.NotificationActivity; import org.apache.hupa.client.activity.TopBarActivity; import org.apache.hupa.client.place.MailFolderPlace; @@ -54,6 +55,7 @@ import com.google.web.bindery.requestfac public class FoldersTreeViewModel implements TreeViewModel { @Inject private HupaRequestFactory rf; + @Inject private HupaController controller; @Inject private PlaceController placeController; @Inject private TopBarActivity.Displayable topBar; @Inject private NotificationActivity.Displayable notice; @@ -69,7 +71,8 @@ public class FoldersTreeViewModel implem @Override public void onSelectionChange(SelectionChangeEvent event) { topBar.showLoading();//FIXME delay to show, why - notice.notice(SafeHtmlUtils.fromString("Hi, this is the notification test.")); + controller.showNotice(SafeHtmlUtils.fromString("Hi, this is the notification test.<a href='http://g.cn/' target='_blacnk'>Link</a>"), 3000); +// notice.notice(SafeHtmlUtils.fromString("Hi, this is the notification test.<a href='http://g.cn/' target='_blacnk'>Link</a>")); SingleSelectionModel<ImapFolder> selectionModel = (SingleSelectionModel<ImapFolder>) event.getSource(); currentFolder = selectionModel.getSelectedObject(); eventBus.fireEvent(new LoadMessagesEvent(user, selectionModel.getSelectedObject())); Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/NotificationView.ui.xml URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/NotificationView.ui.xml?rev=1522344&r1=1522343&r2=1522344&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/NotificationView.ui.xml (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/NotificationView.ui.xml Thu Sep 12 04:25:13 2013 @@ -22,9 +22,13 @@ .fontFeel { <<<<<<< HEAD +<<<<<<< HEAD z-index: 9999; ======= >>>>>>> add loading and notification bar(finishing the folder list click >>>>>>> event), related to the issue#18 +======= + z-index: 9999; +>>>>>>> make a notification timer to be able to schedule the notice with millis time. position: relative; display: inline-block; border-color: #f0c36d; --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org