use of org.eclipse.scout.rt.client.ui.basic.table.GroupingStyle in project scout.rt by eclipse.
the class JsonTable method initJsonProperties.
@Override
protected void initJsonProperties(T model) {
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_ENABLED, model) {
@Override
protected Boolean modelValue() {
return getModel().isEnabled();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_MULTI_SELECT, model) {
@Override
protected Boolean modelValue() {
return getModel().isMultiSelect();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_MULTI_CHECK, model) {
@Override
protected Boolean modelValue() {
return getModel().isMultiCheck();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_MULTILINE_TEXT, model) {
@Override
protected Boolean modelValue() {
return getModel().isMultilineText();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_CHECKABLE, model) {
@Override
protected Boolean modelValue() {
return getModel().isCheckable();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_ROW_ICON_VISIBLE, model) {
@Override
protected Boolean modelValue() {
return getModel().isRowIconVisible();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_HEADER_VISIBLE, model) {
@Override
protected Boolean modelValue() {
return getModel().isHeaderVisible();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_HEADER_ENABLED, model) {
@Override
protected Boolean modelValue() {
return getModel().isHeaderEnabled();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_KEYBOARD_NAVIGATION, model) {
@Override
protected Boolean modelValue() {
return getModel().hasKeyboardNavigation();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_AUTO_RESIZE_COLUMNS, model) {
@Override
protected Boolean modelValue() {
return getModel().isAutoResizeColumns();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_SCROLL_TO_SELECTION, model) {
@Override
protected Boolean modelValue() {
return getModel().isScrollToSelection();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_TABLE_STATUS_VISIBLE, model) {
@Override
protected Boolean modelValue() {
return getModel().isTableStatusVisible();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_TABLE_STATUS, model) {
@Override
protected IStatus modelValue() {
return getModel().getTableStatus();
}
@Override
public Object prepareValueForToJson(Object value) {
return JsonStatus.toJson((IStatus) value);
}
});
putJsonProperty(new JsonAdapterProperty<ITable>(ITable.PROP_TABLE_CONTROLS, model, getUiSession()) {
@Override
protected JsonAdapterPropertyConfig createConfig() {
return new JsonAdapterPropertyConfigBuilder().filter(new DisplayableActionFilter<ITableControl>()).build();
}
@Override
protected List<ITableControl> modelValue() {
return getModel().getTableControls();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_DROP_TYPE, model) {
@Override
protected Integer modelValue() {
return getModel().getDropType();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_DROP_MAXIMUM_SIZE, model) {
@Override
protected Long modelValue() {
return getModel().getDropMaximumSize();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_SORT_ENABLED, model) {
@Override
protected Boolean modelValue() {
return getModel().isSortEnabled();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_UI_SORT_POSSIBLE, model) {
@Override
protected Boolean modelValue() {
return getModel().isUiSortPossible();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_LOADING, model) {
@Override
protected Boolean modelValue() {
return getModel().isLoading();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_GROUPING_STYLE, model) {
@Override
protected GroupingStyle modelValue() {
return getModel().getGroupingStyle();
}
@Override
public Object prepareValueForToJson(Object value) {
return ((GroupingStyle) value).name().toLowerCase();
}
});
putJsonProperty(new JsonAdapterProperty<ITable>(ITable.PROP_KEY_STROKES, model, getUiSession()) {
@Override
protected JsonAdapterPropertyConfig createConfig() {
return new JsonAdapterPropertyConfigBuilder().filter(new DisplayableActionFilter<IAction>()).build();
}
@Override
protected List<IKeyStroke> modelValue() {
return getModel().getKeyStrokes();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_CSS_CLASS, model) {
@Override
protected String modelValue() {
return getModel().getCssClass();
}
});
putJsonProperty(new JsonProperty<ITable>(ITable.PROP_CONTEXT_COLUMN, model) {
@Override
protected Object modelValue() {
return getModel().getContextColumn();
}
@Override
public Object prepareValueForToJson(Object value) {
if (value == null) {
return null;
}
return m_jsonColumns.get(value).getId();
}
});
}
Aggregations