Community
Participate
Working Groups
wtp-sdk-I200511111814 I have in some projects disabled the validation builder, and a new instance of the validation builder got added and enabled (not sure when or how). I am also unable to click the Remove button to remove the excess builders or the new enabled one, due to the Remove button being inactive/greyed out. When I click the checkbox to enable a builder. I would guess the problem is the way in which builders are retained when they are disabled, a simple lookup of the name is not possible anymore. Maybe a new enabled/disable element should be added to the <buildCommand> rather than pushing the builder config to ExternalToolBuilder. I think an API method should be available for looking up if a specific builder is already set on the project, no matter if it has been enabled or disabled. This might be something WTP uses on top of org.eclipse.jem that understands how to lookup a disabled builder. Currently the API method org.eclipse.jem.util.emf.workbench.ProjectUtilities#hasBuilder() exists which components are using to find out if their builder is already setup on the project. This does not detect the case where the builder exists but disabled due to the renaming into ExternalToolBuilder. So the builder adds another instance to the builder, which is now enabled, then things start to go wrong with the properties page handling. I dont think this problem only affect validationBuilder but all builders. This is how a enabled builder looks in the .project config: <buildCommand> <name>org.eclipse.wst.validation.validationbuilder</name> <arguments> </arguments> </buildCommand> This is how a disabled builder looks in the .project config: <buildCommand> <name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> <triggers>full,incremental,</triggers> <arguments> <dictionary> <key>LaunchConfigHandle</key> <value><project>/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch</value> </dictionary> </arguments> </buildCommand>
This really isn't that complicated. * Take a lock on the per-project builder list (if necessary) * Iterate over the list of existing builders (to check to see if the current builder is already in the list) * If it is remove it from the list * Now add the current builder again (at the end of the list presumably) I'm saying it should be Eclipse API to provide some basic safe guards to probably invalid usage and that adding the same builder twice is invalid.