Package com.vaadin.data

Examples of com.vaadin.data.Property$ReadOnlyStatusChangeListener


        logger.warn("failed to find a parent property name; unable to set the parent.");
        return false;
      }

      final EntityItem<T> item = cache.get(entityId);
      final Property property = item.getItemProperty(parentPropertyName);

      property.setValue(newParentId);
      final Object value = property.getValue();

      return (value.equals(newParentId));
    }
    catch (Exception e)
    {
View Full Code Here


        }

        addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(Property.ValueChangeEvent event) {
                Property property = event.getProperty();
                if (BaseObjectPanel.this == property) {
                    updateActiveTable();
                }
            }
        });
View Full Code Here

     */
    protected int compareProperty(Object propertyId, boolean sortDirection,
            Item item1, Item item2) {

        // Get the properties to compare
        final Property property1 = item1.getItemProperty(propertyId);
        final Property property2 = item2.getItemProperty(propertyId);

        // Get the values to compare
        final Object value1 = (property1 == null) ? null : property1.getValue();
        final Object value2 = (property2 == null) ? null : property2.getValue();

        // Result of the comparison
        int r = 0;
        if (sortDirection) {
            r = propertyValueComparator.compare(value1, value2);
View Full Code Here

        final int count = metadata.getColumnCount();
        final ArrayList list = new ArrayList(count);
        for (int i = 1; i <= count; i++) {
            final String columnName = metadata.getColumnName(i);
            list.add(columnName);
            final Property p = getContainerProperty(new Integer(1), columnName);
            propertyTypes.put(columnName, p == null ? Object.class : p
                    .getType());
        }
        propertyIds = Collections.unmodifiableCollection(list);
    }
View Full Code Here

        fireItemSetChange();
        return true;
    }

    private void addValueChangeListener(BeanItem<BT> beanItem, Object propertyId) {
        Property property = beanItem.getItemProperty(propertyId);
        if (property instanceof ValueChangeNotifier) {
            // avoid multiple notifications for the same property if
            // multiple filters are in use
            ValueChangeNotifier notifier = (ValueChangeNotifier) property;
            notifier.removeListener(this);
View Full Code Here

            notifier.addListener(this);
        }
    }

    private void removeValueChangeListener(BeanItem<BT> item, Object propertyId) {
        Property property = item.getItemProperty(propertyId);
        if (property instanceof ValueChangeNotifier) {
            ((ValueChangeNotifier) property).removeListener(this);
        }
    }
View Full Code Here

        for (PropertyDescriptor pd : propertyDescriptors.values()) {
            final Method getMethod = pd.getReadMethod();
            final Method setMethod = pd.getWriteMethod();
            final Class<?> type = pd.getPropertyType();
            final String name = pd.getName();
            final Property p = new MethodProperty(type, bean, getMethod,
                    setMethod);
            addItemProperty(name, p);

        }
    }
View Full Code Here

            if (pd != null) {
                final String name = pd.getName();
                final Method getMethod = pd.getReadMethod();
                final Method setMethod = pd.getWriteMethod();
                final Class<?> type = pd.getPropertyType();
                final Property p = new MethodProperty(type, bean, getMethod,
                        setMethod);
                addItemProperty(name, p);
            }
        }
View Full Code Here

                caption = itemId.toString();
            }
            break;

        case ITEM_CAPTION_MODE_PROPERTY:
            final Property p = getContainerProperty(itemId,
                    getItemCaptionPropertyId());
            if (p != null) {
                caption = p.toString();
            }
            break;
        }

        // All items must have some captions
View Full Code Here

        if (getItemIconPropertyId() == null) {
            return null;
        }

        final Property ip = getContainerProperty(itemId,
                getItemIconPropertyId());
        if (ip == null) {
            return null;
        }
        final Object icon = ip.getValue();
        if (icon instanceof Resource) {
            return (Resource) icon;
        }

        return null;
View Full Code Here

TOP

Related Classes of com.vaadin.data.Property$ReadOnlyStatusChangeListener

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.