View | Details | Raw Unified | Return to bug 262284 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/core/internal/databinding/beans/BeanPropertyHelper.java (-1 / +1 lines)
Lines 209-215 Link Here
209
	 * @param propertyName
209
	 * @param propertyName
210
	 * @return property descriptor or <code>null</code>
210
	 * @return property descriptor or <code>null</code>
211
	 */
211
	 */
212
	/* package */public static PropertyDescriptor getValueTypePropertyDescriptor(
212
	public static PropertyDescriptor getValueTypePropertyDescriptor(
213
			IObservableValue observable, String propertyName) {
213
			IObservableValue observable, String propertyName) {
214
		if (observable.getValueType() != null)
214
		if (observable.getValueType() != null)
215
			return getPropertyDescriptor((Class) observable.getValueType(),
215
			return getPropertyDescriptor((Class) observable.getValueType(),
(-)src/org/eclipse/jface/internal/databinding/viewers/ViewerInputProperty.java (-7 lines)
Lines 39-51 Link Here
39
		return null;
39
		return null;
40
	}
40
	}
41
41
42
	protected void doAddListener(Object source, INativePropertyListener listener) {
43
	}
44
45
	protected void doRemoveListener(Object source,
46
			INativePropertyListener listener) {
47
	}
48
49
	public String toString() {
42
	public String toString() {
50
		return "Viewer.input"; //$NON-NLS-1$
43
		return "Viewer.input"; //$NON-NLS-1$
51
	}
44
	}
(-)src/org/eclipse/jface/databinding/swt/WidgetListProperty.java (-4 / +1 lines)
Lines 34-43 Link Here
34
public abstract class WidgetListProperty extends SimpleListProperty implements
34
public abstract class WidgetListProperty extends SimpleListProperty implements
35
		IWidgetListProperty {
35
		IWidgetListProperty {
36
	public IObservableList observe(Object source) {
36
	public IObservableList observe(Object source) {
37
		if (source instanceof Widget) {
37
		return observe((Widget) source);
38
			return observe((Widget) source);
39
		}
40
		return super.observe(source);
41
	}
38
	}
42
39
43
	public IObservableList observe(Realm realm, Object source) {
40
	public IObservableList observe(Realm realm, Object source) {
(-)src/org/eclipse/jface/databinding/swt/WidgetValueProperty.java (-4 / +1 lines)
Lines 164-173 Link Here
164
	}
164
	}
165
165
166
	public IObservableValue observe(Object source) {
166
	public IObservableValue observe(Object source) {
167
		if (source instanceof Widget) {
167
		return observe((Widget) source);
168
			return observe((Widget) source);
169
		}
170
		return super.observe(source);
171
	}
168
	}
172
169
173
	public IObservableValue observe(Realm realm, Object source) {
170
	public IObservableValue observe(Realm realm, Object source) {
(-)src/org/eclipse/core/internal/databinding/property/set/SimplePropertyObservableSet.java (-2 / +17 lines)
Lines 53-63 Link Here
53
	 * @param source
53
	 * @param source
54
	 * @param property
54
	 * @param property
55
	 */
55
	 */
56
	public SimplePropertyObservableSet(Realm realm, Object source,
56
	public SimplePropertyObservableSet(Realm realm, final Object source,
57
			SimpleSetProperty property) {
57
			final SimpleSetProperty property) {
58
		super(realm);
58
		super(realm);
59
		this.source = source;
59
		this.source = source;
60
		this.property = property;
60
		this.property = property;
61
62
		Runnable typeCheck = new Runnable() {
63
			public void run() {
64
				try {
65
					property.getSet(source);
66
				} catch (RuntimeException e) {
67
					dispose();
68
					throw e;
69
				}
70
			}
71
		};
72
		if (realm.isCurrent())
73
			typeCheck.run();
74
		else
75
			realm.exec(typeCheck);
61
	}
76
	}
62
77
63
	protected void firstListenerAdded() {
78
	protected void firstListenerAdded() {
(-)src/org/eclipse/core/internal/databinding/property/set/SelfSetProperty.java (-7 lines)
Lines 49-59 Link Here
49
			ISimplePropertyListener listener) {
49
			ISimplePropertyListener listener) {
50
		return null; // no listener API
50
		return null; // no listener API
51
	}
51
	}
52
53
	protected void doAddListener(Object source, INativePropertyListener listener) {
54
	}
55
56
	protected void doRemoveListener(Object source,
57
			INativePropertyListener listener) {
58
	}
59
}
52
}
(-)src/org/eclipse/core/internal/databinding/property/value/SelfValueProperty.java (-7 lines)
Lines 44-54 Link Here
44
			ISimplePropertyListener listener) {
44
			ISimplePropertyListener listener) {
45
		return null;
45
		return null;
46
	}
46
	}
47
48
	protected void doAddListener(Object source, INativePropertyListener listener) {
49
	}
50
51
	protected void doRemoveListener(Object source,
52
			INativePropertyListener listener) {
53
	}
54
}
47
}
(-)src/org/eclipse/core/internal/databinding/property/value/SimplePropertyObservableValue.java (-2 / +17 lines)
Lines 45-55 Link Here
45
	 * @param source
45
	 * @param source
46
	 * @param property
46
	 * @param property
47
	 */
47
	 */
48
	public SimplePropertyObservableValue(Realm realm, Object source,
48
	public SimplePropertyObservableValue(Realm realm, final Object source,
49
			SimpleValueProperty property) {
49
			final SimpleValueProperty property) {
50
		super(realm);
50
		super(realm);
51
		this.source = source;
51
		this.source = source;
52
		this.property = property;
52
		this.property = property;
53
54
		Runnable typeCheck = new Runnable() {
55
			public void run() {
56
				try {
57
					property.getValue(source);
58
				} catch (RuntimeException e) {
59
					dispose();
60
					throw e;
61
				}
62
			}
63
		};
64
		if (realm.isCurrent())
65
			typeCheck.run();
66
		else
67
			realm.exec(typeCheck);
53
	}
68
	}
54
69
55
	protected void firstListenerAdded() {
70
	protected void firstListenerAdded() {
(-)src/org/eclipse/core/internal/databinding/property/list/SimplePropertyObservableList.java (-2 / +17 lines)
Lines 56-66 Link Here
56
	 * @param source
56
	 * @param source
57
	 * @param property
57
	 * @param property
58
	 */
58
	 */
59
	public SimplePropertyObservableList(Realm realm, Object source,
59
	public SimplePropertyObservableList(Realm realm, final Object source,
60
			SimpleListProperty property) {
60
			final SimpleListProperty property) {
61
		super(realm);
61
		super(realm);
62
		this.source = source;
62
		this.source = source;
63
		this.property = property;
63
		this.property = property;
64
65
		Runnable typeCheck = new Runnable() {
66
			public void run() {
67
				try {
68
					property.getList(source);
69
				} catch (RuntimeException e) {
70
					dispose();
71
					throw e;
72
				}
73
			}
74
		};
75
		if (realm.isCurrent())
76
			typeCheck.run();
77
		else
78
			realm.exec(typeCheck);
64
	}
79
	}
65
80
66
	protected void firstListenerAdded() {
81
	protected void firstListenerAdded() {
(-)src/org/eclipse/core/internal/databinding/property/list/SelfListProperty.java (-7 lines)
Lines 49-59 Link Here
49
			ISimplePropertyListener listener) {
49
			ISimplePropertyListener listener) {
50
		return null; // no listener API
50
		return null; // no listener API
51
	}
51
	}
52
53
	protected void doAddListener(Object source, INativePropertyListener listener) {
54
	}
55
56
	protected void doRemoveListener(Object source,
57
			INativePropertyListener listener) {
58
	}
59
}
52
}
(-)src/org/eclipse/core/internal/databinding/property/map/SelfMapProperty.java (-7 lines)
Lines 56-66 Link Here
56
			ISimplePropertyListener listener) {
56
			ISimplePropertyListener listener) {
57
		return null; // no listener API
57
		return null; // no listener API
58
	}
58
	}
59
60
	protected void doAddListener(Object source, INativePropertyListener listener) {
61
	}
62
63
	protected void doRemoveListener(Object source,
64
			INativePropertyListener listener) {
65
	}
66
}
59
}
(-)src/org/eclipse/core/internal/databinding/property/map/SimplePropertyObservableMap.java (-2 / +17 lines)
Lines 56-66 Link Here
56
	 * @param source
56
	 * @param source
57
	 * @param property
57
	 * @param property
58
	 */
58
	 */
59
	public SimplePropertyObservableMap(Realm realm, Object source,
59
	public SimplePropertyObservableMap(Realm realm, final Object source,
60
			SimpleMapProperty property) {
60
			final SimpleMapProperty property) {
61
		super(realm);
61
		super(realm);
62
		this.source = source;
62
		this.source = source;
63
		this.property = property;
63
		this.property = property;
64
65
		Runnable typeCheck = new Runnable() {
66
			public void run() {
67
				try {
68
					property.getMap(source);
69
				} catch (RuntimeException e) {
70
					dispose();
71
					throw e;
72
				}
73
			}
74
		};
75
		if (realm.isCurrent())
76
			typeCheck.run();
77
		else
78
			realm.exec(typeCheck);
64
	}
79
	}
65
80
66
	public Object getKeyType() {
81
	public Object getKeyType() {
(-)src/org/eclipse/core/internal/databinding/BindingModelProperty.java (-7 lines)
Lines 40-52 Link Here
40
		return null;
40
		return null;
41
	}
41
	}
42
42
43
	protected void doAddListener(Object source, INativePropertyListener listener) {
44
	}
45
46
	protected void doRemoveListener(Object source,
47
			INativePropertyListener listener) {
48
	}
49
50
	public String toString() {
43
	public String toString() {
51
		return "Binding#model <IObservable>"; //$NON-NLS-1$
44
		return "Binding#model <IObservable>"; //$NON-NLS-1$
52
	}
45
	}
(-)src/org/eclipse/core/internal/databinding/BindingTargetProperty.java (-7 lines)
Lines 40-52 Link Here
40
		return null;
40
		return null;
41
	}
41
	}
42
42
43
	protected void doAddListener(Object source, INativePropertyListener listener) {
44
	}
45
46
	protected void doRemoveListener(Object source,
47
			INativePropertyListener listener) {
48
	}
49
50
	public String toString() {
43
	public String toString() {
51
		return "Binding#target <IObservable>"; //$NON-NLS-1$
44
		return "Binding#target <IObservable>"; //$NON-NLS-1$
52
	}
45
	}
(-)src/org/eclipse/core/internal/databinding/ValidationStatusProviderValidationStatusProperty.java (-7 lines)
Lines 41-53 Link Here
41
		return null;
41
		return null;
42
	}
42
	}
43
43
44
	protected void doAddListener(Object source, INativePropertyListener listener) {
45
	}
46
47
	protected void doRemoveListener(Object source,
48
			INativePropertyListener listener) {
49
	}
50
51
	public String toString() {
44
	public String toString() {
52
		return "ValidationStatusProvider#validationStatus <IObservableValue>"; //$NON-NLS-1$
45
		return "ValidationStatusProvider#validationStatus <IObservableValue>"; //$NON-NLS-1$
53
	}
46
	}

Return to bug 262284