Wednesday, March 23, 2011

Inheriting GWT modules from other Eclipse projects

What if you already have some Eclipse GWT project in the workspace and you want to use it in your current GWT project? Here are the steps (assuming obt2j is the name of the project you want to use and obt is the name of the package where the module you want to inherit from (Obt2) resides).

1. Select your current GWT project in Package Explorer. Go to Properties -> Java Build Path -> Projects, Add..., select obt2j, OK. Select Libraries, Add Class Folder..., select obt2j/src/obt. OK.

2. In a source file from your current project, make a reference to the code owned by module obt. You will see errors, and 1 quick fix will be available:

    Import GWT module obt.Obt2

Apply the fix ONLY ONCE. The following line,

<inherits name="obt.Obt2"/>

, is being added to the corresponding module definition in your current project. Now your current project is hooked to project obt2j.

No comments:

Post a Comment