【发布时间】:2018-11-28 05:30:24
【问题描述】:
我正在尝试从 Eclipse 插件项目中的捆绑包中获取图像。但它总是返回null。请在下面找到项目结构。我想获取“images/EmailTemplatesOutput/assets/icon_4.png”下的图像“icon_4.png”的URL。我尝试了不同的方法。但它返回null。
String path = "icon_4.png";
Bundle bundle = Platform.getBundle("BulkDemo");
URL url = FileLocator.find(bundle, new org.eclipse.core.runtime.Path(path), null);
ImageDescriptor imageDesc = ImageDescriptor.createFromURL(url);
Image image = imageDesc.createImage();
【问题讨论】:
-
哪个语句返回null?你尝试过哪些不同的方法?其中一个路径为
images/EmailTemplatesOutput/assets/icon_4.png? -
FileLocator.find(bundle, new org.eclipse.core.runtime.Path(path), null);此语句返回 null。是。 "images/EmailTemplatesOutput/assets/icon_4.png" 返回 null。
标签: java eclipse plugins eclipse-plugin eclipse-rcp