Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » WindowBuilder » window builder & rap platform
window builder & rap platform [message #716283] Tue, 16 August 2011 17:48 Go to next message
bogdan toma is currently offline bogdan toma
Messages: 38
Registered: February 2010
Member
Hello all,

I am using the latest window builder. When building the GUI i have activated a RAP target platform(version 1.4).
I have a composite which i want to be reused.
Another composite is using it.
  public UsingExposedForExtending(Composite parent, int style)
    {
        super(parent, style);
        setLayout(new GridLayout(1, false));
        
        exposedForExtending = new ExposedForExtending(this, SWT.NONE);


public class ExposedForExtending extends Composite {
	private DataBindingContext m_bindingContext;
	private Binding mBinding;
	private Text text;
	private Composite composite;

	...
public ExposedForExtending(Composite parent, int style) {
		super(parent, style);
		setLayout(new GridLayout(1, false));
...
protected DataBindingContext initDataBindings() {
        DataBindingContext bindingContext = new DataBindingContext();
 ...


When i preview the UsingExposedForExtending i get an exception:
org.eclipse.core.runtime.AssertionFailedException: null argument:Validation realm cannot be null
at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
at org.eclipse.core.databinding.DataBindingContext.<init>(DataBindingContext.java:95)
at org.eclipse.core.databinding.DataBindingContext.<init>(DataBindingContext.java:82)
at de.softcon.wb.other.ExposedForExtending.initDataBindings(ExposedForExtending.java:140)
at de.softcon.wb.other.ExposedForExtending.<init>(ExposedForExtending.java:105)

When using a RCP target platform everything works well.
Maybe there is an idea (besides changing target) how to avoid this exception.

Thank you.
Re: window builder & rap platform [message #716312 is a reply to message #716283] Tue, 16 August 2011 22:47 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric Clayberg
Messages: 832
Registered: July 2009
Location: Boston, MA
Senior Member
Looks like you need to set up a Data Binding Realm. As I recall, RCP apps do that for you. I'm guessing that RAP apps don't, so you need to do that yourself. Sounds like a good question for the RAP or JFace forum. None of the WB committers are experts in using the Eclipse Data Binding framework, so we can't help you much there.

Re: window builder & rap platform [message #716348 is a reply to message #716312] Wed, 17 August 2011 02:32 Go to previous messageGo to next message
bogdan toma is currently offline bogdan toma
Messages: 38
Registered: February 2010
Member
Thank you for your reply.
My question is : how to add some custom code to WindowBuilder (in order that in preview to have this Data Binding Realm) ?

Thank you.
Re: window builder &amp; rap platform [message #716370 is a reply to message #716312] Wed, 17 August 2011 04:15 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 5005
Registered: July 2009
Senior Member
Hi Eric,

You are right the RCP platform launches the whole framework using
Realm.runWithDefault(...).

I don't know how the WindowBuilder creates instances of the sources (i
guess they are created in a seperate Java-Process) so somehow you need
to set the realm, not?

Tom

Am 17.08.11 04:47, schrieb Eric Clayberg:
> Looks like you need to set up a Data Binding Realm. As I recall, RCP
> apps do that for you. I'm guessing that RAP apps don't, so you need to
> do that yourself. Sounds like a good question for the RAP or JFace
> forum. None of the WB committers are experts in using the Eclipse Data
> Binding framework, so we can't help you much there.
>
>
Re: window builder & rap platform [message #716554 is a reply to message #716283] Wed, 17 August 2011 12:56 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
bogdan.toma wrote on Tue, 16 August 2011 17:48

When using a RCP target platform everything works well.
Maybe there is an idea (besides changing target) how to avoid this exception.


Actually WindowBuilder does not support RAP, so while it accidentally works in some cases, does not mean that we tested and support RAP toolkit.

As Tom mentioned, when you use RCP, it already initializes Realm as process of starting Eclipse. But when you use different toolkit, Realm is not initialized for it. So, you need to write extension plugin for WindowBuilder to support RAP.


Konstantin Scheglov,
Google, Inc.
Re: window builder & rap platform [message #716584 is a reply to message #716554] Wed, 17 August 2011 14:59 Go to previous messageGo to next message
Eric Clayberg is currently offline Eric Clayberg
Messages: 832
Registered: July 2009
Location: Boston, MA
Senior Member
In addition to adding first class support for RAP to WB, a quicker solution might be to just add code to your Composite to initialize the Realm if one isn't present.
Re: window builder & rap platform [message #716626 is a reply to message #716554] Wed, 17 August 2011 18:19 Go to previous messageGo to next message
bogdan toma is currently offline bogdan toma
Messages: 38
Registered: February 2010
Member
Thank for answer.

The code generated by WindowBuilder works quite well with the principle of single sourcing (except some issues...).
So I was hoping that also design time to work somehow...

Quote:
So, you need to write extension plugin for WindowBuilder to support RAP


Where do I start ? Is there a documentation for this ?
I want to get a feeling of what "writing an extension plugin" means.

Thank you.
Re: window builder & rap platform [message #717291 is a reply to message #716626] Fri, 19 August 2011 16:33 Go to previous message
Konstantin Scheglov is currently offline Konstantin Scheglov
Messages: 554
Registered: July 2009
Senior Member
I'd start looking on eRCP or RCP plugins implementations, how they add new toolkit support.

Konstantin Scheglov,
Google, Inc.
Previous Topic:How to implement support for a custom toolkit?
Next Topic:"Cannot complete the install"
Goto Forum:
  


Current Time: Wed Apr 16 18:49:04 EDT 2014

Powered by FUDForum. Page generated in 0.01871 seconds