@Override public String toString() { String s = FXBeanPropertyHelper.propertyName(this.propertyDescriptor); if (this.valueType != null) s += "<" + FXBeanPropertyHelper.shortClassName(this.valueType) + ">"; //$NON-NLS-1$//$NON-NLS-2$ return s; } }
@Override protected Object doGetValue(Object source) { return FXBeanPropertyHelper.readProperty(source, this.propertyDescriptor); }
@Override protected void doSetValue(Object source, Object value) { FXBeanPropertyHelper.writeProperty(source, this.propertyDescriptor, value); }
/** * @param propertyDescriptor * @return String description of property descriptor */ public static String propertyName(PropertyDescriptor propertyDescriptor) { Class<?> beanClass = propertyDescriptor.getReadMethod() .getDeclaringClass(); return shortClassName(beanClass) + "." + propertyDescriptor.getName() + ""; //$NON-NLS-1$ //$NON-NLS-2$ }
/** * @param observable * @param propertyName * @return property descriptor or <code>null</code> */ /* package */public static PropertyDescriptor getValueTypePropertyDescriptor( IObservableValue observable, String propertyName) { if (observable.getValueType() != null) return getPropertyDescriptor((Class<?>) observable.getValueType(), propertyName); return null; }
/** * Goes recursively into the interface and gets all defined * propertyDescriptors * * @param propertyDescriptors * The result list of all PropertyDescriptors the given interface * defines (hierarchical) * @param iface * The interface to fetch the PropertyDescriptors * @throws IntrospectionException */ private static void getInterfacePropertyDescriptors( List<PropertyDescriptor> propertyDescriptors, Class<?> iface) throws IntrospectionException { BeanInfo beanInfo = Introspector.getBeanInfo(iface); PropertyDescriptor[] pds = beanInfo.getPropertyDescriptors(); for (int i = 0; i < pds.length; i++) { PropertyDescriptor pd = pds[i]; propertyDescriptors.add(pd); } Class<?>[] subIntfs = iface.getInterfaces(); for (int j = 0; j < subIntfs.length; j++) { getInterfacePropertyDescriptors(propertyDescriptors, subIntfs[j]); } }
@Override public String toString() { String s = "?." + this.propertyName; //$NON-NLS-1$ Class<?> valueType = (Class<?>) getValueType(); if (valueType != null) s += "<" + FXBeanPropertyHelper.shortClassName(valueType) + ">"; //$NON-NLS-1$//$NON-NLS-2$ return s; } }
property = new AnonymousFXBeanValueProperty(propertyNames[0], valueType); } else { propertyDescriptor = FXBeanPropertyHelper.getPropertyDescriptor(beanClass, propertyNames[0]); property = new FXBeanValueProperty(propertyDescriptor, valueType);
PropertyDescriptor propertyDescriptors[]; List<PropertyDescriptor> pds = new ArrayList<>(); getInterfacePropertyDescriptors(pds, beanClass); if (pds.size() > 0) { propertyDescriptors = (PropertyDescriptor[]) pds