Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » [Databinding] Osgi RWT and JFace DataBinding Realm hell
[Databinding] Osgi RWT and JFace DataBinding Realm hell [message #908910] Thu, 06 September 2012 08:07 Go to next message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

Hi,

I'm trying to make JFace databinding working with RWT and Virgo.

The problem is that when I go to a page that use Databinding, it complains about that the validation realm cannot be null.

The solution I found navigating to forums to launch the UI like this:

final Display display = Display.getDefault();
		Realm.runWithDefault(SWTObservables.getRealm(display), new Runnable() {
            public void run() {... 
}


Doesn't because the thread is already finished when I arrive to my page.

If I put the above loop, it complains that sleep is not authorized in a simpleexecutioncontext.

while(!shell.isDisposed()) {
if (!display.readAndDispatch())
	 	display.sleep();
	}




Have you got an idea of how I can make databinding work?

Best regards,
Re: [Databinding] Osgi RWT and JFace DataBinding Realm hell [message #909488 is a reply to message #908910] Fri, 07 September 2012 08:23 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Charlie,

could you please file an enhancement request [1] for databinding support
in the JEE mode?

As a workaround, you can explicitly specify the realm when creating an
observer:

Realm realm = SWTObservables.getRealm( Display.getCurrent() );
BeansObservables.observeValue( realm, viewModel.getPerson(), "name" );

As an alternative, you could also try to setup the realm for the
PROCESS_ACTION phase in a PhaseListener. You would need some kind of
hack to access the protected method Realm#setDefault(). The drawback of
this approach is that in case of an exception you will not be able to
reset the realm.

Regards, Ralf


[1] http://eclipse.org/rap/bugs/

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: [Databinding] Osgi RWT and JFace DataBinding Realm hell [message #909588 is a reply to message #908910] Fri, 07 September 2012 11:29 Go to previous messageGo to next message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

Hi,

Thank you for your answer, adding the realm in each obsvervable did the job (I tested initializing the databindingcontext with it but it was not sufficient).

I created the issue here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=389040

Regards
Re: [Databinding] Osgi RWT and JFace DataBinding Realm hell [message #909962 is a reply to message #909588] Sat, 08 September 2012 07:20 Go to previous message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

> I created the issue here:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=389040

Thank you!


--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:about org.eclipse.ui.themes
Next Topic:Virtual tree viewer refresh bug
Goto Forum:
  


Current Time: Sat Apr 20 00:55:14 GMT 2024

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

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

Back to the top