Statistics
| Revision:

gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.lib / org.gvsig.scripting.lib.api / src / main / java / org / gvsig / scripting / ScriptingBaseScript.java @ 650

History | View | Annotate | Download (1.9 KB)

1
package org.gvsig.scripting;
2

    
3
import java.io.File;
4

    
5
import org.gvsig.tools.observer.WeakReferencingObservable;
6

    
7
/**
8
 * <p>
9
 * Interface that represents Scripting elements.</p>
10
 *
11
 * @see ScriptingUnit
12
 *
13
 * @see ScriptingScript
14
 * @see ScriptingDialog
15
 * @see ScriptingProject
16
 */
17
public interface ScriptingBaseScript extends ScriptingUnit, WeakReferencingObservable {
18

    
19
    /**
20
     * Check if the script execution is enabled.
21
     *
22
     * @return if the script is enabled.
23
     */
24
    public boolean isEnabled();
25

    
26
    /**
27
     * Enable or disable the sript execution.
28
     *
29
     * @param enabled
30
     */
31
    public void setEnabled(boolean enabled);
32

    
33
    /**
34
     * Executes the code of a ScriptBaseScript.
35
     *
36
     * @return
37
     */
38
    public Object run();
39

    
40
    /**
41
     * Executes the code of a ScriptBaseScript.
42
     *
43
     * @param args Contains the input parameters to run the ScriptBaseScript.
44
     * @return
45
     */
46
    public Object run(Object args[]);
47

    
48
    /**
49
     * Executes the code of a ScriptBaseScript in a separated thread
50
     *
51
     * @param args Contains the input parameters to run the ScriptBaseScript.
52
     */
53
    public void runAsTask(Object args[]);
54

    
55
    /**
56
     * Sets the ScriptBaseScript's current status with the saved version.
57
     *
58
     * @param saved Indicate if the ScriptBaseScript is up-to-date or not.
59
     */
60
    public void setSaved(boolean saved);
61

    
62
    /**
63
     * Indicates if the ScriptBaseScript is modified from last saved version.
64
     *
65
     * @return true if current version is up-to-date, false if not.
66
     */
67
    public boolean isSaved();
68

    
69
    public void compile() throws ScriptingRunningException;
70

    
71
    public void put(String name, Object value);
72

    
73
    /**
74
     * Return a resource File that is beside this script.
75
     *
76
     * @param filename
77
     * @return the file which is beside this script
78
     */
79
    public File getResource(String filename);
80

    
81
    public File getScriptFile();
82
}