Have a piece of code that you want to run only when running in Hosted Mode? I made a small utility class that uses one method exposed in the Google Web Toolkit API to do just that.
import com.google.gwt.core.client.GWT;
/**
* Utility Class to help write debugging code
* References to these function could be searched for and removed when deploying to production for increased speed.
* @author Jason Lambert
*
*/
public class Development {
public static boolean isDevelopmentEnvironment() { return !GWT.isScript(); } //detect hosted mode
}
Inspired by how Grails handles development, test and production environments, I made this quick static utility function.
GWT.isScript detects if the current environment is running in compiled byte code or not. useful for switching to download local resources when perhaps same origin policy (SOP) prevents your code from downloading data from external databases or servers.
Showing posts with label GWT. Show all posts
Showing posts with label GWT. Show all posts
Monday, March 26, 2012
Friday, August 12, 2011
Generating class diagrams from Eclipse projects
A zoomed out view of my class structure - using subclasses of standard packages prevents some connections from being detected. |
I was looking to jump back into a project I had started a while ago in Eclipse. A GWT project for viewing resources from our website, and the class structure had totally evaded me. So I wanted to generate a UML class diagram quickly to get back up to speed and remind myself of what everything did.
I recommend ESS-Model if you ever encounter the same situation. Its free and fast. No bothersome purchase orders to fill out!
Subscribe to:
Posts (Atom)