Search in sources :

Example 1 with ThreadRealm

use of org.eclipse.core.tests.databinding.observable.ThreadRealm in project eclipse.platform.ui by eclipse-platform.

the class WidgetObservableThreadTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    threadRealm = new ThreadRealm();
    new Thread() {

        @Override
        public void run() {
            RealmTester.setDefault(threadRealm);
            threadRealm.init(Thread.currentThread());
            threadRealm.block();
        }
    }.start();
    threadRealm.waitUntilBlocking();
}
Also used : ThreadRealm(org.eclipse.core.tests.databinding.observable.ThreadRealm) Before(org.junit.Before)

Example 2 with ThreadRealm

use of org.eclipse.core.tests.databinding.observable.ThreadRealm in project eclipse.platform.ui by eclipse-platform.

the class JavaBeanObservableMapTest method setUp.

@Override
@Before
public void setUp() throws Exception {
    super.setUp();
    ThreadRealm realm = new ThreadRealm();
    realm.init(Thread.currentThread());
    model1 = new Bean("1");
    model2 = new Bean("2");
    set = new WritableSet(realm, new HashSet(), Bean.class);
    set.add(model1);
    set.add(model2);
    String propertyName = "value";
    propertyDescriptor = ((IBeanProperty) BeanProperties.value(Bean.class, propertyName)).getPropertyDescriptor();
    map = BeansObservables.observeMap(set, Bean.class, propertyName);
    beanObservable = (IBeanObservable) map;
}
Also used : ThreadRealm(org.eclipse.core.tests.databinding.observable.ThreadRealm) WritableSet(org.eclipse.core.databinding.observable.set.WritableSet) HashSet(java.util.HashSet) Before(org.junit.Before)

Aggregations

ThreadRealm (org.eclipse.core.tests.databinding.observable.ThreadRealm)2 Before (org.junit.Before)2 HashSet (java.util.HashSet)1 WritableSet (org.eclipse.core.databinding.observable.set.WritableSet)1