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?
<allygirl@mailinator.com> wrote in message
news:hnbmao$iks$1@build.eclipse.org...
>
> 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">
The class must be complete name.
You can find more example codes in org.eclipse.e4.xwt.tests.
Regards
Yves
> . . .
> <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?
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.
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.