Author: dsakovich
Date: 2008-10-14 09:38:02 -0400 (Tue, 14 Oct 2008)
New Revision: 10830
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2892
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-10-14
13:37:04 UTC (rev 10829)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-10-14
13:38:02 UTC (rev 10830)
@@ -40,7 +40,7 @@
import org.w3c.dom.Node;
public class VpeFunctionSrc extends VpeFunction {
- static final String IMG_UNRESOLVED = "unresolved.gif"; //$NON-NLS-1$
+ static final String IMG_UNRESOLVED = "unresolved_image.gif"; //$NON-NLS-1$
static final String IMG_PREFIX = "file:///"; //$NON-NLS-1$
public VpeValue exec(VpePageContext pageContext, Node sourceNode) throws
VpeExpressionException {
@@ -179,7 +179,7 @@
}
protected String getUnresolved() {
- return IMG_UNRESOLVED;
+ return IMG_PREFIX + getAbsoluteResourcePath(IMG_UNRESOLVED);
}
protected String getPrefix() {
@@ -243,4 +243,16 @@
resolvedValue = ElService.getInstance().replaceEl(file, resolvedValue);
return resolvedValue;
}
+
+ public static String getAbsoluteResourcePath(String resourcePathInPlugin) {
+ String pluginPath = VpePlugin.getPluginResourcePath();
+ IPath pluginFile = new Path(pluginPath);
+ File file = pluginFile.append(resourcePathInPlugin).toFile();
+ if (file.exists()) {
+ return file.getAbsolutePath();
+ } else {
+ throw new RuntimeException("Can't get path for " //$NON-NLS-1$
+ + resourcePathInPlugin);
+ }
+ }
}
\ No newline at end of file