Search in sources :

Example 6 with IColumn

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

the class JsonTable method handleColumnBackgroundEffectChanged.

protected void handleColumnBackgroundEffectChanged(JsonEvent event) {
    addTableEventFilterCondition(TableEvent.TYPE_COLUMN_BACKGROUND_EFFECT_CHANGED);
    IColumn column = extractColumn(event.getData());
    Assertions.assertInstance(column, INumberColumn.class, "BackgroundEffect can only be specified on numeric columns");
    getModel().getUIFacade().setColumnBackgroundEffect((INumberColumn<?>) column, event.getData().optString("backgroundEffect"));
}
Also used : IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)

Example 7 with IColumn

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

the class JsonTable method handleUiColumnMoved.

protected void handleUiColumnMoved(JsonEvent event) {
    IColumn column = extractColumn(event.getData());
    int viewIndex = event.getData().getInt("index");
    // Create column list with expected order
    List<IColumn<?>> columns = getColumnsInViewOrder();
    columns.remove(column);
    columns.add(viewIndex, column);
    addTableEventFilterCondition(TableEvent.TYPE_COLUMN_ORDER_CHANGED).setColumns(columns);
    getModel().getUIFacade().fireColumnMovedFromUI(column, viewIndex);
}
Also used : IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)

Example 8 with IColumn

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

the class JsonTable method handleUiPropertyChange.

@Override
protected void handleUiPropertyChange(String propertyName, JSONObject data) {
    if (ITable.PROP_CONTEXT_COLUMN.equals(propertyName)) {
        String contextColumnId = data.optString(propertyName);
        IColumn column = optColumn(contextColumnId);
        addPropertyEventFilterCondition(ITable.PROP_CONTEXT_COLUMN, column);
        getModel().getUIFacade().setContextColumnFromUI(column);
    }
}
Also used : IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)

Example 9 with IColumn

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

the class JsonColumnUserFilter method toJson.

@Override
public JSONObject toJson() {
    JSONObject json = super.toJson();
    ColumnUserFilterState filterState = getFilterState();
    IColumn modelColumn = filterState.getColumn();
    json.put("column", getJsonTable().getColumnId(modelColumn));
    json.put("selectedValues", new JSONArray(filterState.getSelectedValues()));
    return json;
}
Also used : JSONObject(org.json.JSONObject) IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn) ColumnUserFilterState(org.eclipse.scout.rt.client.ui.basic.table.userfilter.ColumnUserFilterState) JSONArray(org.json.JSONArray)

Example 10 with IColumn

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

the class JsonTable method handleUiColumnResized.

protected void handleUiColumnResized(JsonEvent event) {
    IColumn column = extractColumn(event.getData());
    if (column == null) {
        LOG.info("Requested column doesn't exist anymore -> skip columnResized event");
        return;
    }
    int width = event.getData().getInt("width");
    getModel().getUIFacade().setColumnWidthFromUI(column, width);
}
Also used : IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)

Aggregations

IColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)49 ArrayList (java.util.ArrayList)10 TreeMap (java.util.TreeMap)8 CompositeObject (org.eclipse.scout.rt.platform.util.CompositeObject)7 Test (org.junit.Test)6 ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)5 JSONObject (org.json.JSONObject)5 ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)4 IFormField (org.eclipse.scout.rt.client.ui.form.fields.IFormField)4 INumberColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.INumberColumn)3 HashMap (java.util.HashMap)2 IMenu (org.eclipse.scout.rt.client.ui.action.menu.IMenu)2 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 Method (java.lang.reflect.Method)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 TreeSet (java.util.TreeSet)1 ClientUIPreferences (org.eclipse.scout.rt.client.ui.ClientUIPreferences)1 IKeyStroke (org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke)1