public MavenDependenciesWizardPage() {
   this(
       null,
       Messages.getString("wizard.project.page.dependencies.title"), //
       Messages.getString("wizard.project.page.dependencies.description"));
 }
  private void createArtifacts(Composite composite) {
    Label mavenArtifactsLabel = new Label(composite, SWT.NONE);
    mavenArtifactsLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
    mavenArtifactsLabel.setText("Maven Artifacts:");

    dependencyViewer =
        new TableViewer(composite, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
    dependencyViewer.getTable().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 2));
    dependencyViewer.setUseHashlookup(true);
    dependencyViewer.setLabelProvider(new ArtifactLabelProvider());
    dependencyViewer.setSorter(new DependencySorter());
    dependencyViewer.add(dependencies);

    Button addDependencyButton = new Button(composite, SWT.PUSH);
    GridData gd_addDependencyButton = new GridData(SWT.FILL, SWT.TOP, false, false);
    addDependencyButton.setLayoutData(gd_addDependencyButton);
    addDependencyButton.setText(Messages.getString("wizard.project.page.dependencies.add"));

    addDependencyButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            MavenRepositorySearchDialog dialog =
                new MavenRepositorySearchDialog(
                    getShell(), //
                    "Add Dependency",
                    IIndex.SEARCH_ARTIFACT,
                    Collections.<ArtifactKey>emptySet(),
                    showScope);
            if (dialog.open() == Window.OK) {
              Object result = dialog.getFirstResult();
              if (result instanceof IndexedArtifactFile) {
                Dependency dependency = ((IndexedArtifactFile) result).getDependency();
                dependency.setScope(dialog.getSelectedScope());
                dependencyViewer.add(dependency);
                notifyListeners();
              } else if (result instanceof IndexedArtifact) {
                // If we have an ArtifactInfo, we add the first FileInfo it contains
                // which corresponds to the latest version of the artifact.
                Set<IndexedArtifactFile> files = ((IndexedArtifact) result).getFiles();
                if (files != null && !files.isEmpty()) {
                  dependencyViewer.add(files.iterator().next().getDependency());
                  notifyListeners();
                }
              }
            }
          }
        });

    final Button removeDependencyButton = new Button(composite, SWT.PUSH);
    removeDependencyButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true));
    removeDependencyButton.setText(Messages.getString("wizard.project.page.dependencies.remove"));
    removeDependencyButton.setEnabled(false);

    removeDependencyButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            IStructuredSelection selection = (IStructuredSelection) dependencyViewer.getSelection();
            if (selection != null) {
              dependencyViewer.remove(selection.toArray());
              notifyListeners();
            }
          }
        });

    dependencyViewer.addSelectionChangedListener(
        new ISelectionChangedListener() {
          public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            removeDependencyButton.setEnabled(selection.size() > 0);
          }
        });
  }