Author: sdzmitrovich
Date: 2007-12-17 11:42:38 -0500 (Mon, 17 Dec 2007)
New Revision: 5351
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1043
http://jira.jboss.com/jira/browse/JBIDE-1217
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java 2007-12-17
16:27:48 UTC (rev 5350)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/core/resources/XModelObjectEditorInput.java 2007-12-17
16:42:38 UTC (rev 5351)
@@ -174,14 +174,7 @@
if(input instanceof IStorageEditorInput) return
convertStorageEditorInput((IStorageEditorInput)input);
if(input instanceof IURIEditorInput) {
URI uri = ((IURIEditorInput)input).getURI();
- URL url = null;
- try {
- url = uri.toURL();
- } catch (MalformedURLException e) {
- return input;
- }
- if(url == null) return input;
- String f = url.getFile();
+ String f = uri.getPath();
XModelObject o = null;
try {
o = EclipseResourceUtil.createObjectForLocation(f);
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 2007-12-17
16:27:48 UTC (rev 5350)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2007-12-17
16:42:38 UTC (rev 5351)
@@ -11,6 +11,8 @@
package org.jboss.tools.vpe.editor.template.expression;
import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -41,7 +43,16 @@
public VpeValue exec(VpePageContext pageContext, Node sourceNode) {
String tagValue = getParameter(0).exec(pageContext, sourceNode).stringValue();
tagValue = processValue(pageContext, sourceNode, tagValue);
+
+ // decode string from utf
+ try {
+ tagValue = URLDecoder.decode(tagValue,"UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
IPath tagPath = new Path(tagValue);
if (tagPath.isEmpty()) return new VpeValue(getUnresolved());