Search in sources :

Example 6 with IUserFilterState

use of org.eclipse.scout.rt.client.ui.basic.userfilter.IUserFilterState in project scout.rt by eclipse.

the class TableUserFilterManager method setSerializedData.

/**
 * Import the serialized data, e.g. after restoring from a bookmark
 */
public void setSerializedData(byte[] data) {
    try {
        reset();
        Collection<IUserFilterState> filterStates = SerializationUtility.createObjectSerializer().deserialize(data, null);
        for (IUserFilterState filterState : filterStates) {
            boolean success = filterState.notifyDeserialized(m_table);
            if (success) {
                addFilter(filterState);
            } else {
                LOG.info("User filter state of table '{}' cannot be deserialized because the column could not be found. Ignoring element.", m_table.getClass().getName());
            }
        }
    } catch (IOException | ClassNotFoundException e) {
        throw new ProcessingException("Failed reading user filter data.", e);
    }
}
Also used : IUserFilterState(org.eclipse.scout.rt.client.ui.basic.userfilter.IUserFilterState) IOException(java.io.IOException) ProcessingException(org.eclipse.scout.rt.platform.exception.ProcessingException)

Example 7 with IUserFilterState

use of org.eclipse.scout.rt.client.ui.basic.userfilter.IUserFilterState in project scout.rt by eclipse.

the class TableUserFilterManager method removeFilterByKey.

public void removeFilterByKey(Object key) {
    IUserFilterState filter = m_filterMap.remove(key);
    fireFilterRemoved(filter);
    LOG.info("Filter removed {}", filter);
}
Also used : IUserFilterState(org.eclipse.scout.rt.client.ui.basic.userfilter.IUserFilterState)

Example 8 with IUserFilterState

use of org.eclipse.scout.rt.client.ui.basic.userfilter.IUserFilterState in project scout.rt by eclipse.

the class JsonTable method handleUiFilterAdded.

protected void handleUiFilterAdded(JsonEvent event) {
    JSONObject data = event.getData();
    IUserFilterState filterState = createFilterState(data);
    TableEventFilterCondition condition = addTableEventFilterCondition(TableEvent.TYPE_USER_FILTER_ADDED);
    condition.setUserFilter(filterState);
    getModel().getUIFacade().fireFilterAddedFromUI(filterState);
}
Also used : IUserFilterState(org.eclipse.scout.rt.client.ui.basic.userfilter.IUserFilterState) JSONObject(org.json.JSONObject)

Aggregations

IUserFilterState (org.eclipse.scout.rt.client.ui.basic.userfilter.IUserFilterState)8 IOException (java.io.IOException)2 ProcessingException (org.eclipse.scout.rt.platform.exception.ProcessingException)2 JSONObject (org.json.JSONObject)2 ArrayList (java.util.ArrayList)1 ColumnUserFilterState (org.eclipse.scout.rt.client.ui.basic.table.userfilter.ColumnUserFilterState)1 TableUserFilterManager (org.eclipse.scout.rt.client.ui.basic.table.userfilter.TableUserFilterManager)1 JsonTableUserFilter (org.eclipse.scout.rt.ui.html.json.table.userfilter.JsonTableUserFilter)1 JSONArray (org.json.JSONArray)1