Package org.drools.workbench.models.testscenarios.shared

Examples of org.drools.workbench.models.testscenarios.shared.FieldData


            if (selectionEvent.getSelectedItem() == FieldData.TYPE_COLLECTION) {
                CollectionFieldData collectionFieldData = new CollectionFieldData();
                collectionFieldData.setName(field.getName());
                return collectionFieldData;
            } else {
                FieldData fieldData = new FieldData(field.getName(), "");
                fieldData.setNature(selectionEvent.getSelectedItem());
                return fieldData;
            }
        }
    }
View Full Code Here


                    fact.getType());
            widget.setWidget(fieldRowIndex,
                    col,
                    editableCell);
            if (field instanceof FieldData) {
                FieldData fieldData = (FieldData) field;
                if (fieldData.getNature() == FieldData.TYPE_ENUM) {
                    enumEditorMap.put(fieldData, (FieldDataConstraintEditor) editableCell);
                }
            }
        }
        for (FieldDataConstraintEditor outerEnumEditor : enumEditorMap.values()) {
View Full Code Here

    DropDownData getEnums() {
        Map<String, String> currentValueMap = new HashMap<String, String>();
        for (Field f : fact.getFieldData()) {
            if (f instanceof FieldData) {
                FieldData otherFieldData = (FieldData) f;
                currentValueMap.put(otherFieldData.getName(),
                        otherFieldData.getValue());
            }
        }
        return dmo.getEnums(
                factType,
                field.getName(),
View Full Code Here

        parent.renderEditor();
    }

    @UiHandler("newItemBelow")
    public void newItemBelow(ClickEvent event) {
        FieldData newFieldData = new FieldData();
        newFieldData.setName(parentField.getName());
        parentField.getCollectionFieldList().add(index + 1,
                newFieldData);
        parent.renderEditor();
    }
View Full Code Here

    }

    @UiHandler("suffleDown")
    public void suffleDown(ClickEvent event) {
        if (index < parentField.getCollectionFieldList().size() - 1) {
            FieldData onMyLine = parentField.getCollectionFieldList().get(index);
            FieldData onDown = parentField.getCollectionFieldList().get(index + 1);
            parentField.getCollectionFieldList().set(index + 1,
                    onMyLine);
            parentField.getCollectionFieldList().set(index,
                    onDown);
            parent.renderEditor();
View Full Code Here

    }

    @UiHandler("suffleUp")
    public void suffleUp(ClickEvent event) {
        if (index > 0) {
            FieldData oneUp = parentField.getCollectionFieldList().get(index - 1);
            FieldData onMyLine = parentField.getCollectionFieldList().get(index);
            parentField.getCollectionFieldList().set(index,
                    oneUp);
            parentField.getCollectionFieldList().set(index - 1,
                    onMyLine);
            parent.renderEditor();
View Full Code Here

            image.setAltText(TestScenarioConstants.INSTANCE.AElementToAddInCollectionList());
            image.setTitle(TestScenarioConstants.INSTANCE.AElementToAddInCollectionList());
            image.addClickHandler(new ClickHandler() {

                public void onClick(ClickEvent w) {
                    FieldData fieldData = new FieldData();
                    fieldData.setName(field.getName());
                    field.getCollectionFieldList().add(fieldData);
                    parent.renderEditor();
                }
            });
View Full Code Here

    public void testPopulateFacts() throws Exception {
        FactData factData = new FactData(
                "Person",
                "p1",
                Arrays.<Field>asList(
                        new FieldData(
                                "name",
                                "mic" ),
                        new FieldData(
                                "age",
                                "=30 + 3" ) ),
                false );

        factPopulator.add( new NewFactPopulator( populatedData, getTypeResolver(), factData ) );
View Full Code Here

    }

    @Test
    public void testPopulateEnum() throws Exception {

        FieldData fieldData = new FieldData(
                "cheeseType",
                "CheeseType.CHEDDAR" );
        fieldData.setNature( FieldData.TYPE_ENUM );
        FactData factData = new FactData( "Cheese",
                                          "c1",
                                          asList( (Field) fieldData ),
                                          false );
View Full Code Here

        FactData cheeseFactData = new FactData(
                "Cheese",
                "c1",
                Arrays.<Field>asList(
                        new FieldData(
                                "type",
                                "cheddar" ),
                        new FieldData(
                                "price",
                                "42" ) ),
                false );

        factPopulator.add( new NewFactPopulator( populatedData, typeResolver, cheeseFactData ) );

        FactData outerFactData = new FactData(
                "OuterFact",
                "p1",
                Arrays.<Field>asList(
                        new FieldData(
                                "name",
                                "mic" ),
                        new FieldData(
                                "innerFact",
                                "=c1" ) ),
                false );

        factPopulator.add( new NewFactPopulator( populatedData, typeResolver, outerFactData ) );
View Full Code Here

TOP

Related Classes of org.drools.workbench.models.testscenarios.shared.FieldData

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.