Monday, December 2, 2024

Re: A GWT components library - how to organize for Uibinder use?

Not saying this is the correct way, but I just have my simple common widgets in the one package, and specialised widgets in their own package.  Ie:

<ui:UiBinder
  xmlns:ui="urn:ui:com.google.gwt.uibinder"
  xmlns:g="urn:import:com.google.gwt.user.client.ui"
  xmlns:w="urn:import:mypackage.widgets"
  xmlns:s="urn:import:
mypackage.widgets.special">

<w:Button ui:field="myButton" />
<w:Link ui:field="myLink" />
<s:SpecialWidget ui:field="mySpecialWidget" />

On Sunday, 1 December 2024 at 3:59:36 pm UTC+11 cbruno...@gmail.com wrote:
Thanks Jens. This is my first Java project where I am sole architect. I ended up doing what you recommended, although I moved the ui.xml and css files into a sub-package to keep the top level package as clutter free as possible. 



On Saturday, November 30, 2024 at 5:49:08 PM UTC-6 Jens wrote:
UiBinder is XML and you have to import the package as namespace in order to use the components. Personally I would not create another package with classes extending the implementation because both classes would be public and both can be used in UiBinder then. That is likely confusing. I would put all components in the same package. Package private classes supporting a component could have the component name as prefix so they form a group in your IDE through sorting.

-- J.

cbruno...@gmail.com schrieb am Freitag, 29. November 2024 um 20:20:57 UTC+1:
Hello,

Im creating a component library for GWT and I want to be able to use the components in UI binder. However, when implementing my components, each component gets its own package, containing styles, and package private classes needed to build the component. 

However, to use in Uibinder, I need to do something like <m:button.Button text="Click" />

where m points to the package with my components.

Whats is bugging me is the extra "button" in the declaration. Is there anyway to flatten this aside from creating another package with objects simply extending the implementation ?

Thanks

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/8d6bd10a-274a-4581-b01f-e6bf054d9cf9n%40googlegroups.com.

No comments:

Post a Comment