Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get GWT Super Dev Mode to work with IntelliJ

I had a lot of issues getting Super Dev mode to work with IntelliJ. This question, and my answer below, are to document how to do this, for anyone else who might come across this in future (and for my own reference):

like image 598
Ali Avatar asked May 24 '14 04:05

Ali


People also ask

How do I run GWT 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.

How to add gwt configuration in IntelliJ?

Select "Edit Configurations" from the "Run" menu. Press button to add a configuration. Select "GWT Configuration". Select the GWT module to be run.


1 Answers

1) Put the following lines in the module's .gwt.xml code:

<!-- Super Dev Mode Config: -->
  <add-linker name="xsiframe" />
  <set-configuration-property name="devModeRedirectEnabled" value="true" />
  <set-configuration-property name="gwt.superdevmode" value="on" />
  <set-property name="compiler.useSourceMaps" value="true"/>

2) Make two GWT run configurations in IntelliJ, one with Super Dev mode turned on, and the other with super dev mode off.

First config (Code Server): enter image description here

Second config (Dev mode):

enter image description here

3) Run the CodeServer run config. It will give an output such as:

The code server is ready.
Next, visit: http://localhost:9876/

Visit that URL. There will be a 'Dev mode on' button. Drag it to bookmarks bar. Then, click the name of the module on this page, browse its source code to locate the .nocache.js file.

4) Within the host page html, change the path to the existing nocache.js file to point to the nocache.js file whose link was copied in step 3. E.g:

<script type="text/javascript" language="javascript" src="http://localhost:9876/Touch/Touch.nocache.js"></script>

5) Now run the 2nd run config. It will go to the gwt dev mode url, with ?gwt= etc url arguments. Remove those url arguments, and refresh the page. You should now be able to see the host page. If the code server run config is already running, then GWT code might automatically run.

6) When any changes are made to the project, simply click the 'Dev mode on' bookmarklet that was added earlier. It will give the name of the module, and a compile button. Click the Compile button, and it will recompile the module (happens fairly quickly), and refresh the page.

7) The compile button can also be dragged to the bookmark bar, to skip the step of clicking the 'Dev mode on' bookmark.

EDIT: This answer is not complete and has some issues. If someone would like to correct it, please edit it. If anyone reviewers see edits on this answer, please approve them.

like image 122
Ali Avatar answered Sep 30 '22 10:09

Ali