Author: jvelociter
Date: 2007-10-14 16:08:20 +0200 (Sun, 14 Oct 2007)
New Revision: 5391
Modified:
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/Watch.java
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/WatchWidget.java
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/articles/ArticleListWidget.java
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/AddGroupDialog.java
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/AddKeywordDialog.java
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/FeedDialog.java
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/menu/TagCloudWidget.java
Log:
XWATCH-33 Automatically refresh the keyword menu when adding a new keyword
through the dialog
XWATCH-44 Display group pretty name in the add keyword dialog instead of group
page name
Moved some copyright headers sections at the very top of the files (were after
imports)
Modified:
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/Watch.java
===================================================================
---
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/Watch.java
2007-10-13 14:09:17 UTC (rev 5390)
+++
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/Watch.java
2007-10-14 14:08:20 UTC (rev 5391)
@@ -253,14 +253,19 @@
newArticlesMonitoring.stopBlinking();
}
- public void refreshConfig() {
+ /**
+ * Refresh the feed tree UI.
+ * First refresh the configuration that holds the state of feeds lists and
group
+ * Then refresh the user interface that displays the feed tree
+ */
+ public void refreshFeedTree() {
config.refreshConfig(new XWikiAsyncCallback(this) {
public void onSuccess(Object object) {
super.onSuccess(object);
+ // Refresh the feed tree with refreshed config data
userInterface.refreshData("feedtree");
// Load the number of articles for each feed
config.refreshArticleNumber();
- // Refresh tag cloud aynchronously
}
});
}
@@ -346,15 +351,20 @@
}
public void refreshOnNewFeed() {
- refreshConfig();
+ refreshFeedTree();
}
public void refreshOnNewKeyword() {
- refreshConfig();
+ config.refreshConfig(new XWikiAsyncCallback(this) {
+ public void onSuccess(Object object) {
+ super.onSuccess(object);
+ userInterface.refreshData("keywords");
+ }
+ });
}
public void refreshOnNewGroup() {
- refreshConfig();
+ refreshFeedTree();
}
public void refreshOnResetFilter() {
Modified:
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
===================================================================
---
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
2007-10-13 14:09:17 UTC (rev 5390)
+++
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/data/DataManager.java
2007-10-14 14:08:20 UTC (rev 5391)
@@ -80,7 +80,7 @@
if (!((Boolean)object).booleanValue())
cb.onFailure(null);
else
- cb.onSuccess(pageName);
+ cb.onSuccess(pageName);
}
});
}
Modified:
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/WatchWidget.java
===================================================================
---
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/WatchWidget.java
2007-10-13 14:09:17 UTC (rev 5390)
+++
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/WatchWidget.java
2007-10-14 14:08:20 UTC (rev 5391)
@@ -1,10 +1,3 @@
-package com.xpn.xwiki.watch.client.ui;
-
-import com.xpn.xwiki.watch.client.Watch;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.Panel;
-import com.google.gwt.user.client.ui.FlowPanel;
-
/**
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
@@ -23,10 +16,17 @@
* License along with this software;if not,write to the Free
* Software Foundation,Inc.,51 Franklin St,Fifth Floor,Boston,MA
* 02110-1301 USA,or see the FSF site:http://www.fsf.org.
- *
- * @author ldubost
*/
+package com.xpn.xwiki.watch.client.ui;
+import com.xpn.xwiki.watch.client.Watch;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Panel;
+import com.google.gwt.user.client.ui.FlowPanel;
+
+/**
+ * Watch base user interface Widget.
+ */
public class WatchWidget extends Composite {
protected Watch watch;
protected Panel panel = new FlowPanel();
Modified:
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/articles/ArticleListWidget.java
===================================================================
---
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/articles/ArticleListWidget.java
2007-10-13 14:09:17 UTC (rev 5390)
+++
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/articles/ArticleListWidget.java
2007-10-14 14:08:20 UTC (rev 5391)
@@ -1,26 +1,4 @@
package com.xpn.xwiki.watch.client.ui.articles;
-
-import com.xpn.xwiki.watch.client.ui.WatchWidget;
-import com.xpn.xwiki.watch.client.ui.menu.ActionBarWidget;
-import com.xpn.xwiki.watch.client.ui.menu.NavigationBarWidget;
-import com.xpn.xwiki.watch.client.ui.dialog.CommentAddDialog;
-import com.xpn.xwiki.watch.client.ui.dialog.EditTagsDialog;
-import com.xpn.xwiki.watch.client.Watch;
-import com.xpn.xwiki.watch.client.FilterStatus;
-import com.xpn.xwiki.watch.client.Constants;
-import com.xpn.xwiki.watch.client.Feed;
-import com.xpn.xwiki.watch.client.data.FeedArticle;
-import com.xpn.xwiki.watch.client.data.FeedArticleComment;
-import com.xpn.xwiki.gwt.api.client.app.XWikiAsyncCallback;
-import com.xpn.xwiki.gwt.api.client.Document;
-import com.xpn.xwiki.gwt.api.client.dialog.Dialog;
-import com.google.gwt.user.client.ui.*;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-import java.util.List;
-
-
/**
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
@@ -43,6 +21,26 @@
* @author ldubost
*/
+import com.xpn.xwiki.watch.client.ui.WatchWidget;
+import com.xpn.xwiki.watch.client.ui.menu.ActionBarWidget;
+import com.xpn.xwiki.watch.client.ui.menu.NavigationBarWidget;
+import com.xpn.xwiki.watch.client.ui.dialog.CommentAddDialog;
+import com.xpn.xwiki.watch.client.ui.dialog.EditTagsDialog;
+import com.xpn.xwiki.watch.client.Watch;
+import com.xpn.xwiki.watch.client.FilterStatus;
+import com.xpn.xwiki.watch.client.Constants;
+import com.xpn.xwiki.watch.client.Feed;
+import com.xpn.xwiki.watch.client.data.FeedArticle;
+import com.xpn.xwiki.watch.client.data.FeedArticleComment;
+import com.xpn.xwiki.gwt.api.client.app.XWikiAsyncCallback;
+import com.xpn.xwiki.gwt.api.client.Document;
+import com.xpn.xwiki.gwt.api.client.dialog.Dialog;
+import com.google.gwt.user.client.ui.*;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+import java.util.List;
+
public class ArticleListWidget extends WatchWidget {
public ArticleListWidget() {
Modified:
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/AddGroupDialog.java
===================================================================
---
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/AddGroupDialog.java
2007-10-13 14:09:17 UTC (rev 5390)
+++
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/AddGroupDialog.java
2007-10-14 14:08:20 UTC (rev 5391)
@@ -95,12 +95,12 @@
((Watch)app).addGroup(group, new AsyncCallback() {
public void onFailure(Throwable throwable) {
// There should already have been an error display
- ((Watch)app).refreshConfig();
+ ((Watch)app).refreshFeedTree();
}
public void onSuccess(Object object) {
endDialog2();
- ((Watch)app).refreshConfig();
+ ((Watch)app).refreshFeedTree();
}
});
}
Modified:
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/AddKeywordDialog.java
===================================================================
---
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/AddKeywordDialog.java
2007-10-13 14:09:17 UTC (rev 5390)
+++
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/AddKeywordDialog.java
2007-10-14 14:08:20 UTC (rev 5391)
@@ -1,18 +1,3 @@
-package com.xpn.xwiki.watch.client.ui.dialog;
-
-import com.xpn.xwiki.gwt.api.client.app.XWikiGWTApp;
-import com.xpn.xwiki.gwt.api.client.dialog.Dialog;
-import com.xpn.xwiki.watch.client.Feed;
-import com.xpn.xwiki.watch.client.Watch;
-import com.google.gwt.user.client.ui.*;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Map;
-import java.util.Iterator;
-
/**
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
@@ -31,10 +16,19 @@
* License along with this software;if not,write to the Free
* Software Foundation,Inc.,51 Franklin St,Fifth Floor,Boston,MA
* 02110-1301 USA,or see the FSF site:http://www.fsf.org.
- *
- * @author ldubost
*/
+package com.xpn.xwiki.watch.client.ui.dialog;
+import com.xpn.xwiki.gwt.api.client.app.XWikiGWTApp;
+import com.xpn.xwiki.gwt.api.client.dialog.Dialog;
+import com.xpn.xwiki.watch.client.Watch;
+import com.google.gwt.user.client.ui.*;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+import java.util.Map;
+import java.util.Iterator;
+
public class AddKeywordDialog extends Dialog {
protected TextBox keywordTextBox = new TextBox();
protected ListBox groupListBox = new ListBox();
@@ -110,7 +104,7 @@
String groupname = (String) it.next();
if (!groupname.equals(all)) {
String grouptitle = (String) groupMap.get(groupname);
- groupListBox.addItem(groupname, grouptitle);
+ groupListBox.addItem(grouptitle,groupname);
if (group.equals(groupname)) {
selected = true;
groupListBox.setItemSelected(groupListBox.getItemCount(),
true);
@@ -129,14 +123,16 @@
if (updateData()) {
setCurrentResult(keyword);
((Watch)app).addKeyword(keyword, group, new AsyncCallback() {
- public void onFailure(Throwable throwable) {
+ public void onFailure(Throwable throwable)
+ {
// There should already have been an error display
- ((Watch)app).refreshConfig();
}
-
- public void onSuccess(Object object) {
+
+ public void onSuccess(Object object)
+ {
endDialog2();
- ((Watch)app).refreshConfig();
+ // We don't need to refresh keywords here as it as been
taken care by the addKeyword call
+ //((Watch)app).refreshOnNewKeyword()
}
});
}
Modified:
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/FeedDialog.java
===================================================================
---
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/FeedDialog.java
2007-10-13 14:09:17 UTC (rev 5390)
+++
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/dialog/FeedDialog.java
2007-10-14 14:08:20 UTC (rev 5391)
@@ -79,12 +79,12 @@
((Watch)app).addFeed(feed, new AsyncCallback() {
public void onFailure(Throwable throwable) {
// There should already have been an error display
- ((Watch)app).refreshConfig();
+ ((Watch)app).refreshFeedTree();
}
public void onSuccess(Object object) {
endDialog2();
- ((Watch)app).refreshConfig();
+ ((Watch)app).refreshFeedTree();
// this will force a reload of feeds on the server
((Watch)app).forceServerLoading();
}
Modified:
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/menu/TagCloudWidget.java
===================================================================
---
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/menu/TagCloudWidget.java
2007-10-13 14:09:17 UTC (rev 5390)
+++
xwiki-products/xwiki-watch/trunk/web/src/main/java/com/xpn/xwiki/watch/client/ui/menu/TagCloudWidget.java
2007-10-14 14:08:20 UTC (rev 5391)
@@ -1,15 +1,3 @@
-package com.xpn.xwiki.watch.client.ui.menu;
-
-import com.google.gwt.user.client.ui.*;
-import com.xpn.xwiki.watch.client.Watch;
-import com.xpn.xwiki.watch.client.ui.WatchWidget;
-import com.xpn.xwiki.gwt.api.client.app.XWikiAsyncCallback;
-
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Iterator;
-
/**
* See the NOTICE file distributed with this work for additional
* information regarding copyright ownership.
@@ -28,10 +16,19 @@
* License along with this software;if not,write to the Free
* Software Foundation,Inc.,51 Franklin St,Fifth Floor,Boston,MA
* 02110-1301 USA,or see the FSF site:http://www.fsf.org.
- *
- * @author ldubost
*/
+package com.xpn.xwiki.watch.client.ui.menu;
+import com.google.gwt.user.client.ui.*;
+import com.xpn.xwiki.watch.client.Watch;
+import com.xpn.xwiki.watch.client.ui.WatchWidget;
+import com.xpn.xwiki.gwt.api.client.app.XWikiAsyncCallback;
+
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+
public class TagCloudWidget extends WatchWidget {
private Map tagsLink = new HashMap();
_______________________________________________
notifications mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/notifications