use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.
the class EditMenuBuilderTest method testOnDecisionTableSelectedEventWithOtherwiseCellSelectedAndItDoesNotHaveEditableColumns.
@Test
public void testOnDecisionTableSelectedEventWithOtherwiseCellSelectedAndItDoesNotHaveEditableColumns() {
when(dtPresenter.hasEditableColumns()).thenReturn(false);
model.getConditions().add(makePattern52());
model.getData().add(makeDTCellValue52ListWithOtherwise());
uiModel.selectCell(0, 2);
builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(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));
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.
the class EditMenuBuilderTest method testOnDecisionTableSelectedEventWithOtherwiseCellSelectedAndItHasEditableColumns.
@Test
public void testOnDecisionTableSelectedEventWithOtherwiseCellSelectedAndItHasEditableColumns() {
model.getConditions().add(makePattern52());
model.getData().add(makeDTCellValue52ListWithOtherwise());
uiModel.selectCell(0, 2);
builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(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.DecisionTableSelectedEvent in project drools-wb by kiegroup.
the class EditMenuBuilderTest method testOnDecisionTableSelectedEventWithOtherwiseColumnSelectedAndItHasEditableColumns.
@Test
public void testOnDecisionTableSelectedEventWithOtherwiseColumnSelectedAndItHasEditableColumns() {
model.getConditions().add(makePattern52());
model.getData().add(makeDTCellValue52());
uiModel.selectCell(0, 2);
builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(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(null));
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.
the class RadarMenuBuilderTest method testOnDecisionTableSelectedEvent.
@Test
public void testOnDecisionTableSelectedEvent() {
final DecisionTableSelectedEvent event = new DecisionTableSelectedEvent(dtPresenter);
builder.onDecisionTableSelectedEvent(event);
verify(view, times(1)).setEnabled(true);
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.
the class ViewMenuBuilderTest method testToggleMergeState.
@Test
public void testToggleMergeState() {
when(dtPresenter.isMerged()).thenReturn(false);
builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter));
assertTrue(builder.miToggleMergeState.getMenuItem().isEnabled());
assertTrue(builder.miViewAuditLog.getMenuItem().isEnabled());
verify(builder.miToggleMergeState.getMenuItemView(), times(1)).setIconType(eq(null));
builder.onToggleMergeState();
verify(dtPresenter, times(1)).setMerged(eq(true));
verify(builder.miToggleMergeState.getMenuItemView(), times(1)).setIconType(eq(IconType.CHECK));
}
Aggregations