Search in sources :

Example 1 with DecisionTableColumnPlugin

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

the class SummaryPage method openPage.

void openPage(final String selectedItemText) {
    if (selectedItemText.isEmpty() || presenter.isReadOnly()) {
        return;
    }
    final DecisionTableColumnPlugin plugin = findPluginByIdentifier(selectedItemText);
    wizard.start(plugin);
}
Also used : DecisionTableColumnPlugin(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.DecisionTableColumnPlugin)

Example 2 with DecisionTableColumnPlugin

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

the class SummaryPageView method loadPluginList.

@Override
public void loadPluginList(final List<DecisionTableColumnPlugin> plugins) {
    pluginsList.clear();
    for (final DecisionTableColumnPlugin plugin : plugins) {
        pluginsList.addItem(plugin.getTitle(), plugin.getIdentifier());
    }
    pluginsList.setVisibleItemCount(pluginsList.getItemCount());
}
Also used : DecisionTableColumnPlugin(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.DecisionTableColumnPlugin)

Example 3 with DecisionTableColumnPlugin

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

the class PluginHandler method edit.

public void edit(final ActionCol52 column) {
    final DecisionTableColumnPlugin plugin;
    if (column instanceof ActionWorkItemSetFieldCol52 || column instanceof ActionWorkItemInsertFactCol52) {
        plugin = actionWorkItemSetFieldPlugin.get();
    } else if (column instanceof ActionInsertFactCol52 || column instanceof ActionSetFieldCol52) {
        plugin = actionSetFactPlugin.get();
    } else if (column instanceof ActionRetractFactCol52) {
        plugin = actionRetractFactPlugin.get();
    } else if (column instanceof ActionWorkItemCol52) {
        plugin = actionWorkItemPlugin.get();
    } else if (column instanceof BRLActionColumn) {
        plugin = brlActionColumnPlugin.get();
    } else {
        return;
    }
    plugin.setOriginalColumnConfig52(column);
    openWizard(plugin);
}
Also used : BRLActionColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn) ActionInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52) ActionWorkItemInsertFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52) ActionRetractFactCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52) ActionWorkItemCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52) ActionWorkItemSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemSetFieldCol52) DecisionTableColumnPlugin(org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.DecisionTableColumnPlugin) ActionSetFieldCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)

Example 4 with DecisionTableColumnPlugin

use of org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.DecisionTableColumnPlugin 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 5 with DecisionTableColumnPlugin

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

the class PluginHandlerTest method testOpenWizardWhenTableIsNotReadOnly.

@Test
public void testOpenWizardWhenTableIsNotReadOnly() throws Exception {
    final DecisionTableColumnPlugin plugin = mock(DecisionTableColumnPlugin.class);
    final NewGuidedDecisionTableColumnWizard wizard = mock(NewGuidedDecisionTableColumnWizard.class);
    doReturn(false).when(presenter).isReadOnly();
    doReturn(wizard).when(wizardManagedInstance).get();
    pluginHandler.openWizard(plugin);
    verify(wizard).init(presenter);
    verify(wizard).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)

Aggregations

DecisionTableColumnPlugin (org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.DecisionTableColumnPlugin)8 BaseDecisionTableColumnPlugin (org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons.BaseDecisionTableColumnPlugin)5 Test (org.junit.Test)4 NewGuidedDecisionTableColumnWizard (org.drools.workbench.screens.guided.dtable.client.wizard.column.NewGuidedDecisionTableColumnWizard)2 ActionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionCol52)1 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)1 ActionRetractFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionRetractFactCol52)1 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)1 ActionWorkItemCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52)1 ActionWorkItemInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemInsertFactCol52)1 ActionWorkItemSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemSetFieldCol52)1 BRLActionColumn (org.drools.workbench.models.guided.dtable.shared.model.BRLActionColumn)1