public void setRootVisible(boolean rootVisible) { if (isRootVisible() != rootVisible) { boolean oldVal = treeState.isRootVisible(); treeState.setRootVisible(rootVisible); fireViewportChanged(false); reload(); propertyChangeSupport.firePropertyChange("rootVisible", oldVal, treeState.isRootVisible()); } }
/** Set whether or not the root is visible */ public void setRootVisible (boolean val) { if (getOutlineModel() == null) { cachedRootVisible = val ? Boolean.TRUE : Boolean.FALSE; } if (val != isRootVisible()) { //TODO - need to force a property change on the model, //the layout cache doesn't have direct listener support getLayoutCache().setRootVisible(val); firePropertyChange("rootVisible", !val, val); //NOI18N } }
if (cachedRootVisible != null) { layout.setRootVisible( cachedRootVisible.booleanValue());
/** Creates a new instance of DefaultOutlineModel. <strong><b>Note</b> * Do not fire table structure changes from the wrapped TableModel (value * changes are okay). Changes that affect the number of rows must come * from the TreeModel. */ protected DefaultOutlineModel(TreeModel treeModel, TableModel tableModel, boolean largeModel, String nodesColumnLabel) { this.treeModel = treeModel; this.tableModel = tableModel; if (nodesColumnLabel != null) { this.nodesColumnLabel = nodesColumnLabel; } layout = largeModel ? (AbstractLayoutCache) new FixedHeightLayoutCache() : (AbstractLayoutCache) new VariableHeightLayoutCache(); broadcaster = new EventBroadcaster (this); layout.setRootVisible(true); layout.setModel(this); treePathSupport = new TreePathSupport(this, layout); treePathSupport.addTreeExpansionListener(broadcaster); treePathSupport.addTreeWillExpandListener(broadcaster); treeModel.addTreeModelListener(broadcaster); tableModel.addTableModelListener(broadcaster); if (tableModel instanceof ProxyTableModel) { ((ProxyTableModel) tableModel).setOutlineModel(this); } }