Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Images are not properly placed under the plugin folder of product
Images are not properly placed under the plugin folder of product [message #466833] Wed, 25 April 2007 12:16 Go to next message
Eclipse UserFriend
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 #466844 is a reply to message #466833] Wed, 25 April 2007 18:45 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
Look at the build.properties of your plugin. You have to select the Icons folder to include it while exporting
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 Go to previous messageGo to next message
Eclipse UserFriend
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 #466889 is a reply to message #466874] Thu, 26 April 2007 09:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: katarzyna.czeczot.gmail.com

try:

InputStream logoStream = this.getClass().getResourceAsStream("icons/a.gif");
Image imgIcon=new Image(display,logoStream);

I think you have to put icons folder in your source folder for that to
work.
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 Go to previous message
Patrick Paulin is currently offline Patrick PaulinFriend
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
Previous Topic:org/eclipse/core/runtime/Assert missing
Next Topic:Update History Limit when limit < 2
Goto Forum:
  


Current Time: Thu Mar 28 22:01:42 GMT 2024

Powered by FUDForum. Page generated in 0.06688 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top