Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » ViewerSupport.bind issue in a ViewPart
ViewerSupport.bind issue in a ViewPart [message #11988] Thu, 04 June 2009 20:40 Go to next message
Igor Ganapolsky is currently offline Igor GanapolskyFriend
Messages: 39
Registered: July 2009
Location: New York
Member

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 19:41 Go to previous message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
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: Sat Aug 31 23:07:02 GMT 2024

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

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

Back to the top