在GWT UiBinder模板中使用JAR中的图标

在GWT UiBinder模板中使用JAR中的图标,gwt,smartgwt,uibinder,Gwt,Smartgwt,Uibinder,在我的GWT应用程序中,我还将SmartGWT库用于一些用户界面元素。 最近,我想到用SmartGWT图标集中的图标替换一些GWT按钮(如“刷新”或“保存”)的文本,例如/com/smartclient/theme/graphite/public/sc/skins/graphite/images/actions/refresh.png中的刷新图标 我尝试使用限定名称在UiBinder模板中使用图标: <ui:image field="refreshIcon" resource="/

在我的GWT应用程序中,我还将SmartGWT库用于一些用户界面元素。 最近,我想到用SmartGWT图标集中的图标替换一些GWT按钮(如“刷新”或“保存”)的文本,例如/com/smartclient/theme/graphite/public/sc/skins/graphite/images/actions/refresh.png中的刷新图标

我尝试使用限定名称在UiBinder模板中使用图标:

    <ui:image field="refreshIcon" resource="/com/smartclient/theme/graphite/public/sc/skins/Graphite/images/actions/refresh.png" />

如何使用引用的smartgwt.jar库中的捆绑图标作为按钮?

属性名为
src
,而不是
资源



顺便说一句,只要图像在类路径上,它从哪里来并不重要:GWT从类路径加载所有内容,不管它是在JAR还是文件夹中都不重要。

我也尝试过src,但最终eclipse告诉我们:Resource/com/smartclienttheme/graphite/public/sc/skins/graphite/images/actions/refresh.png丢失了第一个“/”,希望这能起作用!我在从jar中引用资源时遇到了这个问题。删除第一个/也不起作用。在通过限定名称访问图像之前,我是否遗漏了一些必须做的事情?看起来设置src属性会将图像引用为URL。jar中是否可能有一个资源类指向图像?类似于这里()。@rayngn Eclipse是错误的:它应该可以工作。
    <g:PushButton ui:field="refreshButton" styleName="{style.Buttons}">
        <g:upFace image="{refreshIcon}" />
    </g:PushButton>
[ERROR] [MonitoringTool] - No com.google.gwt.resources.client.ClientBundle$Source annotation and no resources found with default extensions
<ui:image field="refreshIcon" src="/com/smartclienttheme/graphite/public/sc/skins/Graphite/images/actions/refresh.png" />