Author: fbricon
Date: 2012-08-31 11:56:41 -0400 (Fri, 31 Aug 2012)
New Revision: 43353
Added:
trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/icons/warning.gif
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/xpl/EditDependencyDialog.java
trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/MavenDependencyConversionActivator.java
Log:
JBIDE-12530 : Warn the user about unresolvable dependencies during maven conversion
Added: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/icons/warning.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/icons/warning.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
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
15:18:07 UTC (rev 43352)
+++
trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/IdentifyMavenDependencyPage.java 2012-08-31
15:56:41 UTC (rev 43353)
@@ -35,7 +35,6 @@
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.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
@@ -44,7 +43,6 @@
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jst.j2ee.internal.validation.DependencyUtil;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.swt.SWT;
@@ -57,6 +55,7 @@
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.TableItem;
@@ -102,7 +101,13 @@
private boolean deleteJars;
+ private Label warningImg;
+ private Label warningLabel;
+
+ private static String MESSAGE = "Identify existing classpath entries as Maven
dependencies. Double-click on a Maven Dependency to edit its details";
+
+
public IdentifyMavenDependencyPage(IProject project, Set<IClasspathEntry> entries)
{
super("");
this.project = project;
@@ -169,10 +174,9 @@
layout.marginLeft = 12;
container.setLayout(layout);
container.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- String message = "Identify existing classpath entries as Maven dependencies.
Double-click on a Maven Dependency to edit its details";
- setMessage(message);
+ setMessage(MESSAGE);
+
displayDependenciesTable(container);
deleteJarsBtn = addCheckButton(container, "Delete classpath entries from
project", deleteJars);
@@ -276,8 +280,8 @@
if (entry.getValue() == null) {
return failedImage;
} else {
- //return (isResolved(entry.getValue(), null))?okImage:unresolvedImage;
- return okImage;
+ return (isResolved(entry.getValue(), null))?okImage:unresolvedImage;
+ //return okImage;
}
}
});
@@ -303,11 +307,9 @@
if(editDependencyDialog.open() == Window.OK) {
Dependency newDep = editDependencyDialog.getDependency();
entry.setValue(newDep);
- /*
if (!eq(newDep,d)) {
isResolved(newDep, new NullProgressMonitor());
}
- */
refresh();
}
}
@@ -481,6 +483,14 @@
if (dependenciesViewer != null && !dependenciesViewer.getTable().isDisposed())
{
dependenciesViewer.refresh();
}
+
+ for (Dependency d : getDependencies()) {
+ if (Boolean.FALSE.equals(dependencyResolution.get(d))) {
+ setMessage("Some selected dependencies can not be resolved using the
repositories from your settings.xml", WARNING);
+ return;
+ }
+ }
+ setMessage(MESSAGE);
}
@@ -537,7 +547,7 @@
@Override
public void run() {
Dependency d = job.getDependency();
- //isResolved(d, new NullProgressMonitor());
+ isResolved(d, new NullProgressMonitor());
dependencyMap.put(entry.getKey(), d);
refresh();
}
Modified:
trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/EditDependencyDialog.java
===================================================================
---
trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/EditDependencyDialog.java 2012-08-31
15:18:07 UTC (rev 43352)
+++
trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/xpl/EditDependencyDialog.java 2012-08-31
15:56:41 UTC (rev 43353)
@@ -201,8 +201,9 @@
public void setDependency(Dependency dependency) {
- this.dependency = dependency;
+ this.dependency = dependency == null? null : dependency.clone();
+
if(dependency != null
&& groupIdText != null
&& !groupIdText.isDisposed()) {
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
15:18:07 UTC (rev 43352)
+++
trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/internal/MavenDependencyConversionActivator.java 2012-08-31
15:56:41 UTC (rev 43353)
@@ -95,12 +95,20 @@
}
public static Image getIcon(String pathToIcon) {
+ ImageDescriptor descriptor = imageDescriptorFromPlugin(PLUGIN_ID, pathToIcon);
+ return getIcon(descriptor);
+ }
+
+ private static Image getIcon(ImageDescriptor descriptor) {
Image img = null;
- ImageDescriptor descriptor = imageDescriptorFromPlugin(PLUGIN_ID, pathToIcon);
if(descriptor != null) {
img = descriptor.createImage();
}
return img;
}
+
+ public static Image getWarningIcon() {
+ return getIcon("icons/warning.gif");
+ }
}
\ No newline at end of file
Show replies by date