gvsig-scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.lib / org.gvsig.scripting.lib.api / src / main / java / org / gvsig / scripting / ScriptingManager.java @ 212
History | View | Annotate | Download (5.87 KB)
1 |
package org.gvsig.scripting; |
---|---|
2 |
|
3 |
import java.io.File; |
4 |
import java.util.List; |
5 |
import java.util.Map; |
6 |
|
7 |
/**
|
8 |
* There are two top level management roles within ScriptingFramework: logical and User's Interface (UI) management.
|
9 |
*
|
10 |
* This class is responsible of the logical role. It provides all the services to manage the information used in ScriptingFramework.
|
11 |
*
|
12 |
* @see ScriptingUIManager
|
13 |
* @see ScriptingHelpManager
|
14 |
*/
|
15 |
public interface ScriptingManager { |
16 |
|
17 |
public static final String UNIT_SCRIPT = "Script"; |
18 |
public static final String UNIT_DIALOG = "Dialog"; |
19 |
public static final String UNIT_PROJECT = "Project"; |
20 |
public static final String UNIT_FOLDER = "Folder"; |
21 |
|
22 |
/**
|
23 |
* Returns the System's Folder
|
24 |
*
|
25 |
* @return a {@link ScriptingFolder} with the System's Folder.
|
26 |
*/
|
27 |
public ScriptingFolder getSystemFolder();
|
28 |
|
29 |
/**
|
30 |
* Returns the User's Folder
|
31 |
*
|
32 |
* @return a {@link ScriptingFolder} with the User's Folder.
|
33 |
*/
|
34 |
public ScriptingFolder getUserFolder();
|
35 |
|
36 |
/**
|
37 |
* Sets a new path to the User's Folder
|
38 |
*
|
39 |
* @param path a String with the new path to the User's Folder
|
40 |
*/
|
41 |
public void setRootUserFolder(String path); |
42 |
|
43 |
/**
|
44 |
* Creates a new instance of {@link ScriptingScript} named as the id and in the directory specified
|
45 |
*
|
46 |
* @param folder {@link ScriptingFolder} with the destiny directory information
|
47 |
* @param id String with the identificator of the {@link ScriptingScript} created
|
48 |
*
|
49 |
* @return the new {@link ScriptingScript}
|
50 |
* @deprecated see {@link #createUnit(String, ScriptingFolder, String)}
|
51 |
*/
|
52 |
@Deprecated
|
53 |
public ScriptingScript createScript(ScriptingFolder folder, String id); |
54 |
|
55 |
/**
|
56 |
* Creates a new instance of {@link ScriptingProject} named as the id and in the directory specified
|
57 |
*
|
58 |
* @param folder {@link ScriptingFolder} with the destiny directory information
|
59 |
* @param id String with the identificator of the {@link ScriptingProject} created
|
60 |
*
|
61 |
* @return the new {@link ScriptingProject}
|
62 |
* @deprecated see {@link #createUnit(String, ScriptingFolder, String)}
|
63 |
*/
|
64 |
@Deprecated
|
65 |
public ScriptingProject createProject(ScriptingFolder folder, String id); |
66 |
|
67 |
/**
|
68 |
* Creates a new instance of {@link ScriptingDialog} named as the id and in the directory specified
|
69 |
*
|
70 |
* @param folder {@link ScriptingFolder} with the destiny directory information
|
71 |
* @param id String with the identificator of the {@link ScriptingDialog} created
|
72 |
*
|
73 |
* @return the new {@link ScriptingDialog}
|
74 |
* @deprecated see {@link #createUnit(String, ScriptingFolder, String)}
|
75 |
*/
|
76 |
@Deprecated
|
77 |
public ScriptingDialog createDialog(ScriptingFolder folder, String id); |
78 |
|
79 |
/**
|
80 |
* Creates a new instance of {@link ScriptingFolder} named as the id and in the directory specified
|
81 |
*
|
82 |
* @param folder {@link ScriptingFolder} with the destiny directory information
|
83 |
* @param id String with the identificator of the {@link ScriptingFolder} created
|
84 |
*
|
85 |
* @return the new {@link ScriptingFolder}
|
86 |
* @deprecated see {@link #createUnit(String, ScriptingFolder, String)}
|
87 |
*/
|
88 |
@Deprecated
|
89 |
public ScriptingFolder createFolder(ScriptingFolder folder, String id); |
90 |
|
91 |
public ScriptingUnit createUnit(String unitType, ScriptingFolder folder, String id); |
92 |
|
93 |
public List<String> getUnitTypes(); |
94 |
|
95 |
/**
|
96 |
* Returns the {@link ScriptingBaseScript} associated with the file specified
|
97 |
*
|
98 |
* @param file File where is contained the {@link ScriptingBaseScript}'s information
|
99 |
*
|
100 |
* @return {@link ScriptingBaseScript}
|
101 |
*/
|
102 |
public ScriptingBaseScript getScript(File file); |
103 |
|
104 |
/**
|
105 |
* Returns the {@link ScriptingFolder} associated with the file specified
|
106 |
*
|
107 |
* @param file File where is contained the {@link ScriptingFolder}'s information
|
108 |
*
|
109 |
* @return {@link ScriptingFolder}
|
110 |
*/
|
111 |
public ScriptingFolder getFolder(File file); |
112 |
|
113 |
/**
|
114 |
* Returns the path of the User's Folder
|
115 |
*
|
116 |
* @return a String with the path of the User's Folder
|
117 |
*/
|
118 |
public String getRootUserFolder(); |
119 |
|
120 |
/**
|
121 |
* Registers a File System with {@link ScriptingUnit}s in the SystemFolder
|
122 |
*
|
123 |
* @param name String with the identificator name of the File System registered
|
124 |
* @param folder File with the root of the File System to register
|
125 |
*/
|
126 |
public void registerSystemFolder(String name, File folder); |
127 |
|
128 |
/**
|
129 |
* Gets all the supported Language by their extensions associated with each
|
130 |
* one.
|
131 |
*
|
132 |
* @return a Map with the pairs <key,value> where the key is a String with
|
133 |
* the extension and the value is the Language associated
|
134 |
*/
|
135 |
public Map<String, String> getSupportedLanguagesByExtension(); |
136 |
|
137 |
/**
|
138 |
* Gets all the supported Language and the extensions associated with each
|
139 |
* one.
|
140 |
*
|
141 |
* @return a Map with the pairs <key,value> where the key is a String with
|
142 |
* the Language and the value is the extension associated
|
143 |
*/
|
144 |
public Map<String, String> getExtensionsByLanguages(); |
145 |
|
146 |
/**
|
147 |
* Checks if an id is unique in a determinate folder
|
148 |
*
|
149 |
* @param folder {@ScriptingFolder} with the directory to verify the id
|
150 |
* @param id String with the id to validate
|
151 |
*
|
152 |
* @return true if there isn't another {@link ScriptingUnit} with the same id, and false in the other case
|
153 |
*/
|
154 |
public boolean validateUnitId(ScriptingFolder folder, String id); |
155 |
|
156 |
|
157 |
/**
|
158 |
* Sets a key/value pair in the state of the ScriptingManager that may
|
159 |
* either create a Java Language Binding to be used in the
|
160 |
* execution of scripts
|
161 |
*
|
162 |
* @param key The name of named value to add
|
163 |
* @param value The value of named value to add.
|
164 |
*/
|
165 |
public void put(String key, Object value); |
166 |
|
167 |
/**
|
168 |
* Retrieves a value set in the state of this ScriptingManager
|
169 |
*
|
170 |
* @param key The key whose value is to be returned
|
171 |
*
|
172 |
* @return an Object with the value corresponding to the key
|
173 |
*/
|
174 |
public Object get(String key); |
175 |
|
176 |
/**
|
177 |
* Gets the Help manager
|
178 |
*
|
179 |
* @return a {@link ScriptingHelpManager}
|
180 |
*
|
181 |
* @see ScriptingHelpManager
|
182 |
*/
|
183 |
public ScriptingHelpManager getHelpManager();
|
184 |
} |