Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1784 Rev 1802
1
package org.tela_botanica.client;
1
package org.tela_botanica.client;
2
 
2
 
3
import com.extjs.gxt.ui.client.GXT;
3
import com.extjs.gxt.ui.client.GXT;
4
import com.google.gwt.core.client.EntryPoint;
4
import com.google.gwt.core.client.EntryPoint;
5
import com.google.gwt.core.client.GWT;
5
import com.google.gwt.core.client.GWT;
6
import com.google.gwt.user.client.Window;
6
import com.google.gwt.user.client.Window;
7
 
7
 
8
public class Coel implements EntryPoint {
8
public class Coel implements EntryPoint {
9
 
9
 
10
	public void onModuleLoad() {
10
	public void onModuleLoad() {
11
		
11
		
12
		// A décommenter + compiler en detailed dans le cas d'une erreur
12
		// A décommenter + compiler en detailed dans le cas d'une erreur
13
		// survernant uniquement sur le serveur
13
		// survernant uniquement sur le serveur
14
		/*GWT.setUncaughtExceptionHandler(null);
14
		/*GWT.setUncaughtExceptionHandler(null);
15
		GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {	
15
		GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {	
16
			@Override
16
			@Override
17
			public void onUncaughtException(Throwable e) {
17
			public void onUncaughtException(Throwable e) {
18
					Window.alert("uncaught: " + e.getMessage());
18
					Window.alert("uncaught: " + e.getMessage());
19
					String s = buildStackTrace(e, "RuntimeException:\n");
19
					String s = buildStackTrace(e, "RuntimeException:\n");
20
					Window.alert(s);
20
					Window.alert(s);
21
					e.printStackTrace();
21
					e.printStackTrace();
22
			}
22
			}
23
		});*/
23
		});*/
24
		
24
		
25
		// Fermeture du panneau de chargement de l'appli
25
		// Fermeture du panneau de chargement de l'appli
26
		GXT.hideLoadingPanel("loading");
26
		GXT.hideLoadingPanel("loading");
27
		
27
		
28
		// Création du médiateur
28
		// Création du médiateur
29
		new Mediateur();
29
		new Mediateur();
30
		
30
		
31
		// Si activation du mode débug
31
		// Si activation du mode débug
32
		if (Mediateur.DEBUG) {
32
		if (Mediateur.DEBUG) {
33
			System.out.println("");
33
			System.out.println("");
34
			System.out.println("-------------------------------------------------------------------");
34
			System.out.println("-------------------------------------------------------------------");
35
			System.out.println("");
35
			System.out.println("");
36
		}
36
		}
37
	}
37
	}
38
	
38
	
39
	private String buildStackTrace(Throwable t, String log) {
39
	/*private String buildStackTrace(Throwable t, String log) {
40
	    if (t != null) {
40
	    if (t != null) {
41
		     log += t.getClass().toString();
41
		     log += t.getClass().toString();
42
		     log += t.getMessage();
42
		     log += t.getMessage();
43
		     //
43
		     //
44
		     StackTraceElement[] stackTrace = t.getStackTrace();
44
		     StackTraceElement[] stackTrace = t.getStackTrace();
45
		     if (stackTrace != null) {
45
		     if (stackTrace != null) {
46
		    	 StringBuffer trace = new StringBuffer();
46
		    	 StringBuffer trace = new StringBuffer();
47
		    
47
		    
48
			     for (int i = 0; i < stackTrace.length; i++) {
48
			     for (int i = 0; i < stackTrace.length; i++) {
49
			    	 trace.append(stackTrace[i].getClassName() + "." + stackTrace[i].getMethodName() + "("
49
			    	 trace.append(stackTrace[i].getClassName() + "." + stackTrace[i].getMethodName() + "("
50
			    			 + stackTrace[i].getFileName() + ":" + stackTrace[i].getLineNumber());
50
			    			 + stackTrace[i].getFileName() + ":" + stackTrace[i].getLineNumber());
51
			     }
51
			     }
52
		    
52
		    
53
			     log += trace.toString();
53
			     log += trace.toString();
54
		     }
54
		     }
55
		     //
55
		     //
56
		     Throwable cause = t.getCause();
56
		     Throwable cause = t.getCause();
57
		     if (cause != null && cause != t) {
57
		     if (cause != null && cause != t) {
58
		    	 log += buildStackTrace(cause, "CausedBy:\n");
58
		    	 log += buildStackTrace(cause, "CausedBy:\n");
59
		     }
59
		     }
60
	    }
60
	    }
61
	    return log;
61
	    return log;
62
	}
62
	}*/
63
 
63
 
64
	public static native void  LogVersFirebug(String s) /*-{
64
	public static native void  LogVersFirebug(Object o) /*-{
65
		if (!!($wnd.console && $wnd.console.log)) {
65
		if (!!($wnd.console && $wnd.console.log)) {
66
			console.log(s);
66
			console.log(o);
67
		}
67
		}
68
	}-*/;
68
	}-*/;
69
}
69
}