Re: UiBinder: ClientBundle with ImageResource ui:style. How?

2010-09-10 Thread daniel brelovsky
i think the 'resource' attribute is ignored

u can use the 'src'-attribute and use the relative path to the image!
but there seems to be a problem when the image is in a parent path is in a
parent directory (relative to the ui.xml).
in this case u can write src='../image.png'
but this fails when a second project inherits your project.
in this case the full path works: src='com.bla.image.png'
this is shown as an error in eclipse but works well (maybe a bug in the
google eclipse plugin?)



On Thu, Sep 9, 2010 at 16:52, Andrew Hughes ahhug...@gmail.com wrote:

 Hi Marius,

 Thanks for your help again.

 ui:image resource={res.someImage} and x:SomeWidget
 resource={res.someImage} are very different.

 I'm still lost on this one, but thanks for chipping in  :)


 On Thu, Sep 9, 2010 at 7:04 AM, marius.andreiana 
 marius.andrei...@gmail.com wrote:

 On Sep 8, 5:17 pm, Andrew Hughes ahhug...@gmail.com wrote:
  But when MyView and MyResources are in different packages,
  resource={res.loading} never works. Is this expected and does it work
 for
  you?
 It does work here

 http://code.google.com/p/puzzlebazar/source/browse/src/com/puzzlebazar/client/core/view/SplitMainView.ui.xml
 (see m:ImageHyperlink resource='{resources.logo}' )

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: UiBinder: ClientBundle with ImageResource ui:style. How?

2010-09-09 Thread Andrew Hughes
Hi Marius,

Thanks for your help again.

ui:image resource={res.someImage} and x:SomeWidget
resource={res.someImage} are very different.

I'm still lost on this one, but thanks for chipping in  :)


On Thu, Sep 9, 2010 at 7:04 AM, marius.andreiana marius.andrei...@gmail.com
 wrote:

 On Sep 8, 5:17 pm, Andrew Hughes ahhug...@gmail.com wrote:
  But when MyView and MyResources are in different packages,
  resource={res.loading} never works. Is this expected and does it work
 for
  you?
 It does work here

 http://code.google.com/p/puzzlebazar/source/browse/src/com/puzzlebazar/client/core/view/SplitMainView.ui.xml
 (see m:ImageHyperlink resource='{resources.logo}' )

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: UiBinder: ClientBundle with ImageResource ui:style. How?

2010-09-08 Thread Andrew Hughes
Thanks for the reply,

The path related issue is this...

say I have '*com.blah.client*.MyView.ui.xml' and
*com.blah.client.util*.MyResouces.java'
(NOTE: they are in different packages).

I then try...
ui:with field='res' type='com.blah.client.util.Resources'/
ui:image field=loading resource={res.loading}/

But when MyView and MyResources are in different packages,
resource={res.loading} never works. Is this expected and does it work for
you?


CHEERS :)


On Tue, Sep 7, 2010 at 4:41 PM, marius.andreiana marius.andrei...@gmail.com
 wrote:

 On Sep 7, 5:53 am, Andrew Hughes ahhug...@gmail.com wrote:
  Seems like I can kinda answer two of these questions myself now...
 
  Q: How can loader1.gwt-image be loading.gif?
 
  ui:with type=blah.client.MyClientBundle field=cb/
  ui:image field=loading resource={cb.loading}/
  ui:style
 @sprite .loader1 {
 gwt-image: 'loading';
 padding-left: value('loading.getWidth','px');
 width: auto;
 height: auto;}
 
  /ui:style
 You can also do it with less code:
 ui:image field=loading src=loading.gif/


  The problem with this is that if (loading.gif  MyClientBundle) are in a
  different package/directory to that of the ui.xml BOOM!
 It certainly works for me with
 ui:image field=loading src=path-to-image/loading.gif/
 or
 ui:with field='res' type='com.blah.client.Resources'/


  Q: How can loader3.margin-left be loading.gif.width?
 
  as above...  padding-left: value('loading.getWidth','px');
 See
 http://groups.google.com/group/google-web-toolkit/browse_thread/thread/df5db4040f1f5c76/b3ee0f84cd372eb1
 ?

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: UiBinder: ClientBundle with ImageResource ui:style. How?

2010-09-08 Thread marius.andreiana
On Sep 8, 5:17 pm, Andrew Hughes ahhug...@gmail.com wrote:
 But when MyView and MyResources are in different packages,
 resource={res.loading} never works. Is this expected and does it work for
 you?
It does work here
http://code.google.com/p/puzzlebazar/source/browse/src/com/puzzlebazar/client/core/view/SplitMainView.ui.xml
(see m:ImageHyperlink resource='{resources.logo}' )

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: UiBinder: ClientBundle with ImageResource ui:style. How?

2010-09-07 Thread marius.andreiana
On Sep 7, 5:53 am, Andrew Hughes ahhug...@gmail.com wrote:
 Seems like I can kinda answer two of these questions myself now...

 Q: How can loader1.gwt-image be loading.gif?

 ui:with type=blah.client.MyClientBundle field=cb/
 ui:image field=loading resource={cb.loading}/
 ui:style
   �...@sprite .loader1 {
        gwt-image: 'loading';
        padding-left: value('loading.getWidth','px');
        width: auto;
        height: auto;}

 /ui:style
You can also do it with less code:
ui:image field=loading src=loading.gif/


 The problem with this is that if (loading.gif  MyClientBundle) are in a
 different package/directory to that of the ui.xml BOOM!  
It certainly works for me with
ui:image field=loading src=path-to-image/loading.gif/
or
ui:with field='res' type='com.blah.client.Resources'/


 Q: How can loader3.margin-left be loading.gif.width?

 as above...  padding-left: value('loading.getWidth','px');
See 
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/df5db4040f1f5c76/b3ee0f84cd372eb1?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: UiBinder: ClientBundle with ImageResource ui:style. How?

2010-09-06 Thread Andrew Hughes
Seems like I can kinda answer two of these questions myself now...

Q: How can loader1.gwt-image be loading.gif?

ui:with type=blah.client.MyClientBundle field=cb/
ui:image field=loading resource={cb.loading}/
ui:style
   @sprite .loader1 {
   gwt-image: 'loading';
   padding-left: value('loading.getWidth','px');
   width: auto;
   height: auto;
}
/ui:style


The problem with this is that if (loading.gif  MyClientBundle) are in a
different package/directory to that of the ui.xml BOOM!  This seems a little
stupid to me, re-usablity of ClientBundles across multiple ui.xml templates
is a great idea - but putting them all in the same flat package/directory
structure is not. If anyone can clean this up it would be excellent.

Q: How can loader3.margin-left be loading.gif.width?

as above...  padding-left: value('loading.getWidth','px');


If anyone can help with the other stuff... THANKS HEAPS.


On Tue, Sep 7, 2010 at 10:46 AM, Andrew Hughes ahhug...@gmail.com wrote:

 Hi Guys,

 I'll try to be concise :) I do *NOT* want to use an external css file. All
 style should be in the ui.xml...

 *Client Bundle:*
 public interface MyClientBundle extends ClientBundle {
  @Source(loading.gif) ImageResource loading();
 }

 *ui.xml*
 ui:with type=blah.client.MyClientBundle field=cb/
 ui:style
  .loader1 {
 gwt-image: ;
  }
 .loader2 {
 background: ;
  }
 .loader3 {
 margin-left: ;
  }
 /ui:style

 *Questions:*

 Q: How can loader1.gwt-image be loading.gif?
 Q: How can loader2.background be loading.gif?
 Q: How can loader3.margin-left be loading.gif.width?

 Thanks Heaps :)


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.