Re: using ClientBundle

2010-08-03 Thread Olivier
Hi,

don't make a reference to something in the WAR folder, put your image
at the same level as the clientbundle for example.
Or create a resources folder, but you will have to reference your
image like this
@source(my/package/with/dot/img.gif)

regards

Olivier

On Aug 3, 1:09 pm, avi.yaf...@gmail.com avi.yaf...@gmail.com
wrote:
 Hi

 i need to find a way to point out the the @Source location outside the
 package com. envvoirment.
 i want to create 'images' directory in 'war' directory and write
 {
 @Source (/war/images/img.gif)
 ImageResource img()

 }

 but when i write this i get an error Resource 'img.gif' is missing
 expected.. 

 is it possible to this?

 Thanks,Avi

-- 
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: using ClientBundle

2010-08-03 Thread lineman78
The purpose of clientbundle is to refer to files that are not deployed
on your server.  If you need to deploy the resource for other reasons
you will not want to use clientbundle.

On Aug 3, 9:37 am, Olivier olivier.dau...@gmail.com wrote:
 Hi,

 don't make a reference to something in the WAR folder, put your image
 at the same level as the clientbundle for example.
 Or create a resources folder, but you will have to reference your
 image like this
 @source(my/package/with/dot/img.gif)

 regards

 Olivier

 On Aug 3, 1:09 pm, avi.yaf...@gmail.com avi.yaf...@gmail.com
 wrote:

  Hi

  i need to find a way to point out the the @Source location outside the
  package com. envvoirment.
  i want to create 'images' directory in 'war' directory and write
  {
  @Source (/war/images/img.gif)
  ImageResource img()

  }

  but when i write this i get an error Resource 'img.gif' is missing
  expected.. 

  is it possible to this?

  Thanks,Avi

-- 
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: Using ClientBundle to bundle images for a custom widget

2010-04-21 Thread kozura
I think the image path is relative to where the ClientBundle is, so
your images directory should be put in the same directory.

On Apr 21, 8:10 am, San sandip.pati...@gmail.com wrote:
 Hi I am trying to bundle all my images required for a widget in a
 ClientBundle as follows.

 public interface HeaderWidgetImageResource extends ClientBundle {

         @Source(images/logo.png)
         ImageResource logo();

         @Source(images/spacer.png)
         ImageResource spacer();

 }

 I am using it in UIBinder as follows

 ui:with field='res'
 type='com.sample.client.HeaderWidgetImageResource'/

 and
 g:Image resource='{res.logo}' ui:field=logoImage /g:Image

 I have also created a variable in HeaderWidget.java class which is
 owner of the UIBinder

 @UIField
 Image logoImage;

 All my images I have kept in /client/public/images folder

 Now when I try to compile the project it is giving me following error
 Preparing method logo
    Finding resources
       [ERROR] Resource images/logo.png not found. Is the name
 specified as Class.getResource() would expect?

 What is wrong with the image path?
 Do I need to keep those images in any specific folder?

 -Thanks

 --
 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 
 athttp://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: using ClientBundle for a themeable image set

2010-02-18 Thread Strelok
I think you are on the right track. The getImageResource(...) method
can be replaced with deferred binding.

On Feb 4, 2:40 am, Bob holom...@gmail.com wrote:
 Hi,

 I have a set of static objects which are retrieved from the server and
 rendered in a custom widget on the client.  Each of these objects has
 an image associated with it.  I want these images to be themeable,
 such that the entire set of images used for these objects can be
 swapped out.  For example, say there is a Cat object and a Dog object,
 and there is a 'domestic'themeand a 'wild'theme.   Thethemeis a
 user option.  If the wildthemeis selected, the images should be a
 cheetah and a dingo.  With the domesticthemethey would be a calico
 cat and a golden retriever.

 My thought was that I could distribute these image themes as
 ClientBundles.  So I implemented something like this:

 public interface ImageTheme {
     ImageResource cat();
     ImageResource dog();

 }

 public interface WildImageTheme extends ClientBundle, ImageTheme {
     @Source(cheetah.jpg)
     ImageResource cat();

     @Source(dingo.jpg)
     ImageResource dog();

 }

 public interface DomesticImageTheme extends ClientBundle, ImageTheme {
     @Source(calico.jpg)
     ImageResource cat();

     @Source(golden-retriever.jpg)
     ImageResource dog();

 }

 But then I end up needing some ugly and hard-to-maintain binding code
 on the client like this:

 public static ImageTheme CURRENT_THEME = (ImageTheme) GWT.create
 (DomesticImageTheme.class)

 public ImageResource getImageResource(String animalName) {
     if (Cat.equals(animalName)) {
         return CURRENT_THEME.cat();
     } else if (Dog.equals(animalName)) {
         return CURRENT_THEME.dog();
     }
     [...]

 }

 If it were available to me, I could use reflection to bind the animal
 names to matching method names, but obviously it isn't.  Deferred
 binding is described as GWT's answer to reflection, but does it fit
 here?  Is my ClientBundle asthemepack paradigm flawed?  Does anyone
 have a suggestion for a better way to accomplish this?

 Thanks,
 Bob

-- 
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: using ClientBundle for a themeable image set

2010-02-04 Thread Bob
Nobody? :-(

On Feb 3, 10:40 am, Bob holom...@gmail.com wrote:
 Hi,

 I have a set of static objects which are retrieved from the server and
 rendered in a custom widget on the client.  Each of these objects has
 an image associated with it.  I want these images to be themeable,
 such that the entire set of images used for these objects can be
 swapped out.  For example, say there is a Cat object and a Dog object,
 and there is a 'domestic' theme and a 'wild' theme.   The theme is a
 user option.  If the wild theme is selected, the images should be a
 cheetah and a dingo.  With the domestic theme they would be a calico
 cat and a golden retriever.

 My thought was that I could distribute these image themes as
 ClientBundles.  So I implemented something like this:

 public interface ImageTheme {
     ImageResource cat();
     ImageResource dog();

 }

 public interface WildImageTheme extends ClientBundle, ImageTheme {
     @Source(cheetah.jpg)
     ImageResource cat();

     @Source(dingo.jpg)
     ImageResource dog();

 }

 public interface DomesticImageTheme extends ClientBundle, ImageTheme {
     @Source(calico.jpg)
     ImageResource cat();

     @Source(golden-retriever.jpg)
     ImageResource dog();

 }

 But then I end up needing some ugly and hard-to-maintain binding code
 on the client like this:

 public static ImageTheme CURRENT_THEME = (ImageTheme) GWT.create
 (DomesticImageTheme.class)

 public ImageResource getImageResource(String animalName) {
     if (Cat.equals(animalName)) {
         return CURRENT_THEME.cat();
     } else if (Dog.equals(animalName)) {
         return CURRENT_THEME.dog();
     }
     [...]

 }

 If it were available to me, I could use reflection to bind the animal
 names to matching method names, but obviously it isn't.  Deferred
 binding is described as GWT's answer to reflection, but does it fit
 here?  Is my ClientBundle as theme pack paradigm flawed?  Does anyone
 have a suggestion for a better way to accomplish this?

 Thanks,
 Bob

-- 
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.