gvsig-scripting / org.gvsig.scripting / trunk / org.gvsig.scripting / org.gvsig.scripting.lib / org.gvsig.scripting.lib.api / src / main / java / org / gvsig / scripting / ScriptingManager.java @ 361
History | View | Annotate | Download (6.07 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 |
public void setHomeFolder(File home); |
24 |
|
25 |
public File getHomeFolder(); |
26 |
|
27 |
/**
|
28 |
* Returns the System's Folder
|
29 |
*
|
30 |
* @return a {@link ScriptingFolder} with the System's Folder.
|
31 |
*/
|
32 |
public ScriptingFolder getSystemFolder();
|
33 |
|
34 |
/**
|
35 |
* Returns the User's Folder
|
36 |
*
|
37 |
* @return a {@link ScriptingFolder} with the User's Folder.
|
38 |
*/
|
39 |
public ScriptingFolder getUserFolder();
|
40 |
|
41 |
/**
|
42 |
* Sets a new path to the User's Folder
|
43 |
*
|
44 |
* @param path a String with the new path to the User's Folder
|
45 |
*/
|
46 |
// public void setRootUserFolder(String path);
|
47 |
|
48 |
/**
|
49 |
* Creates a new instance of {@link ScriptingScript} named as the id and in the directory specified
|
50 |
*
|
51 |
* @param folder {@link ScriptingFolder} with the destiny directory information
|
52 |
* @param id String with the identificator of the {@link ScriptingScript} created
|
53 |
*
|
54 |
* @return the new {@link ScriptingScript}
|
55 |
* @deprecated see {@link #createUnit(String, ScriptingFolder, String)}
|
56 |
*/
|
57 |
@Deprecated
|
58 |
public ScriptingScript createScript(ScriptingFolder folder, String id); |
59 |
|
60 |
/**
|
61 |
* Creates a new instance of {@link ScriptingProject} named as the id and in the directory specified
|
62 |
*
|
63 |
* @param folder {@link ScriptingFolder} with the destiny directory information
|
64 |
* @param id String with the identificator of the {@link ScriptingProject} created
|
65 |
*
|
66 |
* @return the new {@link ScriptingProject}
|
67 |
* @deprecated see {@link #createUnit(String, ScriptingFolder, String)}
|
68 |
*/
|
69 |
@Deprecated
|
70 |
public ScriptingProject createProject(ScriptingFolder folder, String id); |
71 |
|
72 |
/**
|
73 |
* Creates a new instance of {@link ScriptingDialog} named as the id and in the directory specified
|
74 |
*
|
75 |
* @param folder {@link ScriptingFolder} with the destiny directory information
|
76 |
* @param id String with the identificator of the {@link ScriptingDialog} created
|
77 |
*
|
78 |
* @return the new {@link ScriptingDialog}
|
79 |
* @deprecated see {@link #createUnit(String, ScriptingFolder, String)}
|
80 |
*/
|
81 |
@Deprecated
|
82 |
public ScriptingDialog createDialog(ScriptingFolder folder, String id); |
83 |
|
84 |
/**
|
85 |
* Creates a new instance of {@link ScriptingFolder} named as the id and in the directory specified
|
86 |
*
|
87 |
* @param folder {@link ScriptingFolder} with the destiny directory information
|
88 |
* @param id String with the identificator of the {@link ScriptingFolder} created
|
89 |
*
|
90 |
* @return the new {@link ScriptingFolder}
|
91 |
* @deprecated see {@link #createUnit(String, ScriptingFolder, String)}
|
92 |
*/
|
93 |
@Deprecated
|
94 |
public ScriptingFolder createFolder(ScriptingFolder folder, String id); |
95 |
|
96 |
public ScriptingUnit createUnit(String unitType, ScriptingFolder folder, String id); |
97 |
|
98 |
public List<String> getUnitTypes(); |
99 |
|
100 |
/**
|
101 |
* Returns the {@link ScriptingBaseScript} associated with the file specified
|
102 |
*
|
103 |
* @param file File where is contained the {@link ScriptingBaseScript}'s information
|
104 |
*
|
105 |
* @return {@link ScriptingBaseScript}
|
106 |
*/
|
107 |
public ScriptingBaseScript getScript(File file); |
108 |
|
109 |
public ScriptingBaseScript getScript(String name); |
110 |
/**
|
111 |
* Returns the {@link ScriptingFolder} associated with the file specified
|
112 |
*
|
113 |
* @param file File where is contained the {@link ScriptingFolder}'s information
|
114 |
*
|
115 |
* @return {@link ScriptingFolder}
|
116 |
*/
|
117 |
public ScriptingFolder getFolder(File file); |
118 |
|
119 |
/**
|
120 |
* Returns the path of the User's Folder
|
121 |
*
|
122 |
* @return a String with the path of the User's Folder
|
123 |
*/
|
124 |
// public String getRootUserFolder();
|
125 |
|
126 |
/**
|
127 |
* Registers a File System with {@link ScriptingUnit}s in the SystemFolder
|
128 |
*
|
129 |
* @param name String with the identificator name of the File System registered
|
130 |
* @param folder File with the root of the File System to register
|
131 |
*/
|
132 |
public void registerSystemFolder(String name, File folder); |
133 |
|
134 |
/**
|
135 |
* Gets all the supported Language by their extensions associated with each
|
136 |
* one.
|
137 |
*
|
138 |
* @return a Map with the pairs <key,value> where the key is a String with
|
139 |
* the extension and the value is the Language associated
|
140 |
*/
|
141 |
public Map<String, String> getSupportedLanguagesByExtension(); |
142 |
|
143 |
/**
|
144 |
* Gets all the supported Language and the extensions associated with each
|
145 |
* one.
|
146 |
*
|
147 |
* @return a Map with the pairs <key,value> where the key is a String with
|
148 |
* the Language and the value is the extension associated
|
149 |
*/
|
150 |
public Map<String, String> getExtensionsByLanguages(); |
151 |
|
152 |
/**
|
153 |
* Checks if an id is unique in a determinate folder
|
154 |
*
|
155 |
* @param folder {@ScriptingFolder} with the directory to verify the id
|
156 |
* @param id String with the id to validate
|
157 |
*
|
158 |
* @return true if there isn't another {@link ScriptingUnit} with the same id, and false in the other case
|
159 |
*/
|
160 |
public boolean validateUnitId(ScriptingFolder folder, String id); |
161 |
|
162 |
|
163 |
/**
|
164 |
* Sets a key/value pair in the state of the ScriptingManager that may
|
165 |
* either create a Java Language Binding to be used in the
|
166 |
* execution of scripts
|
167 |
*
|
168 |
* @param key The name of named value to add
|
169 |
* @param value The value of named value to add.
|
170 |
*/
|
171 |
public void put(String key, Object value); |
172 |
|
173 |
/**
|
174 |
* Retrieves a value set in the state of this ScriptingManager
|
175 |
*
|
176 |
* @param key The key whose value is to be returned
|
177 |
*
|
178 |
* @return an Object with the value corresponding to the key
|
179 |
*/
|
180 |
public Object get(String key); |
181 |
|
182 |
/**
|
183 |
* Gets the Help manager
|
184 |
*
|
185 |
* @return a {@link ScriptingHelpManager}
|
186 |
*
|
187 |
* @see ScriptingHelpManager
|
188 |
*/
|
189 |
public ScriptingHelpManager getHelpManager();
|
190 |
|
191 |
public void addLibFolder(File lib); |
192 |
|
193 |
public File getRootUserFolder(); |
194 |
} |