use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class OutlineMediator method mediateTreeNodeDropAction.
public void mediateTreeNodeDropAction(TreeEvent e, IPageWithTable<? extends ITable> pageWithTable) {
ITableRow row = pageWithTable.getTableRowFor(e.getNode());
ITable table = pageWithTable.getTable();
if (row != null) {
table.getUIFacade().fireRowDropActionFromUI(row, e.getDropObject());
}
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractPage method execComputeParentTablePageMenus.
/**
* The default implementation returns the single selection menus from the parent table page's table.
* <p>
* If this behavior is not desired return an empty list or filter the menus for your needs instead.
*
* @param parentTablePage
* Parent table page
* @return A list (non-null) of single selection menus.
*/
@Order(150)
@ConfigOperation
protected List<IMenu> execComputeParentTablePageMenus(IPageWithTable<?> parentTablePage) {
ITableRow row = parentTablePage.getTableRowFor(this);
if (row == null) {
return CollectionUtility.emptyArrayList();
}
ITable table = parentTablePage.getTable();
table.getUIFacade().setSelectedRowsFromUI(CollectionUtility.arrayList(row));
return ActionUtility.getActions(table.getContextMenu().getChildActions(), ActionUtility.createMenuFilterMenuTypes(CollectionUtility.hashSet(TableMenuType.SingleSelection), false));
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractPageWithNodes method updateContextMenusForSelection.
protected void updateContextMenusForSelection() {
// remove old
if (m_pageMenusOfSelection != null) {
getTable().getContextMenu().removeChildActions(m_pageMenusOfSelection);
m_pageMenusOfSelection = null;
}
List<IMenu> pageMenus = new ArrayList<IMenu>();
List<ITableRow> selectedRows = getTable().getSelectedRows();
if (CollectionUtility.size(selectedRows) == 1) {
ITreeNode node = getTreeNodeFor(CollectionUtility.firstElement(selectedRows));
if (node instanceof IPageWithNodes) {
IPageWithNodes pageWithNodes = (IPageWithNodes) node;
IActionFilter filter = ActionUtility.createMenuFilterMenuTypes(CollectionUtility.hashSet(TreeMenuType.SingleSelection), false);
List<IMenu> menus = ActionUtility.getActions(pageWithNodes.getMenus(), filter);
for (IMenu m : menus) {
pageMenus.add(new OutlineMenuWrapper(m, TREE_MENU_TYPE_MAPPER, filter));
}
}
}
getTable().getContextMenu().addChildActions(pageMenus);
m_pageMenusOfSelection = pageMenus;
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractPageWithNodes method rebuildTableInternal.
@Override
public void rebuildTableInternal() {
List<ITreeNode> childNodes = getChildNodes();
try {
getTable().setTableChanging(true);
//
unlinkAllTableRowWithPage();
getTable().discardAllRows();
for (ITreeNode childNode : childNodes) {
ITableRow row = new TableRow(getTable().getColumnSet());
updateCellFromPageCell(row.getCellForUpdate(0), childNode.getCell());
ITableRow insertedRow = getTable().addRow(row);
linkTableRowWithPage(insertedRow, (IPage) childNode);
}
} finally {
getTable().setTableChanging(false);
}
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractDecimalColumnTest method testPrepareEditInternal.
@Test
public void testPrepareEditInternal() {
setGroupingUsed(false);
setMinFractionDigits(5);
setMaxFractionDigits(6);
setPercent(true);
setMultiplier(100);
setFractionDigits(3);
ITableRow row = Mockito.mock(ITableRow.class);
AbstractBigDecimalField field = (AbstractBigDecimalField) prepareEditInternal(row);
assertFalse("expected groupingUsed-property to be propagated to field", field.isGroupingUsed());
assertEquals("expected minFractionDigits-property to be propagated to field", 5, field.getMinFractionDigits());
assertEquals("expected maxFractionDigits-property to be propagated to field", 6, field.getMaxFractionDigits());
assertTrue("expected percent-property to be propagated to field", field.isPercent());
assertEquals("expected multiplier-property to be propagated to field", 100, field.getMultiplier());
assertEquals("expected fractionDigits-property to be propagated to field", 3, field.getFractionDigits());
}
Aggregations