|
Re: displaying images not from the default directory [message #1807119 is a reply to message #1807092] |
Thu, 23 May 2019 07:23 |
|
Hi Krzysztof
Thanks for debugging and reporting that issue here. It seems like you have found a bug in the JSON layer of Scout. When Scout requests an icon via HTTP, the request URL looks like this:
http://localhost:8082/icon/flags/flag1.jpg
The request is handled by the class IconLoader where the following happens:
final String imageId = pathInfo.substring(pathInfo.lastIndexOf('/') + 1);
Which means only the last part of the URL "flag1.jpg" is used to lookup the icon in the IconProviderService. Could you please report that bug in our Bugzilla?
Until the bug is fixed in Scout you cannot use sub-directories in the /icons folder.
As a workaround you could use the execInit() method instead of getConfiguredImageId(), load the icon and set it as image (BinaryResource):
@Override
protected void execInitField() {
IconSpec iconSpec = IconLocator.instance().getIconSpec("flags/flag1");
setImage(new BinaryResource(iconSpec.getName(), iconSpec.getContent()));
}
Eclipse Scout Homepage | Documentation | GitHub
[Updated on: Thu, 23 May 2019 09:39] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03225 seconds