use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectionsChangedEvent in project drools-wb by kiegroup.
the class EditMenuBuilderTest method testOnDecisionTableSelectionsChangedEventWithSelectionsWithClipboardPopulatedAndItHasEditableColumns.
@Test
public void testOnDecisionTableSelectionsChangedEventWithSelectionsWithClipboardPopulatedAndItHasEditableColumns() {
model.getMetadataCols().add(new MetadataCol52());
model.getData().add(makeDTCellValue52());
uiModel.selectCell(0, 2);
clipboard.setData(makeClipboardHashSetData());
builder.onDecisionTableSelectionsChangedEvent(new DecisionTableSelectionsChangedEvent(dtPresenter));
assertTrue(builder.miCut.getMenuItem().isEnabled());
assertTrue(builder.miCopy.getMenuItem().isEnabled());
assertTrue(builder.miPaste.getMenuItem().isEnabled());
assertTrue(builder.miDeleteSelectedCells.getMenuItem().isEnabled());
assertTrue(builder.miDeleteSelectedColumns.getMenuItem().isEnabled());
assertTrue(builder.miDeleteSelectedRows.getMenuItem().isEnabled());
assertFalse(builder.miOtherwiseCell.getMenuItem().isEnabled());
verify(builder.miOtherwiseCell.getMenuItemView(), times(1)).setIconType(eq(null));
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectionsChangedEvent in project drools-wb by kiegroup.
the class EditMenuBuilderTest method testOnDecisionTableSelectionsChangedEventWithOtherwiseCellSelectedAndItHasEditableColumns.
@Test
public void testOnDecisionTableSelectionsChangedEventWithOtherwiseCellSelectedAndItHasEditableColumns() {
model.getConditions().add(makePattern52());
model.getData().add(makeDTCellValue52ListWithOtherwise());
uiModel.selectCell(0, 2);
builder.onDecisionTableSelectionsChangedEvent(new DecisionTableSelectionsChangedEvent(dtPresenter));
assertTrue(builder.miCut.getMenuItem().isEnabled());
assertTrue(builder.miCopy.getMenuItem().isEnabled());
assertFalse(builder.miPaste.getMenuItem().isEnabled());
assertTrue(builder.miDeleteSelectedCells.getMenuItem().isEnabled());
assertTrue(builder.miDeleteSelectedColumns.getMenuItem().isEnabled());
assertTrue(builder.miDeleteSelectedRows.getMenuItem().isEnabled());
assertTrue(builder.miOtherwiseCell.getMenuItem().isEnabled());
verify(builder.miOtherwiseCell.getMenuItemView(), times(1)).setIconType(eq(IconType.CHECK));
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectionsChangedEvent in project drools-wb by kiegroup.
the class EditMenuBuilderTest method testOnDecisionTableSelectionsChangedEventWithOtherwiseCellSelectedAndItDoesNotHaveEditableColumns.
@Test
public void testOnDecisionTableSelectionsChangedEventWithOtherwiseCellSelectedAndItDoesNotHaveEditableColumns() {
when(dtPresenter.hasEditableColumns()).thenReturn(false);
model.getConditions().add(makePattern52());
model.getData().add(makeDTCellValue52ListWithOtherwise());
uiModel.selectCell(0, 2);
builder.onDecisionTableSelectionsChangedEvent(new DecisionTableSelectionsChangedEvent(dtPresenter));
assertTrue(builder.miCut.getMenuItem().isEnabled());
assertTrue(builder.miCopy.getMenuItem().isEnabled());
assertFalse(builder.miPaste.getMenuItem().isEnabled());
assertTrue(builder.miDeleteSelectedCells.getMenuItem().isEnabled());
assertFalse(builder.miDeleteSelectedColumns.getMenuItem().isEnabled());
assertTrue(builder.miDeleteSelectedRows.getMenuItem().isEnabled());
assertTrue(builder.miOtherwiseCell.getMenuItem().isEnabled());
verify(builder.miOtherwiseCell.getMenuItemView(), times(1)).setIconType(eq(IconType.CHECK));
}
Aggregations