Revision 478 org.gvsig.scripting/trunk/org.gvsig.scripting/org.gvsig.scripting.swing/org.gvsig.scripting.swing.api/src/main/java/org/gvsig/scripting/swing/api/ScriptingUIManager.java
ScriptingUIManager.java | ||
---|---|---|
4 | 4 |
|
5 | 5 |
import javax.swing.ImageIcon; |
6 | 6 |
import javax.swing.JPanel; |
7 |
import javax.swing.text.JTextComponent; |
|
8 | 7 |
|
9 | 8 |
import org.gvsig.about.AboutManager; |
10 | 9 |
import org.gvsig.scripting.ScriptingDialog; |
... | ... | |
14 | 13 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
15 | 14 |
|
16 | 15 |
/** |
17 |
* There are two top level management roles within ScriptingFramework: logical and User's Interface (UI) management. |
|
16 |
* There are two top level management roles within ScriptingFramework: logical |
|
17 |
* and User's Interface (UI) management. |
|
18 | 18 |
* |
19 |
* This class is responsible of the UI management role. It provides all the components shown in the ScriptingFramework. |
|
19 |
* This class is responsible of the UI management role. It provides all the |
|
20 |
* components shown in the ScriptingFramework. |
|
20 | 21 |
* |
21 | 22 |
* @see ScriptingManager |
22 | 23 |
* |
23 | 24 |
*/ |
24 | 25 |
public interface ScriptingUIManager { |
25 |
|
|
26 |
|
|
26 | 27 |
// public void setMainFrame(JFrame mainFrame); |
27 |
/** |
|
28 |
* Creates a new {@link JScriptingLauncher} component. |
|
29 |
* |
|
30 |
* @return a new {@link JScriptingLauncher}. |
|
31 |
* |
|
32 |
* @see JScriptingLauncher |
|
33 |
*/ |
|
34 |
public JScriptingLauncher createLauncher(); |
|
35 |
|
|
36 |
/** |
|
37 |
* Creates a new {@link JScriptingComposer} component. |
|
38 |
* |
|
39 |
* @return a new {@link JScriptingComposer}. |
|
40 |
* |
|
41 |
* @see JScriptingComposer |
|
42 |
*/ |
|
43 |
public JScriptingComposer createComposer(); |
|
44 |
|
|
45 |
/** |
|
46 |
* Creates a new {@link JScriptingBrowser} component. |
|
47 |
* |
|
48 |
* @params uimanager {@link ScriptingUIManager} that identificates the image. |
|
49 |
* @params root {@link ScriptingFolder} that identificates the image. |
|
50 |
* @params folderOnly boolean to indicate if only will be shown folders (if it's true) or it will be shown the ScriptingBaseScript files too (false value). By default, false |
|
51 |
* |
|
52 |
* @return a new {@link JScriptingBrowser}. |
|
53 |
* |
|
54 |
* @see JScriptingBrowser |
|
55 |
*/ |
|
56 |
public JScriptingBrowser createBrowser(ScriptingUIManager uimanager, ScriptingFolder root, boolean foldersOnly); |
|
57 |
|
|
58 |
/** |
|
59 |
* Creates a new {@link JScriptingBrowser} component. |
|
60 |
* |
|
61 |
* @params uimanager {@link ScriptingUIManager} that identificates the image. |
|
62 |
* @params root {@link ScriptingFolder} that identificates the image. |
|
63 |
* |
|
64 |
* @return a new {@link JScriptingBrowser}. |
|
65 |
* |
|
66 |
* @see JScriptingBrowser |
|
67 |
*/ |
|
68 |
public JScriptingBrowser createBrowser(ScriptingUIManager uimanager, ScriptingFolder root); |
|
69 |
|
|
70 |
/** |
|
71 |
* Creates a new {@link JScriptingInstaller} component. |
|
72 |
* |
|
73 |
* @return a new {@link JScriptingInstaller}. |
|
74 |
* |
|
75 |
* @see JScriptingInstaller |
|
76 |
*/ |
|
77 |
public JPanel createInstaller(); |
|
28 |
/** |
|
29 |
* Creates a new {@link JScriptingLauncher} component. |
|
30 |
* |
|
31 |
* @return a new {@link JScriptingLauncher}. |
|
32 |
* |
|
33 |
* @see JScriptingLauncher |
|
34 |
*/ |
|
35 |
public JScriptingLauncher createLauncher(); |
|
78 | 36 |
|
79 |
/** |
|
80 |
* Creates a new JEditorPane component with syntax highlight. |
|
81 |
* |
|
82 |
* @return a new {@link JEditorPaneSyntaxHighlighting}. |
|
83 |
* |
|
84 |
* @see JEditorPaneSyntaxHighlighting |
|
85 |
*/ |
|
86 |
public SyntaxtHighlightTextComponent createSyntaxHighlightingPanel(); |
|
87 |
|
|
88 |
/** |
|
89 |
* Creates a new {@link JCodeEditor} component. |
|
90 |
* |
|
91 |
* @return a new {@link JCodeEditor}. |
|
92 |
* |
|
93 |
* @see JCodeEditor |
|
94 |
*/ |
|
95 |
public JCodeEditor createJCodeEditor(ScriptingUIManager uimanager, ScriptingScript script); |
|
96 |
|
|
97 |
/** |
|
98 |
* Creates a new {@link JDialogEditor} component. |
|
99 |
* |
|
100 |
* @return a new {@link JDialogEditor}. |
|
101 |
* |
|
102 |
* @see JDialogEditor |
|
103 |
*/ |
|
104 |
public JDialogEditor createJDialogEditor(ScriptingUIManager uimanager, ScriptingDialog script); |
|
105 |
|
|
106 |
/** |
|
107 |
* Creates a new {@link JThinlet} component. |
|
108 |
* |
|
109 |
* @return a new {@link JThinlet}. |
|
110 |
* |
|
111 |
* @see JThinlet |
|
112 |
*/ |
|
113 |
public JThinlet createJThinlet(); |
|
114 |
|
|
115 |
/** |
|
116 |
* Creates a new {@link JThinG} component. |
|
117 |
* |
|
118 |
* @return a new {@link JThinG}. |
|
119 |
* |
|
120 |
* @see JThinG |
|
121 |
*/ |
|
122 |
public JThinG createJThinG(); |
|
123 |
|
|
124 |
/** |
|
125 |
* Returns a ImageIcon associated with the name. |
|
126 |
* |
|
127 |
* @params name String that identificates the image. |
|
128 |
* |
|
129 |
* @return the ImageIcon identified by the String name. |
|
130 |
*/ |
|
131 |
public ImageIcon getIcon(String name); |
|
132 |
|
|
133 |
/** |
|
134 |
* Returns a ImageIcon associated with the name. |
|
135 |
* |
|
136 |
* @params name String that identificates the image. |
|
137 |
* @params size String to specify if the size of the icon would be "small", "medium" or "big" (default value: "small"). |
|
138 |
* |
|
139 |
* @return the ImageIcon identified by the String name. |
|
140 |
*/ |
|
141 |
public ImageIcon getIcon(String name, String size); |
|
37 |
/** |
|
38 |
* Creates a new {@link JScriptingComposer} component. |
|
39 |
* |
|
40 |
* @return a new {@link JScriptingComposer}. |
|
41 |
* |
|
42 |
* @see JScriptingComposer |
|
43 |
*/ |
|
44 |
public JScriptingComposer createComposer(); |
|
142 | 45 |
|
143 |
/** |
|
144 |
* Returns the {@link ScriptingManager} of the ScriptingFramework. |
|
145 |
* |
|
146 |
* @return {@link ScriptingManager} |
|
147 |
*/ |
|
148 |
public ScriptingManager getManager(); |
|
149 |
|
|
150 |
/** |
|
151 |
* Returns the {@link AboutManager} to provide services of the 'About Us' information of the ScriptingFramework. |
|
152 |
* |
|
153 |
* @return the {@link AboutManager} |
|
154 |
* |
|
155 |
* @see AboutManager |
|
156 |
*/ |
|
157 |
public AboutManager getAboutManager(); |
|
158 |
|
|
159 |
/** |
|
160 |
* Returns a help panel. |
|
161 |
* |
|
162 |
* @return a JPanel with the JavaDocs registered in the application |
|
163 |
*/ |
|
164 |
public JPanel getAPIHelp(); |
|
165 |
|
|
166 |
/** |
|
167 |
* Returns a help panel. |
|
168 |
* |
|
169 |
* @return a JPanel with the User's help of the application |
|
170 |
*/ |
|
171 |
public JPanel getUserHelp(); |
|
46 |
/** |
|
47 |
* Creates a new {@link JScriptingBrowser} component. |
|
48 |
* |
|
49 |
* @param uimanager {@link ScriptingUIManager} that identificates the |
|
50 |
* image. |
|
51 |
* @param root {@link ScriptingFolder} that identificates the image. |
|
52 |
* @param foldersOnly boolean to indicate if only will be shown folders (if |
|
53 |
* it's true) or it will be shown the ScriptingBaseScript files too (false |
|
54 |
* value). By default, false |
|
55 |
* |
|
56 |
* @return a new {@link JScriptingBrowser}. |
|
57 |
* |
|
58 |
* @see JScriptingBrowser |
|
59 |
*/ |
|
60 |
public JScriptingBrowser createBrowser(ScriptingUIManager uimanager, ScriptingFolder root, boolean foldersOnly); |
|
172 | 61 |
|
173 |
public void addUserHelp(String langName, URL resource); |
|
174 |
|
|
175 |
/** |
|
176 |
* Shows a JPanel in a dialog window with it's own characteristics |
|
177 |
* |
|
178 |
* @params panel JPanel included in the dialog's content |
|
179 |
* @params title String with the dialog's title |
|
180 |
* |
|
181 |
*/ |
|
182 |
public void showDialog(JPanel panel, String title); |
|
183 |
|
|
184 |
/** |
|
185 |
* Shows a JPanel in a window with it's own characteristics |
|
186 |
* |
|
187 |
* @params panel JPanel included in the window's content |
|
188 |
* @params title String with the window's title |
|
189 |
* |
|
190 |
*/ |
|
191 |
public void showWindow(JPanel panel, String title); |
|
192 |
|
|
193 |
/** |
|
194 |
* Shows a JPanel in a tool window with it's own characteristics |
|
195 |
* |
|
196 |
* @params panel JPanel included in the tool's content |
|
197 |
* @params title String with the tool's title |
|
198 |
* |
|
199 |
*/ |
|
200 |
public void showTool(JPanel panel, String title); |
|
62 |
/** |
|
63 |
* Creates a new {@link JScriptingBrowser} component. |
|
64 |
* |
|
65 |
* @param uimanager {@link ScriptingUIManager} that identificates the |
|
66 |
* image. |
|
67 |
* @param root {@link ScriptingFolder} that identificates the image. |
|
68 |
* |
|
69 |
* @return a new {@link JScriptingBrowser}. |
|
70 |
* |
|
71 |
* @see JScriptingBrowser |
|
72 |
*/ |
|
73 |
public JScriptingBrowser createBrowser(ScriptingUIManager uimanager, ScriptingFolder root); |
|
201 | 74 |
|
202 |
/** |
|
203 |
* Registers a new instance of a WindowManager which provides services to the management of the application windows |
|
204 |
* |
|
205 |
* @params manager {@link WindowManager} to register in the ScriptingUIManager. |
|
206 |
* |
|
207 |
* @see WindowManager |
|
208 |
*/ |
|
209 |
// public void registerWindowManager(WindowManager manager); |
|
210 |
|
|
211 |
public String getTranslation(String key); |
|
75 |
/** |
|
76 |
* Creates a new {@link JScriptingInstaller} component. |
|
77 |
* |
|
78 |
* @return a new {@link JScriptingInstaller}. |
|
79 |
* |
|
80 |
* @see JScriptingInstaller |
|
81 |
*/ |
|
82 |
public JPanel createInstaller(); |
|
212 | 83 |
|
213 |
public void setWindowManager(WindowManager windowsManager); |
|
214 |
|
|
215 |
public WindowManager getWindowManager(); |
|
216 |
|
|
84 |
/** |
|
85 |
* Creates a new JEditorPane component with syntax highlight. |
|
86 |
* |
|
87 |
* @return a new {@link JEditorPaneSyntaxHighlighting}. |
|
88 |
* |
|
89 |
* @see JEditorPaneSyntaxHighlighting |
|
90 |
*/ |
|
91 |
public SyntaxtHighlightTextComponent createSyntaxHighlightingPanel(); |
|
92 |
|
|
93 |
/** |
|
94 |
* Creates a new {@link JCodeEditor} component. |
|
95 |
* |
|
96 |
* @param uimanager |
|
97 |
* @param script |
|
98 |
* @return a new {@link JCodeEditor}. |
|
99 |
* |
|
100 |
* @see JCodeEditor |
|
101 |
*/ |
|
102 |
public JCodeEditor createJCodeEditor(ScriptingUIManager uimanager, ScriptingScript script); |
|
103 |
|
|
104 |
/** |
|
105 |
* Creates a new {@link JDialogEditor} component. |
|
106 |
* |
|
107 |
* @param uimanager |
|
108 |
* @param script |
|
109 |
* @return a new {@link JDialogEditor}. |
|
110 |
* |
|
111 |
* @see JDialogEditor |
|
112 |
*/ |
|
113 |
public JDialogEditor createJDialogEditor(ScriptingUIManager uimanager, ScriptingDialog script); |
|
114 |
|
|
115 |
/** |
|
116 |
* Creates a new {@link JThinlet} component. |
|
117 |
* |
|
118 |
* @return a new {@link JThinlet}. |
|
119 |
* |
|
120 |
* @see JThinlet |
|
121 |
*/ |
|
122 |
public JThinlet createJThinlet(); |
|
123 |
|
|
124 |
/** |
|
125 |
* Creates a new {@link JThinG} component. |
|
126 |
* |
|
127 |
* @return a new {@link JThinG}. |
|
128 |
* |
|
129 |
* @see JThinG |
|
130 |
*/ |
|
131 |
public JThinG createJThinG(); |
|
132 |
|
|
133 |
/** |
|
134 |
* Returns a ImageIcon associated with the name. |
|
135 |
* |
|
136 |
* @param name String that identificates the image. |
|
137 |
* |
|
138 |
* @return the ImageIcon identified by the String name. |
|
139 |
*/ |
|
140 |
public ImageIcon getIcon(String name); |
|
141 |
|
|
142 |
/** |
|
143 |
* Returns a ImageIcon associated with the name. |
|
144 |
* |
|
145 |
* @param name String that identificates the image. |
|
146 |
* @param size String to specify if the size of the icon would be "small", |
|
147 |
* "medium" or "big" (default value: "small"). |
|
148 |
* |
|
149 |
* @return the ImageIcon identified by the String name. |
|
150 |
*/ |
|
151 |
public ImageIcon getIcon(String name, String size); |
|
152 |
|
|
153 |
/** |
|
154 |
* Returns the {@link ScriptingManager} of the ScriptingFramework. |
|
155 |
* |
|
156 |
* @return {@link ScriptingManager} |
|
157 |
*/ |
|
158 |
public ScriptingManager getManager(); |
|
159 |
|
|
160 |
/** |
|
161 |
* Returns the {@link AboutManager} to provide services of the 'About Us' |
|
162 |
* information of the ScriptingFramework. |
|
163 |
* |
|
164 |
* @return the {@link AboutManager} |
|
165 |
* |
|
166 |
* @see AboutManager |
|
167 |
*/ |
|
168 |
public AboutManager getAboutManager(); |
|
169 |
|
|
170 |
/** |
|
171 |
* Returns a help panel. |
|
172 |
* |
|
173 |
* @return a JPanel with the JavaDocs registered in the application |
|
174 |
*/ |
|
175 |
public JPanel getHelp(); |
|
176 |
|
|
177 |
/** |
|
178 |
* Returns a help panel. |
|
179 |
* |
|
180 |
* @return a JPanel with the User's help of the application |
|
181 |
*/ |
|
182 |
public JPanel getUserHelp(); |
|
183 |
|
|
184 |
public void addUserHelp(String langName, URL resource); |
|
185 |
|
|
186 |
/** |
|
187 |
* Shows a JPanel in a dialog window with it's own characteristics |
|
188 |
* |
|
189 |
* @param panel JPanel included in the dialog's content |
|
190 |
* @param title String with the dialog's title |
|
191 |
* |
|
192 |
*/ |
|
193 |
public void showDialog(JPanel panel, String title); |
|
194 |
|
|
195 |
/** |
|
196 |
* Shows a JPanel in a window with it's own characteristics |
|
197 |
* |
|
198 |
* @param panel JPanel included in the window's content |
|
199 |
* @param title String with the window's title |
|
200 |
* |
|
201 |
*/ |
|
202 |
public void showWindow(JPanel panel, String title); |
|
203 |
|
|
204 |
/** |
|
205 |
* Shows a JPanel in a tool window with it's own characteristics |
|
206 |
* |
|
207 |
* @param panel JPanel included in the tool's content |
|
208 |
* @param title String with the tool's title |
|
209 |
* |
|
210 |
*/ |
|
211 |
public void showTool(JPanel panel, String title); |
|
212 |
|
|
213 |
public String getTranslation(String key); |
|
214 |
|
|
215 |
public void setWindowManager(WindowManager windowsManager); |
|
216 |
|
|
217 |
public WindowManager getWindowManager(); |
|
218 |
|
|
219 |
public JScriptingConsole createJScriptingConsole(); |
|
220 |
|
|
217 | 221 |
} |
Also available in: Unified diff