/** * If the added column is marked as sorted, set it as the sort column. * * @see org.fujion.component.BaseComponent#afterAddChild(org.fujion.component.BaseComponent) */ @Override protected void afterAddChild(BaseComponent child) { super.afterAddChild(child); if (((Column) child).isSortColumn()) { setSortColumn((Column) child); } }
/** * Sets the sort column state. If set to true, the column is sorted and designated as the * current sort column. * * @param sortColumn If true, this column is sorted and designated as the current sort column. * @param notifyParent If true, update the sort column property of the parent. */ protected void _setSortColumn(boolean sortColumn, boolean notifyParent) { if (propertyChange("sortColumn", this.sortColumn, this.sortColumn = sortColumn, false)) { if (sortColumn) { sort(); } else { updateClient(); } if (notifyParent) { Columns parent = (Columns) getParent(); if (parent != null) { if (sortColumn) { parent.setSortColumn(this); } else if (parent.getSortColumn() == this) { parent.setSortColumn(null); } } } } }