Packaging wiewpoint without generating new code

Hi,

I have created un view point where I changed some part of code manually and I would like to package my viewpoint without generating new code anymore like in figure 1.

I tried to diseable some part of generation in conf file (see figure) but even this doesn’t work, codes are still generated.

image

Kind Regards,

Valery

@ValeryTEGUIAK The generated viewpoint will always try to overwrite Java code and/or models. There are some ways to avoid this. First, as you have noticed, you can disable .ecore/.odesign overwriting by changing the conf file.

In order to avoid overwriting/regeneration of Java methods, you could:

  • Mark the method as “@generated NOT”:
/**
* This returns the label text for the adapted class.
*
* @generated NOT
*/
@Override
public String getText(Object object) {
   if (object instanceof Matchup) {
   EList games = ((Matchup) object).getGames();
   if (games != null) {
   return "Matchup, Games: " + games.size();
   }
   }
   return getString("_UI_Matchup_type");
}
  • Remove the “@generated” tag: any method in the file that doesn’t contain this tag will be left untouched whenever you regenerate it.

You can also have “both” the generated method and the custom implementation if you want. Simply remove the @generated tag from the method, and create another method with the same name but ending in “Gen” (so getName would be getNameGen), and add the @generated tag to it.

Hope this helps.