From 6045f7e2489c5d124d56517344d43511f48b4e52 Mon Sep 17 00:00:00 2001 From: sib12004 Date: Sat, 5 Dec 2015 21:31:17 -0500 Subject: [PATCH] Modified populate function so that our button is no longer a toggle Added some documentation Added button tip --- src/core/genj/tree/Model.java | 5 +++-- src/core/genj/tree/TreeView.java | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core/genj/tree/Model.java b/src/core/genj/tree/Model.java index b10b570..6666b23 100644 --- a/src/core/genj/tree/Model.java +++ b/src/core/genj/tree/Model.java @@ -86,7 +86,7 @@ import java.util.concurrent.CopyOnWriteArrayList; private boolean isFoldSymbols = true; - //OUR CODE///////////////////////////////////////////////////////////////////////////////////////////////// + /** whether we want to expand the tree */ private boolean isExpandAll = false; @@ -160,6 +160,7 @@ import java.util.concurrent.CopyOnWriteArrayList; if (set) { clearHiddenIDs(); + setExpandAll(false); } update(); } @@ -392,7 +393,7 @@ import java.util.concurrent.CopyOnWriteArrayList; hideAncestors.addAll(ids); } - //OUR ATTEMPT AT CLEARING THE LIST OF HIDDEN IDS + /**clears all hidden ancestors and descendants */ public void clearHiddenIDs() { hideAncestors.clear(); hideDescendants.clear(); diff --git a/src/core/genj/tree/TreeView.java b/src/core/genj/tree/TreeView.java index b2330fc..c8016b9 100644 --- a/src/core/genj/tree/TreeView.java +++ b/src/core/genj/tree/TreeView.java @@ -467,7 +467,9 @@ public class TreeView extends View implements ContextProvider, ActionProvider { toolbar.addSeparator(); // expand all - toolbar.add(bh.create(new ActionExpandAll(), Images.imgExpand, model.isExpandAll())); + //toolbar.add(bh.create(new ActionExpandAll(), Images.imgExpand, model.isExpandAll())); + ActionExpandAll expandAllButton = new ActionExpandAll(); + toolbar.add(expandAllButton); // vertical/horizontal toolbar.add(bh.create(new ActionOrientation(), Images.imgVert, model.isVertical())); @@ -1052,13 +1054,13 @@ public class TreeView extends View implements ContextProvider, ActionProvider { */ private ActionExpandAll() { super.setImage(Images.imgExpand); - //super.setTip(RESOURCES, "expandall.tip"); + super.setTip("Expand all"); } /** * @see genj.util.swing.Action2#execute() */ public void actionPerformed(ActionEvent event) { - model.setExpandAll(!model.isExpandAll()); + model.setExpandAll(true); scrollToCurrent(); } }//ActionExpanding