Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » XWT loaded event lookup problem(ResourceLoader looks up method with Widget as parameter on updateEvent method and LoadingData inner class end method tries to invoke method passing CLR as parameter)
XWT loaded event lookup problem [message #843853] Fri, 13 April 2012 08:36 Go to next message
Rafael Ribeiro is currently offline Rafael Ribeiro
Messages: 17
Registered: April 2012
Junior Member
I tried to setup a loaded event handler on a CLR class for a Shell widget as follows:
<Shell xmlns="www.eclipse.org/xwt/presentation" xmlns:x="www.eclipse.org/xwt"
	x:Class="br.rar.dups.Application" text="XWT Application" xmlns:p1="clr-namespace:br.rar.dups"
	loaded="onLoad">

If I specify the onLoad method as follows:
	public void onLoad(Application clr, Event event) {
		StackLayout layout =(StackLayout) XWT.findElementByName(clr, "stack");
	}

ResourceLoader updateEvent complains about not finding onLoad method...
in turn if I specify it as follows:
	public void onLoad(Shell widget, Event event) {
		StackLayout layout =(StackLayout) XWT.findElementByName(widget, "stack");
	}

updateEvent method finds the onLoad method but LoadingData inner class fails to execute the method on its end method since it tries to invoke the found method with the Application CLR class as parameter... resulting in an IllegalArgumentException with an almost blank catching code.
Re: XWT loaded event lookup problem [message #846010 is a reply to message #843853] Sun, 15 April 2012 13:07 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 740
Registered: July 2009
Senior Member
Rafael Ribeiro wrote on Fri, 13 April 2012 08:36
I tried to setup a loaded event handler on a CLR class for a Shell widget as follows:
<Shell xmlns="www.eclipse.org/xwt/presentation" xmlns:x="www.eclipse.org/xwt"
	x:Class="br.rar.dups.Application" text="XWT Application" xmlns:p1="clr-namespace:br.rar.dups"
	loaded="onLoad">

If I specify the onLoad method as follows:
	public void onLoad(Application clr, Event event) {
		StackLayout layout =(StackLayout) XWT.findElementByName(clr, "stack");
	}

ResourceLoader updateEvent complains about not finding onLoad method...
in turn if I specify it as follows:
	public void onLoad(Shell widget, Event event) {
		StackLayout layout =(StackLayout) XWT.findElementByName(widget, "stack");
	}

updateEvent method finds the onLoad method but LoadingData inner class fails to execute the method on its end method since it tries to invoke the found method with the Application CLR class as parameter... resulting in an IllegalArgumentException with an almost blank catching code.


If you provide an x:Class, the executing event code is an instance of that class:
	public void onLoad(Event event) {
                Application clr = this;
		StackLayout layout =(StackLayout) XWT.findElementByName(clr, "stack");
	}

Re: XWT loaded event lookup problem [message #846642 is a reply to message #843853] Mon, 16 April 2012 09:32 Go to previous messageGo to next message
Rafael Ribeiro is currently offline Rafael Ribeiro
Messages: 17
Registered: April 2012
Junior Member
I know and I've been able to do a similar workaround but either both ways I've tried should work or should not throw an exception... it seems to me like the code in question is buggy...
Re: XWT loaded event lookup problem [message #846780 is a reply to message #846642] Mon, 16 April 2012 14:49 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 740
Registered: July 2009
Senior Member
Rafael Ribeiro wrote on Mon, 16 April 2012 09:32
I know and I've been able to do a similar workaround but either both ways I've tried should work or should not throw an exception... it seems to me like the code in question is buggy...


As you know: open source software is driven by those who need it and extend it Smile
Re: XWT loaded event lookup problem [message #846796 is a reply to message #846780] Mon, 16 April 2012 15:04 Go to previous messageGo to next message
Rafael Ribeiro is currently offline Rafael Ribeiro
Messages: 17
Registered: April 2012
Junior Member
For sure I know that's the open source spirit, by the way, where is the source code hosted? I found a CVS repo but I got the impression that it wasn't the one in use...
I tried to figure out how to solve this issue but XWT code isn't that simple... Surprised
Re: XWT loaded event lookup problem [message #846837 is a reply to message #846796] Mon, 16 April 2012 16:01 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 740
Registered: July 2009
Senior Member
AFAIK, all/many eclipse projects will migrate to git. I.e. you will find the xwt git repository at http://git.eclipse.org/c/e4/org.eclipse.e4.xwt.git/

Scroll to the bottom to see the clone url...

And yes, the xwt code will not win any code beauty contest, but, at least, it works Smile

BTW, be aware of bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=373668
Re: XWT loaded event lookup problem [message #846952 is a reply to message #846837] Mon, 16 April 2012 18:38 Go to previous messageGo to next message
Rafael Ribeiro is currently offline Rafael Ribeiro
Messages: 17
Registered: April 2012
Junior Member
Working is the main requirement... Very Happy
As you may have already noticed I did try to solve that issue myself... is there any documentation regarding XWT? Any diagram? If not, could you please point how to debug an eclipse plugin? Should I setup plugin source under another eclipse then start the one to be debugged with remote debugging or is there any other trick? Cause I'll try to solve two bugs in one shot... have you seen one I reported onto WB forum?
And Erdal, could you please have a look at one post I've left on the forum regarding XWT and RAP?

regards,
Rafael
Re: XWT loaded event lookup problem [message #847480 is a reply to message #846837] Tue, 17 April 2012 06:50 Go to previous messageGo to next message
Rafael Ribeiro is currently offline Rafael Ribeiro
Messages: 17
Registered: April 2012
Junior Member
Quote:
BTW, be aware of bug report bugs.eclipse.org/bugs/show_bug.cgi?id=373668

When you said be aware of the bug report did you meant to be aware that the project might be somehow dead? Cause that's the impression I had from this bug report... :S
Re: XWT loaded event lookup problem [message #847625 is a reply to message #847480] Tue, 17 April 2012 09:47 Go to previous message
Erdal Karaca is currently offline Erdal Karaca
Messages: 740
Registered: July 2009
Senior Member
No, it will probably leave the e4 space Smile
Previous Topic:Migrate Eclipse RCP application from Eclipse 3.7 to eclipse e4 SDK
Next Topic:eclipse e4 basics - data model
Goto Forum:
  


Current Time: Fri Aug 29 12:21:50 EDT 2014

Powered by FUDForum. Page generated in 0.06196 seconds