/** * Create an image descriptor for the given image property in the text.properties file. * * @param propertyName * @return */ public static ImageDescriptor getDescriptor(String propertyName) { try { if (propertyName == null) { return null; } // get image path String path = Messages.getString(propertyName); if (path == null || path.trim().length() == 0) { SqlBuilderPlugin.log( Messages.getString("ImageUtil.logMessage2", propertyName), null); // $NON-NLS-1$ return null; } // create image URL url = URLUtil.getResourceURL(path); return ImageDescriptor.createFromURL(url); } catch (Exception e) { SqlBuilderPlugin.log( Messages.getString("ImageUtil.logMessage3", propertyName), e); // $NON-NLS-1$ return null; } }