Images are not properly placed under the plugin folder of product [message #466833] |
Wed, 25 April 2007 12:16 |
Eclipse User |
|
|
|
Originally posted by: johan_susai.yahoo.com
In rcp application, i used the following code
File logo=new File("D:/Data/Icons/a.gif");
Image imgIcon=new Image(display,logo.getAbsolutePath());
While launching this application it works fine, but after exporting i m getting the following error
Unable to create view : i/o error(java.io.FileNotFoundException).
I think while exporting, the images are not properly placed under the plugin folder of product( i am not sure).
So what i did is, i changed the code to
File logo=new File("Icons/a.gif");
Image imgIcon=new Image(display,logo.getAbsolutePath());
Now it wont get work while launching as an Eclipse Application, but after exporting it as a product i manually place the Icon folder(which contains all images) inside the exported product.so now it gets executed well.
So kindly suggest me how to execute as an product without placing the Icon folder manually inside the exported product.
Thanks,
Joe
|
|
|
|
Re: Images are not properly placed under the plugin folder of product [message #466874 is a reply to message #466844] |
Thu, 26 April 2007 05:07 |
Eclipse User |
|
|
|
Originally posted by: johan_susai.yahoo.com
Prakesh,
Thanks for your suggestion, after selecting Icon folder in build.properties and exporting it i can execute the product from my system. But its not working while executing the same application from some other system.so give me a solution to execute the product in any machine.
Thanks,
Joe
|
|
|
|
Re: Images are not properly placed under the plugin folder of product [message #466937 is a reply to message #466874] |
Thu, 26 April 2007 16:01 |
Patrick Paulin Messages: 44 Registered: July 2009 Location: Madison, Wisconsin |
Member |
|
|
Hi Joe,
FWIW, the standard way to access resources in your plug-in is to use the
Bundle.getEntry() method.
So if the your Icons folder is in your plug-in root, you would call
Bundle.getEntry("Icons/a.gif") and then use the URL to access the file.
This separates your file access from the physical location and structure
of your plug-in. After all, your plug-in may be deployed as a jar...
Hope this helps,
--- Patrick
patrick@rcpquickstart.com
joesusai wrote:
> Prakesh,
> Thanks for your suggestion, after selecting Icon folder in build.properties
and exporting it i can execute the product from my system. But its not working
while executing the same application from some other system.so give me a
solution to execute the product in any machine.
> Thanks,
> Joe
Patrick Paulin
Eclipse RCP/OSGi Trainer and Consultant
Modular Mind, Ltd.
patrick@modumind.com
www.modumind.com
twitter.com/pjpaulin
linkedin.com/in/pjpaulin
|
|
|
Powered by
FUDForum. Page generated in 0.03347 seconds