Mercurial > projects > dwt2
comparison org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/Observables.d @ 85:6be48cf9f95c
Work on databinding
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 18 Apr 2009 13:54:50 +0200 |
parents | 383ce7bd736b |
children | 9e0ab372d5d8 |
comparison
equal
deleted
inserted
replaced
84:fcf926c91ca4 | 85:6be48cf9f95c |
---|---|
62 * value | 62 * value |
63 * @since 1.1 | 63 * @since 1.1 |
64 */ | 64 */ |
65 public static IObservableValue unmodifiableObservableValue( | 65 public static IObservableValue unmodifiableObservableValue( |
66 IObservableValue value) { | 66 IObservableValue value) { |
67 Assert.isNotNull(value, "Argument 'value' cannot be null"); //$NON-NLS-1$ | 67 Assert.isNotNull(cast(Object)value, "Argument 'value' cannot be null"); //$NON-NLS-1$ |
68 return new UnmodifiableObservableValue(value); | 68 return new UnmodifiableObservableValue(value); |
69 } | 69 } |
70 | 70 |
71 /** | 71 /** |
72 * Returns an observable value with the given constant value. | 72 * Returns an observable value with the given constant value. |
276 * @param set | 276 * @param set |
277 * the set to wrap in an IObservableSet | 277 * the set to wrap in an IObservableSet |
278 * @return an observable set backed by the given set | 278 * @return an observable set backed by the given set |
279 */ | 279 */ |
280 public static IObservableSet staticObservableSet(Set set) { | 280 public static IObservableSet staticObservableSet(Set set) { |
281 return staticObservableSet(Realm.getDefault(), set, Object.classinfo); | 281 return staticObservableSet(Realm.getDefault(), set, typeid(Object)); |
282 } | 282 } |
283 | 283 |
284 /** | 284 /** |
285 * Returns an observable set of the given element type, backed by the given | 285 * Returns an observable set of the given element type, backed by the given |
286 * set. | 286 * set. |
305 * @param set | 305 * @param set |
306 * the set to wrap in an IObservableSet | 306 * the set to wrap in an IObservableSet |
307 * @return an observable set backed by the given unchanging set | 307 * @return an observable set backed by the given unchanging set |
308 */ | 308 */ |
309 public static IObservableSet staticObservableSet(Realm realm, Set set) { | 309 public static IObservableSet staticObservableSet(Realm realm, Set set) { |
310 return staticObservableSet(realm, set, Object.classinfo); | 310 return staticObservableSet(realm, set, typeid(Object)); |
311 } | 311 } |
312 | 312 |
313 /** | 313 /** |
314 * Returns an observable set of the given element type and belonging to the | 314 * Returns an observable set of the given element type and belonging to the |
315 * given realm, backed by the given set. | 315 * given realm, backed by the given set. |
324 * @since 1.1 | 324 * @since 1.1 |
325 */ | 325 */ |
326 public static IObservableSet staticObservableSet(Realm realm, Set set, | 326 public static IObservableSet staticObservableSet(Realm realm, Set set, |
327 Object elementType) { | 327 Object elementType) { |
328 return new class(realm, set, elementType) ObservableSet { | 328 return new class(realm, set, elementType) ObservableSet { |
329 this(Realm r, Set s, Object e ){ super(r, s, e);} | |
329 public void addChangeListener(IChangeListener listener) { | 330 public void addChangeListener(IChangeListener listener) { |
330 } | 331 } |
331 | 332 |
332 public void addStaleListener(IStaleListener listener) { | 333 public void addStaleListener(IStaleListener listener) { |
333 } | 334 } |
370 * @param list | 371 * @param list |
371 * the list to wrap in an IObservableList | 372 * the list to wrap in an IObservableList |
372 * @return an observable list backed by the given unchanging list | 373 * @return an observable list backed by the given unchanging list |
373 */ | 374 */ |
374 public static IObservableList staticObservableList(List list) { | 375 public static IObservableList staticObservableList(List list) { |
375 return staticObservableList(Realm.getDefault(), list, Object.classinfo); | 376 return staticObservableList(Realm.getDefault(), list, typeid(Object)); |
376 } | 377 } |
377 | 378 |
378 /** | 379 /** |
379 * Returns an observable list of the given element type, backed by the given | 380 * Returns an observable list of the given element type, backed by the given |
380 * list. | 381 * list. |
400 * @param list | 401 * @param list |
401 * the list to wrap in an IObservableList | 402 * the list to wrap in an IObservableList |
402 * @return an observable list backed by the given unchanging list | 403 * @return an observable list backed by the given unchanging list |
403 */ | 404 */ |
404 public static IObservableList staticObservableList(Realm realm, List list) { | 405 public static IObservableList staticObservableList(Realm realm, List list) { |
405 return staticObservableList(realm, list, Object.classinfo); | 406 return staticObservableList(realm, list, typeid(Object)); |
406 } | 407 } |
407 | 408 |
408 /** | 409 /** |
409 * Returns an observable list of the given element type and belonging to the | 410 * Returns an observable list of the given element type and belonging to the |
410 * given realm, backed by the given list. | 411 * given realm, backed by the given list. |
419 * @since 1.1 | 420 * @since 1.1 |
420 */ | 421 */ |
421 public static IObservableList staticObservableList(Realm realm, List list, | 422 public static IObservableList staticObservableList(Realm realm, List list, |
422 Object elementType) { | 423 Object elementType) { |
423 return new class(realm, list, elementType) ObservableList { | 424 return new class(realm, list, elementType) ObservableList { |
425 this(Realm r, List s, Object e ){ super(r, s, e);} | |
424 public void addChangeListener(IChangeListener listener) { | 426 public void addChangeListener(IChangeListener listener) { |
425 } | 427 } |
426 | 428 |
427 public void addStaleListener(IStaleListener listener) { | 429 public void addStaleListener(IStaleListener listener) { |
428 } | 430 } |
486 * the observable map entry identified by a particular key object. | 488 * the observable map entry identified by a particular key object. |
487 * @since 1.1 | 489 * @since 1.1 |
488 */ | 490 */ |
489 public static IObservableFactory mapEntryValueFactory( | 491 public static IObservableFactory mapEntryValueFactory( |
490 IObservableMap map, Object valueType) { | 492 IObservableMap map, Object valueType) { |
491 return new class() IObservableFactory { | 493 return new class(map, valueType) IObservableFactory { |
492 IObservableMap map_; | 494 IObservableMap map_; |
493 Object valueType_; | 495 Object valueType_; |
494 this(IObservableMap a, Object b){ | 496 this(IObservableMap a, Object b){ |
495 map_=a; valueType_=b; | 497 map_=a; valueType_=b; |
496 } | 498 } |