001 package net.sf.tacos.components.tree; 002 003 import java.io.Serializable; 004 005 /** 006 * @author phraktle 007 */ 008 public interface ITreeManager { 009 010 /** 011 * Whether or not node expanded 012 * @param element 013 * @return 014 */ 015 public boolean isExpanded(Object element); 016 017 /** 018 * Checks expanded based on key 019 * @param key 020 * @return 021 */ 022 public boolean isExpandedKey(Serializable key); 023 024 /** 025 * Sets the element to expanded 026 * @param element 027 * @param expand 028 */ 029 public void setExpanded(Object element, boolean expand); 030 031 /** 032 * Sets expanded based on key 033 * @param key 034 * @param expand 035 */ 036 public void setExpandedKey(Serializable key, boolean expand); 037 038 /** 039 * Collapses all nodes. 040 */ 041 public void collapseAll(); 042 043 /** 044 * Expands all 045 * 046 */ 047 public void expandAll(); 048 049 /** 050 * Reveals the object in the tree by adding it and any parents required to 051 * reveal it to the current {@link Tree}s state. 052 * 053 * @param element 054 * @return The top level parent element that had to be revealed in order to 055 * make this component visible, otherwise should return the element 056 * passed in. 057 */ 058 public Object reveal(Object element); 059 060 }