james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From don...@apache.org
Subject svn commit: r1522381 - in /james/hupa/trunk/client/src/main/java/org/apache/hupa/client: activity/LabelListActivity.java ui/LabelListView.java ui/LabelPropertiesView.java
Date Thu, 12 Sep 2013 04:43:31 GMT
Author: dongxu
Date: Thu Sep 12 04:43:31 2013
New Revision: 1522381

URL: http://svn.apache.org/r1522381
Log:
refresh labels list when create/remove label in the setting place, while remove label can
not refresh now

Modified:
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LabelListActivity.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelListView.java
    james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.java

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LabelListActivity.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LabelListActivity.java?rev=1522381&r1=1522380&r2=1522381&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LabelListActivity.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/activity/LabelListActivity.java
Thu Sep 12 04:43:31 2013
@@ -131,6 +131,8 @@ import org.apache.hupa.shared.domain.Gen
 import org.apache.hupa.shared.domain.ImapFolder;
 import org.apache.hupa.shared.events.DeleteFolderEvent;
 import org.apache.hupa.shared.events.DeleteFolderEventHandler;
+import org.apache.hupa.shared.events.RefreshLabelListEvent;
+import org.apache.hupa.shared.events.RefreshLabelListEventHandler;
 
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
@@ -171,6 +173,12 @@ public class LabelListActivity extends A
 				deleteSelected();
 			}
 		});
+		eventBus.addHandler(RefreshLabelListEvent.TYPE, new RefreshLabelListEventHandler(){
+			@Override
+			public void onRefreshEvent(RefreshLabelListEvent event) {
+				display.refresh();
+			}
+		});
 	}
 
 <<<<<<< HEAD
@@ -189,6 +197,7 @@ public class LabelListActivity extends A
 		SingleSelectionModel<LabelNode> getSelectionModel();
 		HasClickHandlers getAdd();
 		HasClickHandlers getDelete();
+		void refresh();
 	}
 
 	public void deleteSelected() {
@@ -204,6 +213,7 @@ public class LabelListActivity extends A
 			@Override
 			public void onSuccess(GenericResult response) {
 				hupaController.hideTopLoading();
+				display.refresh();
 				hupaController.showNotice("The label \"" + f.getFullName() + "\" was deleted.", 10000);
 			}
 			@Override

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelListView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelListView.java?rev=1522381&r1=1522380&r2=1522381&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelListView.java (original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelListView.java Thu
Sep 12 04:43:31 2013
@@ -218,7 +218,7 @@ import com.google.web.bindery.requestfac
 import com.google.web.bindery.requestfactory.shared.ServerFailure;
 
 public class LabelListView extends Composite implements LabelListActivity.Displayable {
-	
+
 	@Inject LabelPropertiesActivity.Displayable labelProperties;
 	@UiField SimplePanel thisView;
 
@@ -281,10 +281,11 @@ public class LabelListView extends Compo
 		}
 	}
 
-	public class ImapLabelListDataProvider extends AsyncDataProvider<LabelNode> {
+	public class ImapLabelListDataProvider extends AsyncDataProvider<LabelNode> implements
HasRefresh {
 
 		private HupaRequestFactory rf;
 		private List<LabelNode> folderNodes = new ArrayList<LabelNode>();
+		HasData<LabelNode> display;
 
 		public List<LabelNode> getDataList() {
 			return Collections.unmodifiableList(folderNodes);
@@ -297,13 +298,16 @@ public class LabelListView extends Compo
 		@Override
 		public void addDataDisplay(HasData<LabelNode> display) {
 			super.addDataDisplay(display);
+			this.display = display;
 		}
 
 		@Override
 		protected void onRangeChanged(HasData<LabelNode> display) {
+
 			rf.fetchFoldersRequest().fetch(null, Boolean.TRUE).fire(new Receiver<List<ImapFolder>>()
{
 				@Override
 				public void onSuccess(List<ImapFolder> response) {
+					folderNodes.clear();
 					if (response == null || response.size() == 0) {
 						updateRowCount(-1, true);
 					} else {
@@ -337,6 +341,11 @@ public class LabelListView extends Compo
 
 			});
 		}
+
+		@Override
+		public void refresh() {
+			this.onRangeChanged(display);
+		}
 	}
 
 <<<<<<< HEAD
@@ -364,13 +373,19 @@ public class LabelListView extends Compo
 	}
 
 <<<<<<< HEAD
+<<<<<<< HEAD
+=======
+>>>>>>> refresh labels list when create/remove label in the setting
place, while remove label can not refresh now
 	@Override
 	public void refresh() {
 		data.refresh();
 	}
 
+<<<<<<< HEAD
 =======
 >>>>>>> make label settings prototype
 =======
 >>>>>>> make delete label in label setting work(backend now)
+=======
+>>>>>>> refresh labels list when create/remove label in the setting
place, while remove label can not refresh now
 }

Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.java?rev=1522381&r1=1522380&r2=1522381&view=diff
==============================================================================
--- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.java
(original)
+++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/ui/LabelPropertiesView.java
Thu Sep 12 04:43:31 2013
@@ -46,6 +46,7 @@ import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.HasClickHandlers;
 <<<<<<< HEAD
+<<<<<<< HEAD
 import com.google.gwt.event.shared.EventBus;
 =======
 import org.apache.hupa.client.activity.LabelListActivity;
@@ -61,6 +62,9 @@ import com.google.gwt.event.dom.client.C
 >>>>>>> add rename RF to label setting feature
 =======
 >>>>>>> make add of label setting work in backend
+=======
+import com.google.gwt.event.shared.EventBus;
+>>>>>>> refresh labels list when create/remove label in the setting
place, while remove label can not refresh now
 import com.google.gwt.uibinder.client.UiBinder;
 import com.google.gwt.uibinder.client.UiField;
 import com.google.gwt.uibinder.client.UiHandler;
@@ -101,7 +105,11 @@ public class LabelPropertiesView extends
 <<<<<<< HEAD
 	@Inject HupaController hc;
 	@Inject EventBus eventBus;
+<<<<<<< HEAD
 
+=======
+	
+>>>>>>> refresh labels list when create/remove label in the setting
place, while remove label can not refresh now
 	@UiField TextBox name;
 	private String path;
 
@@ -213,6 +221,7 @@ public class LabelPropertiesView extends
 				@Override
 				public void onSuccess(GenericResult response) {
 					hc.hideTopLoading();
+					eventBus.fireEvent(new RefreshLabelListEvent());
 					hc.showNotice("The label \"" + f.getFullName() + "\" has been renamed to "+name.getText(),
10000);
 				}
 				@Override
@@ -231,6 +240,7 @@ public class LabelPropertiesView extends
 				@Override
 				public void onSuccess(GenericResult response) {
 					hc.hideTopLoading();
+					eventBus.fireEvent(new RefreshLabelListEvent());
 					hc.showNotice("The label \"" + f.getFullName() + "\" was created.", 10000);
 				}
 				@Override



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