use of org.eclipse.scout.rt.client.ui.basic.table.ITable in project scout.rt by eclipse.
the class MobileDeviceTransformer method notifyPageDetailTableChanged.
@Override
public void notifyPageDetailTableChanged(ITable table) {
IPage<?> activePage = getDesktop().getOutline().getActivePage();
IPage<?> parentPage = activePage.getParentPage();
if (parentPage == null) {
return;
}
ITable parentTable = parentPage.getTable();
if (parentTable == null) {
return;
}
// Remove empty space menus of the current detail table which are already defined on the parent detail table as single selection menus
// This prevents duplicate menus because the ui concatenates these menus when a node is shown
// It is important to only remove outline wrapper menus which are defined on the parent table because the menu could be defined on a page and therefore needs to be displayed
List<IMenu> newMenus = new ArrayList<IMenu>();
for (IMenu menu : table.getMenus()) {
if ((menu instanceof OutlineMenuWrapper)) {
OutlineMenuWrapper menuWrapper = (OutlineMenuWrapper) menu;
IMenu originalMenu = unwrapOutlineWrapperMenu(menuWrapper);
if (menuWrapper.getMenuTypes().contains(TableMenuType.EmptySpace) && originalMenu.getMenuTypes().contains(TableMenuType.SingleSelection) && parentTable.getMenus().contains(originalMenu)) {
// This menu should be removed -> don't add it to the list of new menus
continue;
}
}
newMenus.add(menu);
}
if (!CollectionUtility.equalsCollection(newMenus, table.getContextMenu().getChildActions())) {
table.getContextMenu().setChildActions(newMenus);
}
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITable in project scout.rt by eclipse.
the class ColumnUserFilterState method notifyDeserialized.
@Override
public boolean notifyDeserialized(Object obj) {
ITable table = (ITable) obj;
m_column = BookmarkUtility.resolveColumn(table.getColumns(), m_columnId);
return m_column != null;
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITable in project scout.rt by eclipse.
the class DefaultPageChangeStrategy method pageChanged.
@Override
public void pageChanged(final IOutline outline, final IPage<?> deselectedPage, final IPage<?> selectedPage) {
if (outline == null) {
return;
}
outline.clearContextPage();
IForm detailForm = null;
ITable detailTable = null;
ISearchForm searchForm = null;
// new active page
outline.makeActivePageToContextPage();
IPage<?> activePage = outline.getActivePage();
if (activePage != null) {
try {
activePage.ensureChildrenLoaded();
} catch (RuntimeException | PlatformError e1) {
BEANS.get(ExceptionHandler.class).handle(e1);
}
if (activePage instanceof IPageWithTable) {
IPageWithTable tablePage = (IPageWithTable) activePage;
detailForm = activePage.getDetailForm();
if (activePage.isTableVisible()) {
detailTable = tablePage.getTable(false);
}
if (tablePage.isSearchActive()) {
searchForm = tablePage.getSearchFormInternal();
}
} else if (activePage instanceof IPageWithNodes) {
IPageWithNodes nodePage = (IPageWithNodes) activePage;
if (activePage.isDetailFormVisible()) {
detailForm = activePage.getDetailForm();
}
if (activePage.isTableVisible()) {
detailTable = nodePage.getTable(false);
}
}
}
// remove first
if (detailForm == null) {
outline.setDetailForm(null);
}
if (detailTable == null) {
outline.setDetailTable(null);
}
if (searchForm == null) {
outline.setSearchForm(null);
}
// add new
if (detailForm != null) {
outline.setDetailForm(detailForm);
}
if (detailTable != null) {
outline.setDetailTable(detailTable);
}
if (searchForm != null) {
outline.setSearchForm(searchForm);
}
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITable 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.client.ui.basic.table.ITable in project scout.rt by eclipse.
the class AbstractColumn method completeEdit.
/**
* Complete editing of a cell
* <p>
* By default this calls {@link #setValue(ITableRow, Object)} and delegates to
* {@link #interceptParseValue(ITableRow, Object)} and {@link #interceptValidateValue(ITableRow, Object)}.
*/
@Override
public final void completeEdit(ITableRow row, IFormField editingField) {
ITable table = getTable();
if (table == null || !table.isCellEditable(row, this)) {
return;
}
interceptCompleteEdit(row, editingField);
}
Aggregations