Package org.apache.tapestry.beaneditor

Examples of org.apache.tapestry.beaneditor.PropertyEditModel


        BeanEditorModel model = _source.create(SimpleBean.class, resources);

        assertEquals(model.getPropertyNames(), Arrays.asList("age", "firstName", "lastName"));

        PropertyEditModel age = model.get("age");

        assertEquals(age.getLabel(), "Age");
        assertSame(age.getPropertyType(), int.class);
        assertEquals(age.getEditorType(), "text");

        PropertyEditModel firstName = model.get("firstName");

        assertEquals(firstName.getLabel(), "First Name");
        assertEquals(firstName.getPropertyType(), String.class);
        assertEquals(firstName.getEditorType(), "text");

        assertEquals(model.get("lastName").getLabel(), "Last Name");

        PropertyConduit conduit = model.get("lastName").getConduit();
View Full Code Here


        replay();

        BeanEditorModel model = _source.create(SimpleBean.class, resources);

        PropertyEditModel pm = model.add("frobozz");

        assertEquals(pm.getLabel(), "Frobozz");
        assertEquals(pm.getOrder(), 0);
        assertNull(pm.getConduit());
        assertSame(pm.getPropertyType(), Object.class);

        verify();
    }
View Full Code Here

        final PropertyAdapter adapter = _classPropertyAdapter.getPropertyAdapter(propertyName);

        PropertyConduit conduit = defaultConduit(adapter);

        PropertyEditModel propertyModel = new PropertyEditModelImpl(this, propertyName)
                .label(label).conduit(conduit);

        if (adapter != null)
            propertyModel.propertyType(adapter.getType());

        if (conduit != null)
        {
            Order annotation = conduit.getAnnotation(Order.class);

            if (annotation != null)
                propertyModel.order(annotation.value());
        }

        _properties.put(propertyName, propertyModel);

        return propertyModel;
View Full Code Here

        };
    }

    public PropertyEditModel edit(String propertyName)
    {
        PropertyEditModel propertyModel = _properties.get(propertyName);

        if (propertyModel == null)
            throw new RuntimeException(BeanEditorMessages.unknownProperty(
                    _beanType,
                    propertyName,
View Full Code Here

TOP

Related Classes of org.apache.tapestry.beaneditor.PropertyEditModel

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.