1 package net.sf.tacos.components.tree; 2 3 import java.io.Serializable; 4 5 /** 6 * @author phraktle 7 */ 8 public interface ITreeManager { 9 10 /** 11 * Whether or not node expanded 12 * @param element 13 * @return 14 */ 15 public boolean isExpanded(Object element); 16 17 /** 18 * Checks expanded based on key 19 * @param key 20 * @return 21 */ 22 public boolean isExpandedKey(Serializable key); 23 24 /** 25 * Sets the element to expanded 26 * @param element 27 * @param expand 28 */ 29 public void setExpanded(Object element, boolean expand); 30 31 /** 32 * Sets expanded based on key 33 * @param key 34 * @param expand 35 */ 36 public void setExpandedKey(Serializable key, boolean expand); 37 38 /** 39 * Collapses all nodes. 40 */ 41 public void collapseAll(); 42 43 /** 44 * Expands all 45 * 46 */ 47 public void expandAll(); 48 49 /** 50 * Reveals the object in the tree by adding it and any parents required to 51 * reveal it to the current {@link Tree}s state. 52 * 53 * @param element 54 * @return The top level parent element that had to be revealed in order to 55 * make this component visible, otherwise should return the element 56 * passed in. 57 */ 58 public Object reveal(Object element); 59 60 }