eclipse插件获取ImageDescriptor的方法
来源:互联网 发布:淘宝店铺2心要多少单 编辑:程序博客网 时间:2024/06/01 10:26
org.eclipse.ui.plugin.AbstractUIPlugin
public static ImageDescriptor imageDescriptorFromPlugin(String pluginId, String imageFilePath) { if (pluginId == null || imageFilePath == null) { throw new IllegalArgumentException(); }IWorkbench workbench = PlatformUI.isWorkbenchRunning() ? PlatformUI.getWorkbench() : null;ImageDescriptor imageDescriptor = workbench == null ? null : workbench.getSharedImages().getImageDescriptor(imageFilePath);if (imageDescriptor != null)return imageDescriptor; // found in the shared images // if the bundle is not ready then there is no image Bundle bundle = Platform.getBundle(pluginId); if (!BundleUtility.isReady(bundle)) {return null;} // look for the image (this will check both the plugin and fragment folders URL fullPathString = BundleUtility.find(bundle, imageFilePath); if (fullPathString == null) { try { fullPathString = new URL(imageFilePath); } catch (MalformedURLException e) { return null; } } return ImageDescriptor.createFromURL(fullPathString); }
org.eclipse.jface.resource.ImageDescriptor
public static ImageDescriptor createFromURL(URL url) { if (url == null) { return getMissingImageDescriptor(); } return new URLImageDescriptor(url); }
public static ImageDescriptor createFromFile(Class location, String filename) { return new FileImageDescriptor(location, filename); }public static ImageDescriptor createFromImageData(ImageData data) { return new ImageDataImageDescriptor(data); }
0 0
- eclipse插件获取ImageDescriptor的方法
- SWTJface 如何获取ImageDescriptor
- ImageDescriptor
- 配置eclipse 插件的方法
- eclipse安装插件的方法
- 发布 eclipse 插件的方法
- eclipse插件安装的方法
- eclipse的插件安装方法
- eclipse安装插件的方法
- Eclipse的插件安装方法
- Eclipse插件的安装方法
- Eclipse插件的安装方法
- Eclipse插件的安装方法
- Eclipse 的插件安装方法
- Eclipse安装插件的方法
- Eclipse 插件的安装方法
- Eclipse插件的安装方法
- Eclipse插件的安装方法
- 二叉树(一)利用数组初始化二叉树,并实现前序中序后序遍历
- poj 3449 Geometric Shapes 线段相交
- 第九周练习
- 下载Google官方/CM Android源代码自动重新开始的Shell脚本
- week_9
- eclipse插件获取ImageDescriptor的方法
- 多个Activity跳转中的数据传递(二)
- FFmpeg 基本用法
- ZOJ-1952
- Week9 练习
- 时间类输出重载
- 你好
- NYOJ 51 管闲事的小明
- Android旅程开启