Examples of FieldData


Examples of com.foxykeep.cpcodegenerator.model.FieldData

                hasPreviousUnique = false;
                hasAutoIncrementPrimaryKey = false;
                hasTextField = false;

                for (int i = 0, n = tableData.fieldList.size(); i < n; i++) {
                    FieldData fieldData = tableData.fieldList.get(i);

                    final boolean isNotLast = i != n - 1;

                    sbEnumFields.append(TAB3)
                            .append(fieldData.dbConstantName)
View Full Code Here

Examples of org.broadleafcommerce.openadmin.web.rulebuilder.dto.FieldData

    public void setFields(final List<FieldData> fields) {
        List<FieldData> proxyFields = (List<FieldData>) Proxy.newProxyInstance(getClass().getClassLoader(), new Class<?>[]{List.class}, new InvocationHandler() {
            @Override
            public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                if (method.getName().equals("add")) {
                    FieldData fieldData = (FieldData) args[0];
                    testFieldName(fieldData);
                }
                if (method.getName().equals("addAll")) {
                    Collection<FieldData> addCollection = (Collection<FieldData>) args[0];
                    Iterator<FieldData> itr = addCollection.iterator();
                    while (itr.hasNext()) {
                        FieldData fieldData = itr.next();
                        testFieldName(fieldData);
                    }
                }
                return method.invoke(fields, args);
            }

            private void testFieldName(FieldData fieldData) throws ClassNotFoundException {
                if (!StringUtils.isEmpty(fieldData.getFieldName()) && dynamicEntityDao != null) {
                    Class<?>[] dtos = dynamicEntityDao.getAllPolymorphicEntitiesFromCeiling(Class.forName(getDtoClassName()));
                    if (ArrayUtils.isEmpty(dtos)) {
                        dtos = new Class<?>[]{Class.forName(getDtoClassName())};
                    }
                    Field field = null;
                    for (Class<?> dto : dtos) {
                        field = dynamicEntityDao.getFieldManager().getField(dto, fieldData.getFieldName());
                        if (field != null) {
                            break;
                        }
                    }
                    if (field == null) {
                        throw new IllegalArgumentException("Unable to find the field declared in FieldData (" + fieldData.getFieldName() + ") on the target class (" + getDtoClassName() + "), or any registered entity class that derives from it.");
                    }
                }
            }
        });
        this.fields = proxyFields;
View Full Code Here

Examples of org.drools.guvnor.client.modeldriven.testing.FieldData

    public void testPopulateFacts() throws Exception {
        Scenario sc = new Scenario();
        List facts = ls( new FactData( "Cheese",
                                       "c1",
                                       ls( new FieldData( "type",
                                                          "cheddar" ),
                                           new FieldData( "price",
                                                          "42" ) ),
                                       false ),
                         new FactData( "Person",
                                       "p1",
                                       ls( new FieldData( "name",
                                                          "mic" ),
                                           new FieldData( "age",
                                                          "=30 + 3" ) ),
                                       false ) );

        sc.fixtures.addAll( facts );
        TypeResolver resolver = new ClassTypeResolver( new HashSet<String>(),
View Full Code Here

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

    public FieldPopulator getFieldPopulator(Field field) throws ClassNotFoundException,
            InstantiationException,
            IllegalAccessException, InvocationTargetException, NoSuchMethodException {
        if (field instanceof FieldData) {
            FieldData fieldData = (FieldData) field;
            if (fieldData.getValue() == null) {
                throw new IllegalArgumentException("Field value can not be null");
            } else {
                return getFieldDataPopulator(factObject,
                        fieldData);
            }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.testing.FieldData

                //based upon the first if they were all created after this fix for GUVNOR-1139 was implemented.
                List<FactData> existingFactData = scenario.getFactTypesToFactData().get( factType );
                if ( existingFactData != null ) {
                    if ( existingFactData.size() > 0 ) {
                        for ( FieldData fieldData : existingFactData.get( 0 ).getFieldData() )
                            fd.getFieldData().add( new FieldData( fieldData.getName(),
                                                                  "" ) );
                    }
                }

                return fd;
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.testing.FieldData

                    public void onClick(ClickEvent event) {
                        String field = fieldsListBox.getItemText( fieldsListBox.getSelectedIndex() );
                        for ( Fixture fixture : definitionList ) {
                            if ( fixture instanceof FactData ) {
                                FactData factData = (FactData) fixture;
                                factData.getFieldData().add( new FieldData( field,
                                                                            "" ) );
                            }
                        }
                        render();
                        pop.hide();
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.testing.FieldData

                }

                //
                for ( Map.Entry<String, Integer> entry : presentFields.entrySet() ) {
                    int fieldRow = ((Integer) entry.getValue()).intValue();
                    FieldData fieldData = new FieldData( (String) entry.getKey(),
                                                         "" );
                    factData.getFieldData().add( fieldData );
                    setWidget( fieldRow,
                               col,
                               editableCell( fieldData,
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.testing.FieldData

            Image addPattern = new ImageButton( images.newItemBelow() );
            addPattern.setTitle( constants.AddElementBelow() );

            addPattern.addClickHandler( new ClickHandler() {
                public void onClick(ClickEvent sender) {
                    FieldData newFieldData = new FieldData();
                    newFieldData.setName( field.getName() );
                    newFieldData.collectionType = field.collectionType;
                    field.collectionFieldList.add( index + 1,
                                                   newFieldData );
                    calculateValueFromList();
                    refreshEditor();
                }
            } );
            hpanel.add( addPattern );
            Image moveDown = new ImageButton( images.shuffleDown() );
            moveDown.setTitle( constants.MoveDownListMove() );
            moveDown.addClickHandler( new ClickHandler() {
                public void onClick(ClickEvent sender) {
                    if ( index < field.collectionFieldList.size() - 1 ) {
                        FieldData onMyLine = field.collectionFieldList.get( index );
                        FieldData onDown = field.collectionFieldList.get( index + 1 );
                        field.collectionFieldList.set( index + 1,
                                                       onMyLine );
                        field.collectionFieldList.set( index,
                                                       onDown );
                        calculateValueFromList();
                        refreshEditor();
                    }
                }
            } );
            hpanel.add( moveDown );

            Image moveUp = new ImageButton( images.shuffleUp() );
            moveUp.setTitle( constants.MoveUpList() );
            moveUp.addClickHandler( new ClickHandler() {
                public void onClick(ClickEvent sender) {
                    if ( index > 0 ) {
                        FieldData oneUp = field.collectionFieldList.get( index - 1 );
                        FieldData onMyLine = field.collectionFieldList.get( index );
                        field.collectionFieldList.set( index,
                                                       oneUp );
                        field.collectionFieldList.set( index - 1,
                                                       onMyLine );
                        calculateValueFromList();
                        refreshEditor();
                    }
                }
            } );
            hpanel.add( moveUp );
            panel.add( hpanel );
            i++;
        }

        if ( this.field.collectionFieldList.size() == 0 ) {
            Image add = new ImageButton( images.newItem(),
                                         constants.AElementToAddInCollectionList(),
                                         new ClickHandler() {
                                             public void onClick(ClickEvent w) {
                                                 FieldData newFieldData = new FieldData();
                                                 newFieldData.setName( field.getName() );
                                                 newFieldData.collectionType = field.collectionType;
                                                 field.collectionFieldList.add( newFieldData );
                                                 calculateValueFromList();
                                                 refreshEditor();
                                             }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.testing.FieldData

    public FieldPopulator getFieldPopulator(Field field) throws ClassNotFoundException,
            InstantiationException,
            IllegalAccessException, InvocationTargetException, NoSuchMethodException {
        if (field instanceof FieldData) {
            FieldData fieldData = (FieldData) field;
            if (fieldData.getValue() == null) {
                throw new IllegalArgumentException("Field value can not be null");
            } else {
                return getFieldDataPopulator(factObject,
                        fieldData);
            }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.testing.FieldData

        reader.moveUp();

        reader.moveDown();

        if (reader.getNodeName().equals("value")) {
            FieldData fieldData = new FieldData();

            fieldData.setName(name);

            fieldData.setValue(reader.getValue());
            reader.moveUp();

            if (reader.hasMoreChildren()) {
                reader.moveDown();
                fieldData.setNature(Integer.parseInt(reader.getValue()));
                reader.moveUp();
            }

            return fieldData;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.