Subversion Repositories eFlore/Applications.del

Rev

Rev 2087 | Blame | Compare with Previous | Last modification | View Log | RSS feed

package org.tela_botanica.del.client;

import org.tela_botanica.del.client.cache.CacheClient;
import org.tela_botanica.del.client.gestionhistorique.GestionnaireHistorique;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.History;
import com.google.web.bindery.event.shared.UmbrellaException;
import com.google.gwt.core.client.*;
import com.google.gwt.user.client.Window;

public class Del implements EntryPoint {
        
        @Override
        public void onModuleLoad() {
                
            /*GWT.setUncaughtExceptionHandler(new   
                        GWT.UncaughtExceptionHandler() {  
                public void onUncaughtException(Throwable e) {  
                        Throwable unwrapped = unwrap(e);  
                        Window.alert(buildStackTrace(unwrapped, ""));
                }    
    
                public Throwable unwrap(Throwable e) {   
                        if(e instanceof UmbrellaException) {   
                                UmbrellaException ue = (UmbrellaException) e;  
                                if(ue.getCauses().size() == 1) {   
                                        return unwrap(ue.getCauses().iterator().next());  
                                }  
                        }  
                        return e;  
                }  
            });*/

                CacheClient.getInstance().initialiserAvecParametres();
                History.addValueChangeHandler(new GestionnaireHistorique());
                History.fireCurrentHistoryState();
        }
        
        /*private String buildStackTrace(Throwable t, String log) {
                if (t != null) {
                        log += t.getClass().toString();
                        log += t.getMessage();
                        
                        StackTraceElement[] stackTrace = t.getStackTrace();
                        if (stackTrace != null) {
                                StringBuffer trace = new StringBuffer();

                                for (int i = 0; i < stackTrace.length; i++) {
                                        trace.append(stackTrace[i].getClassName() + "." + stackTrace[i].getMethodName() + "("
                                                + stackTrace[i].getFileName() + ":" + stackTrace[i].getLineNumber());
                                }

                                log += trace.toString();
                        }

                        Throwable cause = t.getCause();
                        if (cause != null && cause != t) {
                                log += buildStackTrace(cause, "CausedBy:\n");
                        }
                }
                return log;
        }*/

        public static native void  LogVersFirebug(Object o) /*-{
                if (!!($wnd.console && $wnd.console.log)) {
                        console.log(o);
                }
        }-*/;
}