Statistics
| Revision:

gvsig-scripting / 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 @ 739

History | View | Annotate | Download (6.89 KB)

1
package org.gvsig.scripting.swing.api;
2

    
3
import java.net.URL;
4
import java.util.Collection;
5
import java.util.List;
6
import javax.swing.Action;
7

    
8
import javax.swing.ImageIcon;
9
import javax.swing.JComponent;
10
import javax.swing.JPanel;
11

    
12
import org.gvsig.about.AboutManager;
13
import org.gvsig.scripting.ScriptingDialog;
14
import org.gvsig.scripting.ScriptingFolder;
15
import org.gvsig.scripting.ScriptingManager;
16
import org.gvsig.scripting.ScriptingScript;
17
import org.gvsig.scripting.ScriptingUnit;
18
import org.gvsig.tools.swing.api.Component;
19
import org.gvsig.tools.swing.api.windowmanager.WindowManager;
20

    
21
/**
22
 * There are two top level management roles within ScriptingFramework: logical
23
 * and User's Interface (UI) management.
24
 *
25
 * This class is responsible of the UI management role. It provides all the
26
 * components shown in the ScriptingFramework.
27
 *
28
 * @see ScriptingManager
29
 *
30
 */
31
public interface ScriptingUIManager {
32
    /**
33
     * Creates a new {@link JScriptingLauncher} component.
34
     *
35
     * @return a new {@link JScriptingLauncher}.
36
     *
37
     * @see JScriptingLauncher
38
     */
39
    public JScriptingLauncher createLauncher();
40

    
41
    /**
42
     * Creates a new {@link JScriptingComposer} component.
43
     *
44
     * @return a new {@link JScriptingComposer}.
45
     *
46
     * @see JScriptingComposer
47
     */
48
    public JScriptingComposer createComposer();
49

    
50
    /**
51
     * Creates a new {@link  JScriptingBrowser} component.
52
     *
53
     * @param root {@link  ScriptingFolder} that identificates the image.
54
     * @param foldersOnly boolean to indicate if only will be shown folders (if
55
     * it's true) or it will be shown the ScriptingBaseScript files too (false
56
     * value). By default, false
57
     *
58
     * @return a new {@link  JScriptingBrowser}.
59
     *
60
     * @see JScriptingBrowser
61
     */
62
    public JScriptingBrowser createBrowser(ScriptingFolder root, boolean foldersOnly);
63

    
64
    /**
65
     * Creates a new {@link  JScriptingBrowser} component.
66
     *
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(ScriptingFolder root);
74

    
75
    /**
76
     * Creates a new {@link  JScriptingInstaller} component.
77
     *
78
     * @return a new {@link  JScriptingInstaller}.
79
     *
80
     * @see JScriptingInstaller
81
     */
82
    public JPanel createInstaller();
83

    
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
     * @param script
96
     * @return a new {@link JCodeEditor}.
97
     *
98
     * @see JCodeEditor
99
     */
100
    public JCodeEditor createJCodeEditor(ScriptingScript script);
101

    
102
    /**
103
     * Creates a new {@link JDialogEditor} component.
104
     *
105
     * @param uimanager
106
     * @param script
107
     * @return a new {@link JDialogEditor}.
108
     *
109
     * @see JDialogEditor
110
     */
111
    public JDialogEditor createJDialogEditor(ScriptingDialog script);
112

    
113
    /**
114
     * Creates a new {@link JThinlet} component.
115
     *
116
     * @return a new {@link JThinlet}.
117
     *
118
     * @see JThinlet
119
     */
120
    public JThinlet createJThinlet();
121

    
122
    /**
123
     * Creates a new {@link JThinG} component.
124
     *
125
     * @return a new {@link JThinG}.
126
     *
127
     * @see JThinG
128
     */
129
    public JThinG createJThinG();
130

    
131
    /**
132
     * Creates a JEditor for the scripting unit passed as parameter.
133
     * Return null if not exists an editor for this unit.
134
     * 
135
     * @param unit
136
     * @return 
137
     */
138
    public JEditor createEditor(ScriptingUnit unit);
139
    
140
    /**
141
     * Returns a ImageIcon associated with the name.
142
     *
143
     * @param name String that identificates the image.
144
     *
145
     * @return the ImageIcon identified by the String name.
146
     */
147
    public ImageIcon getIcon(String name);
148

    
149
    /**
150
     * Returns a ImageIcon associated with the name.
151
     *
152
     * @param name String that identificates the image.
153
     * @param size String to specify if the size of the icon would be "small",
154
     * "medium" or "big" (default value: "small").
155
     *
156
     * @return the ImageIcon identified by the String name.
157
     */
158
    public ImageIcon getIcon(String name, String size);
159

    
160
    /**
161
     * Returns the {@link ScriptingManager} of the ScriptingFramework.
162
     *
163
     * @return {@link ScriptingManager}
164
     */
165
    public ScriptingManager getManager();
166

    
167
    /**
168
     * Returns the {@link AboutManager} to provide services of the 'About Us'
169
     * information of the ScriptingFramework.
170
     *
171
     * @return the {@link AboutManager}
172
     *
173
     * @see AboutManager
174
     */
175
    public AboutManager getAboutManager();
176

    
177
    /**
178
     * Returns a help panel.
179
     *
180
     * @return a JPanel with the JavaDocs registered in the application
181
     */
182
    public JPanel getHelp();
183

    
184
    /**
185
     * Returns a help panel.
186
     *
187
     * @return a JPanel with the User's help of the application
188
     */
189
    public JPanel getUserHelp();
190

    
191
    public void addUserHelp(String langName, URL resource);
192

    
193
    /**
194
     * Shows a JPanel in a dialog window with it's own characteristics
195
     *
196
     * @param panel JPanel included in the dialog's content
197
     * @param title String with the dialog's title
198
     *
199
     */
200
    public void showDialog(JComponent panel, String title);
201

    
202
    /**
203
     * Shows a JPanel in a window with it's own characteristics
204
     *
205
     * @param panel JPanel included in the window's content
206
     * @param title String with the window's title
207
     *
208
     */
209
    public void showWindow(JComponent panel, String title);
210

    
211
    /**
212
     * Shows a JPanel in a tool window with it's own characteristics
213
     *
214
     * @param panel JPanel included in the tool's content
215
     * @param title String with the tool's title
216
     *
217
     */
218
    public void showTool(JComponent panel, String title);
219

    
220
    public String getTranslation(String key);
221

    
222
    public void setWindowManager(WindowManager windowsManager);
223

    
224
    public WindowManager getWindowManager();
225
    
226
    public JScriptingConsole createJScriptingConsole();
227
    
228
    public JScriptingConsole createJScriptingConsole(boolean captureOutput);
229
        
230
    public void addComposerTool(Action action);
231
    
232
    public void addComposerMenu(String text, Action action);
233
    
234
    public Collection<Action> getComposerTools();
235
    
236
    public interface MenuEntry {
237
        public String getText();
238
        public Action getAction();
239
    }
240
    public Collection<MenuEntry> getComposerMenus();
241

    
242
    public JScriptingComposer getActiveComposer();
243
    
244
    public void addCreatedComponentListener(CreateComponentListener listener);
245
    
246
    public void removeCreatedComponentListener(CreateComponentListener listener);
247
    
248
    public void registerEditor(EditorFactory factory);
249
    
250
    public boolean hasEditor(ScriptingUnit unit);
251
    
252
    public List<EditorFactory> getEditorFactories();
253
    
254
}