How to put userdefined code into generated classes

It is possible to put userdefined field and method definitions into the generated classes (for WebForms and WebPanels). This will usually be needed when event handling code gets larger and is to be extracted into separate methods (although in most cases it would probably be better style to extract it to commands).

As W4T Eclipse re-writes the code on every significant change in any property of the widgets on the form or panel, the user-defined code must be especially marked, to tell the plugin to leave it untouched.

This is done by including it into special tags, like this:


      //$userdefined_start
      private int someField = 5;
      
      protected void someMethod( String param ) {
        // whatever code here ...
      }
      //$userdefined_end
      

Note that there has to be at most one of these user-defined code blocks per class.


Copyright (c) 2003 by Innoopract Informationssysteme GmbH. All rights reserved.