/** * Returns the type of the value from {@link #doGetValue()}, i.e. * String.class * * @see org.eclipse.core.databinding.observable.value.IObservableValue#getValueType() */ public Object getValueType() { return observable.getValueType(); }
@Override public Object getValueType() { return target.getValueType(); }
public Object getValueType() { return decorated.getValueType(); }
@Override public Object getValueType() { return target.getValueType(); }
public Object getValueType() { return target.getValueType(); }
/** * @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; }
/** * @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; }
/** * Helper method for * <code>MasterDetailObservables.detailValue(master, valueFactory(master.getRealm(), propertyName), propertyType)</code> * * @param master * @param propertyName * the name of the property. May be nested e.g. "parent.name" * @param propertyType * can be <code>null</code> * @return an observable value that tracks the current value of the named * property for the current value of the master observable value * * @see MasterDetailObservables * @since 1.2 * * @deprecated use <code>BeanProperties</code> instead */ @Deprecated public static IObservableValue observeDetailValue(IObservableValue master, String propertyName, Class propertyType) { Class beanClass = null; if (master.getValueType() instanceof Class) beanClass = (Class) master.getValueType(); return observeDetailValue(master, beanClass, propertyName, propertyType); }
/** * Helper method for * <code>MasterDetailObservables.detailMap(master, mapFactory(master.getRealm(), propertyName))</code> * * @param master * @param propertyName * @return an observable map that tracks the map-type named property for the * current value of the master observable value. * @since 1.2 * * @deprecated use <code>PojoProperties</code> instead */ public static IObservableMap observeDetailMap(IObservableValue master, String propertyName) { Class pojoClass = null; if (master.getValueType() instanceof Class) pojoClass = (Class) master.getValueType(); return PojoProperties.map(pojoClass, propertyName) .observeDetail(master); } }
/** * Helper method for * <code>MasterDetailObservables.detailSet(master, setFactory(master.getRealm(), propertyName), propertyType)</code> * * @param master * @param propertyName * @param propertyType * can be <code>null</code> * @return an observable set that tracks the named property for the current * value of the master observable value * * @see MasterDetailObservables * @since 1.2 * * @deprecated use <code>BeanProperties</code> instead */ @Deprecated public static IObservableSet observeDetailSet(IObservableValue master, String propertyName, Class propertyType) { Class beanClass = null; if (master.getValueType() instanceof Class) beanClass = (Class) master.getValueType(); return BeanProperties.set(beanClass, propertyName, propertyType) .observeDetail(master); }
/** * Helper method for * <code>MasterDetailObservables.detailMap(master, mapFactory(master.getRealm(), propertyName))</code> * * @param master * @param propertyName * @return an observable map that tracks the map-type named property for the * current value of the master observable value. * @since 1.2 * * @deprecated use <code>BeanProperties</code> instead */ @Deprecated public static IObservableMap observeDetailMap(IObservableValue master, String propertyName) { Class beanClass = null; if (master.getValueType() instanceof Class) beanClass = (Class) master.getValueType(); return BeanProperties.map(beanClass, propertyName) .observeDetail(master); }
/** * Helper method for * <code>MasterDetailObservables.detailSet(master, setFactory(master.getRealm(), propertyName), propertyType)</code> * * @param master * @param propertyName * @param propertyType * can be <code>null</code> * @return an observable set that tracks the named property for the current * value of the master observable value * * @see MasterDetailObservables * @since 1.2 * * @deprecated use <code>PojoProperties</code> instead */ public static IObservableSet observeDetailSet(IObservableValue master, String propertyName, Class propertyType) { Class pojoClass = null; if (master.getValueType() instanceof Class) pojoClass = (Class) master.getValueType(); return PojoProperties.set(pojoClass, propertyName, propertyType) .observeDetail(master); }
/** * Helper method for * <code>MasterDetailObservables.detailList(master, listFactory(master.getRealm(), propertyName, propertyType), propertyType)</code> * * @param master * @param propertyName * @param propertyType * can be <code>null</code> * @return an observable list that tracks the named property for the current * value of the master observable value * * @see MasterDetailObservables * @since 1.2 * * @deprecated use <code>PojoProperties</code> instead */ public static IObservableList observeDetailList(IObservableValue master, String propertyName, Class propertyType) { Class pojoClass = null; if (master.getValueType() instanceof Class) pojoClass = (Class) master.getValueType(); return PojoProperties.list(pojoClass, propertyName).observeDetail( master); }
/** * Helper method for * <code>MasterDetailObservables.detailValue(master, valueFactory(master.getRealm, propertyName), propertyType)</code> * * @param master * @param propertyName * the property name. May be nested e.g. "parent.name" * @param propertyType * can be <code>null</code> * @return an observable value that tracks the current value of the named * property for the current value of the master observable value * * @see MasterDetailObservables * @since 1.2 * * @deprecated use <code>PojoProperties</code> instead */ public static IObservableValue observeDetailValue(IObservableValue master, String propertyName, Class propertyType) { Class pojoClass = null; if (master.getValueType() instanceof Class) pojoClass = (Class) master.getValueType(); return PojoProperties.value(pojoClass, propertyName, propertyType) .observeDetail(master); }
/** * Helper method for * <code>MasterDetailObservables.detailList(master, listFactory(master.getRealm(), propertyName, propertyType), propertyType)</code> * * @param master * @param propertyName * @param propertyType * can be <code>null</code> * @return an observable list that tracks the named property for the current * value of the master observable value * * @see MasterDetailObservables * @since 1.2 * * @deprecated use <code>BeanProperties</code> instead */ @Deprecated public static IObservableList observeDetailList(IObservableValue master, String propertyName, Class propertyType) { Class beanClass = null; if (master.getValueType() instanceof Class) beanClass = (Class) master.getValueType(); return BeanProperties.list(beanClass, propertyName, propertyType) .observeDetail(master); }
/** * @param widget * @param property * @param decorated */ public SWTVetoableValueDecorator(Widget widget, WidgetStringValueProperty property, IObservableValue decorated) { super(decorated, true); this.property = property; this.widget = widget; Assert .isTrue(decorated.getValueType().equals(String.class), "SWTVetoableValueDecorator can only decorate observable values of String value type"); //$NON-NLS-1$ WidgetListenerUtil.asyncAddListener(widget, SWT.Dispose, disposeListener); }
@Override public IObservableValue observeDetail(IObservableValue master) { Object valueType = getValueType(); if (valueType == null) valueType = inferValueType(master.getValueType()); return MasterDetailObservables.detailValue(master, valueFactory(master .getRealm()), valueType); }
@Override public IObservableValue observeDetail(IObservableValue master) { Object valueType = getValueType(); if (valueType == null) valueType = inferValueType(master.getValueType()); return MasterDetailObservables.detailValue(master, valueFactory(master .getRealm()), valueType); }
@Override public IObservableValue observeDetail(IObservableValue master) { Object valueType = getValueType(); if (valueType == null) valueType = inferValueType(master.getValueType()); return MasterDetailObservables.detailValue(master, valueFactory(master .getRealm()), valueType); }
private void updateInnerObservableValue() { currentOuterValue = outerObservableValue.getValue(); if (innerObservableValue != null) { innerObservableValue.removeValueChangeListener(innerChangeListener); innerObservableValue.dispose(); } if (currentOuterValue == null) { innerObservableValue = null; } else { ObservableTracker.setIgnore(true); try { innerObservableValue = (IObservableValue) factory .createObservable(currentOuterValue); } finally { ObservableTracker.setIgnore(false); } DetailObservableHelper.warnIfDifferentRealms(getRealm(), innerObservableValue.getRealm()); if (detailType != null) { Object innerValueType = innerObservableValue.getValueType(); Assert .isTrue( detailType.equals(innerValueType), "Cannot change value type in a nested observable value, from " + innerValueType + " to " + detailType); //$NON-NLS-1$ //$NON-NLS-2$ } innerObservableValue.addValueChangeListener(innerChangeListener); } }