[xwiki-notifications] r8801 - in xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client: . ui/dialog

lucaa (SVN) notifications at xwiki.org
Tue Apr 1 01:39:19 CEST 2008


Author: lucaa
Date: 2008-04-01 01:39:19 +0200 (Tue, 01 Apr 2008)
New Revision: 8801

Modified:
   xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/Watch.java
   xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/FeedDeleteDialog.java
Log:
XWATCH-115: Feed Deletion
* Added a more proper refresh mechanism when a feed is deleted
* Included refreshing the tag cloud when articles are deleted


Modified: xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/Watch.java
===================================================================
--- xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/Watch.java	2008-03-31 20:36:33 UTC (rev 8800)
+++ xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/Watch.java	2008-03-31 23:39:19 UTC (rev 8801)
@@ -326,6 +326,27 @@
     }
 
     /**
+     * A feed has been deleted: we must update the FilterStatus (remove the feed as the currently
+     * selected feed) and refresh interface objects impacted by this: feed tree,
+     * article list and the tag cloud if the articles of the feed have also been deleted.
+     *  
+     * @param feed deleted feed
+     * @param withArticles true if articles fetched for this feed have also been deleted,
+     *        false otherwise
+     */
+    public void refreshOnFeedDelete(Feed feed, boolean withArticles) {
+        getFilterStatus().setFeed(null);
+        getFilterStatus().setGroup(null);
+        getFilterStatus().setStart(0);
+        refreshFeedTree();
+        refreshArticleList();
+        if (withArticles) {
+            //do some other interface updates
+            refreshTagCloud();
+        }
+    }
+
+    /**
      * A group has been clicked. We need to:
      *  - invalidate the feed setting
      *  - invalidate the start number

Modified: xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/FeedDeleteDialog.java
===================================================================
--- xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/FeedDeleteDialog.java	2008-03-31 20:36:33 UTC (rev 8800)
+++ xwiki-products/xwiki-watch/trunk/gwt/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/FeedDeleteDialog.java	2008-03-31 23:39:19 UTC (rev 8801)
@@ -78,15 +78,13 @@
                 public void onFailure(Throwable throwable)
                 {
                     super.onFailure(throwable);
-                    ((Watch)app).refreshFeedTree();
-                    ((Watch)app).refreshArticleList();
                 }
                 public void onSuccess(Object o)
                 {
                     super.onSuccess(o);
                     endDialog2();
-                    ((Watch)app).refreshFeedTree();
-                    ((Watch)app).refreshArticleList();
+                    ((Watch)this.app).refreshOnFeedDelete(FeedDeleteDialog.this.feed,
+                            FeedDeleteDialog.this.deleteArticlesCheckBox.isChecked());
                 }
             });
     }



More information about the notifications mailing list