svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.framework / org.gvsig.andami / src / main / java / org / gvsig / andami / PluginsManager.java @ 41218
History | View | Annotate | Download (4.97 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.andami; |
25 |
|
26 |
import java.io.File; |
27 |
import java.util.Iterator; |
28 |
import java.util.List; |
29 |
|
30 |
import org.gvsig.andami.plugins.ExclusiveUIExtension; |
31 |
import org.gvsig.andami.plugins.IExtension; |
32 |
import org.gvsig.installer.lib.api.PackageInfo; |
33 |
|
34 |
public interface PluginsManager { |
35 |
/**
|
36 |
* Return the associated pluginServices to the extension class passed as parameter.
|
37 |
* @param extension
|
38 |
* @return plugin services
|
39 |
*/
|
40 |
public PluginServices getPlugin(Class<? extends IExtension> extension); |
41 |
|
42 |
/**
|
43 |
* Return the associated pluginServices to the extension plugin.
|
44 |
* @param pluginName, name of the plugin
|
45 |
* @return plugin services
|
46 |
*/ public PluginServices getPlugin(String pluginName); |
47 |
|
48 |
/**
|
49 |
* Get the package info associated to the plugin of the extension.
|
50 |
*
|
51 |
* @param extension extension of the plugin
|
52 |
* @return plugin package info
|
53 |
*/
|
54 |
public PackageInfo getPackageInfo(Class<? extends IExtension> extension); |
55 |
|
56 |
/**
|
57 |
* Get the package info associated to the plugin with the specified name.
|
58 |
*
|
59 |
* @param pluginName, name of the plugin
|
60 |
* @return plugin package info
|
61 |
*/
|
62 |
public PackageInfo getPackageInfo(String pluginName); |
63 |
|
64 |
/**
|
65 |
* Get the package info associated to the application.
|
66 |
*
|
67 |
* @return application package info
|
68 |
*/
|
69 |
public PackageInfo getPackageInfo();
|
70 |
|
71 |
/**
|
72 |
* Return the list of plugins loaded in the application
|
73 |
* @return list of plugins
|
74 |
*/
|
75 |
public List<PluginServices> getPlugins(); |
76 |
|
77 |
/**
|
78 |
* Gets the instance of the extension whose class is provided.
|
79 |
*
|
80 |
* @param extension, class of the extension to retrieve
|
81 |
*
|
82 |
* @return The instance of the extension, or null if the instance does
|
83 |
* not exist.
|
84 |
*/
|
85 |
public IExtension getExtension(Class<? extends IExtension> extension); |
86 |
|
87 |
/**
|
88 |
* Return an iterator over al extensions loaded in the application.
|
89 |
*
|
90 |
* @return iterator over extensions
|
91 |
*/
|
92 |
public Iterator<IExtension> getExtensions(); |
93 |
|
94 |
/**
|
95 |
* Set an extension to control the visivility of all the extensions
|
96 |
* of the application.
|
97 |
*
|
98 |
* @param extension
|
99 |
*/
|
100 |
public void setExclusiveUIExtension(ExclusiveUIExtension extension); |
101 |
|
102 |
/**
|
103 |
* Return the ExclusiveUIExtension installed in the application or
|
104 |
* null.
|
105 |
* @return
|
106 |
*/
|
107 |
public ExclusiveUIExtension getExclusiveUIExtension();
|
108 |
|
109 |
|
110 |
/**
|
111 |
* @deprecated use {@link #translate(String)}
|
112 |
* @see {@link #translate(String)}
|
113 |
*/
|
114 |
public String getText(Object obj, String msg); |
115 |
|
116 |
/**
|
117 |
* Translate the message key to the current language used
|
118 |
* in the application.
|
119 |
*
|
120 |
* @param msg key to translate
|
121 |
* @return message traslated or the key
|
122 |
*/
|
123 |
public String translate(String msg); |
124 |
|
125 |
/**
|
126 |
* Returns the main application folder, where the application is installed.
|
127 |
*
|
128 |
* @return the main application folder
|
129 |
*/
|
130 |
public File getApplicationFolder(); |
131 |
|
132 |
/**
|
133 |
* Returns the default folder with the installable package bundles.
|
134 |
*
|
135 |
* @return the default folder with the installable package bundles
|
136 |
*/
|
137 |
public File getInstallFolder(); |
138 |
|
139 |
/**
|
140 |
* Returns the application folder in the home of user.
|
141 |
*
|
142 |
* @return the main application folder
|
143 |
*/
|
144 |
public File getApplicationHomeFolder(); |
145 |
|
146 |
/**
|
147 |
* Returns the plugins folder.
|
148 |
*
|
149 |
* @return the plugins folder
|
150 |
* @deprecated use {@link #getPluginsFolders()}
|
151 |
*/
|
152 |
public File getPluginsFolder(); |
153 |
|
154 |
/**
|
155 |
* Returns a list of folder on the plugins are instaleds.
|
156 |
*
|
157 |
* @return list of folders File of the plugins.
|
158 |
*/
|
159 |
public List<File> getPluginsFolders(); |
160 |
|
161 |
|
162 |
/**
|
163 |
* @deprecated @see {@link #getPluginsFolders()}
|
164 |
*/
|
165 |
public File getPluginsDirectory(); |
166 |
|
167 |
/**
|
168 |
* This method allows plugins to require the execution of
|
169 |
* tasks
|
170 |
*
|
171 |
* @param task
|
172 |
* @param in_event_thread
|
173 |
* @param priority
|
174 |
*/
|
175 |
public void addAdditionalTask(Runnable task, boolean in_event_thread, int priority); |
176 |
|
177 |
/**
|
178 |
* This method executes the tasks required by the plugins.
|
179 |
*
|
180 |
* @return
|
181 |
*/
|
182 |
public void executeAdditionalTasks(); |
183 |
|
184 |
} |