Community
Participate
Working Groups
Currently contributors to the New Visual Class wizard provide a class whose only purpose is to provide the location of the template. The whole contribution mechanism should be restructured so that : (1) The icon, text and location of the template for a particular style should be provided in the plugin.xml itself. With this the wizard doesnt have to load plugins just because their entry shows up in the tree. (2) Optionally the styles could contribute a 'StyleHelper' class, which will allow the style do more than just provide content: (a) It should be allowed to validate whether a particular style can be generated into a particular project. Ex: it doesnt make sense to generate RCP Views into a regular non-plugin Java Project. Hence there should be an API on the contributor to say 'boolean validate(ISelection)' which will return whether this style is applicable to the passed in workspace resource selection. (b)It should be allowed to make necessary changes to the project so that necessary libraries/JARs are added to the classpath. Ex: Creating an JFace class in a normal Java project should add the SWT container with JFace support. Hence an API 'boolean contribute(IProject)' should be provided to the contributor.
NewVisualClassWizardPage.handleFieldChanged does a check that really should be in the contributor instead. It does a check to see if the project is a PDE project, and if it is, does it have "org.eclipse.ui" in it. This was added as a kludge to be able to create SWT controls in PDE projects because since we currently can't update the PDE plugin.xml there was no way to make sure that SWT was in the classpath. This should of been done through the contributor instead. This is not the proper place for it. It should be removed from here.