Revision 283
org.gvsig.toolbox/trunk/org.gvsig.toolbox/org.gvsig.toolbox.gui/src/main/java/es/unex/sextante/gui/cmd/DeleteScriptAction.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.io.File; |
4 | 4 |
|
5 |
import javax.swing.JOptionPane; |
|
6 |
|
|
5 | 7 |
import es.unex.sextante.core.GeoAlgorithm; |
6 | 8 |
import es.unex.sextante.core.Sextante; |
7 | 9 |
import es.unex.sextante.gui.core.IToolboxRightButtonAction; |
... | ... | |
19 | 21 |
|
20 | 22 |
public void execute(final GeoAlgorithm alg) { |
21 | 23 |
|
22 |
final ScriptAlgorithm script = (ScriptAlgorithm) alg; |
|
23 |
final File file = new File(script.getFilename()); |
|
24 |
file.delete(); |
|
25 |
SextanteGUI.updateAlgorithmProvider(ScriptAlgorithmProvider.class); |
|
26 |
SextanteGUI.getGUIFactory().updateToolbox(); |
|
24 |
int deleteScriptResult = JOptionPane.showConfirmDialog(null, Sextante.getText("are_you_sure_to_delete_the_selected_script"), Sextante.getText("Warning"), JOptionPane.YES_NO_OPTION); |
|
25 |
if (deleteScriptResult == JOptionPane.YES_OPTION) { |
|
26 |
final ScriptAlgorithm script = (ScriptAlgorithm) alg; |
|
27 |
final File file = new File(script.getFilename()); |
|
28 |
file.delete(); |
|
29 |
SextanteGUI.updateAlgorithmProvider(ScriptAlgorithmProvider.class); |
|
30 |
SextanteGUI.getGUIFactory().updateToolbox(); |
|
31 |
} |
|
27 | 32 |
|
28 | 33 |
} |
29 | 34 |
|
org.gvsig.toolbox/trunk/org.gvsig.toolbox/org.gvsig.toolbox.gui/src/main/java/es/unex/sextante/gui/modeler/DeleteModelAction.java | ||
---|---|---|
1 |
package es.unex.sextante.gui.modeler; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
|
|
5 |
import es.unex.sextante.core.GeoAlgorithm; |
|
6 |
import es.unex.sextante.core.Sextante; |
|
7 |
import es.unex.sextante.gui.core.IToolboxRightButtonAction; |
|
8 |
import es.unex.sextante.gui.core.SextanteGUI; |
|
9 |
|
|
10 |
public class DeleteModelAction |
|
11 |
implements |
|
12 |
IToolboxRightButtonAction { |
|
13 |
|
|
14 |
public boolean canBeExecutedOnAlgorithm(final GeoAlgorithm alg) { |
|
15 |
|
|
16 |
return alg instanceof ModelAlgorithm; |
|
17 |
|
|
18 |
} |
|
19 |
|
|
20 |
|
|
21 |
public void execute(final GeoAlgorithm alg) { |
|
22 |
|
|
23 |
final ModelAlgorithm model = (ModelAlgorithm) alg; |
|
24 |
final File file = new File(model.getFilename()); |
|
25 |
file.delete(); |
|
26 |
SextanteGUI.updateAlgorithmProvider(ModelerAlgorithmProvider.class); |
|
27 |
SextanteGUI.getGUIFactory().updateToolbox(); |
|
28 |
//fillTree(m_sLastSearchString, m_bLastSearchIncludedHelpFiles); |
|
29 |
//collapseAll(); |
|
30 |
|
|
31 |
|
|
32 |
} |
|
33 |
|
|
34 |
|
|
35 |
public String getDescription() { |
|
36 |
|
|
37 |
return Sextante.getText("Delete"); |
|
38 |
|
|
39 |
} |
|
40 |
|
|
41 |
} |
|
1 |
package es.unex.sextante.gui.modeler; |
|
2 |
|
|
3 |
import java.io.File; |
|
4 |
|
|
5 |
import javax.swing.JOptionPane; |
|
6 |
|
|
7 |
import es.unex.sextante.core.GeoAlgorithm; |
|
8 |
import es.unex.sextante.core.Sextante; |
|
9 |
import es.unex.sextante.gui.core.IToolboxRightButtonAction; |
|
10 |
import es.unex.sextante.gui.core.SextanteGUI; |
|
11 |
|
|
12 |
public class DeleteModelAction |
|
13 |
implements |
|
14 |
IToolboxRightButtonAction { |
|
15 |
|
|
16 |
public boolean canBeExecutedOnAlgorithm(final GeoAlgorithm alg) { |
|
17 |
|
|
18 |
return alg instanceof ModelAlgorithm; |
|
19 |
|
|
20 |
} |
|
21 |
|
|
22 |
|
|
23 |
public void execute(final GeoAlgorithm alg) { |
|
24 |
|
|
25 |
int deleteModelResult = JOptionPane.showConfirmDialog(null, Sextante.getText("are_you_sure_to_delete_the_selected_model"), Sextante.getText("Warning"), JOptionPane.YES_NO_OPTION); |
|
26 |
if (deleteModelResult == JOptionPane.YES_OPTION) { |
|
27 |
final ModelAlgorithm model = (ModelAlgorithm) alg; |
|
28 |
final File file = new File(model.getFilename()); |
|
29 |
file.delete(); |
|
30 |
SextanteGUI.updateAlgorithmProvider(ModelerAlgorithmProvider.class); |
|
31 |
SextanteGUI.getGUIFactory().updateToolbox(); |
|
32 |
} |
|
33 |
|
|
34 |
} |
|
35 |
|
|
36 |
|
|
37 |
public String getDescription() { |
|
38 |
|
|
39 |
return Sextante.getText("Delete"); |
|
40 |
|
|
41 |
} |
|
42 |
|
|
43 |
} |
org.gvsig.toolbox/trunk/org.gvsig.toolbox/org.gvsig.toolbox.gui/src/main/resources/org/gvsig/toolbox/gui/i18n/text_en.properties | ||
---|---|---|
708 | 708 |
Do_you_want_to_overwrite=Do you want to overwrite it? |
709 | 709 |
|
710 | 710 |
Description=Description\: |
711 |
|
|
712 |
are_you_sure_to_delete_the_selected_model=Are you sure to delete the selected model? |
|
713 |
|
|
714 |
are_you_sure_to_delete_the_selected_script=Are you sure to delete the selected script? |
Also available in: Unified diff