Program: 91666
Project: 91666
Buggy source:
/** 
 * Create contents of the wizard.
 * @param parent
 */
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NULL);
  setControl(container);
  container.setLayout(new GridLayout(1,false));
  Composite treeViewerContainer=new Composite(container,SWT.NULL);
  GridDataFactory.fillDefaults().grab(true,false).applyTo(treeViewerContainer);
  TreeColumnLayout treeColumnLayout=new TreeColumnLayout();
  treeViewerContainer.setLayout(treeColumnLayout);
  treeViewer=new TreeViewer(treeViewerContainer,SWT.BORDER | SWT.FULL_SELECTION);
  Tree tree=treeViewer.getTree();
  tree.setLinesVisible(true);
  tree.setHeaderVisible(true);
  tree.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  TreeViewerColumn treeViewerColumn=new TreeViewerColumn(treeViewer,SWT.NONE);
  TreeColumn trclmnNewColumn=treeViewerColumn.getColumn();
  trclmnNewColumn.setText(Messages.LifecycleMappingPage_mavenBuildColumnTitle);
  treeColumnLayout.setColumnData(trclmnNewColumn,new ColumnWeightData(65,150,true));
  TreeViewerColumn columnViewerAction=new TreeViewerColumn(treeViewer,SWT.NONE);
  TreeColumn columnAction=columnViewerAction.getColumn();
  treeColumnLayout.setColumnData(columnAction,new ColumnWeightData(35,true));
  columnAction.setText(Messages.LifecycleMappingPage_actionColumnTitle);
  columnViewerAction.setEditingSupport(new EditingSupport(treeViewer){
    @SuppressWarnings("String_Node_Str") @Override protected void setValue(    Object element,    Object value){
      if (element instanceof ILifecycleMappingLabelProvider) {
        ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
        int intVal=((Integer)value).intValue();
        List<IMavenDiscoveryProposal> all=mappingConfiguration.getProposals(prov.getKey());
        if (ignore.contains(element)) {
          ignore.remove(element);
        }
 else         if (ignoreAtDefinition.contains(element)) {
          ignoreAtDefinition.remove(element);
        }
 else         if (intVal == all.size() + NO_ACTION_IDX || shouldDeslectProposal(prov)) {
          IMavenDiscoveryProposal prop=mappingConfiguration.getSelectedProposal(prov.getKey());
          mappingConfiguration.removeSelectedProposal(prop);
        }
        if (intVal < all.size()) {
          IMavenDiscoveryProposal sel=all.get(intVal);
          if (sel != null) {
            mappingConfiguration.addSelectedProposal(sel);
          }
        }
 else {
switch (intVal - all.size()) {
case IGNORE_IDX:
            ignore.add(prov);
          break;
case IGNORE_PARENT_IDX:
        ignoreAtDefinition.add(prov);
    }
  }
  getViewer().refresh(true);
  updateErrorCount();
  getContainer().updateButtons();
}
}
@SuppressWarnings("String_Node_Str") @Override protected Object getValue(Object element){
if (element instanceof ILifecycleMappingLabelProvider) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
  IMavenDiscoveryProposal prop=mappingConfiguration.getSelectedProposal(prov.getKey());
  List<IMavenDiscoveryProposal> all=mappingConfiguration.getProposals(prov.getKey());
  if (ignore.contains(element)) {
    return Integer.valueOf(all.size() + IGNORE_IDX);
  }
 else   if (ignoreAtDefinition.contains(element)) {
    return Integer.valueOf(all.size() + IGNORE_PARENT_IDX);
  }
 else {
    int index=all.indexOf(prop);
    return index >= 0 ? Integer.valueOf(index) : Integer.valueOf(all.size() + NO_ACTION_IDX);
  }
}
return Integer.valueOf(0);
}
@SuppressWarnings("String_Node_Str") @Override protected CellEditor getCellEditor(Object element){
if (element instanceof ILifecycleMappingLabelProvider) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
  List<IMavenDiscoveryProposal> all=mappingConfiguration.getProposals(prov.getKey());
  List<String> values=new ArrayList<String>();
  for (  IMavenDiscoveryProposal prop : all) {
    values.add(NLS.bind(Messages.LifecycleMappingPage_installDescription,prop.toString()));
  }
  if (prov.isError(mappingConfiguration)) {
    values.add(Messages.LifecycleMappingPage_resolveLaterDescription);
  }
 else {
    values.add(EMPTY_STRING);
  }
  addIgnoreProposals(values,prov);
  ComboBoxCellEditor edit=new ComboBoxCellEditor(treeViewer.getTree(),values.toArray(new String[values.size()]));
  Control cont=edit.getControl();
  if (cont instanceof CCombo) {
    CCombo combo=(CCombo)cont;
    combo.setEditable(false);
  }
  return edit;
}
throw new IllegalStateException();
}
@SuppressWarnings("String_Node_Str") @Override protected boolean canEdit(Object element){
if (element instanceof AggregateMappingLabelProvider) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
  List<IMavenDiscoveryProposal> all=mappingConfiguration.getProposals(prov.getKey());
  return all != null && !all.isEmpty() || prov.getKey() instanceof MojoExecutionMappingRequirement;
}
return false;
}
}
);
treeViewer.setContentProvider(new ITreeContentProvider(){
public void dispose(){
}
public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
}
public Object[] getElements(Object inputElement){
if (inputElement instanceof LifecycleMappingDiscoveryRequest) {
  Map<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>> packagings=new HashMap<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>>();
  Map<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>> mojos=new HashMap<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>>();
  Map<IMavenProjectFacade,List<ILifecycleMappingRequirement>> projects=((LifecycleMappingDiscoveryRequest)inputElement).getProjects();
  for (  final Entry<IMavenProjectFacade,List<ILifecycleMappingRequirement>> entry : projects.entrySet()) {
    final String relPath=entry.getKey().getProject().getFile(IMavenConstants.POM_FILE_NAME).getFullPath().toPortableString();
    for (    final ILifecycleMappingRequirement requirement : entry.getValue()) {
      if (requirement != null) {
        List<ILifecycleMappingLabelProvider> val=mojos.get(requirement);
        if (val == null) {
          val=new ArrayList<ILifecycleMappingLabelProvider>();
          mojos.put(requirement,val);
        }
        val.add(new ILifecycleMappingLabelProvider(){
          public String getMavenText(){
            if (requirement instanceof MojoExecutionMappingRequirement) {
              String executionId=((MojoExecutionMappingRequirement)requirement).getExecutionId();
              if ("String_Node_Str".equals(executionId)) {
                return NLS.bind("String_Node_Str",relPath);
              }
              return NLS.bind("String_Node_Str",executionId,relPath);
            }
            return null;
          }
          public boolean isError(          LifecycleMappingDiscoveryRequest mappingConfiguration){
            return !mappingConfiguration.isRequirementSatisfied(getKey());
          }
          public ILifecycleMappingRequirement getKey(){
            return requirement;
          }
          @SuppressWarnings("String_Node_Str") public Collection<MavenProject> getProjects(){
            MavenProject mavenProject;
            try {
              mavenProject=entry.getKey().getMavenProject(new NullProgressMonitor());
              return Collections.singleton(mavenProject);
            }
 catch (            CoreException e) {
              LOG.error(e.getMessage(),e);
              throw new RuntimeException(e.getMessage(),e);
            }
          }
        }
);
      }
    }
  }
  List<ILifecycleMappingLabelProvider> toRet=new ArrayList<ILifecycleMappingLabelProvider>();
  for (  Map.Entry<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>> ent : packagings.entrySet()) {
    toRet.add(new AggregateMappingLabelProvider(ent.getKey(),ent.getValue()));
  }
  for (  Map.Entry<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>> ent : mojos.entrySet()) {
    toRet.add(new AggregateMappingLabelProvider(ent.getKey(),ent.getValue()));
  }
  return toRet.toArray();
}
return null;
}
public Object[] getChildren(Object parentElement){
if (parentElement instanceof AggregateMappingLabelProvider) {
  return ((AggregateMappingLabelProvider)parentElement).getChildren();
}
return new Object[0];
}
public Object getParent(Object element){
return null;
}
public boolean hasChildren(Object element){
Object[] children=getChildren(element);
return children != null && children.length > 0;
}
}
);
treeViewer.setLabelProvider(new ITableLabelProvider(){
public void removeListener(ILabelProviderListener listener){
}
public boolean isLabelProperty(Object element,String property){
return false;
}
public void dispose(){
}
public void addListener(ILabelProviderListener listener){
}
@SuppressWarnings("String_Node_Str") public String getColumnText(Object element,int columnIndex){
if (element instanceof ILifecycleMappingLabelProvider) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
  if (columnIndex == MAVEN_INFO_IDX) {
    String text=prov.getMavenText();
    if (prov instanceof AggregateMappingLabelProvider && !isHandled(prov)) {
      text=NLS.bind(Messages.LifecycleMappingPage_errorMavenBuild,new String[]{text,String.valueOf(((AggregateMappingLabelProvider)prov).getChildren().length)});
    }
    return text;
  }
 else   if (columnIndex == ACTION_INFO_IDX && element instanceof AggregateMappingLabelProvider) {
    IMavenDiscoveryProposal proposal=mappingConfiguration.getSelectedProposal(prov.getKey());
    if (ignore.contains(element)) {
      return Messages.LifecycleMappingPage_doNotExecutePom;
    }
 else     if (ignoreAtDefinition.contains(element)) {
      return Messages.LifecycleMappingPage_doNotExecuteParent;
    }
 else     if (proposal != null) {
      return NLS.bind(Messages.LifecycleMappingPage_installDescription,proposal.toString());
    }
 else     if (loading || !prov.isError(mappingConfiguration)) {
      return EMPTY_STRING;
    }
 else {
      return Messages.LifecycleMappingPage_resolveLaterDescription;
    }
  }
}
return null;
}
@SuppressWarnings("String_Node_Str") public Image getColumnImage(Object element,int columnIndex){
if (columnIndex != 0) {
  return null;
}
if (element instanceof AggregateMappingLabelProvider) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
  if (prov.isError(mappingConfiguration)) {
    if (!isHandled(prov)) {
      return MavenImages.IMG_ERROR;
    }
  }
  return MavenImages.IMG_PASSED;
}
return MavenImages.IMG_POM;
}
}
);
treeViewer.addSelectionChangedListener(new ISelectionChangedListener(){
@SuppressWarnings("String_Node_Str") public void selectionChanged(SelectionChangedEvent event){
if (event.getSelection() instanceof IStructuredSelection && ((IStructuredSelection)event.getSelection()).size() == 1) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)((IStructuredSelection)event.getSelection()).getFirstElement();
  if (ignore.contains(prov)) {
    details.setText(Messages.LifecycleMappingPage_doNotExecutePomDescription);
    license.setText(EMPTY_STRING);
  }
 else   if (ignoreAtDefinition.contains(prov)) {
    details.setText(Messages.LifecycleMappingPage_doNotExecuteParentDescription);
    license.setText(EMPTY_STRING);
  }
 else {
    IMavenDiscoveryProposal proposal=mappingConfiguration.getSelectedProposal(prov.getKey());
    details.setText(proposal != null ? proposal.getDescription() : mappingConfiguration.getProposals(prov.getKey()).isEmpty() ? NLS.bind(Messages.LifecycleMappingPage_noMarketplaceEntryDescription,prov.getMavenText()) : EMPTY_STRING);
    license.setText(proposal == null ? EMPTY_STRING : proposal.getLicense());
  }
}
 else {
  resetDetails();
}
}
}
);
treeViewer.setComparator(new ViewerComparator(){
public int compare(Viewer viewer,Object e1,Object e2){
if (!(e1 instanceof ILifecycleMappingLabelProvider && e2 instanceof ILifecycleMappingLabelProvider)) {
  return super.compare(viewer,e1,e2);
}
int cat1=category(e1);
int cat2=category(e2);
if (cat1 != cat2) {
  return cat1 - cat2;
}
return ((ILifecycleMappingLabelProvider)e1).getMavenText().compareTo(((ILifecycleMappingLabelProvider)e2).getMavenText());
}
}
);
Composite composite=new Composite(container,SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false,1,1));
composite.setLayout(new GridLayout(3,false));
errorCountLabel=new Label(composite,SWT.NONE);
errorCountLabel.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false,1,1));
Button btnNewButton_1=new Button(composite,SWT.NONE);
btnNewButton_1.addSelectionListener(new SelectionAdapter(){
@Override @SuppressWarnings("String_Node_Str") public void widgetSelected(SelectionEvent e){
mappingConfiguration.clearSelectedProposals();
ignore.clear();
ignoreAtDefinition.clear();
treeViewer.refresh();
getWizard().getContainer().updateButtons();
updateErrorCount();
}
}
);
btnNewButton_1.setText(Messages.LifecycleMappingPage_deselectAllButton);
autoSelectButton=new Button(composite,SWT.NONE);
autoSelectButton.addSelectionListener(new SelectionAdapter(){
@Override @SuppressWarnings("String_Node_Str") public void widgetSelected(SelectionEvent e){
resetDetails();
ignore.clear();
ignoreAtDefinition.clear();
discoverProposals();
}
}
);
autoSelectButton.setText(Messages.LifecycleMappingPage_autoSelectButton);
GC gc=new GC(container);
gc.setFont(JFaceResources.getDialogFont());
FontMetrics fontMetrics=gc.getFontMetrics();
gc.dispose();
Group grpDetails=new Group(container,SWT.NONE);
grpDetails.setLayout(new GridLayout(1,false));
grpDetails.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,1,1));
grpDetails.setText(Messages.LifecycleMappingPage_descriptionLabel);
details=new Text(grpDetails,SWT.WRAP | SWT.READ_ONLY | SWT.V_SCROLL);
GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
gd.heightHint=Dialog.convertHeightInCharsToPixels(fontMetrics,3);
gd.minimumHeight=Dialog.convertHeightInCharsToPixels(fontMetrics,1);
details.setLayoutData(gd);
Group grpLicense=new Group(container,SWT.NONE);
grpLicense.setLayout(new GridLayout(1,false));
grpLicense.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,1,1));
grpLicense.setText(Messages.LifecycleMappingPage_licenseLabel);
license=new Text(grpLicense,SWT.READ_ONLY);
gd=new GridData(SWT.FILL,SWT.FILL,true,true);
gd.heightHint=Dialog.convertHeightInCharsToPixels(fontMetrics,1);
gd.minimumHeight=Dialog.convertHeightInCharsToPixels(fontMetrics,1);
license.setLayoutData(gd);
}

Fixed version (ground truth):
/** 
 * Create contents of the wizard.
 * @param parent
 */
public void createControl(Composite parent){
  Composite container=new Composite(parent,SWT.NULL);
  setControl(container);
  container.setLayout(new GridLayout(1,false));
  Composite treeViewerContainer=new Composite(container,SWT.NULL);
  GridDataFactory.fillDefaults().grab(true,false).applyTo(treeViewerContainer);
  TreeColumnLayout treeColumnLayout=new TreeColumnLayout();
  treeViewerContainer.setLayout(treeColumnLayout);
  treeViewer=new TreeViewer(treeViewerContainer,SWT.BORDER | SWT.FULL_SELECTION);
  Tree tree=treeViewer.getTree();
  tree.setLinesVisible(true);
  tree.setHeaderVisible(true);
  tree.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true,1,1));
  TreeViewerColumn treeViewerColumn=new TreeViewerColumn(treeViewer,SWT.NONE);
  TreeColumn trclmnNewColumn=treeViewerColumn.getColumn();
  trclmnNewColumn.setText(Messages.LifecycleMappingPage_mavenBuildColumnTitle);
  treeColumnLayout.setColumnData(trclmnNewColumn,new ColumnWeightData(65,150,true));
  TreeViewerColumn columnViewerAction=new TreeViewerColumn(treeViewer,SWT.NONE);
  TreeColumn columnAction=columnViewerAction.getColumn();
  treeColumnLayout.setColumnData(columnAction,new ColumnWeightData(35,true));
  columnAction.setText(Messages.LifecycleMappingPage_actionColumnTitle);
  columnViewerAction.setEditingSupport(new EditingSupport(treeViewer){
    @SuppressWarnings("String_Node_Str") @Override protected void setValue(    Object element,    Object value){
      if (element instanceof ILifecycleMappingLabelProvider) {
        ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
        int intVal=((Integer)value).intValue();
        List<IMavenDiscoveryProposal> all=mappingConfiguration.getProposals(prov.getKey());
        if (ignore.contains(element)) {
          ignore.remove(element);
        }
 else         if (ignoreAtDefinition.contains(element)) {
          ignoreAtDefinition.remove(element);
        }
 else         if (intVal == all.size() + NO_ACTION_IDX || shouldDeslectProposal(prov)) {
          IMavenDiscoveryProposal prop=mappingConfiguration.getSelectedProposal(prov.getKey());
          mappingConfiguration.removeSelectedProposal(prop);
        }
        if (intVal < all.size()) {
          IMavenDiscoveryProposal sel=all.get(intVal);
          if (sel != null) {
            mappingConfiguration.addSelectedProposal(sel);
          }
        }
 else {
switch (intVal - all.size()) {
case IGNORE_IDX:
            ignore.add(prov);
          break;
case IGNORE_PARENT_IDX:
        ignoreAtDefinition.add(prov);
    }
  }
  getViewer().refresh(true);
  updateErrorCount();
  getContainer().updateButtons();
}
}
@SuppressWarnings("String_Node_Str") @Override protected Object getValue(Object element){
if (element instanceof ILifecycleMappingLabelProvider) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
  IMavenDiscoveryProposal prop=mappingConfiguration.getSelectedProposal(prov.getKey());
  List<IMavenDiscoveryProposal> all=mappingConfiguration.getProposals(prov.getKey());
  if (ignore.contains(element)) {
    return Integer.valueOf(all.size() + IGNORE_IDX);
  }
 else   if (ignoreAtDefinition.contains(element)) {
    return Integer.valueOf(all.size() + IGNORE_PARENT_IDX);
  }
 else {
    int index=all.indexOf(prop);
    return index >= 0 ? Integer.valueOf(index) : Integer.valueOf(all.size() + NO_ACTION_IDX);
  }
}
return Integer.valueOf(0);
}
@SuppressWarnings("String_Node_Str") @Override protected CellEditor getCellEditor(Object element){
if (element instanceof ILifecycleMappingLabelProvider) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
  List<IMavenDiscoveryProposal> all=mappingConfiguration.getProposals(prov.getKey());
  List<String> values=new ArrayList<String>();
  for (  IMavenDiscoveryProposal prop : all) {
    values.add(NLS.bind(Messages.LifecycleMappingPage_installDescription,prop.toString()));
  }
  if (prov.isError(mappingConfiguration)) {
    values.add(Messages.LifecycleMappingPage_resolveLaterDescription);
  }
 else {
    values.add(EMPTY_STRING);
  }
  addIgnoreProposals(values,prov);
  ComboBoxCellEditor edit=new ComboBoxCellEditor(treeViewer.getTree(),values.toArray(new String[values.size()]));
  Control cont=edit.getControl();
  if (cont instanceof CCombo) {
    CCombo combo=(CCombo)cont;
    combo.setEditable(false);
  }
  return edit;
}
throw new IllegalStateException();
}
@SuppressWarnings("String_Node_Str") @Override protected boolean canEdit(Object element){
if (element instanceof AggregateMappingLabelProvider) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
  List<IMavenDiscoveryProposal> all=mappingConfiguration.getProposals(prov.getKey());
  return all != null && !all.isEmpty() || prov.getKey() instanceof MojoExecutionMappingRequirement;
}
return false;
}
}
);
treeViewer.setContentProvider(new ITreeContentProvider(){
public void dispose(){
}
public void inputChanged(Viewer viewer,Object oldInput,Object newInput){
}
public Object[] getElements(Object inputElement){
if (inputElement instanceof LifecycleMappingDiscoveryRequest) {
  Map<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>> packagings=new HashMap<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>>();
  Map<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>> mojos=new HashMap<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>>();
  Map<IMavenProjectFacade,List<ILifecycleMappingRequirement>> projects=((LifecycleMappingDiscoveryRequest)inputElement).getProjects();
  for (  final Entry<IMavenProjectFacade,List<ILifecycleMappingRequirement>> entry : projects.entrySet()) {
    final String relPath=entry.getKey().getProject().getFile(IMavenConstants.POM_FILE_NAME).getFullPath().toPortableString();
    for (    final ILifecycleMappingRequirement requirement : entry.getValue()) {
      if (requirement != null) {
        List<ILifecycleMappingLabelProvider> val=mojos.get(requirement);
        if (val == null) {
          val=new ArrayList<ILifecycleMappingLabelProvider>();
          mojos.put(requirement,val);
        }
        val.add(new ILifecycleMappingLabelProvider(){
          public String getMavenText(){
            String executionId=null;
            if (requirement instanceof MojoExecutionMappingRequirement) {
              executionId=((MojoExecutionMappingRequirement)requirement).getExecutionId();
            }
 else             if (requirement instanceof ProjectConfiguratorMappingRequirement) {
              executionId=((ProjectConfiguratorMappingRequirement)requirement).getExecution().getExecutionId();
            }
            if (executionId != null) {
              if ("String_Node_Str".equals(executionId)) {
                return NLS.bind("String_Node_Str",relPath);
              }
              return NLS.bind("String_Node_Str",executionId,relPath);
            }
            return null;
          }
          public boolean isError(          LifecycleMappingDiscoveryRequest mappingConfiguration){
            return !mappingConfiguration.isRequirementSatisfied(getKey());
          }
          public ILifecycleMappingRequirement getKey(){
            return requirement;
          }
          @SuppressWarnings("String_Node_Str") public Collection<MavenProject> getProjects(){
            MavenProject mavenProject;
            try {
              mavenProject=entry.getKey().getMavenProject(new NullProgressMonitor());
              return Collections.singleton(mavenProject);
            }
 catch (            CoreException e) {
              LOG.error(e.getMessage(),e);
              throw new RuntimeException(e.getMessage(),e);
            }
          }
        }
);
      }
    }
  }
  List<ILifecycleMappingLabelProvider> toRet=new ArrayList<ILifecycleMappingLabelProvider>();
  for (  Map.Entry<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>> ent : packagings.entrySet()) {
    toRet.add(new AggregateMappingLabelProvider(ent.getKey(),ent.getValue()));
  }
  for (  Map.Entry<ILifecycleMappingRequirement,List<ILifecycleMappingLabelProvider>> ent : mojos.entrySet()) {
    toRet.add(new AggregateMappingLabelProvider(ent.getKey(),ent.getValue()));
  }
  return toRet.toArray();
}
return null;
}
public Object[] getChildren(Object parentElement){
if (parentElement instanceof AggregateMappingLabelProvider) {
  return ((AggregateMappingLabelProvider)parentElement).getChildren();
}
return new Object[0];
}
public Object getParent(Object element){
return null;
}
public boolean hasChildren(Object element){
Object[] children=getChildren(element);
return children != null && children.length > 0;
}
}
);
treeViewer.setLabelProvider(new ITableLabelProvider(){
public void removeListener(ILabelProviderListener listener){
}
public boolean isLabelProperty(Object element,String property){
return false;
}
public void dispose(){
}
public void addListener(ILabelProviderListener listener){
}
@SuppressWarnings("String_Node_Str") public String getColumnText(Object element,int columnIndex){
if (element instanceof ILifecycleMappingLabelProvider) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
  if (columnIndex == MAVEN_INFO_IDX) {
    String text=prov.getMavenText();
    if (prov instanceof AggregateMappingLabelProvider && !isHandled(prov)) {
      text=NLS.bind(Messages.LifecycleMappingPage_errorMavenBuild,new String[]{text,String.valueOf(((AggregateMappingLabelProvider)prov).getChildren().length)});
    }
    return text;
  }
 else   if (columnIndex == ACTION_INFO_IDX && element instanceof AggregateMappingLabelProvider) {
    IMavenDiscoveryProposal proposal=mappingConfiguration.getSelectedProposal(prov.getKey());
    if (ignore.contains(element)) {
      return Messages.LifecycleMappingPage_doNotExecutePom;
    }
 else     if (ignoreAtDefinition.contains(element)) {
      return Messages.LifecycleMappingPage_doNotExecuteParent;
    }
 else     if (proposal != null) {
      return NLS.bind(Messages.LifecycleMappingPage_installDescription,proposal.toString());
    }
 else     if (loading || !prov.isError(mappingConfiguration)) {
      return EMPTY_STRING;
    }
 else {
      return Messages.LifecycleMappingPage_resolveLaterDescription;
    }
  }
}
return null;
}
@SuppressWarnings("String_Node_Str") public Image getColumnImage(Object element,int columnIndex){
if (columnIndex != 0) {
  return null;
}
if (element instanceof AggregateMappingLabelProvider) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)element;
  if (prov.isError(mappingConfiguration)) {
    if (!isHandled(prov)) {
      return MavenImages.IMG_ERROR;
    }
  }
  return MavenImages.IMG_PASSED;
}
return MavenImages.IMG_POM;
}
}
);
treeViewer.addSelectionChangedListener(new ISelectionChangedListener(){
@SuppressWarnings("String_Node_Str") public void selectionChanged(SelectionChangedEvent event){
if (event.getSelection() instanceof IStructuredSelection && ((IStructuredSelection)event.getSelection()).size() == 1) {
  ILifecycleMappingLabelProvider prov=(ILifecycleMappingLabelProvider)((IStructuredSelection)event.getSelection()).getFirstElement();
  if (ignore.contains(prov)) {
    details.setText(Messages.LifecycleMappingPage_doNotExecutePomDescription);
    license.setText(EMPTY_STRING);
  }
 else   if (ignoreAtDefinition.contains(prov)) {
    details.setText(Messages.LifecycleMappingPage_doNotExecuteParentDescription);
    license.setText(EMPTY_STRING);
  }
 else {
    IMavenDiscoveryProposal proposal=mappingConfiguration.getSelectedProposal(prov.getKey());
    details.setText(proposal != null ? proposal.getDescription() : mappingConfiguration.getProposals(prov.getKey()).isEmpty() ? NLS.bind(Messages.LifecycleMappingPage_noMarketplaceEntryDescription,prov.getMavenText()) : EMPTY_STRING);
    license.setText(proposal == null ? EMPTY_STRING : proposal.getLicense());
  }
}
 else {
  resetDetails();
}
}
}
);
treeViewer.setComparator(new ViewerComparator(){
public int compare(Viewer viewer,Object e1,Object e2){
if (!(e1 instanceof ILifecycleMappingLabelProvider && e2 instanceof ILifecycleMappingLabelProvider)) {
  return super.compare(viewer,e1,e2);
}
int cat1=category(e1);
int cat2=category(e2);
if (cat1 != cat2) {
  return cat1 - cat2;
}
return ((ILifecycleMappingLabelProvider)e1).getMavenText().compareTo(((ILifecycleMappingLabelProvider)e2).getMavenText());
}
}
);
Composite composite=new Composite(container,SWT.NONE);
composite.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false,1,1));
composite.setLayout(new GridLayout(3,false));
errorCountLabel=new Label(composite,SWT.NONE);
errorCountLabel.setLayoutData(new GridData(SWT.FILL,SWT.CENTER,true,false,1,1));
Button btnNewButton_1=new Button(composite,SWT.NONE);
btnNewButton_1.addSelectionListener(new SelectionAdapter(){
@Override @SuppressWarnings("String_Node_Str") public void widgetSelected(SelectionEvent e){
mappingConfiguration.clearSelectedProposals();
ignore.clear();
ignoreAtDefinition.clear();
treeViewer.refresh();
getWizard().getContainer().updateButtons();
updateErrorCount();
}
}
);
btnNewButton_1.setText(Messages.LifecycleMappingPage_deselectAllButton);
autoSelectButton=new Button(composite,SWT.NONE);
autoSelectButton.addSelectionListener(new SelectionAdapter(){
@Override @SuppressWarnings("String_Node_Str") public void widgetSelected(SelectionEvent e){
resetDetails();
ignore.clear();
ignoreAtDefinition.clear();
discoverProposals();
}
}
);
autoSelectButton.setText(Messages.LifecycleMappingPage_autoSelectButton);
GC gc=new GC(container);
gc.setFont(JFaceResources.getDialogFont());
FontMetrics fontMetrics=gc.getFontMetrics();
gc.dispose();
Group grpDetails=new Group(container,SWT.NONE);
grpDetails.setLayout(new GridLayout(1,false));
grpDetails.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,1,1));
grpDetails.setText(Messages.LifecycleMappingPage_descriptionLabel);
details=new Text(grpDetails,SWT.WRAP | SWT.READ_ONLY | SWT.V_SCROLL);
GridData gd=new GridData(SWT.FILL,SWT.FILL,true,true);
gd.heightHint=Dialog.convertHeightInCharsToPixels(fontMetrics,3);
gd.minimumHeight=Dialog.convertHeightInCharsToPixels(fontMetrics,1);
details.setLayoutData(gd);
Group grpLicense=new Group(container,SWT.NONE);
grpLicense.setLayout(new GridLayout(1,false));
grpLicense.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,false,1,1));
grpLicense.setText(Messages.LifecycleMappingPage_licenseLabel);
license=new Text(grpLicense,SWT.READ_ONLY);
gd=new GridData(SWT.FILL,SWT.FILL,true,true);
gd.heightHint=Dialog.convertHeightInCharsToPixels(fontMetrics,1);
gd.minimumHeight=Dialog.convertHeightInCharsToPixels(fontMetrics,1);
license.setLayoutData(gd);
}