Modified populate function so that our button is no longer a toggle

Added some documentation
Added button tip
master
sib12004 2015-12-05 21:31:17 -05:00
parent b0c6bc72b8
commit 6045f7e248
2 changed files with 8 additions and 5 deletions

View File

@ -86,7 +86,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
private boolean isFoldSymbols = true; private boolean isFoldSymbols = true;
//OUR CODE///////////////////////////////////////////////////////////////////////////////////////////////// /** whether we want to expand the tree */
private boolean isExpandAll = false; private boolean isExpandAll = false;
@ -160,6 +160,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
if (set) if (set)
{ {
clearHiddenIDs(); clearHiddenIDs();
setExpandAll(false);
} }
update(); update();
} }
@ -392,7 +393,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
hideAncestors.addAll(ids); hideAncestors.addAll(ids);
} }
//OUR ATTEMPT AT CLEARING THE LIST OF HIDDEN IDS /**clears all hidden ancestors and descendants */
public void clearHiddenIDs() { public void clearHiddenIDs() {
hideAncestors.clear(); hideAncestors.clear();
hideDescendants.clear(); hideDescendants.clear();

View File

@ -467,7 +467,9 @@ public class TreeView extends View implements ContextProvider, ActionProvider {
toolbar.addSeparator(); toolbar.addSeparator();
// expand all // 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 // vertical/horizontal
toolbar.add(bh.create(new ActionOrientation(), Images.imgVert, model.isVertical())); toolbar.add(bh.create(new ActionOrientation(), Images.imgVert, model.isVertical()));
@ -1052,13 +1054,13 @@ public class TreeView extends View implements ContextProvider, ActionProvider {
*/ */
private ActionExpandAll() { private ActionExpandAll() {
super.setImage(Images.imgExpand); super.setImage(Images.imgExpand);
//super.setTip(RESOURCES, "expandall.tip"); super.setTip("Expand all");
} }
/** /**
* @see genj.util.swing.Action2#execute() * @see genj.util.swing.Action2#execute()
*/ */
public void actionPerformed(ActionEvent event) { public void actionPerformed(ActionEvent event) {
model.setExpandAll(!model.isExpandAll()); model.setExpandAll(true);
scrollToCurrent(); scrollToCurrent();
} }
}//ActionExpanding }//ActionExpanding