Search in sources :

Example 16 with ActionInsertNode

use of org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionInsertNode in project drools-wb by kiegroup.

the class GuidedDecisionTreePalette method setDataModelOracle.

public void setDataModelOracle(final AsyncPackageDataModelOracle oracle, final boolean isReadOnly) {
    this.oracle = PortablePreconditions.checkNotNull("oracle", oracle);
    clear();
    // Add types and constraints
    for (String className : oracle.getFactTypes()) {
        add(makePanelGroup(className, isReadOnly));
    }
    // Add actions
    final GuidedDecisionTreePaletteGroup paletteGroup = new GuidedDecisionTreePaletteGroup();
    if (oracle.getFactTypes().length > 0) {
        final String className = oracle.getFactTypes()[0];
        final ActionInsertNode an1 = new ActionInsertNodeImpl(className);
        paletteGroup.addStencil(actionInsertNodeFactory, stencilBuilder, new ActionInsertFactoryHelper(an1, isReadOnly), isReadOnly);
    }
    final ActionUpdateNode an2 = new ActionUpdateNodeImpl();
    paletteGroup.addStencil(actionUpdateNodeFactory, stencilBuilder, new ActionUpdateFactoryHelper(an2, isReadOnly), isReadOnly);
    final ActionRetractNode an3 = new ActionRetractNodeImpl();
    paletteGroup.addStencil(actionRetractNodeFactory, stencilBuilder, new ActionRetractFactoryHelper(an3, isReadOnly), isReadOnly);
    add(new PanelGroup() {

        {
            final PanelCollapse collapse = new PanelCollapse() {

                {
                    add(new PanelBody() {

                        {
                            add(paletteGroup);
                        }
                    });
                }
            };
            add(new PanelHeader() {

                {
                    setDataToggle(Toggle.COLLAPSE);
                    setDataParent(getId());
                    setDataTargetWidget(collapse);
                    add(new Heading(HeadingSize.H4) {

                        {
                            setText(GuidedDecisionTreeConstants.INSTANCE.actionsPaletteGroup());
                        }
                    });
                }
            });
            add(collapse);
        }
    });
}
Also used : ActionInsertNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionInsertNode) Heading(org.gwtbootstrap3.client.ui.Heading) ActionRetractFactoryHelper(org.drools.workbench.screens.guided.dtree.client.widget.factories.ActionRetractFactoryHelper) ActionUpdateFactoryHelper(org.drools.workbench.screens.guided.dtree.client.widget.factories.ActionUpdateFactoryHelper) ActionRetractNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionRetractNode) ActionInsertFactoryHelper(org.drools.workbench.screens.guided.dtree.client.widget.factories.ActionInsertFactoryHelper) ActionInsertNodeImpl(org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionInsertNodeImpl) ActionRetractNodeImpl(org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionRetractNodeImpl) PanelBody(org.gwtbootstrap3.client.ui.PanelBody) PanelHeader(org.gwtbootstrap3.client.ui.PanelHeader) ActionUpdateNode(org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionUpdateNode) ActionUpdateNodeImpl(org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionUpdateNodeImpl) PanelGroup(org.gwtbootstrap3.client.ui.PanelGroup) PanelCollapse(org.gwtbootstrap3.client.ui.PanelCollapse)

Aggregations

ActionInsertNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionInsertNode)16 TypeNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.TypeNode)13 ActionInsertNodeImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionInsertNodeImpl)12 ActionFieldValueImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionFieldValueImpl)9 GuidedDecisionTree (org.drools.workbench.models.guided.dtree.shared.model.GuidedDecisionTree)8 TypeNodeImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.TypeNodeImpl)8 Test (org.junit.Test)8 ActionRetractNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionRetractNode)5 ActionUpdateNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.ActionUpdateNode)5 BigIntegerValue (org.drools.workbench.models.guided.dtree.shared.model.values.impl.BigIntegerValue)5 DateValue (org.drools.workbench.models.guided.dtree.shared.model.values.impl.DateValue)5 IntegerValue (org.drools.workbench.models.guided.dtree.shared.model.values.impl.IntegerValue)5 Calendar (java.util.Calendar)4 ConstraintNode (org.drools.workbench.models.guided.dtree.shared.model.nodes.ConstraintNode)4 Node (org.drools.workbench.models.guided.dtree.shared.model.nodes.Node)4 BigInteger (java.math.BigInteger)2 Date (java.util.Date)2 ActionRetractNodeImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionRetractNodeImpl)2 ActionUpdateNodeImpl (org.drools.workbench.models.guided.dtree.shared.model.nodes.impl.ActionUpdateNodeImpl)2 ArrayList (java.util.ArrayList)1