Subversion Repositories eFlore/Applications.del

Rev

Rev 2078 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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