Package org.apache.tapestry.internal.beaneditor

Examples of org.apache.tapestry.internal.beaneditor.BeanModelImpl


        Messages messages = resources.getMessages();

        ClassPropertyAdapter adapter = _propertyAccess.getAdapter(beanClass);

        BeanModel model = new BeanModelImpl(beanClass, _propertyConduitSource, _typeCoercer,
                messages);

        List<String> propertyNames = newList();

        for (String propertyName : adapter.getPropertyNames())
        {
            PropertyAdapter pa = adapter.getPropertyAdapter(propertyName);

            if (!pa.isRead())
                continue;

            if (pa.getAnnotation(NonVisual.class) != null)
                continue;

            if (filterReadOnlyProperties && !pa.isUpdate())
                continue;

            String editorType = _registry.get(pa.getType());

            // If an unregistered type, then ignore the property.

            if (editorType.equals(""))
                continue;

            model.add(propertyName).editorType(editorType);

            propertyNames.add(propertyName);
        }

        // Set default property order for properties that are not explicit.

        List<String> orderedNames = TapestryUtils.orderProperties(
                adapter,
                _classFactory,
                propertyNames);

        for (int i = 0; i < orderedNames.size(); i++)
        {
            String propertyName = orderedNames.get(i);

            model.get(propertyName).order(i);
        }

        return model;
    }
View Full Code Here


        Messages messages = resources.getMessages();

        ClassPropertyAdapter adapter = _propertyAccess.getAdapter(beanClass);

        final BeanModel model = new BeanModelImpl(beanClass, _propertyConduitSource, _typeCoercer, messages);

        List<String> propertyNames = newList();

        Map<String, Runnable> worksheet = newMap();

        for (final String propertyName : adapter.getPropertyNames())
        {
            PropertyAdapter pa = adapter.getPropertyAdapter(propertyName);

            if (!pa.isRead()) continue;

            if (pa.getAnnotation(NonVisual.class) != null) continue;

            if (filterReadOnlyProperties && !pa.isUpdate()) continue;

            final String dataType = _dataTypeAnalyzer.identifyDataType(pa);

            // If an unregistered type, then ignore the property.

            if (dataType == null) continue;

            propertyNames.add(propertyName);

            // We need to defer execution of this; we want to add them in proper order, not
            // alphabetical order.

            Runnable worker = new Runnable()
            {
                public void run()
                {
                    model.add(propertyName).dataType(dataType);
                }
            };

            worksheet.put(propertyName, worker);
        }
View Full Code Here

        Messages messages = resources.getMessages();

        ClassPropertyAdapter adapter = _propertyAccess.getAdapter(beanClass);

        final BeanModel model = new BeanModelImpl(beanClass, _propertyConduitSource, _typeCoercer,
                messages);

        List<String> propertyNames = newList();

        Map<String, Runnable> worksheet = newMap();

        for (final String propertyName : adapter.getPropertyNames())
        {
            PropertyAdapter pa = adapter.getPropertyAdapter(propertyName);

            if (!pa.isRead()) continue;

            if (pa.getAnnotation(NonVisual.class) != null) continue;

            if (filterReadOnlyProperties && !pa.isUpdate()) continue;

            final String dataType = _dataTypeAnalyzer.identifyDataType(pa);

            // If an unregistered type, then ignore the property.

            if (dataType == null) continue;

            propertyNames.add(propertyName);

            // We need to defer execution of this; we want to add them in proper order, not
            // alphabetical order.

            Runnable worker = new Runnable()
            {
                public void run()
                {
                    model.add(propertyName).dataType(dataType);
                }
            };

            worksheet.put(propertyName, worker);
        }
View Full Code Here

        Messages messages = resources.getMessages();

        ClassPropertyAdapter adapter = _propertyAccess.getAdapter(beanClass);

        BeanModel model = new BeanModelImpl(beanClass, _propertyConduitSource, _typeCoercer,
                messages);

        List<String> propertyNames = newList();

        for (String propertyName : adapter.getPropertyNames())
        {
            PropertyAdapter pa = adapter.getPropertyAdapter(propertyName);

            if (!pa.isRead())
                continue;

            if (pa.getAnnotation(NonVisual.class) != null)
                continue;

            if (filterReadOnlyProperties && !pa.isUpdate())
                continue;

            String dataType = _dataTypeAnalyzer.identifyDataType(pa);

            // If an unregistered type, then ignore the property.

            if (dataType == null)
                continue;

            model.add(propertyName).dataType(dataType);

            propertyNames.add(propertyName);
        }

        // Set default property order for properties that are not explicit.

        List<String> orderedNames = TapestryInternalUtils.orderProperties(
                adapter,
                _classFactory,
                propertyNames);

        for (int i = 0; i < orderedNames.size(); i++)
        {
            String propertyName = orderedNames.get(i);

            model.get(propertyName).order(i);
        }

        return model;
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.internal.beaneditor.BeanModelImpl

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.