Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-04-06 17:53:18 -0400
committerIgor Fedorenko2011-04-06 20:30:01 -0400
commit1cc5b9d5675ce5c12b65dba5b0e1ab728f346373 (patch)
tree2ea849f915d8422bf8457fa810e395c209a1c9ea /org.eclipse.m2e.editor
parent34f8c611dc55b1bc853e8b432a9f30b71c4b2db2 (diff)
downloadm2e-core-1cc5b9d5675ce5c12b65dba5b0e1ab728f346373.tar.gz
m2e-core-1cc5b9d5675ce5c12b65dba5b0e1ab728f346373.tar.xz
m2e-core-1cc5b9d5675ce5c12b65dba5b0e1ab728f346373.zip
Introduced IMavenProjectRegistry to replace MavenProjectManager
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.editor')
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java4
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java4
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ParentGatherer.java4
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/PomHierarchyComposite.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java8
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java11
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java8
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java4
8 files changed, 22 insertions, 23 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 3f4a04b3..e23bf0d1 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
@@ -43,7 +43,7 @@ import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.ArtifactKey;
import org.eclipse.m2e.core.index.IndexedArtifactFile;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.IMavenProjectRegistry;
import org.eclipse.m2e.core.ui.internal.dialogs.EditDependencyDialog;
import org.eclipse.m2e.core.ui.internal.dialogs.MavenRepositorySearchDialog;
import org.eclipse.m2e.core.ui.internal.editing.PomHelper;
@@ -654,7 +654,7 @@ public class DependenciesComposite extends Composite {
IRunnableWithProgress projectLoader = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
- MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.create(pomEditor.getPomFile(), true, monitor);
if (projectFacade != null) {
hierarchy.addAll(new ParentGatherer(projectFacade.getMavenProject(), projectFacade).getParentHierarchy(monitor));
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java
index 107ba897..d9e06b0b 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java
@@ -26,7 +26,7 @@ import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.IMavenProjectRegistry;
import org.eclipse.m2e.core.ui.internal.MavenImages;
import org.eclipse.m2e.editor.MavenEditorImages;
import org.eclipse.m2e.editor.internal.Messages;
@@ -217,7 +217,7 @@ public class DependencyLabelProvider extends LabelProvider implements IColorProv
}
if(groupId != null && artifactId != null && version != null) {
- MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.getMavenProject(groupId, artifactId, version);
if(projectFacade != null) {
return isManaged ? MavenImages.getOverlayImage(MavenImages.PATH_PROJECT, MavenImages.PATH_LOCK, IDecoration.BOTTOM_LEFT) : MavenEditorImages.IMG_PROJECT;
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ParentGatherer.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ParentGatherer.java
index 6a79c0ce..7801a0e7 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ParentGatherer.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/ParentGatherer.java
@@ -20,7 +20,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.embedder.IMaven;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.IMavenProjectRegistry;
/**
* Helper class to get the parent chain given a pom
@@ -45,7 +45,7 @@ public class ParentGatherer {
public LinkedList<MavenProject> getParentHierarchy(IProgressMonitor monitor) throws CoreException {
LinkedList<MavenProject> hierarchy = new LinkedList<MavenProject>();
IMaven maven = MavenPlugin.getDefault().getMaven();
- MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
maven.detachFromSession(mavenProject);
hierarchy.add(mavenProject);
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/PomHierarchyComposite.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/PomHierarchyComposite.java
index ef88813e..64294320 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/PomHierarchyComposite.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/PomHierarchyComposite.java
@@ -112,7 +112,7 @@ public class PomHierarchyComposite extends Composite implements IInputSelectionP
public Color getForeground(Object element) {
if(element instanceof MavenProject) {
MavenProject project = (MavenProject) element;
- IMavenProjectFacade search = MavenPlugin.getDefault().getMavenProjectManager()
+ IMavenProjectFacade search = MavenPlugin.getDefault().getMavenProjectRegistry()
.getMavenProject(project.getGroupId(), project.getArtifactId(), project.getVersion());
if(search == null) {
// This project is not in the workspace
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
index 3bf21e0d..444b6304 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
@@ -235,10 +235,10 @@ public class ManageDependenciesDialog extends AbstractMavenDialog {
*/
protected void computeResult() {
MavenProject targetPOM = getTargetPOM();
- IMavenProjectFacade targetFacade = MavenPlugin.getDefault().getMavenProjectManager()
+ IMavenProjectFacade targetFacade = MavenPlugin.getDefault().getMavenProjectRegistry()
.getMavenProject(targetPOM.getGroupId(), targetPOM.getArtifactId(), targetPOM.getVersion());
MavenProject currentPOM = projectHierarchy.getFirst();
- IMavenProjectFacade currentFacade = MavenPlugin.getDefault().getMavenProjectManager()
+ IMavenProjectFacade currentFacade = MavenPlugin.getDefault().getMavenProjectRegistry()
.getMavenProject(currentPOM.getGroupId(), currentPOM.getArtifactId(), currentPOM.getVersion());
if (targetFacade == null || currentFacade == null) {
@@ -393,7 +393,7 @@ public class ManageDependenciesDialog extends AbstractMavenDialog {
return;
}
boolean error = false;
- IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectManager()
+ IMavenProjectFacade facade = MavenPlugin.getDefault().getMavenProjectRegistry()
.getMavenProject(targetProject.getGroupId(), targetProject.getArtifactId(), targetProject.getVersion());
if(facade == null) {
error = true;
@@ -471,7 +471,7 @@ public class ManageDependenciesDialog extends AbstractMavenDialog {
public Color getForeground(Object element) {
if(element instanceof MavenProject) {
MavenProject project = (MavenProject) element;
- IMavenProjectFacade search = MavenPlugin.getDefault().getMavenProjectManager()
+ IMavenProjectFacade search = MavenPlugin.getDefault().getMavenProjectRegistry()
.getMavenProject(project.getGroupId(), project.getArtifactId(), project.getVersion());
if(search == null) {
//This project is not in the workspace so we can't really modify it.
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java
index 56e1a2fa..57d082b7 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java
@@ -52,10 +52,11 @@ import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.internal.MavenPluginActivator;
import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
-import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.IMavenProjectRegistry;
import org.eclipse.m2e.core.ui.internal.actions.OpenPomAction;
import org.eclipse.m2e.editor.MavenEditorImages;
import org.eclipse.m2e.editor.internal.Messages;
@@ -137,7 +138,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
}
protected void createFormContent(IManagedForm managedForm) {
- MavenPlugin.getDefault().getMavenProjectManager().addMavenProjectChangedListener(this);
+ MavenPluginActivator.getDefault().getMavenProjectManager().addMavenProjectChangedListener(this);
FormToolkit formToolkit = managedForm.getToolkit();
@@ -822,7 +823,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
if(element instanceof DependencyNode) {
DependencyNode node = (DependencyNode) element;
org.sonatype.aether.artifact.Artifact a = node.getDependency().getArtifact();
- MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.getMavenProject(a.getGroupId(), //
a.getArtifactId(), //
a.getBaseVersion() == null ? a.getVersion() : a.getBaseVersion());
@@ -900,7 +901,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
public Image getImage(Object element) {
if(element instanceof Artifact) {
Artifact a = (Artifact) element;
- MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.getMavenProject(a.getGroupId(), //
a.getArtifactId(), //
a.getBaseVersion() == null ? a.getVersion() : a.getBaseVersion());
@@ -985,7 +986,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
@Override
public void dispose() {
- MavenPlugin.getDefault().getMavenProjectManager().removeMavenProjectChangedListener(this);
+ MavenPluginActivator.getDefault().getMavenProjectManager().removeMavenProjectChangedListener(this);
if(searchHighlightColor != null) {
searchHighlightColor.dispose();
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
index f100b7b9..f3faf4a8 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java
@@ -55,10 +55,10 @@ import org.eclipse.jface.text.source.IVerticalRuler;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.embedder.ArtifactKey;
+import org.eclipse.m2e.core.internal.MavenPluginActivator;
import org.eclipse.m2e.core.project.IMavenProjectChangedListener;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
import org.eclipse.m2e.core.project.MavenProjectChangedEvent;
-import org.eclipse.m2e.core.project.MavenProjectManager;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.core.ui.internal.actions.OpenPomAction.MavenPathStorageEditorInput;
import org.eclipse.m2e.core.ui.internal.actions.OpenPomAction.MavenStorageEditorInput;
@@ -741,8 +741,7 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
}
public void dispose() {
- MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
- projectManager.removeMavenProjectChangedListener(this);
+ MavenPluginActivator.getDefault().getMavenProjectManager().removeMavenProjectChangedListener(this);
new UIJob(Messages.MavenPomEditor_job_disposing) {
@SuppressWarnings("synthetic-access")
@@ -802,8 +801,7 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
}
reloadMavenProjectCache();
- MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
- projectManager.addMavenProjectChangedListener(this);
+ MavenPluginActivator.getDefault().getMavenProjectManager().addMavenProjectChangedListener(this);
activationListener = new MavenPomActivationListener(site.getWorkbenchWindow().getPartService());
}
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java
index 24b2ce54..63e6979d 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java
@@ -37,7 +37,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.core.IMavenConstants;
import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.MavenProjectManager;
+import org.eclipse.m2e.core.project.IMavenProjectRegistry;
import org.eclipse.m2e.core.ui.internal.actions.OpenPomAction;
import org.eclipse.m2e.core.ui.internal.dialogs.InputHistory;
import org.eclipse.m2e.core.ui.internal.editing.PomEdits;
@@ -588,7 +588,7 @@ public abstract class MavenPomEditorPage extends FormPage {
if (!modulePath.lastSegment().endsWith("pom.xml")) { //$NON-NLS-1$
modulePath = modulePath.append("pom.xml"); //$NON-NLS-1$
}
- MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
+ IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
IMavenProjectFacade[] facades = projectManager.getProjects();
for(int i = 0; i < facades.length; i++ ) {
if(facades[i].getPom().getLocation().equals(modulePath)) {

Back to the top