61 |
61 |
import java.security.Policy;
|
62 |
62 |
import java.text.MessageFormat;
|
63 |
63 |
import java.util.ArrayList;
|
|
64 |
import java.util.Arrays;
|
64 |
65 |
import java.util.Comparator;
|
65 |
66 |
import java.util.Enumeration;
|
66 |
67 |
import java.util.HashMap;
|
... | ... | |
195 |
196 |
|
196 |
197 |
public abstract String[] getAliases(Item item);
|
197 |
198 |
|
198 |
|
public Item get(Object key) {
|
|
199 |
public boolean isAlias(String key) {
|
|
200 |
return aliases.get(key)!=null ;
|
|
201 |
}
|
|
202 |
|
|
203 |
public String getMainKey(String key) {
|
199 |
204 |
Item item = super.get(key);
|
200 |
205 |
if( item != null ) {
|
|
206 |
return key;
|
|
207 |
}
|
|
208 |
String alias = aliases.get(key);
|
|
209 |
if( alias != null ) {
|
|
210 |
return alias;
|
|
211 |
}
|
|
212 |
return null;
|
|
213 |
}
|
|
214 |
|
|
215 |
public Item get(Object key) {
|
|
216 |
Item item = super.get(key);
|
|
217 |
if( item != null ) {
|
201 |
218 |
return item;
|
202 |
219 |
}
|
203 |
220 |
String alias = aliases.get(key);
|
... | ... | |
323 |
340 |
protected static ListBaseException launcherrors = null;
|
324 |
341 |
|
325 |
342 |
protected static Theme theme = null;
|
|
343 |
|
|
344 |
private List<String> deprecatedPluginNames = null;
|
326 |
345 |
|
327 |
346 |
private static final class ProxyAuth extends Authenticator {
|
328 |
347 |
|
... | ... | |
402 |
421 |
return PluginServices.getText(Launcher.class,msg);
|
403 |
422 |
}
|
404 |
423 |
|
|
424 |
private List<String> getDeprecatedPluginNames() {
|
|
425 |
if( deprecatedPluginNames == null ) {
|
|
426 |
String[] ss = new String[] {
|
|
427 |
"org.gvsig.app",
|
|
428 |
"org.gvsig.coreplugin",
|
|
429 |
"org.gvsig.editing",
|
|
430 |
"org.gvsig.installer.app.extension",
|
|
431 |
"org.gvsig.exportto.app.extension"
|
|
432 |
};
|
|
433 |
deprecatedPluginNames = Arrays.asList(ss);
|
|
434 |
}
|
|
435 |
return deprecatedPluginNames;
|
|
436 |
}
|
|
437 |
|
405 |
438 |
public void doMain(String[] args) throws Exception {
|
406 |
439 |
|
407 |
440 |
if (args.length < 1) {
|
... | ... | |
2076 |
2109 |
// Se obtienen las dependencias y sus class loaders
|
2077 |
2110 |
boolean ready = true;
|
2078 |
2111 |
Depends[] dependencies = config.getDepends();
|
2079 |
|
PluginClassLoader[] loaders = new PluginClassLoader[dependencies.length];
|
|
2112 |
List<PluginClassLoader> loaders = new ArrayList<PluginClassLoader>();
|
2080 |
2113 |
|
2081 |
2114 |
for (int j = 0; j < dependencies.length; j++) {
|
2082 |
2115 |
Depends dependency = dependencies[j];
|
2083 |
2116 |
String dependencyName = dependency.getPluginName();
|
2084 |
2117 |
PluginConfig dependencyPluginConfig = pluginsConfig.get(dependencyName);
|
2085 |
|
PluginServices dependenyPluginService = pluginsServices.get(dependencyName);
|
|
2118 |
PluginServices dependencyPluginService = pluginsServices.get(dependencyName);
|
2086 |
2119 |
|
|
2120 |
if( getDeprecatedPluginNames().contains(dependencyName) ) {
|
|
2121 |
logger.warn("Plugin '"+pluginName+"' use a deprecated plugin name '"+dependencyName+"' as dependency. Must use '"+pluginsConfig.getMainKey(dependencyName)+"'.");
|
|
2122 |
}
|
2087 |
2123 |
if ( dependencyPluginConfig == null) {
|
2088 |
2124 |
if( dependency.getOptional() ) {
|
2089 |
2125 |
this.logger.info("Plugin '"+pluginName+"', optional dependency '"+dependencyName+"' not found");
|
... | ... | |
2095 |
2131 |
+ dependencies[j].getPluginName());
|
2096 |
2132 |
}
|
2097 |
2133 |
} else {
|
2098 |
|
if ( dependenyPluginService!=null &&
|
2099 |
|
installed.contains(dependenyPluginService.getPluginName())) {
|
2100 |
|
loaders[j] = (pluginsServices.get(dependencies[j]
|
2101 |
|
.getPluginName())).getClassLoader();
|
|
2134 |
if ( dependencyPluginService!=null &&
|
|
2135 |
installed.contains(dependencyPluginService.getPluginName())) {
|
|
2136 |
loaders.add(dependencyPluginService.getClassLoader());
|
2102 |
2137 |
} else {
|
2103 |
2138 |
if( !dependency.getOptional() ) {
|
2104 |
2139 |
ready = false;
|
... | ... | |
3064 |
3099 |
+ " '" + name + "'");
|
3065 |
3100 |
}
|
3066 |
3101 |
|
3067 |
|
// public static void initIconThemes() {
|
3068 |
|
// // load the iconTheme
|
3069 |
|
// IconThemeManager iconManager = new IconThemeManager();
|
3070 |
|
// PluginServices.setIconThemeManager(iconManager);
|
3071 |
|
// IconThemeInfo selectedTheme = iconManager.readConfig();
|
3072 |
|
// if (selectedTheme!=null) {
|
3073 |
|
// iconManager.setDefault(selectedTheme);
|
3074 |
|
// logger.info("Setting the icon theme: "+selectedTheme.toVerboseString());
|
3075 |
|
// }
|
3076 |
|
// else {
|
3077 |
|
// // set the default dir and try to load the default theme
|
3078 |
|
// try {
|
3079 |
|
// iconManager.setThemesDir(new File("iconThemes"));
|
3080 |
|
// IconThemeInfo[] list = iconManager.list();
|
3081 |
|
//
|
3082 |
|
// for (int i=0; i<list.length; i++) {
|
3083 |
|
// if (list[i].getResourceName().equals("iconThemes/icons")) {
|
3084 |
|
// iconManager.setDefault(list[i]);
|
3085 |
|
// logger.info("Setting the default icon theme: "+list[i].toVerboseString());
|
3086 |
|
// return;
|
3087 |
|
// }
|
3088 |
|
// }
|
3089 |
|
// } catch (FileNotFoundException e) {
|
3090 |
|
// logger.info("IconTheme basedir does not exist");
|
3091 |
|
// }
|
3092 |
|
// // create an empty theme
|
3093 |
|
// IconThemeInfo info = new IconThemeInfo();
|
3094 |
|
// info.setName("No theme loaded");
|
3095 |
|
// info.setResource(null); // null resource means that no real theme is
|
3096 |
|
// loaded
|
3097 |
|
// info.setDescription("No theme loaded");
|
3098 |
|
// info.setVersion("0");
|
3099 |
|
// iconManager.setDefault(new IconTheme(info));
|
3100 |
|
// logger.info("Setting an empty icon theme");
|
3101 |
|
//
|
3102 |
|
// }
|
3103 |
|
// }
|
3104 |
|
|
3105 |
3102 |
public static void initIconThemes() {
|
3106 |
3103 |
PluginsManager pluginsManager = PluginsLocator.getManager();
|
3107 |
3104 |
IconThemeManager iconManager = ToolsSwingLocator.getIconThemeManager();
|