Author: simoneg
Date: Mon Oct 5 22:16:15 2009
New Revision: 822054
URL: http://svn.apache.org/viewvc?rev=822054&view=rev
Log:
LABS-421 : warning when sources not found
Modified:
labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/basics/MagmaPDEUtils.java
Modified:
labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/basics/MagmaPDEUtils.java
URL:
http://svn.apache.org/viewvc/labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/basics/MagmaPDEUtils.java?rev=822054&r1=822053&r2=822054&view=diff
==============================================================================
---
labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/basics/MagmaPDEUtils.java
(original)
+++
labs/magma/trunk/magma-eclipse/src/org/apache/magma/tools/magmaeclipse/basics/MagmaPDEUtils.java
Mon Oct 5 22:16:15 2009
@@ -22,6 +22,7 @@
import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IMarker;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
@@ -668,9 +669,27 @@
}
}
+ // Checks a warning marker on the project for missing
sources
+ IMarker warn = null;
+ IMarker[] markers =
project.findMarkers(IMarker.PROBLEM, false, IResource.DEPTH_ZERO);
+ for (IMarker marker : markers) {
+ if (marker.getAttribute("__magma_warn",
"").length() > 0) {
+ warn = marker;
+ break;
+ }
+ }
+
if (downloadSources) {
+ if (warn == null) {
+ warn =
project.createMarker(IMarker.PROBLEM);
+ warn.setAttribute(IMarker.SEVERITY,
IMarker.SEVERITY_WARNING);
+ warn.setAttribute(IMarker.MESSAGE,
"Some sources for Magma projects were not found");
+ warn.setAttribute("__magma_warn",
"yes");
+ }
DownloadSourcesJob ds = new
DownloadSourcesJob(mavenProject, complete);
ds.schedule();
+ } else {
+ if (warn != null) warn.delete();
}
} catch (Exception e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]