Revision 2828 trunk/frameworks/_fwAndami/src/com/iver/andami/Launcher.java

View differences:

Launcher.java
132 132
	private static HashMap classesExtensions = new HashMap();
133 133
	private static String andamiConfigPath;
134 134
	private static String pluginsPersistencePath;
135
    
136
    private static ArrayList pluginsOrdered = new ArrayList();
135 137

  
136 138
	/**
137 139
	 * DOCUMENT ME!
......
191 193
		andamiConfig.setPluginsDirectory(args[1]);
192 194

  
193 195
		// Configurar el locale
196
        String localeStr = "";
194 197
		if (args.length == 3) {
195
			locale = new Locale(args[2]);
198
            localeStr = args[2];
199
            
196 200
		} else {
197
			locale = getLocale(andamiConfig.getLocaleLanguage(),
201
            localeStr = andamiConfig.getLocaleLanguage();
202
			/* locale = getLocale(localeStr,
198 203
					andamiConfig.getLocaleCountry(),
199
					andamiConfig.getLocaleVariant());
204
					andamiConfig.getLocaleVariant()); */
200 205
		}
206
        if (localeStr.compareTo("va")==0)
207
        {
208
            locale = new Locale("ca");
209
            Messages.init("va");
210
        }
211
        else
212
        {
213
            locale = new Locale(localeStr);
214
            Messages.init(locale);
215
        }
201 216

  
202 217
		Locale.setDefault(locale);
203
		JComponent.setDefaultLocale(locale);
204
		Messages.init(locale);
218
		JComponent.setDefaultLocale(locale);        
219
		
205 220

  
206 221
		//Se pone el lookAndFeel
207 222
		try {
......
417 432
	 *
418 433
	 */
419 434
	private static void initializeExtensions() {
420
		Iterator i = pluginsConfig.keySet().iterator();
435
		Iterator i = pluginsOrdered.iterator();
421 436

  
422 437
		while (i.hasNext()) {
423 438
			String pName = (String) i.next();
439
            logger.debug("Initilizing extensions from " + pName);
424 440
			PluginConfig pc = (PluginConfig) pluginsConfig.get(pName);
425 441
			PluginServices ps = (PluginServices) pluginsServices.get(pName);
426 442

  
......
452 468
					Class extensionClass = ps.getClassLoader().loadClass(extension.getClassName());
453 469
					extensionInstance = (com.iver.andami.plugins.Extension) extensionClass.newInstance();
454 470
					classesExtensions.put(extensionClass, extensionInstance);
471
                    // logger.debug("Initializing " + extension.getClassName());
472
                    extensionInstance.inicializar();
473
                    // logger.debug(extension.getClassName() + " initialized.");
455 474

  
456
					extensionInstance.inicializar();
457 475
				} catch (InstantiationException e1) {
458 476
					logger.error(Messages.getString(
459 477
							"Launcher.Error_instanciando_la_extension") +
......
768 786
					pluginsServices.put(ps.getPluginName(), ps);
769 787

  
770 788
					instalados.add(pluginName);
789
                    // FJP: Los metemos ordenados para luego no cargar uno que necesita de otro antes de tiempo. Esto lo usaremos al 
790
                    // inicializar los plugins
791
                    pluginsOrdered.add(pluginName);
771 792

  
772 793
					circle = false;
773 794
				} catch (IOException e) {
......
798 819
				pluginsConfig.remove(pluginName);
799 820
				i = pluginsConfig.keySet().iterator();
800 821
			}
801
		}
822
		} 
802 823
	}
803 824

  
804 825
	/**

Also available in: Unified diff