[jbosstools-commits] JBoss Tools SVN: r43351 - in trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui: dialog and 3 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Fri Aug 31 08:46:42 EDT 2012


Author: fbricon
Date: 2012-08-31 08:46:42 -0400 (Fri, 31 Aug 2012)
New Revision: 43351

Added:
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/DeleteExistingJarsJob.java
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/ConversionUtils.java
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/EditDependencyDialog.java
Removed:
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/ConversionUtils.java
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/EditDependencyDialog.java
Modified:
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/Messages.java
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/ConvertToMavenDependencyWizard.java
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/DependencyConversionPreviewPage.java
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/IdentifyMavenDependencyPage.java
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/handlers/ConvertToMavenDependencyHandler.java
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/handlers/IdentifyJarJob.java
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/CellListener.java
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/ClasspathConversionParticipant.java
   trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/MavenDependencyConversionActivator.java
Log:
JBIDE-8973 : open dependency dialog on dbl-click, delete classpath entries

Modified: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/Messages.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/Messages.java	2012-08-31 12:43:17 UTC (rev 43350)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/Messages.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -1,5 +1,5 @@
 /*************************************************************************************
- * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * Copyright (c) 2012 Red Hat, Inc. and others.
  * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at

Deleted: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/ConversionUtils.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/ConversionUtils.java	2012-08-31 12:43:17 UTC (rev 43350)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/ConversionUtils.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *     IBM Corporation - initial API and implementation
- *     Theodora Yeung (tyeung at bea.com) - ensure that JarPackageFragmentRoot make it into cache
- *                                                           before its contents
- *                                                           (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=102422)
- *     Stephan Herrmann - Contribution for Bug 346010 - [model] strange initialization dependency in OptionTests
- *     Terry Parker <tparker at google.com> - DeltaProcessor misses state changes in archive files, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=357425
- *     Red Hat - copied code from {@link org.eclipse.jdt.internal.core.JavaModelManager.#getZipFile(IPath)} 
- *******************************************************************************/
-package org.jboss.tools.maven.conversion.ui.dialog;
-
-import java.io.File;
-import java.net.URI;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.internal.core.util.Messages;
-import org.eclipse.jdt.internal.core.util.Util;
-import org.jboss.tools.maven.conversion.ui.internal.MavenDependencyConversionActivator;
-
- at SuppressWarnings("restriction")
-public class ConversionUtils {
-	
-	
-	/**
-	 * Returns the underlying {@link File} from a {@link IClasspathEntry}.
-	 * <br/>
-	 * Part of the code comes from {@link org.eclipse.jdt.internal.core.JavaModelManager.#getZipFile(IPath)} 
-	 * @param cpe
-	 * @return
-	 * @throws CoreException
-	 */
-	public static File getFile(IClasspathEntry cpe) throws CoreException {
-		IPath path = cpe.getPath();
-		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
-		IResource file = root.findMember(path);
-		File localFile = null;
-		if (file != null) {
-			// internal resource
-			URI location;
-			if (file.getType() != IResource.FILE || (location = file.getLocationURI()) == null) {
-				throw new CoreException(new Status(IStatus.ERROR, MavenDependencyConversionActivator.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
-			}
-			localFile = Util.toLocalFile(location, null/*no progress availaible*/);
-			if (localFile == null)
-				throw new CoreException(new Status(IStatus.ERROR, MavenDependencyConversionActivator.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
-		} else {
-			// external resource -> it is ok to use toFile()
-			localFile= path.toFile();
-		}
-		return localFile;
-	}
-
-}

Modified: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/ConvertToMavenDependencyWizard.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/ConvertToMavenDependencyWizard.java	2012-08-31 12:43:17 UTC (rev 43350)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/ConvertToMavenDependencyWizard.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
 package org.jboss.tools.maven.conversion.ui.dialog;
 
 import java.util.List;
@@ -11,6 +21,7 @@
 public class ConvertToMavenDependencyWizard extends Wizard {
 
 	private IProject project;
+	
 	private Set<IClasspathEntry> entries;
 
 
@@ -42,8 +53,21 @@
 	@Override
 	public boolean performFinish() {
 		if (identificationPage != null) {
-			dependencies = identificationPage.getDependencies(); 
+			dependencies = identificationPage.getDependencies();
+			
+			if (identificationPage.isDeleteJars()) {
+				/* actually only delete classpath entries */
+				DeleteExistingJarsJob deleteJob = new DeleteExistingJarsJob(project, entries);
+				deleteJob.schedule();
+				try {
+					deleteJob.join();//wait for job to finish to prevent bad concurrency issues 
+				} catch (InterruptedException e) {
+					e.printStackTrace();
+					//ignore
+				}
+			}
 		}
+		
 		return true;
 	}
 

Added: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/DeleteExistingJarsJob.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/DeleteExistingJarsJob.java	                        (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/DeleteExistingJarsJob.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -0,0 +1,142 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.maven.conversion.ui.dialog;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.MultiStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.IClasspathContainer;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.jboss.tools.maven.conversion.ui.dialog.xpl.ConversionUtils;
+import org.jboss.tools.maven.core.MavenCoreActivator;
+
+public class DeleteExistingJarsJob extends Job {
+
+	private Set<IClasspathEntry> entries;
+
+	private IJavaProject javaProject;
+
+	public DeleteExistingJarsJob(IProject project, Set<IClasspathEntry> entries) {
+		super("Delete classpath entries"
+				+ ((project == null) ? "" : "for " + project.getName()));
+		this.javaProject = JavaCore.create(project);
+		this.entries = entries;
+	}
+
+	@Override
+	protected IStatus run(IProgressMonitor monitor) {
+		Set<IPath> pathsToRemove = new HashSet<IPath>();
+		Set<IFile> filesToRemove = new HashSet<IFile>();
+		try {
+
+			for (IClasspathEntry e : entries) {
+				collectDeletableEntries(e, pathsToRemove, filesToRemove);
+			}
+
+			updateClasspath(pathsToRemove, monitor);
+			/* Need to use the refactoring API
+			deleteFiles(filesToRemove, monitor);
+			*/
+
+		} catch (CoreException e) {
+			return new Status(IStatus.ERROR, MavenCoreActivator.PLUGIN_ID, "Unable to delete classpath entries", e);
+		}
+
+		return Status.OK_STATUS;
+	}
+
+	private void deleteFiles(Set<IFile> filesToRemove, IProgressMonitor monitor)
+			throws CoreException {
+		List<IStatus> exceptions = new ArrayList<IStatus>();
+		for (IFile f : filesToRemove) {
+			if (f.exists()) {
+				try {
+					f.delete(true, monitor);
+				} catch (CoreException e) {
+					exceptions.add(new Status(Status.ERROR, MavenCoreActivator.PLUGIN_ID, 0, "Unable to delete "+f.getFullPath(), e));
+				}
+			}
+		}
+		
+		if (!exceptions.isEmpty()) {
+			IStatus[] statuses = new IStatus[exceptions.size()];
+			exceptions.toArray(statuses);
+			IStatus status = new MultiStatus(MavenCoreActivator.PLUGIN_ID, Status.ERROR, statuses  ,"Unable to delete files", null);
+			throw new CoreException(status );
+		}
+	}
+
+	private void updateClasspath(Set<IPath> pathsToRemove,	IProgressMonitor monitor) throws CoreException {
+		if (pathsToRemove.isEmpty()) {
+			return;
+		}
+		ArrayList<IClasspathEntry> newEntries = new ArrayList<IClasspathEntry>();
+		for (IClasspathEntry entry : javaProject.getRawClasspath()) {
+			if (!pathsToRemove.contains(entry.getPath())) {
+				newEntries.add(entry);
+			}
+		}
+		javaProject.setRawClasspath(
+				newEntries.toArray(new IClasspathEntry[newEntries.size()]),
+				null);
+	}
+
+	private void collectDeletableEntries(IClasspathEntry entry,
+			Set<IPath> pathsToRemove, Set<IFile> filesToRemove)
+			throws CoreException {
+		if ((entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY 
+			 && entry.getPath() != null)) {
+			
+			if (pathsToRemove != null) {
+				pathsToRemove.add(entry.getPath());
+			}
+			
+			if (filesToRemove != null) {
+				IFile f = ConversionUtils.getIFile(entry);
+				if (f != null && f.exists()
+						&& javaProject.getProject().equals(f.getProject())) {
+					filesToRemove.add(f);
+				}
+			}
+			return;
+		}
+
+		if (pathsToRemove == null) {
+			return;
+		}
+		if (entry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
+			IPath path = entry.getPath();
+			pathsToRemove.add(path);
+			IClasspathContainer container = JavaCore.getClasspathContainer(	path, javaProject);
+			if (container != null) {
+				IClasspathEntry[] cpes = container.getClasspathEntries();
+				if (cpes != null && cpes.length > 0) {
+					collectDeletableEntries(entry, null, filesToRemove);
+				}
+			}
+		}
+		// TODO handle other entry kinds
+	}
+
+}
\ No newline at end of file

Modified: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/DependencyConversionPreviewPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/DependencyConversionPreviewPage.java	2012-08-31 12:43:17 UTC (rev 43350)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/DependencyConversionPreviewPage.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
 package org.jboss.tools.maven.conversion.ui.dialog;
 
 import org.eclipse.jface.wizard.WizardPage;

Deleted: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/EditDependencyDialog.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/EditDependencyDialog.java	2012-08-31 12:43:17 UTC (rev 43350)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/EditDependencyDialog.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2011 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *      Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.jboss.tools.maven.conversion.ui.dialog;
-
-import static org.eclipse.m2e.core.ui.internal.util.Util.nvl;
-
-import org.apache.maven.model.Dependency;
-import org.eclipse.m2e.core.ui.internal.Messages;
-import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.SelectionStatusDialog;
-
-
-public class EditDependencyDialog extends SelectionStatusDialog  {
-  private static final String[] TYPES = new String[] {"jar", "war", "rar", "ear", "par", "ejb", "ejb-client", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
-      "test-jar", "java-source", "javadoc", "maven-plugin", "pom"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
-
-  private String[] scopes = new String[] {"compile", "provided", "runtime", "test", "system"};
-
-  protected Text groupIdText;
-
-  protected Text artifactIdText;
-
-  protected Text versionText;
-
-  protected Text classifierText;
-
-  protected Combo typeCombo;
-
-  protected Combo scopeCombo;
-
-  protected Text systemPathText;
-
-  protected Button optionalButton;
-
-  private Dependency dependency;
-
-/**
-   * 
-   * @param parent
-   * @param dependencyManagement
-   * @param project can be null, only used for indexer search as scope  
-   * @param mavenProject
-   */
-  public EditDependencyDialog(Shell parent) {
-    super(parent);
-    setShellStyle(getShellStyle() | SWT.RESIZE);
-    setTitle("Edit dependency");
-  }
-
-  @Override
-  protected Control createDialogArea(Composite parent) {
-    Composite superComposite = (Composite) super.createDialogArea(parent);
-
-    Composite composite = new Composite(superComposite, SWT.NONE);
-    composite.setLayout(new GridLayout(3, false));
-    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-
-    Label groupIdLabel = new Label(composite, SWT.NONE);
-    groupIdLabel.setText(Messages.EditDependencyDialog_groupId_label);
-
-    groupIdText = new Text(composite, SWT.BORDER);
-    GridData gd_groupIdText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
-    gd_groupIdText.horizontalIndent = 4;
-    groupIdText.setLayoutData(gd_groupIdText);
-    //ProposalUtil.addGroupIdProposal(project, groupIdText, Packaging.ALL);
-    M2EUIUtils.addRequiredDecoration(groupIdText);
-
-    Label artifactIdLabel = new Label(composite, SWT.NONE);
-    artifactIdLabel.setText("Artifact Id");
-
-    artifactIdText = new Text(composite, SWT.BORDER);
-    GridData gd_artifactIdText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
-    gd_artifactIdText.horizontalIndent = 4;
-    artifactIdText.setLayoutData(gd_artifactIdText);
-    //ProposalUtil.addArtifactIdProposal(project, groupIdText, artifactIdText, Packaging.ALL);
-    M2EUIUtils.addRequiredDecoration(artifactIdText);
-
-    Label versionLabel = new Label(composite, SWT.NONE);
-    versionLabel.setText(Messages.EditDependencyDialog_version_label);
-
-    versionText = new Text(composite, SWT.BORDER);
-    GridData versionTextData = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
-    versionTextData.horizontalIndent = 4;
-    versionTextData.widthHint = 200;
-    versionText.setLayoutData(versionTextData);
-    //ProposalUtil.addVersionProposal(project, mavenproject, groupIdText, artifactIdText, versionText, Packaging.ALL);
-
-    Label classifierLabel = new Label(composite, SWT.NONE);
-    classifierLabel.setText(Messages.EditDependencyDialog_classifier_label);
-
-    classifierText = new Text(composite, SWT.BORDER);
-    GridData gd_classifierText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
-    gd_classifierText.horizontalIndent = 4;
-    gd_classifierText.widthHint = 200;
-    classifierText.setLayoutData(gd_classifierText);
-    //ProposalUtil
-    //    .addClassifierProposal(project, groupIdText, artifactIdText, versionText, classifierText, Packaging.ALL);
-
-    Label typeLabel = new Label(composite, SWT.NONE);
-    typeLabel.setText(Messages.EditDependencyDialog_type_label);
-
-    typeCombo = new Combo(composite, SWT.NONE);
-    typeCombo.setItems(TYPES);
-    GridData gd_typeText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
-    gd_typeText.horizontalIndent = 4;
-    gd_typeText.widthHint = 120;
-    typeCombo.setLayoutData(gd_typeText);
-
-    Label scopeLabel = new Label(composite, SWT.NONE);
-    scopeLabel.setText(Messages.EditDependencyDialog_scope_label);
-
-    scopeCombo = new Combo(composite, SWT.NONE);
-    scopeCombo.setItems(scopes);
-    GridData gd_scopeText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
-    gd_scopeText.horizontalIndent = 4;
-    gd_scopeText.widthHint = 120;
-    scopeCombo.setLayoutData(gd_scopeText);
-
-    Label systemPathLabel = new Label(composite, SWT.NONE);
-    systemPathLabel.setText(Messages.EditDependencyDialog_systemPath_label);
-
-    systemPathText = new Text(composite, SWT.BORDER);
-    GridData gd_systemPathText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
-    gd_systemPathText.horizontalIndent = 4;
-    gd_systemPathText.widthHint = 200;
-    systemPathText.setLayoutData(gd_systemPathText);
-
-//    selectSystemPathButton = new Button(composite, SWT.NONE);
-//    selectSystemPathButton.setText("Select...");
-
-    new Label(composite, SWT.NONE);
-
-    optionalButton = new Button(composite, SWT.CHECK);
-    optionalButton.setText(Messages.EditDependencyDialog_optional_checkbox);
-    GridData gd_optionalButton = new GridData(SWT.LEFT, SWT.TOP, false, false, 2, 1);
-    gd_optionalButton.horizontalIndent = 4;
-    optionalButton.setLayoutData(gd_optionalButton);
-
-    composite.setTabList(new Control[] {groupIdText, artifactIdText, versionText, classifierText, typeCombo,
-        scopeCombo, systemPathText, /*selectSystemPathButton,*/optionalButton});
-
-    setDependency(dependency);
-
-    return superComposite;
-  }
-  
-  @Override
-  protected void computeResult() {
-	if (dependency == null) {
-		dependency = new Dependency();
-	}
-    final String groupId = valueOrNull(groupIdText.getText());
-    final String artifactId = valueOrNull(artifactIdText.getText());
-    final String version =  valueOrNull(versionText.getText()); 
-    final String type = valueOrNull(typeCombo.getText());
-    final String scope = valueOrNull(scopeCombo.getText());
-    final String classifier = valueOrNull(classifierText.getText());
-    final String system = valueOrNull(systemPathText.getText());
-    
-    dependency.setArtifactId(artifactId);
-    dependency.setGroupId(groupId);
-    dependency.setType(type);
-    dependency.setVersion(version);
-    dependency.setScope(scope);
-    dependency.setClassifier(classifier);
-    dependency.setSystemPath(system);
-    boolean optional = optionalButton.getSelection();
-    if (optional != dependency.isOptional()) {
-    	dependency.setOptional(optional);
-    }
-  }
-  
-  private String valueOrNull(String value) {
-    if (value != null) {
-      value = value.trim();
-      if (value.length() == 0) {
-        value = null;
-      }
-    }
-    return value;
-  }
-  
-
-  public void setDependency(Dependency dependency) {
-    this.dependency = dependency;
-
-    if(dependency != null 
-       && groupIdText != null 
-       && !groupIdText.isDisposed()) {
-      groupIdText.setText(nvl(dependency.getGroupId()));
-      artifactIdText.setText(nvl(dependency.getArtifactId()));
-      versionText.setText(nvl(dependency.getVersion()));
-      classifierText.setText(nvl(dependency.getClassifier()));
-      typeCombo.setText("".equals(nvl(dependency.getType())) ? "jar" : dependency.getType()); //$NON-NLS-1$ //$NON-NLS-2$
-      scopeCombo.setText("".equals(nvl(dependency.getScope())) ? "compile" : dependency.getScope()); //$NON-NLS-1$ //$NON-NLS-2$
-      systemPathText.setText(nvl(dependency.getSystemPath()));
-
-      boolean optional = Boolean.parseBoolean(dependency.getOptional());
-      if(optionalButton.getSelection() != optional) {
-        optionalButton.setSelection(optional);
-      }
-    }
-  }
-
-  /**
-  * @return the dependency
-  */
-  public Dependency getDependency() {
-	return dependency;
-  }
-
-}

Modified: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/IdentifyMavenDependencyPage.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/IdentifyMavenDependencyPage.java	2012-08-31 12:43:17 UTC (rev 43350)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/IdentifyMavenDependencyPage.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -1,5 +1,5 @@
 /*************************************************************************************
- * Copyright (c) 2009-2011 Red Hat, Inc. and others.
+ * Copyright (c) 2012 Red Hat, Inc. and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -30,18 +30,17 @@
 import org.eclipse.jdt.core.IClasspathEntry;
 import org.eclipse.jdt.core.IJavaProject;
 import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CellEditor;
 import org.eclipse.jface.viewers.CheckStateChangedEvent;
 import org.eclipse.jface.viewers.CheckboxTableViewer;
 import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.DialogCellEditor;
-import org.eclipse.jface.viewers.ICellModifier;
 import org.eclipse.jface.viewers.ICheckStateListener;
 import org.eclipse.jface.viewers.TableViewerColumn;
 import org.eclipse.jface.window.Window;
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
 import org.eclipse.swt.graphics.Image;
@@ -49,11 +48,12 @@
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.TableItem;
+import org.jboss.tools.maven.conversion.ui.dialog.xpl.ConversionUtils;
+import org.jboss.tools.maven.conversion.ui.dialog.xpl.EditDependencyDialog;
 import org.jboss.tools.maven.conversion.ui.handlers.IdentifyJarJob;
 import org.jboss.tools.maven.conversion.ui.internal.CellListener;
 import org.jboss.tools.maven.conversion.ui.internal.MavenDependencyConversionActivator;
@@ -63,10 +63,12 @@
 
 public class IdentifyMavenDependencyPage extends WizardPage {
 
+	/*
 	private static final String SOURCE_PROPERTY = "SOURCE_PROPERTY";
 
 	private static final String DEPENDENCY_PROPERTY = "DEPENDENCY_PROPERTY";
-
+    */
+	
 	private static final int DEPENDENCY_COLUMN = 2;
 
 	private Map<IClasspathEntry, Dependency> dependencyMap;
@@ -85,6 +87,11 @@
 	
 	private CheckboxTableViewer dependenciesViewer;
 	
+	private Button deleteJarsBtn;
+	
+	private boolean deleteJars;
+
+
 	public IdentifyMavenDependencyPage(IProject project, Set<IClasspathEntry> entries) {
 		super("");
 		this.project = project;
@@ -140,15 +147,29 @@
 		container.setLayout(layout);
 		container.setLayoutData(new GridData(GridData.FILL_BOTH));
 		
-		String message = "Identify existing classpath entries as Maven dependencies";
+		String message = "Identify existing classpath entries as Maven dependencies. Double-click on a Maven Dependency to edit its details";
 		setMessage(message);
 
 		displayDependenciesTable(container);
 
+		deleteJarsBtn = addCheckButton(container, "Delete classpath entries from project", deleteJars);
+		deleteJarsBtn.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				deleteJars = deleteJarsBtn.getSelection();
+			}
+		});
 		runIdentificationJobs();
 	}
+
+	private Button addCheckButton(Composite container, String label,
+			boolean selected) {
+		Button checkBtn = new Button(container, SWT.CHECK);
+		checkBtn.setText(label);
+		checkBtn.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1));
+		checkBtn.setSelection(selected);
+		return checkBtn;
+	}
 	
-
 	private void displayDependenciesTable(Composite container) {
 		GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 4);
 		gd.heightHint = 500;
@@ -258,6 +279,8 @@
 					if(editDependencyDialog.open() == Window.OK) {
 						entry.setValue(editDependencyDialog.getDependency());
 					}
+				} else {
+					MessageDialog.openInformation(getShell(), "you dbl-clicked", "you dbl-clicked");
 				}
 			}
 		});
@@ -265,10 +288,12 @@
 		
 		addSelectionButton(container, "Select All", true);
 		addSelectionButton(container, "Deselect All", false);
-		//addIdentifyButton(container, "Identify dependencies");
+		if (Boolean.getBoolean("org.jboss.tools.maven.conversion.debug")) {
+			addIdentifyButton(container, "Identify dependencies");
+		}
 		addResetButton(container, "Reset");
 
-		addCellEditors();
+		//addCellEditors();
 	}
 
 	
@@ -277,6 +302,7 @@
 		return true;
 	} 
 	
+	/*
 	protected void addCellEditors() {
 		dependenciesViewer.setColumnProperties(
 				new String[] { "EMPTY",	SOURCE_PROPERTY, DEPENDENCY_PROPERTY });
@@ -286,7 +312,7 @@
 		dependenciesViewer.setCellEditors(editors);
 		dependenciesViewer.setCellModifier(new DependencyCellModifier());
 	}
-
+    
 	private class DependencyCellModifier implements ICellModifier {
 
 		public boolean canModify(Object element, String property) {
@@ -333,10 +359,9 @@
 			}
 			return d;
 		}
-		
 	}
+    */
 
-
 	private Button addSelectionButton(Composite container, String label,
 			final boolean ischecked) {
 		Button button = new Button(container, SWT.NONE);
@@ -513,4 +538,10 @@
 		}
 		return dependencies;
 	}
+
+
+	public boolean isDeleteJars() {
+		return deleteJars;
+	}
+
 }

Copied: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/ConversionUtils.java (from rev 43326, trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/ConversionUtils.java)
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/ConversionUtils.java	                        (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/ConversionUtils.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *     Theodora Yeung (tyeung at bea.com) - ensure that JarPackageFragmentRoot make it into cache
+ *                                                           before its contents
+ *                                                           (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=102422)
+ *     Stephan Herrmann - Contribution for Bug 346010 - [model] strange initialization dependency in OptionTests
+ *     Terry Parker <tparker at google.com> - DeltaProcessor misses state changes in archive files, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=357425
+ *     Red Hat - copied code from {@link org.eclipse.jdt.internal.core.JavaModelManager.#getZipFile(IPath)} 
+ *******************************************************************************/
+package org.jboss.tools.maven.conversion.ui.dialog.xpl;
+
+import java.io.File;
+import java.net.URI;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.internal.core.util.Messages;
+import org.eclipse.jdt.internal.core.util.Util;
+import org.jboss.tools.maven.conversion.ui.internal.MavenDependencyConversionActivator;
+
+ at SuppressWarnings("restriction")
+public class ConversionUtils {
+	
+	
+	/**
+	 * Returns the underlying {@link File} from a {@link IClasspathEntry}.
+	 * <br/>
+	 * Part of the code comes from {@link org.eclipse.jdt.internal.core.JavaModelManager.#getZipFile(IPath)} 
+	 * @param cpe
+	 * @return
+	 * @throws CoreException
+	 */
+	public static File getFile(IClasspathEntry cpe) throws CoreException {
+		Assert.isNotNull(cpe, "ClasspathEntry can not be null");
+		IPath path = cpe.getPath();
+		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+		IResource file = root.findMember(path);
+		File localFile = null;
+		if (file != null) {
+			// internal resource
+			URI location;
+			if (file.getType() != IResource.FILE || (location = file.getLocationURI()) == null) {
+				throw new CoreException(new Status(IStatus.ERROR, MavenDependencyConversionActivator.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
+			}
+			localFile = Util.toLocalFile(location, null/*no progress availaible*/);
+			if (localFile == null)
+				throw new CoreException(new Status(IStatus.ERROR, MavenDependencyConversionActivator.PLUGIN_ID, -1, Messages.bind(Messages.file_notFound, path.toString()), null));
+		} else {
+			// external resource -> it is ok to use toFile()
+			localFile= path.toFile();
+		}
+		return localFile;
+	}
+
+	public static IFile getIFile(IClasspathEntry cpe) throws CoreException {
+		Assert.isNotNull(cpe, "ClasspathEntry can not be null");
+		IPath path = cpe.getPath();
+		if (path != null) {
+			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+			IResource file = root.findMember(path);
+			if (file != null && file instanceof IFile) {
+				return (IFile) file;
+			}
+		}
+		return null;
+	}
+
+}

Copied: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/EditDependencyDialog.java (from rev 43326, trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/EditDependencyDialog.java)
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/EditDependencyDialog.java	                        (rev 0)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/EditDependencyDialog.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -0,0 +1,231 @@
+/*******************************************************************************
+ * Copyright (c) 2008-2011 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *      Sonatype, Inc. - initial API and implementation
+ *******************************************************************************/
+
+package org.jboss.tools.maven.conversion.ui.dialog.xpl;
+
+import static org.eclipse.m2e.core.ui.internal.util.Util.nvl;
+
+import org.apache.maven.model.Dependency;
+import org.eclipse.m2e.core.ui.internal.Messages;
+import org.eclipse.m2e.core.ui.internal.util.M2EUIUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.SelectionStatusDialog;
+
+
+public class EditDependencyDialog extends SelectionStatusDialog  {
+  private static final String[] TYPES = new String[] {"jar", "war", "rar", "ear", "par", "ejb", "ejb-client", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
+      "test-jar", "java-source", "javadoc", "maven-plugin", "pom"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
+
+  private String[] scopes = new String[] {"compile", "provided", "runtime", "test", "system"};
+
+  protected Text groupIdText;
+
+  protected Text artifactIdText;
+
+  protected Text versionText;
+
+  protected Text classifierText;
+
+  protected Combo typeCombo;
+
+  protected Combo scopeCombo;
+
+  protected Text systemPathText;
+
+  protected Button optionalButton;
+
+  private Dependency dependency;
+
+/**
+   * 
+   * @param parent
+   * @param dependencyManagement
+   * @param project can be null, only used for indexer search as scope  
+   * @param mavenProject
+   */
+  public EditDependencyDialog(Shell parent) {
+    super(parent);
+    setShellStyle(getShellStyle() | SWT.RESIZE);
+    setTitle("Edit dependency");
+  }
+
+  @Override
+  protected Control createDialogArea(Composite parent) {
+    Composite superComposite = (Composite) super.createDialogArea(parent);
+
+    Composite composite = new Composite(superComposite, SWT.NONE);
+    composite.setLayout(new GridLayout(3, false));
+    composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+    Label groupIdLabel = new Label(composite, SWT.NONE);
+    groupIdLabel.setText(Messages.EditDependencyDialog_groupId_label);
+
+    groupIdText = new Text(composite, SWT.BORDER);
+    GridData gd_groupIdText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+    gd_groupIdText.horizontalIndent = 4;
+    groupIdText.setLayoutData(gd_groupIdText);
+    //ProposalUtil.addGroupIdProposal(project, groupIdText, Packaging.ALL);
+    M2EUIUtils.addRequiredDecoration(groupIdText);
+
+    Label artifactIdLabel = new Label(composite, SWT.NONE);
+    artifactIdLabel.setText("Artifact Id");
+
+    artifactIdText = new Text(composite, SWT.BORDER);
+    GridData gd_artifactIdText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+    gd_artifactIdText.horizontalIndent = 4;
+    artifactIdText.setLayoutData(gd_artifactIdText);
+    //ProposalUtil.addArtifactIdProposal(project, groupIdText, artifactIdText, Packaging.ALL);
+    M2EUIUtils.addRequiredDecoration(artifactIdText);
+
+    Label versionLabel = new Label(composite, SWT.NONE);
+    versionLabel.setText(Messages.EditDependencyDialog_version_label);
+
+    versionText = new Text(composite, SWT.BORDER);
+    GridData versionTextData = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+    versionTextData.horizontalIndent = 4;
+    versionTextData.widthHint = 200;
+    versionText.setLayoutData(versionTextData);
+    //ProposalUtil.addVersionProposal(project, mavenproject, groupIdText, artifactIdText, versionText, Packaging.ALL);
+
+    Label classifierLabel = new Label(composite, SWT.NONE);
+    classifierLabel.setText(Messages.EditDependencyDialog_classifier_label);
+
+    classifierText = new Text(composite, SWT.BORDER);
+    GridData gd_classifierText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+    gd_classifierText.horizontalIndent = 4;
+    gd_classifierText.widthHint = 200;
+    classifierText.setLayoutData(gd_classifierText);
+    //ProposalUtil
+    //    .addClassifierProposal(project, groupIdText, artifactIdText, versionText, classifierText, Packaging.ALL);
+
+    Label typeLabel = new Label(composite, SWT.NONE);
+    typeLabel.setText(Messages.EditDependencyDialog_type_label);
+
+    typeCombo = new Combo(composite, SWT.NONE);
+    typeCombo.setItems(TYPES);
+    GridData gd_typeText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+    gd_typeText.horizontalIndent = 4;
+    gd_typeText.widthHint = 120;
+    typeCombo.setLayoutData(gd_typeText);
+
+    Label scopeLabel = new Label(composite, SWT.NONE);
+    scopeLabel.setText(Messages.EditDependencyDialog_scope_label);
+
+    scopeCombo = new Combo(composite, SWT.NONE);
+    scopeCombo.setItems(scopes);
+    GridData gd_scopeText = new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1);
+    gd_scopeText.horizontalIndent = 4;
+    gd_scopeText.widthHint = 120;
+    scopeCombo.setLayoutData(gd_scopeText);
+
+    Label systemPathLabel = new Label(composite, SWT.NONE);
+    systemPathLabel.setText(Messages.EditDependencyDialog_systemPath_label);
+
+    systemPathText = new Text(composite, SWT.BORDER);
+    GridData gd_systemPathText = new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1);
+    gd_systemPathText.horizontalIndent = 4;
+    gd_systemPathText.widthHint = 200;
+    systemPathText.setLayoutData(gd_systemPathText);
+
+//    selectSystemPathButton = new Button(composite, SWT.NONE);
+//    selectSystemPathButton.setText("Select...");
+
+    new Label(composite, SWT.NONE);
+
+    optionalButton = new Button(composite, SWT.CHECK);
+    optionalButton.setText(Messages.EditDependencyDialog_optional_checkbox);
+    GridData gd_optionalButton = new GridData(SWT.LEFT, SWT.TOP, false, false, 2, 1);
+    gd_optionalButton.horizontalIndent = 4;
+    optionalButton.setLayoutData(gd_optionalButton);
+
+    composite.setTabList(new Control[] {groupIdText, artifactIdText, versionText, classifierText, typeCombo,
+        scopeCombo, systemPathText, /*selectSystemPathButton,*/optionalButton});
+
+    setDependency(dependency);
+
+    return superComposite;
+  }
+  
+  @Override
+  protected void computeResult() {
+	if (dependency == null) {
+		dependency = new Dependency();
+	}
+    final String groupId = valueOrNull(groupIdText.getText());
+    final String artifactId = valueOrNull(artifactIdText.getText());
+    final String version =  valueOrNull(versionText.getText()); 
+    final String type = valueOrNull(typeCombo.getText());
+    final String scope = valueOrNull(scopeCombo.getText());
+    final String classifier = valueOrNull(classifierText.getText());
+    final String system = valueOrNull(systemPathText.getText());
+    
+    dependency.setArtifactId(artifactId);
+    dependency.setGroupId(groupId);
+    dependency.setType(type);
+    dependency.setVersion(version);
+    dependency.setScope(scope);
+    dependency.setClassifier(classifier);
+    dependency.setSystemPath(system);
+    boolean optional = optionalButton.getSelection();
+    if (optional != dependency.isOptional()) {
+    	dependency.setOptional(optional);
+    }
+  }
+  
+  private String valueOrNull(String value) {
+    if (value != null) {
+      value = value.trim();
+      if (value.length() == 0) {
+        value = null;
+      }
+    }
+    return value;
+  }
+  
+
+  public void setDependency(Dependency dependency) {
+    this.dependency = dependency;
+
+    if(dependency != null 
+       && groupIdText != null 
+       && !groupIdText.isDisposed()) {
+      groupIdText.setText(nvl(dependency.getGroupId()));
+      artifactIdText.setText(nvl(dependency.getArtifactId()));
+      versionText.setText(nvl(dependency.getVersion()));
+      classifierText.setText(nvl(dependency.getClassifier()));
+      typeCombo.setText("".equals(nvl(dependency.getType())) ? "jar" : dependency.getType()); //$NON-NLS-1$ //$NON-NLS-2$
+      scopeCombo.setText("".equals(nvl(dependency.getScope())) ? "compile" : dependency.getScope()); //$NON-NLS-1$ //$NON-NLS-2$
+      systemPathText.setText(nvl(dependency.getSystemPath()));
+
+      boolean optional = Boolean.parseBoolean(dependency.getOptional());
+      if(optionalButton.getSelection() != optional) {
+        optionalButton.setSelection(optional);
+      }
+    }
+  }
+
+  /**
+  * @return the dependency
+  */
+  public Dependency getDependency() {
+	return dependency;
+  }
+
+}

Modified: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/handlers/ConvertToMavenDependencyHandler.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/handlers/ConvertToMavenDependencyHandler.java	2012-08-31 12:43:17 UTC (rev 43350)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/handlers/ConvertToMavenDependencyHandler.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -1,5 +1,5 @@
 /*************************************************************************************
- * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * Copyright (c) 2012 Red Hat, Inc. and others.
  * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at

Modified: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/handlers/IdentifyJarJob.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/handlers/IdentifyJarJob.java	2012-08-31 12:43:17 UTC (rev 43350)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/handlers/IdentifyJarJob.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
 package org.jboss.tools.maven.conversion.ui.handlers;
 
 import java.io.File;

Modified: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/CellListener.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/CellListener.java	2012-08-31 12:43:17 UTC (rev 43350)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/CellListener.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
 package org.jboss.tools.maven.conversion.ui.internal;
 
 import org.eclipse.core.runtime.Assert;
@@ -29,8 +39,7 @@
 		for (int i = 0; i < columnCount; i++) {
 			Rectangle rect = item.getBounds(i);
 			if (rect.contains(pt)) {
-				int index = table.indexOf(item);
-				handle(index, item);
+				handle(i, item);
 			}
 		}
 	}

Modified: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/ClasspathConversionParticipant.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/ClasspathConversionParticipant.java	2012-08-31 12:43:17 UTC (rev 43350)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/ClasspathConversionParticipant.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2012 Red Hat, Inc. and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
 package org.jboss.tools.maven.conversion.ui.internal;
 
 import java.util.Collection;

Modified: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/MavenDependencyConversionActivator.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/MavenDependencyConversionActivator.java	2012-08-31 12:43:17 UTC (rev 43350)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/MavenDependencyConversionActivator.java	2012-08-31 12:46:42 UTC (rev 43351)
@@ -1,5 +1,5 @@
 /*************************************************************************************
- * Copyright (c) 2008-2011 Red Hat, Inc. and others.
+ * Copyright (c) 2012 Red Hat, Inc. and others.
  * All rights reserved. This program and the accompanying materials 
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at



More information about the jbosstools-commits mailing list