Search in sources :

Example 1 with ColumnStructuralRefreshEvent

use of org.eclipse.nebula.widgets.nattable.layer.event.ColumnStructuralRefreshEvent in project nebula.widgets.nattable by eclipse.

the class ColumnReorderLayer method loadState.

@Override
public void loadState(String prefix, Properties properties) {
    super.loadState(prefix, properties);
    String property = properties.getProperty(prefix + PERSISTENCE_KEY_COLUMN_INDEX_ORDER);
    if (property != null) {
        List<Integer> newColumnIndexOrder = new ArrayList<Integer>();
        // $NON-NLS-1$
        StringTokenizer tok = new StringTokenizer(property, ",");
        while (tok.hasMoreTokens()) {
            String index = tok.nextToken();
            newColumnIndexOrder.add(Integer.valueOf(index));
        }
        if (isRestoredStateValid(newColumnIndexOrder)) {
            this.columnIndexOrder.clear();
            this.columnIndexOrder.addAll(newColumnIndexOrder);
            // refresh index-position mapping
            refreshIndexPositionMapping();
        }
    }
    invalidateCache();
    fireLayerEvent(new ColumnStructuralRefreshEvent(this));
}
Also used : StringTokenizer(java.util.StringTokenizer) ColumnStructuralRefreshEvent(org.eclipse.nebula.widgets.nattable.layer.event.ColumnStructuralRefreshEvent) ArrayList(java.util.ArrayList)

Example 2 with ColumnStructuralRefreshEvent

use of org.eclipse.nebula.widgets.nattable.layer.event.ColumnStructuralRefreshEvent in project nebula.widgets.nattable by eclipse.

the class ColumnGroupHeaderLayer method loadState.

@Override
public void loadState(String prefix, Properties properties) {
    super.loadState(prefix, properties);
    this.model.loadState(prefix, properties);
    fireLayerEvent(new ColumnStructuralRefreshEvent(this));
}
Also used : ColumnStructuralRefreshEvent(org.eclipse.nebula.widgets.nattable.layer.event.ColumnStructuralRefreshEvent)

Aggregations

ColumnStructuralRefreshEvent (org.eclipse.nebula.widgets.nattable.layer.event.ColumnStructuralRefreshEvent)2 ArrayList (java.util.ArrayList)1 StringTokenizer (java.util.StringTokenizer)1