Search in sources :

Example 6 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class CellContextMenuTest method testOnDecisionTableSelectedEventReadOnly.

@Test
public void testOnDecisionTableSelectedEventReadOnly() {
    dtPresenter.getAccess().setReadOnly(true);
    menu.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter));
    verify(view, times(1)).enableCutMenuItem(eq(false));
    verify(view, times(1)).enableCopyMenuItem(eq(false));
    verify(view, times(1)).enablePasteMenuItem(eq(false));
    verify(view, times(1)).enableDeleteCellMenuItem(eq(false));
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 7 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class InsertMenuBuilderTest method testOnDecisionTableSelectedEventWithMultipleRowsSelectedAndItDoesNotHaveEditableColumns.

@Test
public void testOnDecisionTableSelectedEventWithMultipleRowsSelectedAndItDoesNotHaveEditableColumns() {
    when(dtPresenter.hasEditableColumns()).thenReturn(false);
    model.getConditions().add(makePattern52());
    model.getData().add(makeDTCellValue52List());
    model.getData().add(makeDTCellValue52List());
    uiModel.selectCells(0, 2, 1, 2);
    builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter));
    assertTrue(builder.miAppendRow.getMenuItem().isEnabled());
    assertFalse(builder.miInsertRowAbove.getMenuItem().isEnabled());
    assertFalse(builder.miInsertRowBelow.getMenuItem().isEnabled());
    assertFalse(builder.miInsertColumn.getMenuItem().isEnabled());
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 8 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class InsertMenuBuilderTest method testOnDecisionTableSelectedEventWithSingleRowSelectedAndItHasEditableColumns.

@Test
public void testOnDecisionTableSelectedEventWithSingleRowSelectedAndItHasEditableColumns() {
    model.getConditions().add(makePattern52());
    model.getData().add(makeDTCellValue52List());
    uiModel.selectCell(0, 2);
    builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter));
    assertTrue(builder.miAppendRow.getMenuItem().isEnabled());
    assertTrue(builder.miInsertRowAbove.getMenuItem().isEnabled());
    assertTrue(builder.miInsertRowBelow.getMenuItem().isEnabled());
    assertTrue(builder.miInsertColumn.getMenuItem().isEnabled());
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 9 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class InsertMenuBuilderTest method testOnDecisionTableSelectedEventWithNoSelectionsAndItHasEditableColumns.

@Test
public void testOnDecisionTableSelectedEventWithNoSelectionsAndItHasEditableColumns() {
    builder.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter));
    assertTrue(builder.miAppendRow.getMenuItem().isEnabled());
    assertFalse(builder.miInsertRowAbove.getMenuItem().isEnabled());
    assertFalse(builder.miInsertRowBelow.getMenuItem().isEnabled());
    assertTrue(builder.miInsertColumn.getMenuItem().isEnabled());
}
Also used : DecisionTableSelectedEvent(org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent) Test(org.junit.Test)

Example 10 with DecisionTableSelectedEvent

use of org.drools.workbench.screens.guided.dtable.client.widget.table.events.cdi.DecisionTableSelectedEvent in project drools-wb by kiegroup.

the class RowContextMenuTest method testOnDecisionTableSelectedEventWithNoSelections.

@Test
public void testOnDecisionTableSelectedEventWithNoSelections() {
    menu.onDecisionTableSelectedEvent(new DecisionTableSelectedEvent(dtPresenter));
    verify(view, times(1)).enableCutMenuItem(eq(false));
    verify(view, times(1)).enableCopyMenuItem(eq(false));
    verify(view, times(1)).enablePasteMenuItem(eq(false));
    verify(view, times(1)).enableInsertRowAboveMenuItem(eq(false));
    verify(view, times(1)).enableInsertRowBelowMenuItem(eq(false));
    verify(view, times(1)).enableDeleteRowMenuItem(eq(false));
}
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