use of org.eclipse.scout.rt.ui.html.json.form.fields.JsonAdapterPropertyConfigBuilder 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();
}
});
}
use of org.eclipse.scout.rt.ui.html.json.form.fields.JsonAdapterPropertyConfigBuilder in project scout.rt by eclipse.
the class JsonTree method initJsonProperties.
@Override
protected void initJsonProperties(TREE model) {
super.initJsonProperties(model);
putJsonProperty(new JsonProperty<TREE>(ITree.PROP_TITLE, model) {
@Override
protected String modelValue() {
return getModel().getTitle();
}
});
putJsonProperty(new JsonProperty<TREE>(ITree.PROP_ICON_ID, model) {
@Override
protected String modelValue() {
return getModel().getIconId();
}
@Override
public Object prepareValueForToJson(Object value) {
return BinaryResourceUrlUtility.createIconUrl((String) value);
}
});
putJsonProperty(new JsonProperty<TREE>(ITree.PROP_CSS_CLASS, model) {
@Override
protected String modelValue() {
return getModel().getCssClass();
}
});
putJsonProperty(new JsonProperty<TREE>(ITree.PROP_CHECKABLE, model) {
@Override
protected Boolean modelValue() {
return getModel().isCheckable();
}
});
putJsonProperty(new JsonProperty<TREE>(ITree.PROP_MULTI_CHECK, model) {
@Override
protected Boolean modelValue() {
return getModel().isMultiCheck();
}
});
putJsonProperty(new JsonProperty<TREE>(ITree.PROP_ENABLED, model) {
@Override
protected Boolean modelValue() {
return getModel().isEnabled();
}
});
putJsonProperty(new JsonProperty<TREE>(ITree.PROP_LAZY_EXPANDING_ENABLED, model) {
@Override
protected Boolean modelValue() {
return getModel().isLazyExpandingEnabled();
}
});
putJsonProperty(new JsonProperty<TREE>(ITree.PROP_AUTO_CHECK_CHILDREN, model) {
@Override
protected Boolean modelValue() {
return getModel().isAutoCheckChildNodes();
}
});
putJsonProperty(new JsonProperty<ITree>(ITree.PROP_SCROLL_TO_SELECTION, model) {
@Override
protected Boolean modelValue() {
return getModel().isScrollToSelection();
}
});
putJsonProperty(new JsonProperty<ITree>(ITree.PROP_DROP_TYPE, model) {
@Override
protected Integer modelValue() {
return getModel().getDropType();
}
});
putJsonProperty(new JsonProperty<ITree>(ITree.PROP_DROP_MAXIMUM_SIZE, model) {
@Override
protected Long modelValue() {
return getModel().getDropMaximumSize();
}
});
putJsonProperty(new JsonAdapterProperty<ITree>(ITree.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<TREE>(ITree.PROP_DISPLAY_STYLE, model) {
@Override
protected String modelValue() {
return getModel().getDisplayStyle();
}
});
putJsonProperty(new JsonProperty<TREE>(ITree.PROP_TOGGLE_BREADCRUMB_STYLE_ENABLED, model) {
@Override
protected Boolean modelValue() {
return getModel().isToggleBreadcrumbStyleEnabled();
}
});
}
use of org.eclipse.scout.rt.ui.html.json.form.fields.JsonAdapterPropertyConfigBuilder in project scout.rt by eclipse.
the class JsonTabBox method initJsonProperties.
@Override
protected void initJsonProperties(TAB_BOX model) {
super.initJsonProperties(model);
putJsonProperty(new JsonAdapterProperty<ITabBox>(ITabBox.PROP_SELECTED_TAB, model, getUiSession()) {
@Override
protected IGroupBox modelValue() {
return getModel().getSelectedTab();
}
@Override
protected JsonAdapterPropertyConfig createConfig() {
return new JsonAdapterPropertyConfigBuilder().disposeOnChange(false).build();
}
});
}
use of org.eclipse.scout.rt.ui.html.json.form.fields.JsonAdapterPropertyConfigBuilder in project scout.rt by eclipse.
the class JsonCalendar method initJsonProperties.
@Override
protected void initJsonProperties(CALENDAR model) {
putJsonProperty(new JsonAdapterProperty<CALENDAR>(ICalendar.PROP_COMPONENTS, model, getUiSession()) {
@Override
protected Set<? extends CalendarComponent> modelValue() {
return getModel().getComponents();
}
});
putJsonProperty(new JsonAdapterProperty<CALENDAR>(ICalendar.PROP_SELECTED_COMPONENT, model, getUiSession()) {
@Override
protected CalendarComponent modelValue() {
return getModel().getSelectedComponent();
}
@Override
protected JsonAdapterPropertyConfig createConfig() {
return new JsonAdapterPropertyConfigBuilder().disposeOnChange(false).build();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_DISPLAY_MODE, model) {
@Override
protected Integer modelValue() {
return getModel().getDisplayMode();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_DISPLAY_CONDENSED, model) {
@Override
protected Boolean modelValue() {
return getModel().isDisplayCondensed();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_TITLE, model) {
@Override
protected String modelValue() {
return getModel().getTitle();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_VIEW_RANGE, model) {
@Override
protected Range<Date> modelValue() {
return getModel().getViewRange();
}
@SuppressWarnings("unchecked")
@Override
public Object prepareValueForToJson(Object value) {
if (value == null) {
return null;
}
return new JsonDateRange((Range<Date>) value).toJson();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_SELECTED_DATE, model) {
@Override
protected Date modelValue() {
return getModel().getSelectedDate();
}
@Override
public Object prepareValueForToJson(Object value) {
return new JsonDate((Date) value).asJsonString();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_LOAD_IN_PROGRESS, model) {
@Override
protected Boolean modelValue() {
return getModel().isLoadInProgress();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_START_HOUR, model) {
@Override
protected Integer modelValue() {
return getModel().getStartHour();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_END_HOUR, model) {
@Override
protected Integer modelValue() {
return getModel().getEndHour();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_USE_OVERFLOW_CELLS, model) {
@Override
protected Boolean modelValue() {
return getModel().getUseOverflowCells();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_SHOW_DISPLAY_MODE_SELECTION, model) {
@Override
protected Boolean modelValue() {
return getModel().getShowDisplayModeSelection();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_MARK_NOON_HOUR, model) {
@Override
protected Boolean modelValue() {
return getModel().getMarkNoonHour();
}
});
putJsonProperty(new JsonProperty<CALENDAR>(ICalendar.PROP_MARK_OUT_OF_MONTH_DAYS, model) {
@Override
protected Boolean modelValue() {
return getModel().getMarkOutOfMonthDays();
}
});
}
use of org.eclipse.scout.rt.ui.html.json.form.fields.JsonAdapterPropertyConfigBuilder in project scout.rt by eclipse.
the class JsonAction method initJsonProperties.
@Override
protected void initJsonProperties(ACTION model) {
super.initJsonProperties(model);
putJsonProperty(new JsonProperty<ACTION>(IAction.PROP_TEXT, model) {
@Override
protected String modelValue() {
return getModel().getText();
}
});
putJsonProperty(new JsonProperty<ACTION>(IAction.PROP_ICON_ID, model) {
@Override
protected String modelValue() {
return getModel().getIconId();
}
@Override
public Object prepareValueForToJson(Object value) {
return BinaryResourceUrlUtility.createIconUrl((String) value);
}
});
putJsonProperty(new JsonProperty<ACTION>(IAction.PROP_TOOLTIP_TEXT, model) {
@Override
protected String modelValue() {
return getModel().getTooltipText();
}
});
putJsonProperty(new JsonProperty<ACTION>("toggleAction", model) {
@Override
protected Boolean modelValue() {
return getModel().isToggleAction();
}
});
putJsonProperty(new JsonProperty<ACTION>(IAction.PROP_SELECTED, model) {
@Override
protected Boolean modelValue() {
return getModel().isSelected();
}
});
putJsonProperty(new JsonProperty<ACTION>(IAction.PROP_ENABLED, model) {
@Override
protected Boolean modelValue() {
return getModel().isEnabled();
}
});
putJsonProperty(new JsonProperty<ACTION>(IAction.PROP_VISIBLE, model) {
@Override
protected Boolean modelValue() {
return getModel().isVisible();
}
});
putJsonProperty(new JsonProperty<ACTION>(IAction.PROP_KEY_STROKE, model) {
@Override
protected String modelValue() {
return getModel().getKeyStroke();
}
});
putJsonProperty(new JsonProperty<ACTION>(IAction.PROP_KEYSTROKE_FIRE_POLICY, model) {
@Override
protected Integer modelValue() {
return getModel().getKeyStrokeFirePolicy();
}
});
putJsonProperty(new JsonProperty<ACTION>(IAction.PROP_HORIZONTAL_ALIGNMENT, model) {
@Override
protected Integer modelValue() {
return (int) getModel().getHorizontalAlignment();
}
});
putJsonProperty(new JsonProperty<ACTION>(IAction.PROP_CSS_CLASS, model) {
@Override
protected String modelValue() {
return getModel().getCssClass();
}
});
putJsonProperty(new JsonAdapterProperty<ACTION>(IActionNode.PROP_CHILD_ACTIONS, model, getUiSession()) {
@Override
protected JsonAdapterPropertyConfig createConfig() {
return new JsonAdapterPropertyConfigBuilder().filter(new DisplayableActionFilter<IAction>()).build();
}
@Override
protected Object modelValue() {
if (getModel() instanceof IActionNode) {
return ((IActionNode) getModel()).getChildActions();
}
return null;
}
});
}
Aggregations