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() { |