Search in sources :

Example 6 with NewGuidedDecisionTableColumnWizard

use of org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard in project drools-wb by kiegroup.

the class ColumnsPagePresenter method openNewGuidedDecisionTableColumnWizard.

void openNewGuidedDecisionTableColumnWizard() {
    if (!isColumnCreationEnabledToActiveDecisionTable()) {
        return;
    }
    getActiveDecisionTable().ifPresent(dt -> {
        final NewGuidedDecisionTableColumnWizard wizard = wizardManagedInstance.get();
        wizard.init(dt);
        wizard.start();
    });
}
Also used : NewGuidedDecisionTableColumnWizard(org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard)

Example 7 with NewGuidedDecisionTableColumnWizard

use of org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard in project drools-wb by kiegroup.

the class InsertMenuBuilder method openNewGuidedDecisionTableColumnWizard.

void openNewGuidedDecisionTableColumnWizard(final GuidedDecisionTableModellerView.Presenter modeller) {
    final NewGuidedDecisionTableColumnWizard wizard = wizardManagedInstance.get();
    final Optional<GuidedDecisionTableView.Presenter> activeDecisionTable = modeller.getActiveDecisionTable();
    activeDecisionTable.ifPresent(dt -> {
        wizard.init(dt);
        wizard.start();
    });
}
Also used : NewGuidedDecisionTableColumnWizard(org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard)

Example 8 with NewGuidedDecisionTableColumnWizard

use of org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard in project drools-wb by kiegroup.

the class InsertMenuBuilderTest method testOnAppendColumnWhenModellerIsPresent.

@Test
public void testOnAppendColumnWhenModellerIsPresent() {
    final NewGuidedDecisionTableColumnWizard wizard = mock(NewGuidedDecisionTableColumnWizard.class);
    doReturn(wizard).when(wizardManagedInstance).get();
    when(modeller.getActiveDecisionTable()).thenReturn(Optional.of(dtPresenter));
    builder.setModeller(modeller);
    builder.onAppendColumn();
    verify(builder).openNewGuidedDecisionTableColumnWizard(modeller);
}
Also used : NewGuidedDecisionTableColumnWizard(org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard) Test(org.junit.Test)

Example 9 with NewGuidedDecisionTableColumnWizard

use of org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard in project drools-wb by kiegroup.

the class InsertMenuBuilderTest method testOnAppendColumnWhenActiveDecisionTableIsNotPresent.

@Test
public void testOnAppendColumnWhenActiveDecisionTableIsNotPresent() {
    final NewGuidedDecisionTableColumnWizard wizard = mock(NewGuidedDecisionTableColumnWizard.class);
    when(wizardManagedInstance.get()).thenReturn(wizard);
    when(modeller.getActiveDecisionTable()).thenReturn(Optional.empty());
    builder.setModeller(modeller);
    builder.onAppendColumn();
    verify(wizard, never()).init(any(GuidedDecisionTableView.Presenter.class));
    verify(wizard, never()).start();
}
Also used : NewGuidedDecisionTableColumnWizard(org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard) GuidedDecisionTablePresenter(org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTablePresenter) Test(org.junit.Test)

Example 10 with NewGuidedDecisionTableColumnWizard

use of org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard in project drools-wb by kiegroup.

the class ColumnsPagePresenterTest method testOpenNewGuidedDecisionTableColumnWizardWhenColumnCreatingIsNotEnabled.

@Test
public void testOpenNewGuidedDecisionTableColumnWizardWhenColumnCreatingIsNotEnabled() {
    final NewGuidedDecisionTableColumnWizard wizard = mock(NewGuidedDecisionTableColumnWizard.class);
    doReturn(false).when(presenter).isColumnCreationEnabledToActiveDecisionTable();
    doReturn(wizard).when(wizardManagedInstance).get();
    presenter.openNewGuidedDecisionTableColumnWizard();
    verify(wizard, never()).init(any());
    verify(wizard, never()).start();
}
Also used : NewGuidedDecisionTableColumnWizard(org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard) Test(org.junit.Test)

Aggregations

NewGuidedDecisionTableColumnWizard (org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard)13 Test (org.junit.Test)9 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)2 BaseDecisionTableColumnPlugin (org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.BaseDecisionTableColumnPlugin)2 DecisionTableColumnPlugin (org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.DecisionTableColumnPlugin)2 GuidedDecisionTableModellerView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableModellerView)1 GuidedDecisionTablePresenter (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTablePresenter)1 DecisionTablePopoverUtils (org.drools.workbench.screens.guided.dtable.client.wizard.column.pages.common.DecisionTablePopoverUtils)1