图像的扩展点

时间:2012-07-23 12:03:39

标签: java eclipse-rcp

我正在尝试为图片创建扩展点。我在想的是用户应该给一个名称id和图像的路径,但之后我该如何创建图像。当在扩展中给出一个类时,可以使用createExecutableExtension并创建该对象。但只有图像的路径如何实现。有什么建议?

1 个答案:

答案 0 :(得分:0)

类似的东西:

// configuration element is the handle of your extension-point
    String contributor = configurationElement.getContributor().getName();
    String path = configurationElement.getAttribute("path");
    InputStream openStream = FileLocator.openStream(Platform.getBundle(contributor), new Path(path), false);
    Image image = new Image(null, openStream);
相关问题