made Expand image

made isExpandAll getter setter in Model
TreeView.ActionExpandAll class
populate toolbar expand button added
master
Siena 2015-10-25 22:58:27 -04:00
parent cd7d88b7ec
commit 7ec846a567
4 changed files with 53 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@ -35,7 +35,8 @@ final class Images {
imgVert,
imgDoFams,
imgDontFams,
imgFoldSymbols;
imgFoldSymbols,
imgExpand;
/**
* Constructor which pre-loads all images
@ -53,6 +54,7 @@ final class Images {
imgDontFams = new ImageIcon(this,"images/DontFams" );
imgFoldSymbols = new ImageIcon(this,"images/FoldUnfold" );
imgExpand = new ImageIcon(this, "images/Expand");
}
} //Images

View File

@ -85,6 +85,11 @@ import java.util.concurrent.CopyOnWriteArrayList;
/** whether we show toggles for un/folding */
private boolean isFoldSymbols = true;
//OUR CODE/////////////////////////////////////////////////////////////////////////////////////////////////
private boolean isExpandAll = false;
/** individuals whose ancestors we're not interested in */
private Set<String> hideAncestors = new HashSet<String>();
@ -146,6 +151,26 @@ import java.util.concurrent.CopyOnWriteArrayList;
return root;
}
/**
* Accessor - expand all
**/
public void setExpandAll(boolean set) {
if (isExpandAll==set) return;
isExpandAll = set;
if (set)
{
clearHiddenIDs();
}
update();
}
/**
* Accessor - get isExpandAll
*/
public boolean isExpandAll() {
return isExpandAll;
}
/**
* Accessor - wether we're vertical
*/

View File

@ -466,6 +466,9 @@ public class TreeView extends View implements ContextProvider, ActionProvider {
// gap
toolbar.addSeparator();
// expand all
toolbar.add(bh.create(new ActionExpandAll(), Images.imgExpand, model.isExpandAll()));
// vertical/horizontal
toolbar.add(bh.create(new ActionOrientation(), Images.imgVert, model.isVertical()));
@ -1040,6 +1043,28 @@ public class TreeView extends View implements ContextProvider, ActionProvider {
}
/**
* Action ExpandAll on/off
*/
private class ActionExpandAll extends Action2 {
/**
* Constructor
*/
private ActionExpandAll() {
super.setImage(Images.imgExpand);
//super.setTip(RESOURCES, "expandall.tip");
}
/**
* @see genj.util.swing.Action2#execute()
*/
public void actionPerformed(ActionEvent event) {
model.setExpandAll(!model.isExpandAll());
scrollToCurrent();
}
}//ActionExpanding
/**
* Action - bookmark something
*/