views:

24

answers:

1

I would like to modify an already existing wizard in eclipse. My plan is to copy the existing wizard plugin to a new plugin an make the changes there. But how do I enable this modified wizard in eclipse?

I know how to create a local P2 update site but how do I make sure that the original wizard is replaced with the updated version?

+1  A: 

This isn't an easy question, as Eclipse does not support changing existing wizards (and on global, Eclipse is built for adding features instead of replacing them).

Some ideas you could consider: you can define a new wizard, that can reuse existing pages, and simply add a new wizard, that does your trick, while the original one would stay.

How to install it: if you have a new wizard in a new plug-in, simply use the export wizard (Right click/Export), and there select the Deployable plug-ins and fragments wizard from the Plug-in development category. On the next page select the install into host feature, and the plug-in will be installed.

If you insist on replacing the plug-in (that is not the nice way), you could copy the entire existing plug-in, increase its version number and make your changes, then install this plug-in from an update site (or using the Eclipse wizard). Caveats: if the original plug-in is updated, yours have to be as well, and if both plug-ins have the same version, quite nice conflicts can be seen, that are quite hard to handle.

Zoltán Ujhelyi
Thanks for the input! Currently I just create a new plugin which adds a new New File Wizard. But it could be nice to modify the "parent" wizard (which shows all the possible New File wizards) to only show selected number of wizards specified in the code - but I guess this gives the same problem. Alternatively I am considering this: http://wiki.eclipse.org/Steps_to_use_Fragments_to_patch_a_plug-in
tul
Fragments only work, if the original plug-in was developed in a way to support fragments (see the second part where the host's manifest should be modified in the wiki). If you can modify the manifest, you have other ways to make differences in the code. E.g. add an option to the existing wizard to add new pages into it (e.g. using extension point, etc.)
Zoltán Ujhelyi