@Override public void deconfigure() throws CoreException { IProjectDescription desc = getDescription(); List<ICommand> commands = Arrays.asList(desc.getBuildSpec()); for (ICommand i : commands) { if (!BigraphBuilder.BUILDER_ID.equals(i)) continue; (commands = new ArrayList<ICommand>(commands)).remove(i); desc.setBuildSpec(commands.toArray(EMPTY)); project.setDescription(desc, null); return; } }
@Override public void configure() throws CoreException { IProjectDescription desc = getDescription(); List<ICommand> commands = Arrays.asList(desc.getBuildSpec()); for (ICommand i : commands) if (BigraphBuilder.BUILDER_ID.equals(i.getBuilderName())) return; ICommand newCommand = desc.newCommand(); newCommand.setBuilderName(BigraphBuilder.BUILDER_ID); (commands = new ArrayList<ICommand>(commands)).add(newCommand); desc.setBuildSpec(commands.toArray(EMPTY)); project.setDescription(desc, null); }