Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Consistent duplication of custom xwt UI
Consistent duplication of custom xwt UI [message #581818] Tue, 14 September 2010 18:32 Go to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Hello,
I have a peculiar problem.

Whenever I create a UI with XWT and embed it in another UI, the embedded UI is duplicated in the application.

For example, I have a xwt UI call CashForm ( I am using Instantiation's/Google Designer to create the UI). I now create a xwt Forms application and embed the NameForm it. Runing the application displays two NameForms UI! :blush:

This consistently occurs whenever the process is repeated with different UI forms.

I contacted support at Google and the following is there response
"It seems that XWT first creates the CashForm Composite and then renders its XWT file one more time. You should contact the XWT authors and suggest that they should not do this. I don't see any problem when I drop a CashForm Composite on a normal Java SWT application, so this appears to be an XWT rendering bug."

Hence now I am contacting you.

Please see the relevant attachements - I cannot attach the files. Some instruction for this please.

Thanks
Re: Consistent duplication of custom xwt UI [message #582014 is a reply to message #581818] Thu, 16 September 2010 17:16 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Just touching base to see if Bug 325298 was confirmed and
any idea when it will be resolved as I cannot do anything serious
with Forms with this problem.

Thanks.
Re: Consistent duplication of custom xwt UI [message #629917 is a reply to message #582014] Wed, 29 September 2010 23:18 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
The case is closed. The bug is invalided. Please see my comment in the bug.

Best regards
Yves YANG
"St Clair Clarke" <st_clair@flowja.com> wrote in message
news:i6tje0$cm$1@build.eclipse.org...
> Just touching base to see if Bug 325298 was confirmed and
> any idea when it will be resolved as I cannot do anything serious
> with Forms with this problem.
>
> Thanks.
Re: Consistent duplication of custom xwt UI [message #632428 is a reply to message #629917] Tue, 12 October 2010 20:41 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Hello,
Has anyone being successful at nesting an XWT form in another form without the nested form being duplicated in the UI?

E4 experts closed what I thought was a bug. However, the problem still exist.

I use WindowBuilder Pro to generate the forms and consistently gets duplication.

WindowBuilderPro (Google - formerly Instanatiation) disagrees with the explanation given by the e4 experts.

The result: the user is left out in the coldjavascript:%20insertTag(document.post_form.msg_body,%20' ',%20'%20:evil:%20');

If anyone has been successful at this, please post a snippet so I can learn from it.

Thanks
Re: Consistent duplication of custom xwt UI [message #632590 is a reply to message #632428] Wed, 13 October 2010 14:12 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 756
Registered: July 2009
Senior Member
I have been able to achieve this by defining my own attribute handler... have a look at INamespaceHandler...

<Composite xmlns:my="my-magic-namespace-handler" >
...
<Composite my:ref="my.external.xwt.form"/>
<Label .../>
</Composite>

The Composite inside the root Composite will be filled/loaded with the contents of the external xwt form.

Re: Consistent duplication of custom xwt UI [message #632663 is a reply to message #632590] Wed, 13 October 2010 19:07 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Hello Erdal,

Thanks for the pointer.

Could you please post a complete snippet of how this should work?

All of us who are facing this problem would appreciate that.

NB. Would you say your solution is due to a problem with XWT library? or a bug?

Do you use your solution in the generation of all your Composites when using the forms API?

Thanks a million.
Re: Consistent duplication of custom xwt UI [message #632684 is a reply to message #632663] Wed, 13 October 2010 21:30 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 756
Registered: July 2009
Senior Member
The namespace handler is part of a higher level framework, but I will try to extract a standalone solution...

Anyways, the problems you will face:

What XWTProfile was used to load the xwt parent form?
What options were used to load the parent form?
Cascade data context to embedded form?

Steps to adapt that solution, snippets:

1. xwt form (called test.xwt):

<Browser x:style="None" xmlns="http://www.eclipse.org/xwt/presentation"
xmlns:x="http://www.eclipse.org/xwt" url="google.com">
</Browser>

2. form:

<SashForm xmlns="http://www.eclipse.org/xwt/presentation"
xmlns:x="http://www.eclipse.org/xwt" xmlns:d="ref-urn">
<Browser x:style="None" url="eclipse.org">
</Browser>

<Composite d:ref="platform:/resource/your-bundle/forms/test.xwt">
<Composite.layout>
<FillLayout />
</Composite.layout>
</Composite>
</SashForm>

A) define namespace handler:
public class RefNamespaceHandler
implements INamespaceHandler {

public void handleAttribute( Widget widget, Object target, String name,
String value ) {
// ...
// find a way to fix the open issues mentioned above...
// options must contain 'target' as container (XWTLoader.CONTAINER_PROPERTY)
url = new URL( value )
XWTForms.loadWithOptions(url, options);
}
}

B) register namespace handler:

XWT.registerNamespaceHandler("ref-urn",
new RefNamespaceHandler());


As xwt does not support embedding external forms, this is rather a workaround... I am using it to modularize the application UI...
Re: Consistent duplication of custom xwt UI [message #633678 is a reply to message #632428] Mon, 18 October 2010 20:07 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
I have added a comment in the bug. I wonder if you have read it.

The problem is that the constructor of the referenced composent loads the UI
resource. It is not necessary. It is already doen by XWT. This is why the UI
is doubled.

Best regards
Yves YANG
"St Clair Clarke" <st_clair@flowja.com> wrote in message
news:i92gvv$mh4$1@news.eclipse.org...
> Hello,
> Has anyone being successful at nesting an XWT form in another form without
> the nested form being duplicated in the UI?
>
> E4 experts closed what I thought was a bug. However, the problem still
> exist.
>
> I use WindowBuilder Pro to generate the forms and consistently gets
> duplication.
>
> WindowBuilderPro (Google - formerly Instanatiation) disagrees with the
> explanation given by the e4 experts.
>
> The result: the user is left out in the
> coldjavascript:%20insertTag(document.post_form.msg_body,%20'
> ',%20'%20:evil:%20');
>
> If anyone has been successful at this, please post a snippet so I can
> learn from it.
>
> Thanks
Re: Consistent duplication of custom xwt UI [message #633733 is a reply to message #633678] Tue, 19 October 2010 07:34 Go to previous messageGo to next message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
Registered: July 2009
Senior Member
Yves YANG wrote on Tue, 19 October 2010 00:07
I have added a comment in the bug. I wonder if you have read it.

The problem is that the constructor of the referenced composent loads the UI
resource. It is not necessary. It is already doen by XWT. This is why the UI
is doubled.



Is it possible to change XWT so that during parsing <p:MyCompsite> it will check first if MyComposite is Control and create it as Java object? I think that now XWT checks first for MyComposite.xwt file.


Konstantin Scheglov,
Google, Inc.
Re: Consistent duplication of custom xwt UI [message #633938 is a reply to message #633733] Tue, 19 October 2010 23:56 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
> Is it possible to change XWT so that during parsing <p:MyCompsite> it
> will check first if MyComposite is Control and create it as Java object? I
> think that now XWT checks first for MyComposite.xwt file.

I understood your point. The solution you proposed presents an advantage;
the XWT Component can be used via API as a UI element in Java. I worth an
investigation.

Best regards
yves
Re: Consistent duplication of custom xwt UI [message #634253 is a reply to message #633938] Wed, 20 October 2010 23:49 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
In fact, I think it is not good idea to change the current solution for
following reasons:
1. Java class for XWT plays a role of Controler in MVC design, its
purpose is to handle the events
2. For the previous reason, one Java class can be used by several UI
resources.
3. XWT leverages the decalarative UI, not progarmming UI

Hope you understand my concern.

Best regards
Yves YANG
"Yves YANG" <yves.yang@soyatec.com> wrote in message
news:i9lb0b$9ch$1@news.eclipse.org...
>> Is it possible to change XWT so that during parsing <p:MyCompsite> it
>> will check first if MyComposite is Control and create it as Java object?
>> I think that now XWT checks first for MyComposite.xwt file.
>
> I understood your point. The solution you proposed presents an advantage;
> the XWT Component can be used via API as a UI element in Java. I worth an
> investigation.
>
> Best regards
> yves
Re: Consistent duplication of custom xwt UI [message #638494 is a reply to message #581818] Thu, 11 November 2010 13:50 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Hello Yves,
As the lead on e4, I think you should be able to discuss this issue with WindowBuilder developers and come to some agreement that benefit all eclipse users.

WindowBulder is the most advanced tool for building eclipse UI. Now that Google purchased it and literally donate it to all users for free, the number of users will increase exponentially.

For us not to be able to use this tool because of some issues in XWT is a big negative in the future use of e4. Very soon, the word will spread that one cannot use this tool to simply embed one XWT UI in another - such a fundamental part of todays programming. I don't know how many developers out there are still hand-coding. At the most, few!

If you noticed, the number of hits on this topic is sizable - I think it is an indication of its problem. Any one experimenting with e4 will come upon this problem sooner than later.

I implore you and your team to work out this stumbling block with the WindowBuilder team for the sake of all of us. If you know of another tool equivalent or near equivalent to WindowBuilder please let me know.

I am very excited about e4. However, this issue is killing my enthusiasm.

Please re-open this issue and let us move forward.

Currently, I don't think there are many users who are doing significant production development with e4, so I don't think it would be breaking implementation by developers if both your team and WindowBulder team put your heads together to sort this issue in a more amicable manner.

In both your arguments are sound reasoning, but at the end of it all the problem still exists.

FACT: WE THE USERS OF WINDOWBUILDER AND FUTURE DEVELOPERS WITH E4 NEED HELP. PLEASE OBLIGE US. IT WILL BE TO THE BENEFIT OF ALL ECLIPSE USERS.

Re: Consistent duplication of custom xwt UI [message #639380 is a reply to message #581818] Tue, 16 November 2010 10:24 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
Hi St Clair,

We have investigated the issue. I do understand why WindowBuilder generate UI component in that way. We have tried to take it into consideration in XWT. But finally, we cannot since it isn't compatible with the design guidelines of XWT.

Hope you understand the situation.

Best regards
Yves YANG
Re: Consistent duplication of custom xwt UI [message #639381 is a reply to message #639380] Tue, 16 November 2010 10:33 Go to previous message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Thanks Yve,
I appreciate the investigation and the explanation.

I am certain the WB team is linked to this topic.
Previous Topic:xwt Internationalization: how i can use UTF-8 encoding in XWT
Next Topic:Wizard with xwt
Goto Forum:
  


Current Time: Thu Dec 18 21:50:30 GMT 2014

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

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