Revision 34114 branches/v2_0_0_prep/frameworks/_fwAndami/src/org/gvsig/andami/impl/DefaultPluginsManager.java
DefaultPluginsManager.java | ||
---|---|---|
1 | 1 |
package org.gvsig.andami.impl; |
2 | 2 |
|
3 |
import java.io.File; |
|
3 | 4 |
import java.util.ArrayList; |
4 | 5 |
import java.util.Enumeration; |
5 | 6 |
import java.util.Iterator; |
... | ... | |
11 | 12 |
import org.gvsig.andami.config.generate.AndamiConfig; |
12 | 13 |
import org.gvsig.andami.config.generate.Plugin; |
13 | 14 |
import org.gvsig.andami.plugins.ExclusiveUIExtension; |
15 |
import org.gvsig.andami.plugins.Extension; |
|
14 | 16 |
import org.gvsig.andami.plugins.IExtension; |
17 |
import org.gvsig.andami.plugins.PluginClassLoader; |
|
15 | 18 |
|
16 | 19 |
public class DefaultPluginsManager implements PluginsManager{ |
17 | 20 |
|
... | ... | |
28 | 31 |
return PluginServices.getExtensions(); |
29 | 32 |
} |
30 | 33 |
|
31 |
public PluginServices getPlugin(Class<PluginServices> plugin) { |
|
32 |
return PluginServices.getPluginServices(plugin); |
|
34 |
@SuppressWarnings("rawtypes") |
|
35 |
/** |
|
36 |
* Return the associated pluginServices to the extension class passed as parameter. |
|
37 |
* |
|
38 |
*/ |
|
39 |
public PluginServices getPlugin(Class<?> extension) { |
|
40 |
String pluginName = ((PluginClassLoader)extension.getClassLoader()).getPluginName(); |
|
41 |
return this.getPlugin(pluginName); |
|
33 | 42 |
} |
34 | 43 |
|
35 | 44 |
public PluginServices getPlugin(String pluginName) { |
36 |
return PluginServices.getPluginServices(pluginName);
|
|
45 |
return Launcher.getPluginServices(pluginName);
|
|
37 | 46 |
} |
38 | 47 |
|
39 | 48 |
@SuppressWarnings("unchecked") |
... | ... | |
53 | 62 |
PluginServices.setExclusiveUIExtension(extension); |
54 | 63 |
} |
55 | 64 |
|
65 |
public File getPluginsDirectory() { |
|
66 |
return new File(Launcher.getAndamiConfig().getPluginsDirectory()); |
|
67 |
} |
|
68 |
|
|
56 | 69 |
} |
Also available in: Unified diff