package org.adligo.models.core.client.i18n;

import java.util.HashMap;
import java.util.Map;

import org.adligo.i.adi.client.I18nConstantsFactory;
import org.adligo.i.adi.client.I_Invoker;
import org.adligo.models.core.client.I_ModelsCoreConstants;

import com.google.gwt.core.client.GWT;
import com.google.gwt.i18n.client.Constants;

public class ModelsCoreConstantsSetup {
	private static boolean init = false;
	
	public static void init() {
		if (!init) {
			init = true;
			I18nConstantsFactory.INSTANCE.put(I_ModelsCoreConstants.class,
					new I_Invoker() {
						I_GwtModelsCoreConstants csts;
						
						@Override
						public Object invoke(Object valueObject) {
							if (csts == null) {
								csts = GWT.create(I_GwtModelsCoreConstants.class);
							}
							return csts;
						}
					});
			I18nConstantsFactory.INSTANCE.setDefalutFactory(new I_Invoker() {
				private Map<Class<?>,Constants> map = new HashMap<Class<?>,Constants>();
				
				@Override
				public Object invoke(Object valueObject) {
					Constants obj = map.get(valueObject);
					if (obj == null) {
						obj = (Constants) GWT.create((Class<?>) valueObject);
						map.put((Class<?>) valueObject, obj);
					}
					return obj;
				}
			});
		}
	}
	
}

@@ -802,428 +802,8 @@
 %7D);%0A
-%09%09%09I18nConstantsFactory.INSTANCE.setDefalutFactory(new I_Invoker() %7B%0A%09%09%09%09private Map%3CClass%3C?%3E,Constants%3E map = new HashMap%3CClass%3C?%3E,Constants%3E();%0A%09%09%09%09%0A%09%09%09%09@Override%0A%09%09%09%09public Object invoke(Object valueObject) %7B%0A%09%09%09%09%09Constants obj = map.get(valueObject);%0A%09%09%09%09%09if (obj == null) %7B%0A%09%09%09%09%09%09obj = (Constants) GWT.create((Class%3C?%3E) valueObject);%0A%09%09%09%09%09%09map.put((Class%3C?%3E) valueObject, obj);%0A%09%09%09%09%09%7D%0A%09%09%09%09%09return obj;%0A%09%09%09%09%7D%0A%09%09%09%7D);%0A
 %09%09%7D%0A

fix for gwt compile