From: Keith D. <kd...@cs...> - 2004-05-28 12:49:15
|
Ronald, You should be able to do what you said below with a Map, instead of Properties (the constructor to DefaultAwtImageSource expects a map of image keys to Resource location-pointers; Spring's built in property editor machinery should convert the string values you specify to Resources for you.) However, I can add support in for Properties; they're a bit more concise to specify than map entries in the bean xml. The reason Properties won't work now is because it treats values as all Strings. Good point. I agree there should be no requirement on using a bundle for loading image files. BTW - AwtImageResource is just a wrapper around another spring Resource capable of turning the InputStream backing the Resource into an awt.Image. Keep 'em coming! ;-) Keith -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of em...@ro... Sent: Friday, May 28, 2004 8:36 AM To: spr...@li... Subject: [Springframework-rcp-dev] Question/remark imageSource And another one from me, concerning the use of images. I've looked through your context.xml to see how to define images, and I think its very complete, but in some cases a bit too complete. I understand the meaning to include resource bundles for your images (so you can have different images based on languages) but for a simple application (with only a couple of very simple icon's) its a bit too much. How about being able to define them like this: <bean id="imageSource" class="org.springframework.rcp.image.AwtImageSourceImpl"> <constructor-arg index="0"> <props> <prop key="cancel.icon">images/alert/x.gif</prop> </props> </constructor-arg> </bean> Therefor an AmtImageSourceImpl could be made up without resources, but that means that the AwtImageSourceImpl should implement a different interface (with only the getImage(String key)) command, or the AwtImageSource interface should extend that and the existing AwtImageSource interface should be renamed to AwtImageResource interface of something like that. Cheers Ronald ------------------------------------------------------- This SF.Net email is sponsored by: Oracle 10g Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click _______________________________________________ Springframework-rcp-dev mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-rcp-dev |