Package org.apache.tapestry5.beaneditor

Examples of org.apache.tapestry5.beaneditor.PropertyModel


        public List<SortConstraint> getSortConstraints()
        {
            if (sortColumnId == null)
                return Collections.emptyList();

            PropertyModel sortModel = getDataModel().getById(sortColumnId);

            SortConstraint constraint = new SortConstraint(sortModel, getColumnSort());

            return Collections.singletonList(constraint);
        }
View Full Code Here


        public List<SortConstraint> getSortContraints()
        {
            if (sortColumnId == null)
                return Collections.emptyList();

            PropertyModel sortModel = model.getById(sortColumnId);

            SortConstraint constraint = new SortConstraint(sortModel, getColumnSort());

            return Collections.singletonList(constraint);
        }
View Full Code Here

        public List<SortConstraint> getSortConstraints()
        {
            if (sortColumnId == null)
                return Collections.emptyList();

            PropertyModel sortModel = getDataModel().getById(sortColumnId);

            SortConstraint constraint = new SortConstraint(sortModel, getColumnSort());

            return Collections.singletonList(constraint);
        }
View Full Code Here

    @Test
    public void add()
    {
        BeanModel model = mockBeanModel();
        PropertyModel fred = mockPropertyModel();
        PropertyModel barney = mockPropertyModel();

        expect(model.add("fred", null)).andReturn(fred);
        expect(model.add("barney", null)).andReturn(barney);

        replay();
View Full Code Here

     */
    @Test
    public void include_before_add()
    {
        BeanModel model = mockBeanModel();
        PropertyModel fred = mockPropertyModel();

        EasyMock.checkOrder(model, true);

        expect(model.include("sam")).andReturn(model);

View Full Code Here

    @Test
    public void modify_full()
    {
        BeanModel model = mockBeanModel();
        PropertyModel fred = mockPropertyModel();
        PropertyModel barney = mockPropertyModel();

        expect(model.add("fred", null)).andReturn(fred);
        expect(model.add("barney", null)).andReturn(barney);

        expect(model.exclude("pebbles", "bambam")).andReturn(model);
View Full Code Here

        assert position != null;
        validateNewPropertyName(propertyName);

        // Locate the existing one.

        PropertyModel existing = get(existingPropertyName);

        // Use the case normalized property name.

        int pos = propertyNames.indexOf(existing.getPropertyName());

        PropertyModel newModel = new PropertyModelImpl(this, propertyName, conduit, messages);

        properties.put(propertyName, newModel);

        int offset = position == RelativePosition.AFTER ? 1 : 0;
View Full Code Here

    public PropertyModel add(String propertyName, PropertyConduit conduit)
    {
        validateNewPropertyName(propertyName);

        PropertyModel propertyModel = new PropertyModelImpl(this, propertyName, conduit, messages);

        properties.put(propertyName, propertyModel);

        // Remember the order in which the properties were added.
View Full Code Here

        return new CoercingPropertyConduitWrapper(propertyConduitSource.create(beanType, propertyName), typeCoercer);
    }

    public PropertyModel get(String propertyName)
    {
        PropertyModel propertyModel = properties.get(propertyName);

        if (propertyModel == null)
            throw new UnknownValueException(String.format(
                    "Bean editor model for %s does not contain a property named '%s'.", beanType.getName(),
                    propertyName), new AvailableValues("Defined properties", propertyNames));
View Full Code Here

    public BeanModel<T> exclude(String... propertyNames)
    {
        for (String propertyName : propertyNames)
        {
            PropertyModel model = properties.get(propertyName);

            if (model == null)
                continue;

            // De-referencing from the model is needed because the name provided may not be a
            // case-exact match, so we get the normalized or canonical name from the model because
            // that's the one in propertyNames.

            this.propertyNames.remove(model.getPropertyName());

            properties.remove(propertyName);
        }

        return this;
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.beaneditor.PropertyModel

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.