use of org.eclipse.scout.rt.client.ui.basic.table.userfilter.ColumnUserFilterState 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;
}
use of org.eclipse.scout.rt.client.ui.basic.table.userfilter.ColumnUserFilterState in project scout.rt by eclipse.
the class AbstractTable method linkColumnFilters.
private void linkColumnFilters() {
TableUserFilterManager filterManager = getUserFilterManager();
if (filterManager == null) {
return;
}
for (IColumn<?> col : getColumns()) {
IUserFilterState filter = getUserFilterManager().getFilter(col.getColumnId());
if (filter == null) {
continue;
}
if (!(filter instanceof ColumnUserFilterState)) {
throw new IllegalStateException("Unexpected filter state" + filter.getClass());
}
((ColumnUserFilterState) filter).setColumn(col);
}
}
use of org.eclipse.scout.rt.client.ui.basic.table.userfilter.ColumnUserFilterState in project scout.rt by eclipse.
the class JsonColumnUserFilter method createFilterStateFromJson.
/**
* This method creates a type specific filter-state model for the given column and JSON data. Sub-classes may
* implement this method to return a different type. The default impl. returns a {@link ColumnUserFilterState}.
*
* @return
*/
public ColumnUserFilterState createFilterStateFromJson(IColumn<?> column, JSONObject json) {
ColumnUserFilterState filterState = new ColumnUserFilterState(column);
filterState.setSelectedValues(createSelectedValuesFromJson(json));
return filterState;
}
Aggregations