Revision 5596 trunk/extensions/extScripting/src/org/gvsig/scripting/ScriptPanel.java
ScriptPanel.java | ||
---|---|---|
92 | 92 |
this.setLocation(this.top,this.left); |
93 | 93 |
} |
94 | 94 |
*/ |
95 |
String urlString; |
|
96 |
try { |
|
97 |
URL url = new URL(this.xmlFileName); |
|
98 |
urlString = url.getPath(); |
|
99 |
} catch (MalformedURLException e) { |
|
100 |
File file = new File(this.xmlFileName); |
|
101 |
if (!file.exists()) { |
|
102 |
throw new IOException("File "+ file.getAbsolutePath()+ " not found."); |
|
103 |
}else { |
|
104 |
urlString = "file://" +file.getAbsolutePath(); |
|
105 |
} |
|
95 |
File file = new File(this.xmlFileName); |
|
96 |
if (!file.exists()) { |
|
97 |
throw new IOException("File "+ file.getAbsolutePath()+ " not found."); |
|
106 | 98 |
} |
107 | 99 |
if (this.title == null) { |
108 |
this.title = urlString;
|
|
100 |
this.title = this.xmlFileName;
|
|
109 | 101 |
} |
110 |
ScriptableThinlet thinlet = ScriptPanel.getNewScriptableThinletInstance(this.language);
|
|
102 |
DefaultThinlet thinlet = ScriptPanel.getNewScriptableThinletInstance(this.language);
|
|
111 | 103 |
|
112 |
thinlet.add(thinlet.parse(urlString));
|
|
104 |
thinlet.add(thinlet.parse(file));
|
|
113 | 105 |
|
114 | 106 |
this.add(thinlet); |
115 | 107 |
|
... | ... | |
132 | 124 |
return viewInfo; |
133 | 125 |
} |
134 | 126 |
|
135 |
protected static ScriptableThinlet getNewScriptableThinletInstance(String language) throws BSFException {
|
|
136 |
ScriptableThinlet thinlet = new DefaultThinlet(language);
|
|
127 |
protected static DefaultThinlet getNewScriptableThinletInstance(String language) throws BSFException {
|
|
128 |
DefaultThinlet thinlet = new DefaultThinlet(language);
|
|
137 | 129 |
thinlet.getBSFManager().setClassLoader(PluginServices.getPluginServices("com.iver.cit.gvsig").getClassLoader()); |
138 | 130 |
//thinlet.getBSFManager().setClassLoader(PluginServices.ge); |
139 | 131 |
return thinlet; |
Also available in: Unified diff