/** * Use the given <code>treeTableCellRenderer</code> when rendering the * hierarchy column of the tree table. */ public void setRenderer(TreeTableCellRenderer treeTableCellRenderer) { checkAccessThread(); // ensure we can find the view column index of the hierarchical column final int viewColumnIndex = table.convertColumnIndexToView(hierarchyColumnModelIndex); if (viewColumnIndex == -1) throw new IllegalArgumentException("Unable to locate a view index for the given model index: " + hierarchyColumnModelIndex); // look up the hierarchical TableColumn final TableColumn viewColumn = table.getColumnModel().getColumn(viewColumnIndex); // dispose the old renderer this.treeTableCellRenderer.dispose(); // install the new renderer this.treeTableCellRenderer = treeTableCellRenderer; treeTableCellRenderer.setShowExpanderForEmptyParent(showExpanderForEmptyParent); viewColumn.setCellRenderer(treeTableCellRenderer); }
/** * Use the given <code>treeTableCellRenderer</code> when rendering the * hierarchy column of the tree table. */ public void setRenderer(TreeTableCellRenderer treeTableCellRenderer) { checkAccessThread(); // ensure we can find the view column index of the hierarchical column final int viewColumnIndex = table.convertColumnIndexToView(hierarchyColumnModelIndex); if (viewColumnIndex == -1) throw new IllegalArgumentException("Unable to locate a view index for the given model index: " + hierarchyColumnModelIndex); // look up the hierarchical TableColumn final TableColumn viewColumn = table.getColumnModel().getColumn(viewColumnIndex); // dispose the old renderer this.treeTableCellRenderer.dispose(); // install the new renderer this.treeTableCellRenderer = treeTableCellRenderer; treeTableCellRenderer.setShowExpanderForEmptyParent(showExpanderForEmptyParent); viewColumn.setCellRenderer(treeTableCellRenderer); }
/** * Use the given <code>treeTableCellRenderer</code> when rendering the * hierarchy column of the tree table. */ public void setRenderer(TreeTableCellRenderer treeTableCellRenderer) { checkAccessThread(); // ensure we can find the view column index of the hierarchical column final int viewColumnIndex = table.convertColumnIndexToView(hierarchyColumnModelIndex); if (viewColumnIndex == -1) { throw new IllegalArgumentException("Unable to locate a view index for the given model index: " + hierarchyColumnModelIndex); } // look up the hierarchical TableColumn final TableColumn viewColumn = table.getColumnModel().getColumn(viewColumnIndex); // dispose the old renderer this.treeTableCellRenderer.dispose(); // install the new renderer this.treeTableCellRenderer = treeTableCellRenderer; treeTableCellRenderer.setShowExpanderForEmptyParent(showExpanderForEmptyParent); viewColumn.setCellRenderer(treeTableCellRenderer); }
/** * Sets whether the expander is displayed for nodes that do not contain * children but are allowed to contain children, and thus may accumulate * children in the future. If this property is <tt>true</tt> then empty * nodes that may contain children in the future are displayed with a * visible expander; otherwise they are displayed without the expander. * A node signals that it may contain children in the future by returning * <tt>true</tt> from {@link TreeList.Format#allowsChildren(Object)}. */ public void setShowExpanderForEmptyParent(boolean showExpanderForEmptyParent) { checkAccessThread(); if (this.showExpanderForEmptyParent == showExpanderForEmptyParent) return; this.showExpanderForEmptyParent = showExpanderForEmptyParent; // indicate the new property value to the renderer and editor treeTableCellRenderer.setShowExpanderForEmptyParent(showExpanderForEmptyParent); treeTableCellEditor.setShowExpanderForEmptyParent(showExpanderForEmptyParent); // repaint the table so the display is updated table.repaint(); }
/** * Sets whether the expander is displayed for nodes that do not contain * children but are allowed to contain children, and thus may accumulate * children in the future. If this property is <tt>true</tt> then empty * nodes that may contain children in the future are displayed with a * visible expander; otherwise they are displayed without the expander. * A node signals that it may contain children in the future by returning * <tt>true</tt> from {@link ca.odell.glazedlists.TreeList.Format#allowsChildren(Object)}. */ public void setShowExpanderForEmptyParent(boolean showExpanderForEmptyParent) { checkAccessThread(); if (this.showExpanderForEmptyParent == showExpanderForEmptyParent) { return; } this.showExpanderForEmptyParent = showExpanderForEmptyParent; // indicate the new property value to the renderer and editor treeTableCellRenderer.setShowExpanderForEmptyParent(showExpanderForEmptyParent); treeTableCellEditor.setShowExpanderForEmptyParent(showExpanderForEmptyParent); // repaint the table so the display is updated table.repaint(); }
/** * Sets whether the expander is displayed for nodes that do not contain * children but are allowed to contain children, and thus may accumulate * children in the future. If this property is <tt>true</tt> then empty * nodes that may contain children in the future are displayed with a * visible expander; otherwise they are displayed without the expander. * A node signals that it may contain children in the future by returning * <tt>true</tt> from {@link TreeList.Format#allowsChildren(Object)}. */ public void setShowExpanderForEmptyParent(boolean showExpanderForEmptyParent) { checkAccessThread(); if (this.showExpanderForEmptyParent == showExpanderForEmptyParent) return; this.showExpanderForEmptyParent = showExpanderForEmptyParent; // indicate the new property value to the renderer and editor treeTableCellRenderer.setShowExpanderForEmptyParent(showExpanderForEmptyParent); treeTableCellEditor.setShowExpanderForEmptyParent(showExpanderForEmptyParent); // repaint the table so the display is updated table.repaint(); }