Search in sources :

Example 1 with AbstractBooleanColumn

use of org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractBooleanColumn in project scout.rt by eclipse.

the class AbstractTable method createColumnsInternal.

private void createColumnsInternal() {
    List<Class<? extends IColumn>> ca = getConfiguredColumns();
    OrderedCollection<IColumn<?>> columns = new OrderedCollection<IColumn<?>>();
    // configured columns
    for (Class<? extends IColumn> clazz : ca) {
        IColumn<?> column = ConfigurationUtility.newInnerInstance(this, clazz);
        columns.addOrdered(column);
    }
    // contributed columns
    List<IColumn> contributedColumns = m_contributionHolder.getContributionsByClass(IColumn.class);
    for (IColumn c : contributedColumns) {
        columns.addOrdered(c);
    }
    // dynamically injected columns
    injectColumnsInternal(columns);
    // move columns
    ExtensionUtility.moveModelObjects(columns);
    m_columnSet = new ColumnSet(this, columns.getOrderedList());
    if (getConfiguredCheckableColumn() != null) {
        AbstractBooleanColumn checkableColumn = getColumnSet().getColumnByClass(getConfiguredCheckableColumn());
        setCheckableColumn(checkableColumn);
    }
    PropertyChangeListener columnVisibleListener = new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            // disable ui sort possible property if needed
            checkIfColumnPreventsUiSortForTable();
            // prevent invisible context column (because the UI does not know of invisible columns)
            checkIfContextColumnIsVisible();
        }
    };
    for (IColumn column : m_columnSet.getColumns()) {
        column.addPropertyChangeListener(IColumn.PROP_VISIBLE, columnVisibleListener);
    }
}
Also used : PropertyChangeEvent(java.beans.PropertyChangeEvent) AbstractBooleanColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractBooleanColumn) PropertyChangeListener(java.beans.PropertyChangeListener) IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn) OrderedCollection(org.eclipse.scout.rt.platform.util.collection.OrderedCollection)

Aggregations

PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 AbstractBooleanColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractBooleanColumn)1 IColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)1 OrderedCollection (org.eclipse.scout.rt.platform.util.collection.OrderedCollection)1