Search in sources :

Example 51 with DecisionTableSelectedEvent

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));
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 52 with DecisionTableSelectedEvent

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));
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 53 with DecisionTableSelectedEvent

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));
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 54 with DecisionTableSelectedEvent

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);
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 55 with DecisionTableSelectedEvent

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));
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Aggregations

DecisionTableSelectedEvent (org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent)58 Test (org.junit.Test)54 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)14 ObservablePath (org.uberfire.backend.vfs.ObservablePath)10 PlaceRequest (org.uberfire.mvp.PlaceRequest)10 GuidedDecisionTablePresenter (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTablePresenter)9 GuidedDecisionTableEditorContent (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorContent)9 MetadataCol52 (org.drools.workbench.models.guided.dtable.shared.model.MetadataCol52)7 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)5 GuidedDecisionTableEditorGraphContent (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphContent)2 GuidedDecisionTableGraphEntry (org.drools.workbench.screens.guided.dtable.model.GuidedDecisionTableEditorGraphModel.GuidedDecisionTableGraphEntry)2 OverviewWidgetPresenter (org.kie.workbench.common.widgets.metadata.client.widget.OverviewWidgetPresenter)2 Matchers.anyBoolean (org.mockito.Matchers.anyBoolean)2 MultiPageEditor (org.uberfire.client.workbench.widgets.multipage.MultiPageEditor)2 PathPlaceRequest (org.uberfire.mvp.impl.PathPlaceRequest)2 PostConstruct (javax.annotation.PostConstruct)1 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)1 Overview (org.guvnor.common.services.shared.metadata.model.Overview)1 AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)1 ImportsWidgetPresenter (org.kie.workbench.common.widgets.configresource.client.widget.bound.ImportsWidgetPresenter)1