Statistics
| Revision:

root / org.gvsig.toolbox / trunk / org.gvsig.toolbox / org.gvsig.toolbox.gui / src / main / java / es / unex / sextante / gui / cmd / EditScriptAction.java @ 265

History | View | Annotate | Download (1008 Bytes)

1
package es.unex.sextante.gui.cmd;
2

    
3
import es.unex.sextante.core.GeoAlgorithm;
4
import es.unex.sextante.core.Sextante;
5
import es.unex.sextante.gui.core.IToolboxRightButtonAction;
6
import es.unex.sextante.gui.core.SextanteGUI;
7
import es.unex.sextante.gui.settings.SextanteScriptsSettings;
8
import java.io.File;
9

    
10
public class EditScriptAction
11
    implements
12
    IToolboxRightButtonAction {
13

    
14
    @Override
15
    public void execute(final GeoAlgorithm alg) {
16
        ScriptEditingPanel panel = new ScriptEditingPanel(SextanteGUI.getSettingParameterValue(
17
            SextanteScriptsSettings.SCRIPTS_FOLDER) + File.separator + alg.getName() + ".bsh"
18
        );
19
        SextanteGUI.getGUIFactory().showGenericDialog("Script", panel);
20
    }
21

    
22
    @Override
23
    public String getDescription() {
24

    
25
        return Sextante.getText("Edit");
26

    
27
    }
28

    
29
    @Override
30
    public boolean canBeExecutedOnAlgorithm(final GeoAlgorithm alg) {
31

    
32
        return alg instanceof ScriptAlgorithm;
33

    
34
    }
35

    
36
}