Skip to main content



      Home
Home » Eclipse Projects » JFace » ViewerSupport.bind issue in a ViewPart
ViewerSupport.bind issue in a ViewPart [message #11988] Thu, 04 June 2009 16:40 Go to next message
Eclipse UserFriend
I am trying to do something like:
ViewerSupport.bind(viewer,BeansObservables.observeList(Model Provider.getInstance(),
"items"),BeanProperties.values(new String[] { "itemName",
"price", "quantity", "subtotal" } ) );

But I get an exception "Realm cannot be null". However, this is a JFace
ViewPart that is called in a JFace tab. How in the world would I
instantiate a Realm in a ViewPart???
Re: ViewerSupport.bind issue in a ViewPart [message #17696 is a reply to message #11988] Tue, 30 June 2009 15:41 Go to previous message
Eclipse UserFriend
Are you running that code in the UI thread? In an Eclipse/RCP application
the UI thread has a default realm based on the SWT Display. All UI code in
the event loop generally does not need to worry about the Realm.

But if you have another thread, or if you are not using
Workbench#createAndRunWorkbench, then you have to deal with the
realm/synchronization issues yourself. See
http://wiki.eclipse.org/JFace_Data_Binding/FAQ#What_is_a_Rea lm.2C_and_do_I_need_to_care.3F
for more info.

Will

"Igor Ganapolsky" <eazyigz@gmail.com> wrote in message
news:e5602c311b4403ea124ec53ba71d165b$1@www.eclipse.org...
>I am trying to do something like:
> ViewerSupport.bind(viewer,BeansObservables.observeList(Model Provider.getInstance(),
> "items"),BeanProperties.values(new String[] { "itemName",
> "price", "quantity", "subtotal" } ) );
> But I get an exception "Realm cannot be null". However, this is a JFace
> ViewPart that is called in a JFace tab. How in the world would I
> instantiate a Realm in a ViewPart???
>
Previous Topic:How to customize context menus in text editor?
Next Topic:DataBindingContext for TableViewer in ViewPart
Goto Forum:
  


Current Time: Tue Jun 03 04:48:34 EDT 2025

Powered by FUDForum. Page generated in 0.03787 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top