Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Piggott2011-04-15 12:44:32 -0400
committerMatthew Piggott2011-04-15 15:03:24 -0400
commitcfc9d18fb6459472703ee574e6d5a1e0e6f5effe (patch)
tree5a88be0ce50becaa93262ff039fb75e3c86358ef /org.eclipse.m2e.editor
parent72aebf4dd3e1edf8b158a11627fe3c0dd044557c (diff)
downloadm2e-core-cfc9d18fb6459472703ee574e6d5a1e0e6f5effe.tar.gz
m2e-core-cfc9d18fb6459472703ee574e6d5a1e0e6f5effe.tar.xz
m2e-core-cfc9d18fb6459472703ee574e6d5a1e0e6f5effe.zip
Removed many uses of depreciated MavenPlugin.getDefault()
Diffstat (limited to 'org.eclipse.m2e.editor')
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependenciesComposite.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/composites/DependencyLabelProvider.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java10
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/DependencyTreePage.java4
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditor.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/MavenPomEditorPage.java2
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java4
7 files changed, 11 insertions, 15 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 8a315f8c..739ddd30 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
@@ -655,7 +655,7 @@ public class DependenciesComposite extends Composite {
IRunnableWithProgress projectLoader = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
try {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.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 d9e06b0b..451cc001 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
@@ -217,7 +217,7 @@ public class DependencyLabelProvider extends LabelProvider implements IColorProv
}
if(groupId != null && artifactId != null && version != null) {
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.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/dialogs/ManageDependenciesDialog.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/dialogs/ManageDependenciesDialog.java
index 6e19c569..4b3feb64 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().getMavenProjectRegistry()
+ IMavenProjectFacade targetFacade = MavenPlugin.getMavenProjectRegistry()
.getMavenProject(targetPOM.getGroupId(), targetPOM.getArtifactId(), targetPOM.getVersion());
MavenProject currentPOM = projectHierarchy.getFirst();
- IMavenProjectFacade currentFacade = MavenPlugin.getDefault().getMavenProjectRegistry()
+ IMavenProjectFacade currentFacade = MavenPlugin.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().getMavenProjectRegistry()
+ IMavenProjectFacade facade = MavenPlugin.getMavenProjectRegistry()
.getMavenProject(targetProject.getGroupId(), targetProject.getArtifactId(), targetProject.getVersion());
if(facade == null) {
error = true;
@@ -403,7 +403,7 @@ public class ManageDependenciesDialog extends AbstractMavenDialog {
org.apache.maven.model.Model model = null;
if(facade.getMavenProject() == null || facade.getMavenProject().getModel() == null) {
try {
- model = MavenPlugin.getDefault().getMavenModelManager().readMavenModel(facade.getPom());
+ model = MavenPlugin.getMavenModelManager().readMavenModel(facade.getPom());
} catch(CoreException e) {
Object[] arguments = {facade.getPom(), e.getLocalizedMessage()};
String message = NLS.bind(Messages.ManageDependenciesDialog_pomReadingError, arguments);
@@ -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().getMavenProjectRegistry()
+ IMavenProjectFacade search = MavenPlugin.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 57d082b7..3e3da0e0 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
@@ -823,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();
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.getMavenProject(a.getGroupId(), //
a.getArtifactId(), //
a.getBaseVersion() == null ? a.getVersion() : a.getBaseVersion());
@@ -901,7 +901,7 @@ public class DependencyTreePage extends FormPage implements IMavenProjectChanged
public Image getImage(Object element) {
if(element instanceof Artifact) {
Artifact a = (Artifact) element;
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade projectFacade = projectManager.getMavenProject(a.getGroupId(), //
a.getArtifactId(), //
a.getBaseVersion() == null ? a.getVersion() : a.getBaseVersion());
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 f3faf4a8..812786a6 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
@@ -690,7 +690,7 @@ public class MavenPomEditor extends FormEditor implements IResourceChangeListene
log.error("Unable to read maven project. Dependencies not updated."); //$NON-NLS-1$
return null;
}
- DependencyNode root = MavenPlugin.getDefault().getMavenModelManager().readDependencyTree(mavenProject, classpath, monitor);
+ DependencyNode root = MavenPlugin.getMavenModelManager().readDependencyTree(mavenProject, classpath, monitor);
root.setData("LEVEL", "ROOT");
for (DependencyNode nd : root.getChildren()) {
nd.setData("LEVEL", "DIRECT");
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 63e6979d..29406f76 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
@@ -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$
}
- IMavenProjectRegistry projectManager = MavenPlugin.getDefault().getMavenProjectRegistry();
+ IMavenProjectRegistry projectManager = MavenPlugin.getMavenProjectRegistry();
IMavenProjectFacade[] facades = projectManager.getProjects();
for(int i = 0; i < facades.length; i++ ) {
if(facades[i].getPom().getLocation().equals(modulePath)) {
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java
index d2a2e6e4..b81bbbf5 100644
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java
+++ b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/pom/PomEditorPreferencePage.java
@@ -13,7 +13,6 @@ package org.eclipse.m2e.editor.pom;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
-import org.eclipse.m2e.core.MavenPlugin;
import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator;
import org.eclipse.m2e.editor.internal.Messages;
import org.eclipse.swt.widgets.Composite;
@@ -24,14 +23,11 @@ public class PomEditorPreferencePage extends FieldEditorPreferencePage implement
public static final String P_DEFAULT_POM_EDITOR_PAGE = "eclipse.m2.defaultPomEditorPage"; //$NON-NLS-1$
public static final String P_SHOW_ADVANCED_TABS = "eclipse.m2.showAdvancedTabs"; //$NON-NLS-1$
- final MavenPlugin plugin;
private Composite parent;
public PomEditorPreferencePage() {
super(GRID);
setPreferenceStore(M2EUIPluginActivator.getDefault().getPreferenceStore());
-
- plugin = MavenPlugin.getDefault();
}
public void init(IWorkbench workbench) {

Back to the top