}
String extension = "no extension";
if (id!=0)
extension = fileName.substring(id+1, fileName.length());
Program program = Program.findProgram(extension);
if (program == null) {
InputStream stream = UIConstants.getIconByExtension(extension);
Image img = new Image(SWTThread.getDisplay(),stream);
try {
stream.close();
} catch (IOException e) {
e.printStackTrace();
}
stream = null;
return img;
}
ImageData image_data = program.getImageData();
if (image_data == null) {
return getImage("image_not_found.png");
}
image_data = image_data.scaledTo(16, 16);
Image image = new Image(SWTThread.getDisplay(),image_data);