XWT callback to specific instance [message #520304] |
Thu, 11 March 2010 16:11  |
Eclipse User |
|
|
|
I am trying out XWT and running into some confusion.
My foo.xwt has a tag referencing the Java class providing callback support.
For example,
<Composite ... x:Class="Foo">
. . .
<Button x:style="SWT.PUSH" text="Bar" SelectionEvent="selection" ></Button>
with a file Foo.java containing the callback handler
public class Foo extends Composite {
public XwtComponent1(Composite parent, int style) {
super(parent, style);
}
protected void selection(Event event) {
. . . }
}
Now, from Bar.java I am loading the XWT to open the GUI. I'd like to have
the button click go to a method in my BAR.java class and to
the *instance* of BAR which opened the GUI.
What are the mechanics of this or am I going down the wrong path completely?
|
|
|
|
|
|
Re: XWT callback to specific instance [message #520580 is a reply to message #520579] |
Fri, 12 March 2010 16:02  |
Eclipse User |
|
|
|
Precisely, you can look at the class XWTAbstractPart in
org.eclipse.e4.xwt.ui.workbench:
newOptions.put(XWTLoader.CLASS_PROPERTY, this);
Regards
Yves
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hne9qj$2h6$1@build.eclipse.org...
> You can specify BAR directly in x:Class.
>
> Regards
> yves
> <allygirl@mailinator.com> wrote in message
> news:hndonv$h8b$1@build.eclipse.org...
>> Thank you for your response. Perhaps I oversimplified the first part of
>> my post. Yes, the class would be fully qualified.... The core part of my
>> question is the second half regarding having the widget callback
>> (selection(...) ) either 1) go to an instanceof x.y.Foo that is known by
>> my code (vs. a new instance created by the XWT engine) or 2) the callback
>> goes to the instance which requested XWT to open the GUI spec to begin
>> with. I reviewed many of the test examples and nothing is jumping out as
>> addressing this question. Can you point me to an example?
>> i.e. a button on the XWT created GUI which calls back into the code which
>> opened that XWT GUI.
>> Many thanks for any assistance you can provide.
>
>
|
|
|
Re: XWT callback to specific instance [message #570336 is a reply to message #520579] |
Fri, 12 March 2010 16:02  |
Eclipse User |
|
|
|
Precisely, you can look at the class XWTAbstractPart in
org.eclipse.e4.xwt.ui.workbench:
newOptions.put(XWTLoader.CLASS_PROPERTY, this);
Regards
Yves
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:hne9qj$2h6$1@build.eclipse.org...
> You can specify BAR directly in x:Class.
>
> Regards
> yves
> <allygirl@mailinator.com> wrote in message
> news:hndonv$h8b$1@build.eclipse.org...
>> Thank you for your response. Perhaps I oversimplified the first part of
>> my post. Yes, the class would be fully qualified.... The core part of my
>> question is the second half regarding having the widget callback
>> (selection(...) ) either 1) go to an instanceof x.y.Foo that is known by
>> my code (vs. a new instance created by the XWT engine) or 2) the callback
>> goes to the instance which requested XWT to open the GUI spec to begin
>> with. I reviewed many of the test examples and nothing is jumping out as
>> addressing this question. Can you point me to an example?
>> i.e. a button on the XWT created GUI which calls back into the code which
>> opened that XWT GUI.
>> Many thanks for any assistance you can provide.
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03557 seconds