[jbosstools-commits] JBoss Tools SVN: r44006 - in trunk/maven/plugins: org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog and 2 other directories.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Tue Sep 25 11:31:54 EDT 2012
Author: fbricon
Date: 2012-09-25 11:31:53 -0400 (Tue, 25 Sep 2012)
New Revision: 44006
Removed:
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/profiles/
Modified:
trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/META-INF/MANIFEST.MF
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.ui/META-INF/MANIFEST.MF
Log:
JBIDE-12530 Warn the user about unresolvable dependencies during maven conversion and add a link to Repository Management.
Modified: trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/META-INF/MANIFEST.MF 2012-09-25 15:29:38 UTC (rev 44005)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/META-INF/MANIFEST.MF 2012-09-25 15:31:53 UTC (rev 44006)
@@ -13,7 +13,8 @@
org.eclipse.jst.j2ee.ui;bundle-version="1.1.500",
org.eclipse.ui.ide;bundle-version="3.7.0",
org.eclipse.m2e.core.ui;bundle-version="1.1.0",
- org.jboss.tools.maven.core;bundle-version="1.4.0"
+ org.jboss.tools.maven.core;bundle-version="1.4.0",
+ org.jboss.tools.maven.ui;bundle-version="1.4.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-Vendor: %BundleVendor
Bundle-Localization: plugin
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-09-25 15:29:38 UTC (rev 44005)
+++ trunk/maven/plugins/org.jboss.tools.maven.conversion.ui/src/org/jboss/tools/maven/conversion/ui/dialog/IdentifyMavenDependencyPage.java 2012-09-25 15:31:53 UTC (rev 44006)
@@ -32,6 +32,9 @@
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
@@ -39,6 +42,7 @@
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.jface.window.Window;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -51,6 +55,7 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
@@ -68,6 +73,7 @@
import org.jboss.tools.maven.core.identification.IFileIdentificationManager;
import org.jboss.tools.maven.core.identification.IdentificationUtil;
import org.jboss.tools.maven.core.internal.identification.FileIdentificationManager;
+import org.jboss.tools.maven.ui.wizard.ConfigureMavenRepositoriesWizard;
public class IdentifyMavenDependencyPage extends WizardPage {
@@ -106,6 +112,10 @@
private Button stopButton;
+ private Label warningImg;
+
+ private Link warningLink;
+
private static String MESSAGE = "Identify existing classpath entries as Maven dependencies. Double-click on a Maven Dependency to edit its details";
@@ -159,6 +169,31 @@
loadingImage = MavenDependencyConversionActivator.getLoadingIcon();
}
+ private void createWarning(Composite container) {
+ warningImg = new Label(container, SWT.CENTER);
+ warningLink = new Link(container, SWT.NONE);
+ warningLink.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(warningImg);
+ warningImg.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING));
+ warningLink.setText("Some selected dependencies can not be resolved. Click <a>here</a> to configure repositories in your settings.xml.");
+ warningLink.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ openSettingsRepositoriesWizard();
+ }
+
+ private void openSettingsRepositoriesWizard() {
+ ConfigureMavenRepositoriesWizard wizard = new ConfigureMavenRepositoriesWizard();
+ WizardDialog dialog = new WizardDialog(Display.getDefault().getActiveShell(), wizard);
+ dialog.create();
+ dialog.open();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ widgetSelected(e);
+ }
+ });
+ }
+
@Override
public void createControl(Composite parent) {
@@ -177,6 +212,8 @@
setMessage(MESSAGE);
+ createWarning(container);
+
displayDependenciesTable(container);
Link remoteRepoPrefsLink = new Link(container, SWT.NONE);
@@ -422,10 +459,24 @@
private synchronized void refresh() {
enableIdentificationButtons();
+ displayWarning();
setPageComplete(hasNoRunningJobs());
//setMessage(MESSAGE);
}
+ private void displayWarning() {
+ for (Dependency d : getDependencies()) {
+ if (Boolean.FALSE.equals(dependencyResolution.get(d))) {
+ setVisible(warningImg, true);
+ setVisible(warningLink, true);
+ return;
+ }
+ }
+ setVisible(warningImg, false);
+ setVisible(warningLink, false);
+
+ }
+
private void setVisible(Control control, boolean visible) {
if (control != null && !control.isDisposed()) {
control.setVisible(visible);
@@ -561,6 +612,7 @@
}
}
} finally {
+ displayWarning();
enableIdentificationButtons();
}
}
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF 2012-09-25 15:29:38 UTC (rev 44005)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/META-INF/MANIFEST.MF 2012-09-25 15:31:53 UTC (rev 44006)
@@ -26,4 +26,5 @@
Export-Package: org.jboss.tools.maven.ui,
org.jboss.tools.maven.ui.internal.libprov,
org.jboss.tools.maven.ui.internal.project.facet,
- org.jboss.tools.maven.ui.preferences
+ org.jboss.tools.maven.ui.preferences,
+ org.jboss.tools.maven.ui.wizard
More information about the jbosstools-commits
mailing list