Search in sources :

Example 1 with NewGuidedDecisionTableColumnWizard

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

the class PluginHandler method openWizard.

void openWizard(final DecisionTableColumnPlugin plugin) {
    if (presenter.isReadOnly()) {
        return;
    }
    final NewGuidedDecisionTableColumnWizard wizard = wizardManagedInstance.get();
    wizard.init(presenter);
    wizard.start(plugin);
}
Also used : NewGuidedDecisionTableColumnWizard(org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard)

Example 2 with NewGuidedDecisionTableColumnWizard

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

the class ColumnsPagePresenterTest method testOpenNewGuidedDecisionTableColumnWizardWhenColumnCreatingIsEnabled.

@Test
public void testOpenNewGuidedDecisionTableColumnWizardWhenColumnCreatingIsEnabled() {
    final NewGuidedDecisionTableColumnWizard wizard = mock(NewGuidedDecisionTableColumnWizard.class);
    final GuidedDecisionTableView.Presenter activeDecisionTable = mock(GuidedDecisionTableView.Presenter.class);
    doReturn(true).when(presenter).isColumnCreationEnabledToActiveDecisionTable();
    doReturn(Optional.of(activeDecisionTable)).when(modeller).getActiveDecisionTable();
    doReturn(wizard).when(wizardManagedInstance).get();
    presenter.openNewGuidedDecisionTableColumnWizard();
    verify(wizard).init(activeDecisionTable);
    verify(wizard).start();
}
Also used : NewGuidedDecisionTableColumnWizard(org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard) GuidedDecisionTableView(org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView) Test(org.junit.Test)

Example 3 with NewGuidedDecisionTableColumnWizard

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

the class PluginHandlerTest method testOpenWizardWhenTableIsReadOnly.

@Test
public void testOpenWizardWhenTableIsReadOnly() throws Exception {
    final DecisionTableColumnPlugin plugin = mock(DecisionTableColumnPlugin.class);
    final NewGuidedDecisionTableColumnWizard wizard = mock(NewGuidedDecisionTableColumnWizard.class);
    doReturn(true).when(presenter).isReadOnly();
    doReturn(wizard).when(wizardManagedInstance).get();
    pluginHandler.openWizard(plugin);
    verify(wizard, never()).init(presenter);
    verify(wizard, never()).start(plugin);
}
Also used : NewGuidedDecisionTableColumnWizard(org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard) DecisionTableColumnPlugin(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.DecisionTableColumnPlugin) BaseDecisionTableColumnPlugin(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.BaseDecisionTableColumnPlugin) Test(org.junit.Test)

Example 4 with NewGuidedDecisionTableColumnWizard

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

the class InsertMenuBuilderTest method testOpenNewGuidedDecisionTableColumnWizard.

@Test
public void testOpenNewGuidedDecisionTableColumnWizard() {
    final GuidedDecisionTableModellerView.Presenter modeller = mock(GuidedDecisionTableModellerView.Presenter.class);
    final GuidedDecisionTableView.Presenter activeDecisionTable = mock(GuidedDecisionTableView.Presenter.class);
    final NewGuidedDecisionTableColumnWizard wizard = mock(NewGuidedDecisionTableColumnWizard.class);
    doReturn(wizard).when(wizardManagedInstance).get();
    doReturn(Optional.of(activeDecisionTable)).when(modeller).getActiveDecisionTable();
    builder.openNewGuidedDecisionTableColumnWizard(modeller);
    verify(wizard).init(activeDecisionTable);
    verify(wizard).start();
}
Also used : NewGuidedDecisionTableColumnWizard(org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard) GuidedDecisionTableModellerView(org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableModellerView) GuidedDecisionTableView(org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView) Test(org.junit.Test)

Example 5 with NewGuidedDecisionTableColumnWizard

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

the class InsertMenuBuilderTest method testOnAppendColumnWhenModellerIsNotPresent.

@Test
public void testOnAppendColumnWhenModellerIsNotPresent() {
    final NewGuidedDecisionTableColumnWizard wizard = mock(NewGuidedDecisionTableColumnWizard.class);
    doReturn(wizard).when(wizardManagedInstance).get();
    builder.setModeller(null);
    builder.onAppendColumn();
    verify(builder, never()).openNewGuidedDecisionTableColumnWizard(any());
}
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