Subversion Repositories eFlore/Applications.del

Rev

Rev 2087 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2087 Rev 2109
1
package org.tela_botanica.del.client;
1
package org.tela_botanica.del.client;
2
 
2
 
3
import org.tela_botanica.del.client.cache.CacheClient;
3
import org.tela_botanica.del.client.cache.CacheClient;
4
import org.tela_botanica.del.client.gestionhistorique.GestionnaireHistorique;
4
import org.tela_botanica.del.client.gestionhistorique.GestionnaireHistorique;
-
 
5
import org.tela_botanica.del.client.config.Config;
5
 
6
 
6
import com.google.gwt.core.client.EntryPoint;
7
import com.google.gwt.core.client.EntryPoint;
7
import com.google.gwt.user.client.History;
8
import com.google.gwt.user.client.History;
8
import com.google.web.bindery.event.shared.UmbrellaException;
-
 
9
import com.google.gwt.core.client.*;
9
import com.google.gwt.core.client.*;
10
import com.google.gwt.user.client.Window;
-
 
11
 
10
 
12
public class Del implements EntryPoint {
11
public class Del implements EntryPoint {
13
	
12
	
14
	@Override
13
	@Override
15
	public void onModuleLoad() {
14
	public void onModuleLoad() {
16
		
15
		
17
	    /*GWT.setUncaughtExceptionHandler(new   
16
	    /*GWT.setUncaughtExceptionHandler(new   
18
	    		GWT.UncaughtExceptionHandler() {  
17
	    		GWT.UncaughtExceptionHandler() {  
19
	    	public void onUncaughtException(Throwable e) {  
18
	    	public void onUncaughtException(Throwable e) {  
20
	    		Throwable unwrapped = unwrap(e);  
19
	    		Throwable unwrapped = unwrap(e);  
21
	    		Window.alert(buildStackTrace(unwrapped, ""));
20
	    		Window.alert(buildStackTrace(unwrapped, ""));
22
	    	}    
21
	    	}    
23
    
22
    
24
	    	public Throwable unwrap(Throwable e) {   
23
	    	public Throwable unwrap(Throwable e) {   
25
	    		if(e instanceof UmbrellaException) {   
24
	    		if(e instanceof UmbrellaException) {   
26
	    			UmbrellaException ue = (UmbrellaException) e;  
25
	    			UmbrellaException ue = (UmbrellaException) e;  
27
	    			if(ue.getCauses().size() == 1) {   
26
	    			if(ue.getCauses().size() == 1) {   
28
	    				return unwrap(ue.getCauses().iterator().next());  
27
	    				return unwrap(ue.getCauses().iterator().next());  
29
	    			}  
28
	    			}  
30
	    		}  
29
	    		}  
31
	    		return e;  
30
	    		return e;  
32
	    	}  
31
	    	}  
33
	    });*/
32
	    });*/
34
 
33
 
35
		CacheClient.getInstance().initialiserAvecParametres();
34
		CacheClient.getInstance().initialiserAvecParametres();
36
		History.addValueChangeHandler(new GestionnaireHistorique());
35
		History.addValueChangeHandler(new GestionnaireHistorique());
37
		History.fireCurrentHistoryState();
36
		History.fireCurrentHistoryState();
38
	}
37
	}
39
	
38
	
40
	/*private String buildStackTrace(Throwable t, String log) {
39
	/*private String buildStackTrace(Throwable t, String log) {
41
		if (t != null) {
40
		if (t != null) {
42
			log += t.getClass().toString();
41
			log += t.getClass().toString();
43
			log += t.getMessage();
42
			log += t.getMessage();
44
			
43
			
45
			StackTraceElement[] stackTrace = t.getStackTrace();
44
			StackTraceElement[] stackTrace = t.getStackTrace();
46
			if (stackTrace != null) {
45
			if (stackTrace != null) {
47
				StringBuffer trace = new StringBuffer();
46
				StringBuffer trace = new StringBuffer();
48
 
47
 
49
				for (int i = 0; i < stackTrace.length; i++) {
48
				for (int i = 0; i < stackTrace.length; i++) {
50
					trace.append(stackTrace[i].getClassName() + "." + stackTrace[i].getMethodName() + "("
49
					trace.append(stackTrace[i].getClassName() + "." + stackTrace[i].getMethodName() + "("
51
						+ stackTrace[i].getFileName() + ":" + stackTrace[i].getLineNumber());
50
						+ stackTrace[i].getFileName() + ":" + stackTrace[i].getLineNumber());
52
				}
51
				}
53
 
52
 
54
				log += trace.toString();
53
				log += trace.toString();
55
			}
54
			}
56
 
55
 
57
			Throwable cause = t.getCause();
56
			Throwable cause = t.getCause();
58
			if (cause != null && cause != t) {
57
			if (cause != null && cause != t) {
59
				log += buildStackTrace(cause, "CausedBy:\n");
58
				log += buildStackTrace(cause, "CausedBy:\n");
60
			}
59
			}
61
		}
60
		}
62
		return log;
61
		return log;
63
	}*/
62
	}*/
64
 
63
 
65
	public static native void  LogVersFirebug(Object o) /*-{
64
	public static native void  LogVersFirebug(Object o) /*-{
66
		if (!!($wnd.console && $wnd.console.log)) {
65
		if (!!($wnd.console && $wnd.console.log)) {
67
			console.log(o);
66
			console.log(o);
68
		}
67
		}
69
	}-*/;
68
	}-*/;
70
}
69
}