Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to determine if GWT code is running in development mode?

I'm working on a GWT application and would like to branch some logic based on whether the code is running in development mode or is live in production.

For example, when the code needs to make an AJAX call we would like to set the URL depending on mode.

like image 954
arrrghnold Avatar asked Aug 24 '10 00:08

arrrghnold


People also ask

How to run GWT project in Super Dev Mode?

Starting with GWT 2.7, Dev Mode launches Super Dev Mode automatically. Just start Dev Mode and reload the page, and it will recompile automatically when necessary.

What is GWT development mode?

development mode. Refers to running your application under a special GWT supplied browser. Development mode runs your application directly in Java so that you can use a Java IDE debugger to help test and debug your application. Google Plugin for Eclipse.

What is GWT CodeServer?

Using this Development Mode will start a code server that listens for requests from the browser to compile the application. When the CodeServer launches and moves the resources to the module directory. Then it adds a war/module/module. nocache.


1 Answers

GWT >= 2.1.0

boolean isDevelopmentMode() {
    return !GWT.isProdMode() && GWT.isClient();
}

GWT < 2.1.0

boolean isDevelopmentMode() {
    return !GWT.isScript() && GWT.isClient();
}
like image 118
Dean Povey Avatar answered Sep 23 '22 01:09

Dean Povey