Package org.drools.ide.common.client.modeldriven.brl

Examples of org.drools.ide.common.client.modeldriven.brl.FreeFormLine


    @Test
    public void testFreeFormLine() {
        RuleModel model = new RuleModel();

        model.lhs = new IPattern[1];
        FreeFormLine ffl0 = new FreeFormLine();
        ffl0.text = "ffl0";
        model.lhs[0] = ffl0;

        RuleModelCloneVisitor cloneVisitor = new RuleModelCloneVisitor();
        RuleModel clone = cloneVisitor.visitRuleModel( model );

        assertEquals( 1,
                      clone.lhs.length );
        assertNotSame( model.lhs[0],
                       clone.lhs[0] );
        assertNotNull( clone.lhs[0] );
        assertTrue( clone.lhs[0] instanceof FreeFormLine );
        FreeFormLine ffl0Clone = (FreeFormLine) clone.lhs[0];
        assertEquals( ffl0.text,
                      ffl0Clone.text );
    }
View Full Code Here


                } else if (sender == fromAccumulateBtn) {
                    getFromCollectPattern().setRightPattern(new FromAccumulateCompositeFactPattern());
                } else if (sender == fromCollectBtn) {
                    getFromCollectPattern().setRightPattern(new FromCollectCompositeFactPattern());
                } else if (sender == freeFormDRLBtn) {
                    getFromCollectPattern().setRightPattern(new FreeFormLine());
                } else {
                    throw new IllegalArgumentException("Unknown sender: " + sender);
                }
                setModified(true);
                getModeller().refreshWidget();
View Full Code Here

                             "FF" );
            cmds.put( "FF",
                      new Command() {

                          public void execute() {
                              model.addRhsItem( new FreeFormLine(),
                                                Integer.parseInt( positionCbo.getValue( positionCbo.getSelectedIndex() ) ) );
                              hide();
                          }
                      } );
View Full Code Here

            public void widgetDefaultSelected(SelectionEvent e) {
            }

            public void widgetSelected(SelectionEvent e) {
                modeller.getModel().addRhsItem( new FreeFormLine() );
                modeller.setDirty( true );
                modeller.reloadRhs();
                close();
            }
        } );
View Full Code Here

        }
        return clone;
    }

    private FreeFormLine visitFreeFormLine(FreeFormLine ffl) {
        FreeFormLine clone = new FreeFormLine();
        clone.text = ffl.text;
        return clone;
    }
View Full Code Here

            public void widgetDefaultSelected(SelectionEvent e) {
            }

            public void widgetSelected(SelectionEvent e) {
                modeller.getModel().addLhsItem( new FreeFormLine() );
                modeller.setDirty( true );
                modeller.reloadLhs();
                close();
            }
        } );
View Full Code Here

        RuleModel m = new RuleModel();
        m.name = "with composite";
        m.lhs = new IPattern[1];
        m.rhs = new IAction[1];

        FreeFormLine fl = new FreeFormLine();
        fl.text = "Person()";
        m.lhs[0] = fl;

        FreeFormLine fr = new FreeFormLine();
        fr.text = "fun()";
        m.rhs[0] = fr;

        String drl = brlPersistence.marshal( m );
        assertNotNull( drl );
View Full Code Here

        RuleModel m = new RuleModel();
        m.name = "with composite";
        m.lhs = new IPattern[1];
        m.rhs = new IAction[1];

        FreeFormLine fl = new FreeFormLine();
        fl.text = "Person()";
        m.lhs[0] = fl;

        FreeFormLine fr = new FreeFormLine();
        fr.text = "fun()";
        m.rhs[0] = fr;

        String xml = BRXMLPersistence.getInstance().marshal( m );
        assertNotNull( xml );
View Full Code Here

    sfc.setConstraintValueType(BaseSingleFieldConstraint.TYPE_TEMPLATE);
    fp.addConstraint(sfc);

    m.lhs[0] = fp;
   
    FreeFormLine ffl = new FreeFormLine();
    ffl.text = "Cheese(type == @{type}, price < @{price})";
   
    m.lhs[1] = ffl;

    ActionInsertFact aif = new ActionInsertFact("Person");
View Full Code Here

            public void widgetDefaultSelected(SelectionEvent e) {
            }

            public void widgetSelected(SelectionEvent e) {
                modeller.getModel().addRhsItem( new FreeFormLine() );
                modeller.setDirty( true );
                modeller.reloadRhs();
                close();
            }
        } );
View Full Code Here

TOP

Related Classes of org.drools.ide.common.client.modeldriven.brl.FreeFormLine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.