[hg] main-silver: Issue #231219 - changed query paging in dashbo...

  • From: Jan Peska < >
  • To:
  • Subject: [hg] main-silver: Issue #231219 - changed query paging in dashbo...
  • Date: Fri, 21 Jun 2013 04:47:15 -0700

changeset 2640f4603c15 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/2640f4603c15
description:
        Issue #231219 - changed query paging in dashboard has no effect until 
restart (refresh maybe?)
        Init paging also for queries if the task limit setting is changed

diffstat:

 
bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/ClosedRepositoryNode.java
 |   2 +-
 
bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/DashboardViewer.java
      |  12 +++++---
 
bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/RepositoryNode.java
       |  13 ++++++++-
 3 files changed, 19 insertions(+), 8 deletions(-)

diffs (100 lines):

diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/ClosedRepositoryNode.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/ClosedRepositoryNode.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/ClosedRepositoryNode.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/ClosedRepositoryNode.java
@@ -60,7 +60,7 @@
     }
 
     @Override
-    void updateContent() {
+    void updateContent(boolean initPaging) {
     }
 
     @Override
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/DashboardViewer.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/DashboardViewer.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/DashboardViewer.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/DashboardViewer.java
@@ -238,7 +238,7 @@
             REQUEST_PROCESSOR.post(new Runnable() {
                 @Override
                 public void run() {
-                    updateContent();
+                    updateContent(true);
                 }
             });
         } else if 
(evt.getPropertyName().equals(DashboardSettings.AUTO_SYNC_SETTINGS_CHANGED)) {
@@ -788,7 +788,7 @@
         if (refresh) {
             taskHits = 0;
             persistExpanded = !wasForceExpand;
-            updateContent();
+            updateContent(false);
             persistExpanded = true;
             return taskHits;
         } else {
@@ -799,7 +799,7 @@
     private int manageApplyFilter(boolean refresh) {
         if (refresh) {
             taskHits = 0;
-            updateContent();
+            updateContent(false);
             return taskHits;
         } else {
             return -1;
@@ -1098,17 +1098,19 @@
         model.removeRoot(node);
     }
 
-    private void updateContent() {
+    private void updateContent(boolean initPaging) {
         synchronized (LOCK_CATEGORIES) {
             for (CategoryNode categoryNode : categoryNodes) {
+                if (initPaging) {
                 categoryNode.initPaging();
+                }
                 categoryNode.updateContent();
             }
             setCategories(categoryNodes);
         }
         synchronized (LOCK_REPOSITORIES) {
             for (RepositoryNode repositoryNode : repositoryNodes) {
-                repositoryNode.updateContent();
+                repositoryNode.updateContent(initPaging);
             }
             setRepositories(repositoryNodes);
         }
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/RepositoryNode.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/RepositoryNode.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/RepositoryNode.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/RepositoryNode.java
@@ -338,8 +338,11 @@
         return repository.getDisplayName();
     }
 
-    void updateContent() {
+    void updateContent(boolean initPaging) {
         updateNodes();
+        if (initPaging) {
+            initPaging();
+        }
         refreshChildren();
     }
 
@@ -364,12 +367,18 @@
         refresh();
     }
 
+    private void initPaging() {
+        for (QueryNode queryNode : queryNodes) {
+            queryNode.initPaging();
+        }
+    }
+
     private class RepositoryListener implements PropertyChangeListener {
 
         @Override
         public void propertyChange(PropertyChangeEvent evt) {
             if 
(evt.getPropertyName().equals(RepositoryImpl.EVENT_QUERY_LIST_CHANGED)) {
-                updateContent();
+                updateContent(false);
             } else if 
(evt.getPropertyName().equals(RepositoryImpl.EVENT_ATTRIBUTES_CHANGED)) {
                 if (evt.getNewValue() instanceof Map) {
                     Map<String, String> attributes = (Map<String, String>) 
evt.getNewValue();

[hg] main-silver: Issue #231219 - changed query paging in dashbo...

Jan Peska 06/21/2013

Project Features

About this Project

ConnectedDeveloper was started in November 2009, is owned by tpavek, and has 64 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close