[hg] main-silver: Issue #233929 - Expanded queries are collapsed...

  • From: Jan Peska < >
  • To:
  • Subject: [hg] main-silver: Issue #233929 - Expanded queries are collapsed...
  • Date: Thu, 08 Aug 2013 12:53:42 -0700

changeset 61d678109185 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/61d678109185
description:
        Issue #233929 - Expanded queries are collapsed after the finished 
task filter is changed
        Keep expanded state for query nodes

diffstat:

 
bugtracking/src/org/netbeans/modules/bugtracking/tasks/dashboard/DashboardViewer.java
 |  23 ++++++---
 1 files changed, 16 insertions(+), 7 deletions(-)

diffs (71 lines):

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
@@ -755,7 +755,7 @@
 
     public int removeTaskFilter(DashboardFilter<TaskNode> taskFilter, 
boolean refresh) {
         appliedTaskFilters.removeFilter(taskFilter);
-        return manageRemoveFilter(refresh, !taskFilter.expandNodes());
+        return manageRemoveFilter(refresh, taskFilter.expandNodes());
     }
 
     public int applyCategoryFilter(DashboardFilter<CategoryNode> 
categoryFilter, boolean refresh) {
@@ -765,7 +765,7 @@
 
     public int removeCategoryFilter(DashboardFilter<CategoryNode> 
categoryFilter, boolean refresh) {
         appliedCategoryFilters.removeFilter(categoryFilter);
-        return manageRemoveFilter(refresh, !categoryFilter.expandNodes());
+        return manageRemoveFilter(refresh, categoryFilter.expandNodes());
     }
 
     public int applyRepositoryFilter(DashboardFilter<RepositoryNode> 
repositoryFilter, boolean refresh) {
@@ -775,7 +775,7 @@
 
     public int removeRepositoryFilter(DashboardFilter<RepositoryNode> 
repositoryFilter, boolean refresh) {
         appliedRepositoryFilters.removeFilter(repositoryFilter);
-        return manageRemoveFilter(refresh, !repositoryFilter.expandNodes());
+        return manageRemoveFilter(refresh, repositoryFilter.expandNodes());
     }
 
     public void clearFilters() {
@@ -818,7 +818,7 @@
         if (expandNodes()) {
             return true;
         }
-        return expandedNodes.contains(node);
+        return expandedNodes.remove(node);
     }
 
     public List<TreeListNode> getSelectedNodes() {
@@ -1082,8 +1082,8 @@
     }
 
     private void addRootToModel(final int index, final TreeListNode node) {
-        if (expandNodes() || expandedNodes.remove(node)) {
-            node.setExpanded(true);
+        if (!(node instanceof RepositoryNode) && node.isExpandable()) {
+            node.setExpanded(expandNodes() || expandedNodes.remove(node));
         }
         model.addRoot(index, node);
     }
@@ -1091,10 +1091,19 @@
     private void removeRootFromModel(final TreeListNode node) {
         if (persistExpanded) {
             expandedNodes.remove(node);
-            if (node.isExpanded() && !(node instanceof RepositoryNode)) {
+            if (node.isExpanded()) {
+                if (node instanceof RepositoryNode) {
+                    List<TreeListNode> children = node.getChildren();
+                    for (TreeListNode query : children) {
+                        if (query.isExpanded()) {
+                            expandedNodes.add(query);
+                        }
+                    }
+                } else {
                 expandedNodes.add(node);
             }
         }
+        }
         model.removeRoot(node);
     }
 

[hg] main-silver: Issue #233929 - Expanded queries are collapsed...

Jan Peska 08/08/2013

Project Features

About this Project

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