[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: How to read image descriptor from a program folder

Rajesh,

Does ImageDescriptor.createFromFile(Class, String) do the trick? How about ImageDescriptor.createFromURL and you pass in the file: URL for the file?


Rajesh Adukkadukkath wrote:
I have the following method implementation provided to read the images from a program folder. The implementation uses ProgramImageDescriptor that is an internal class. Can anybody suggest me an alternative to perform the same functionality without using "ProgramImageDescriptor" ?

public static ImageDescriptor getImageDescriptorFromProgram(String filename, int offset) {
String key = filename + "*" + offset; //use * as it is not a valid filename character//$NON-NLS-1$
ImageDescriptor desc = getImageDescriptor(key);
if (desc == null) {
desc = new ProgramImageDescriptor(filename, offset);
descriptors_.put(key, desc);
}
return desc;
}


Warm Regards,
Rajesh