root / tags / v1_0_2_Build_905 / extensions / extScripting / src / org / gvsig / scripting / xul / XULInfoToolSupport.java @ 10767
History | View | Annotate | Download (1.12 KB)
1 | 9222 | jjdelcerro | package org.gvsig.scripting.xul; |
---|---|---|---|
2 | |||
3 | import java.io.File; |
||
4 | |||
5 | import org.apache.bsf.BSFException; |
||
6 | |||
7 | import com.iver.cit.gvsig.fmap.layers.layerOperations.XMLItem; |
||
8 | import com.iver.cit.gvsig.project.documents.view.info.gui.IXULInfoToolSupport; |
||
9 | |||
10 | public class XULInfoToolSupport extends XULScriptableJPanel implements IXULInfoToolSupport{ |
||
11 | |||
12 | private static final long serialVersionUID = 3943484157036349337L; |
||
13 | |||
14 | public void show(String s) { |
||
15 | |||
16 | } |
||
17 | |||
18 | public void refreshSize() { |
||
19 | |||
20 | } |
||
21 | |||
22 | public void show(XMLItem item) { |
||
23 | this.put("infoData",item); |
||
24 | String path = "r'" + new File(getXULFile()).getParent() + "'"; |
||
25 | try {
|
||
26 | getThinlet().getBSFManager().exec( |
||
27 | XULScriptablePanel.JYTHON, |
||
28 | "Java:JPanelThinlet.show(XMLItem)",
|
||
29 | 1,
|
||
30 | 1,
|
||
31 | "import sys\n" +
|
||
32 | "try:\n" +
|
||
33 | " sys.path.remove("+path+")\n" + |
||
34 | "except:\n" +
|
||
35 | " pass\n" +
|
||
36 | "sys.path.insert(1,"+path+")\n" |
||
37 | ); |
||
38 | } catch(BSFException e) {
|
||
39 | // TODO Auto-generated catch block
|
||
40 | e.printStackTrace(); |
||
41 | } |
||
42 | Object root = getThinlet().getItem(getThinlet().getDesktop(),0); |
||
43 | getThinlet().invokeMethod(root,"show");
|
||
44 | } |
||
45 | |||
46 | |||
47 | } |