Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilos Kleint2010-12-27 10:52:06 -0500
committerMilos Kleint2010-12-27 10:52:06 -0500
commitae957d2dd92a312bdf6638654764a221f3f3c371 (patch)
treed0f6883b3db2e632955f8ad4cc373b772b490d58
parent1d9670a1afe8209fe224daec2a8f1e1a00c5ca96 (diff)
downloadm2e-core-ae957d2dd92a312bdf6638654764a221f3f3c371.tar.gz
m2e-core-ae957d2dd92a312bdf6638654764a221f3f3c371.tar.xz
m2e-core-ae957d2dd92a312bdf6638654764a221f3f3c371.zip
get rid of readMavenProject method that was actually just an elaborate way of getting the Maven facade..
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java45
1 files changed, 5 insertions, 40 deletions
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java
index 80a3f20c..c4828432 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java
@@ -718,8 +718,11 @@ public class DependenciesComposite extends Composite {
IRunnableWithProgress projectLoader = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
- IMavenProjectFacade projectFacade = readMavenProject(monitor);
- hierarchy.addAll(new ParentGatherer(pomEditor.getMavenProject(), projectFacade).getParentHierarchy(monitor));
+ MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectFacade projectFacade = projectManager.create(pomEditor.getPomFile(), true, monitor);
+ if (projectFacade != null) {
+ hierarchy.addAll(new ParentGatherer(projectFacade.getMavenProject(), projectFacade).getParentHierarchy(monitor));
+ }
} catch(CoreException e) {
throw new InvocationTargetException(e);
}
@@ -739,44 +742,6 @@ public class DependenciesComposite extends Composite {
manageDepDialog.open();
}
- /**
- * Attempts to completely load the current MavenProject so as to get at the
- * effective pom.
- *
- * In the case where the MavenProject cannot be accessed and markers are present,
- * it will inform the user that they need to fix the problems before they can
- * proceed.
- *
- * @param monitor
- * @return the IMavenProjectFacade that corresponds to the project, or null if one was not loaded.
- * @throws CoreException
- */
- protected IMavenProjectFacade readMavenProject(IProgressMonitor monitor) throws CoreException {
- MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
- MavenProject mavenProject = pomEditor.getMavenProject();
- if (mavenProject == null) {
- IMarker[] markers = pomEditor.getPomFile().findMarkers(IMavenConstants.MARKER_ID, true, IResource.DEPTH_ZERO);
- if (markers != null && markers.length > 0) {
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- MessageDialog.openError(getShell(), Messages.DependenciesComposite_error, Messages.DependenciesComposite_fixProjectErrors);
- }
- });
- return null;
- } else {
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- MessageDialog.openError(getShell(), Messages.DependenciesComposite_error, Messages.DependenciesComposite_checkConsoleForErrors);
- }
- });
- return null;
- }
- }
- return projectManager.create(pomEditor.getPomFile(), true, monitor);
- }
-
protected void setDependenciesInput() {
List<Object> deps = new ArrayList<Object>(model.getDependencies());
if (showInheritedDependencies) {

Back to the top