diff options
author | Jonathan Bauer | 2016-03-15 14:34:05 +0100 |
---|---|---|
committer | Jonathan Bauer | 2016-03-15 14:34:05 +0100 |
commit | edb91e12cbd351f450374d95e84c11e9c8577708 (patch) | |
tree | ae32609f905eb48b7d5b089afbaab4f635b956f8 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/JCheckBoxTree.java | |
parent | [client] cleanup debug stuff (diff) | |
download | tutor-module-edb91e12cbd351f450374d95e84c11e9c8577708.tar.gz tutor-module-edb91e12cbd351f450374d95e84c11e9c8577708.tar.xz tutor-module-edb91e12cbd351f450374d95e84c11e9c8577708.zip |
[client] fix typo + always call collapseFullySelectedNodes in setCheckedState
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/JCheckBoxTree.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/JCheckBoxTree.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/JCheckBoxTree.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/JCheckBoxTree.java index bdb3e360..16f260b7 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/JCheckBoxTree.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/JCheckBoxTree.java @@ -103,7 +103,7 @@ public class JCheckBoxTree extends JTree { this.expandRow(i); } // Now collapse again if it's not first level - for (int i = 0; i > this.getRowCount(); i++) { + for (int i = 0; i < this.getRowCount(); i++) { TreePath path = this.getPathForRow(i); if (path.getPathCount() > 1) this.collapseRow(i); @@ -120,6 +120,7 @@ public class JCheckBoxTree extends JTree { this.expandPath(path); } } + collapseFullySelectedNodes(); } // New method that returns only the checked paths (totally ignores original @@ -135,7 +136,7 @@ public class JCheckBoxTree extends JTree { return cn.isSelected && cn.hasChildren && !cn.allChildrenSelected; } // Collapses all nodes that have only selected children - public void collapseFullySelectedNodes() { + private void collapseFullySelectedNodes() { // the paths need to be sorted by length, otherwise some nodes will get expanded again // even though they should be collapsed for (Entry<TreePath, CheckedNode> it : nodesCheckingState.entrySet()) { |