Accessing Pictures in Custom Widgets [message #755142] |
Mon, 07 November 2011 13:51 |
S. Schulz Messages: 72 Registered: September 2011 |
Member |
|
|
Hallo!
(I'm trying this for the second time, for whatever reason the forum thought my question was not important enough and deleted it when I tried to preview.)
We finally created a custom widget with Qooxdoo and the LCA of RAP. While researching the possibilities we are now facing another problem. How do you register images in RAP to be used in Qooxdoo?
Now RAP does this inside org.eclipse.swt.internal.widgets.displaykit.ClientResources this way:
String name = "resource/widget/rap/ctabfolder/maximize.gif";
IResourceManager resourceManager = RWT.getResourceManager();
resourceManager.register(name, openResourceStream(name));
When accessing the file in Qooxdoo, it uses this approach:
maxIcon = "widget/ctabfolder/maximize.gif";
this.maxButton.setIcon(maxIcon);
So why did the path of the picture change? What is happening internally while registering? And how would we go about registering our own images? (Recreating the above scenario inside our own plug-in didn't work at all.)
Thank you for your kind help.
|
|
|
|
|
Re: Accessing Pictures in Custom Widgets [message #755412 is a reply to message #755329] |
Tue, 08 November 2011 12:00 |
Ivan Furnadjiev Messages: 2427 Registered: July 2009 Location: Sofia, Bulgaria |
Senior Member |
|
|
Probably, the solution will be to keep these images in the "widget that
is used to build many other widgets". Other widgets will get the images
from it. For me it sounds like WidgetsBuilder#getDecorationImage,
WidgetsBuilder#getErrorImage
Best,
Ivan
On 11/8/2011 10:04 AM, s.schulz wrote:
> Thank you so far.
> The problem is, the widget in question is only a JavaScript widget
> that is used to build many other widgets. In this case, it's an error
> decoration that is put next to some other controls to show the
> validation status. We have already tried successfully the above
> approach, but it would mean many other controls would have to call
> and/or implement writeImage() in their LCA's AND would have a
> additional method setErrorImage() in their JavaScript classes. All of
> that seems to be a lot of duplicated code, which we'd like to avoid,
> since the same image is used every single time.
|
|
|
Re: Accessing Pictures in Custom Widgets [message #755672 is a reply to message #755412] |
Wed, 09 November 2011 09:22 |
S. Schulz Messages: 72 Registered: September 2011 |
Member |
|
|
> Probably, the solution will be to keep these images in the "widget that is used to build many other widgets".
That's what we want to do, but the Decoration has no Java counterpart, so can only access the images via Qooxdoo, and that is not working so far.
> For me it sounds like WidgetsBuilder#getDecorationImage, WidgetsBuilder#getErrorImage
But this way each of the other widgets would have to set the image manually, after getting it from the WidgetsBuilder.
|
|
|
Re: Accessing Pictures in Custom Widgets [message #755673 is a reply to message #755412] |
Wed, 09 November 2011 09:22 |
S. Schulz Messages: 72 Registered: September 2011 |
Member |
|
|
> Probably, the solution will be to keep these images in the "widget that is used to build many other widgets".
That's what we want to do, but the Decoration has no Java counterpart, so can only access the images via Qooxdoo, and that is not working so far.
> For me it sounds like WidgetsBuilder#getDecorationImage, WidgetsBuilder#getErrorImage
But this way each of the other widgets would have to set the image manually, after getting it from the WidgetsBuilder.
|
|
|
Powered by
FUDForum. Page generated in 0.04066 seconds