gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.swing / org.gvsig.scripting.swing.impl / src / main / java / org / gvsig / scripting / swing / impl / composer / editors / SimpleScriptEditor.java @ 1066
History | View | Annotate | Download (1.03 KB)
1 |
/*
|
---|---|
2 |
* To change this license header, choose License Headers in Project Properties.
|
3 |
* To change this template file, choose Tools | Templates
|
4 |
* and open the template in the editor.
|
5 |
*/
|
6 |
package org.gvsig.scripting.swing.impl.composer.editors; |
7 |
|
8 |
import javax.swing.JComponent; |
9 |
import org.gvsig.scripting.ScriptingScript; |
10 |
import org.gvsig.tools.script.Script; |
11 |
|
12 |
/**
|
13 |
*
|
14 |
* @author jjdelcerro
|
15 |
*/
|
16 |
public class SimpleScriptEditor |
17 |
extends BaseTextEditor
|
18 |
implements org.gvsig.tools.swing.api.script.ScriptSwingManager.ScriptEditor
|
19 |
{ |
20 |
|
21 |
public SimpleScriptEditor() {
|
22 |
super();
|
23 |
} |
24 |
|
25 |
@Override
|
26 |
public void set(Script script) { |
27 |
ScriptingScript theScript = (ScriptingScript)script; |
28 |
this.setText(theScript.getMimeType(), theScript.getCode());
|
29 |
} |
30 |
|
31 |
@Override
|
32 |
public void fetch(Script script) { |
33 |
ScriptingScript theScript = (ScriptingScript)script; |
34 |
theScript.setCode(this.getText());
|
35 |
} |
36 |
|
37 |
@Override
|
38 |
public JComponent asJComponent() { |
39 |
return this; |
40 |
} |
41 |
|
42 |
} |