use of org.eclipse.scout.rt.client.ui.action.IActionFilter in project scout.rt by eclipse.
the class TableMenuTest method testEmptySelection.
/**
* Tests the visibility for a empty space menu
*/
@Test
public void testEmptySelection() {
Table t = new Table();
t.addRowsByMatrix(TEST_ROWS);
ITableContextMenu contextMenu = t.getContextMenu();
// empty selection
t.selectRows(CollectionUtility.<ITableRow>emptyArrayList(), false);
IActionFilter filter = ActionUtility.createMenuFilterMenuTypes(contextMenu.getCurrentMenuTypes(), true);
List<IMenu> visibleMenus = ActionUtility.normalizedActions(contextMenu.getChildActions(), filter);
assertEquals(1, visibleMenus.size());
assertEquals("EmptySpaceMenu", visibleMenus.get(0).getClass().getSimpleName());
}
use of org.eclipse.scout.rt.client.ui.action.IActionFilter in project scout.rt by eclipse.
the class TableMenuTest method testRowDisabledEmptySelection.
/**
* Tests menu empty space menu enabled if row disabled, empty selection
*/
@Test
public void testRowDisabledEmptySelection() {
Table t = new Table();
t.addRowsByMatrix(TEST_ROWS);
ITableContextMenu contextMenu = t.getContextMenu();
t.getRow(0).setEnabled(false);
t.selectRows(CollectionUtility.<ITableRow>emptyArrayList(), false);
IActionFilter filter = ActionUtility.createMenuFilterMenuTypes(contextMenu.getCurrentMenuTypes(), true);
List<IMenu> visibleMenus = ActionUtility.normalizedActions(contextMenu.getChildActions(), filter);
assertEquals(true, visibleMenus.get(0).isEnabled());
}
use of org.eclipse.scout.rt.client.ui.action.IActionFilter in project scout.rt by eclipse.
the class TableMenuTest method testTableDisabledSingleSelection.
/**
* Tests menu disabled if table disabled, single selection
*/
@Test
public void testTableDisabledSingleSelection() {
Table t = new Table();
t.setEnabled(false);
t.addRowsByMatrix(TEST_ROWS);
ITableContextMenu contextMenu = t.getContextMenu();
t.selectRows(CollectionUtility.arrayList(t.getRow(0)), false);
IActionFilter filter = ActionUtility.createMenuFilterMenuTypes(contextMenu.getCurrentMenuTypes(), true);
List<IMenu> visibleMenus = ActionUtility.normalizedActions(contextMenu.getChildActions(), filter);
assertEquals(false, visibleMenus.get(0).isEnabled());
}
use of org.eclipse.scout.rt.client.ui.action.IActionFilter in project scout.rt by eclipse.
the class TableMenuTest method testTableDisabledEmptySelection.
/**
* Tests empty space menu disabled if table disabled, empty selection
*/
@Test
public void testTableDisabledEmptySelection() {
Table t = new Table();
t.setEnabled(false);
t.addRowsByMatrix(TEST_ROWS);
ITableContextMenu contextMenu = t.getContextMenu();
t.selectRows(CollectionUtility.<ITableRow>emptyArrayList(), false);
IActionFilter filter = ActionUtility.createMenuFilterMenuTypes(contextMenu.getCurrentMenuTypes(), true);
List<IMenu> visibleMenus = ActionUtility.normalizedActions(contextMenu.getChildActions(), filter);
assertEquals(false, visibleMenus.get(0).isEnabled());
}
Aggregations