Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.m2e.core/plugin.xml1
-rw-r--r--org.eclipse.m2e.core/schema/m2menu.exsd125
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AbstractMavenMenuCreator.java99
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenMenuAction.java157
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/actions/DefaultMavenMenuCreator.java139
-rw-r--r--org.eclipse.m2e.editor/plugin.xml4
-rw-r--r--org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/PomEditorMenuCreator.java35
-rw-r--r--org.eclipse.m2e.jdt/plugin.xml4
-rw-r--r--org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenJdtMenuCreator.java110
-rw-r--r--org.eclipse.m2e.refactoring/plugin.xml4
-rw-r--r--org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringMavenMenuCreator.java36
11 files changed, 0 insertions, 714 deletions
diff --git a/org.eclipse.m2e.core/plugin.xml b/org.eclipse.m2e.core/plugin.xml
index e0842f84..a3c07b5d 100644
--- a/org.eclipse.m2e.core/plugin.xml
+++ b/org.eclipse.m2e.core/plugin.xml
@@ -13,7 +13,6 @@
<extension-point id="scmHandlersUi" name="%extension-point.scmhandlersui.name" schema="schema/scmHandlersUi.exsd"/>
<extension-point id="archetypeCatalogs" name="%extension-point.archetypes.name" schema="schema/archetypes.exsd"/>
<extension-point id="projectConfigurators" name="%extension-point.configurators.name" schema="schema/projectConfigurators.exsd"/>
- <extension-point id="m2menu" name="%extension-point.m2menu.name" schema="schema/m2menu.exsd"/>
<extension-point id="lifecycleMappings" name="%extension-point.lifecyclemappings.name" schema="schema/lifecycleMappings.exsd"/>
<extension-point id="lifecycleMappingPropertyPage" name = "%extension-point.mapping.proppage.name" schema = "schema/lifecycleMappingPropertyPage.exsd"/>
<extension-point id="mavenComponentContributors" name="%extension-point.component.name" schema="schema/mavenComponentContributors.exsd"/>
diff --git a/org.eclipse.m2e.core/schema/m2menu.exsd b/org.eclipse.m2e.core/schema/m2menu.exsd
deleted file mode 100644
index e7e9f364..00000000
--- a/org.eclipse.m2e.core/schema/m2menu.exsd
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.m2e" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.m2e" id="m2menu" name="m2 menu item"/>
- </appinfo>
- <documentation>
- Extension point used to add additional entries to the Maven popup menu
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element deprecated="true" />
- </appinfo>
- <documentation>
- Extension point can be used to contribute additional actions to the Maven popup menu
- </documentation>
- </annotation>
- <complexType>
- <sequence>
- <element ref="factory" minOccurs="1" maxOccurs="unbounded"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appinfo>
- <meta.attribute translatable="true"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="factory">
- <annotation>
- <appinfo>
- <meta.element deprecated="true"/>
- </appinfo>
- <documentation>
- A menu factory used to add actions to the Maven popup menu
- </documentation>
- </annotation>
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
- A menu factory class name
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn="org.eclipse.m2e.actions.AbstractMavenMenuCreator:"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 0.9.6
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- See
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2007, 2008 Sonatype, Inc.
-All rights reserved. This program and the accompanying materials
-are made available under the terms of the Eclipse Public License v1.0
-which accompanies this distribution, and is available at
-http://www.eclipse.org/legal/epl-v10.html
- </documentation>
- </annotation>
-
-</schema>
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AbstractMavenMenuCreator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AbstractMavenMenuCreator.java
deleted file mode 100644
index 92a431a5..00000000
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/AbstractMavenMenuCreator.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.m2e.core.actions;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IActionDelegate;
-
-import org.eclipse.m2e.core.MavenPlugin;
-
-
-/**
- * Abstract Maven menu creator can be used to contribute custom entries to the Maven popup menu.
- * <p>
- * Custom items can be added to one of the standard groups {@link #NEW}, {@link #OPEN}, {@link #UPDATE}, {@link #NATURE}
- * or {@link #IMPORT}.
- *
- * @see org.eclipse.m2e.m2menu extension point
- *
- * @author Eugene Kuleshov
- */
-public abstract class AbstractMavenMenuCreator {
- public static final String NEW = "new"; //$NON-NLS-1$
- public static final String OPEN = "open"; //$NON-NLS-1$
- public static final String UPDATE = "update"; //$NON-NLS-1$
- public static final String NATURE = "nature"; //$NON-NLS-1$
- public static final String IMPORT = "import"; //$NON-NLS-1$
-
- protected IStructuredSelection selection;
-
- public void selectionChanged(IAction action, ISelection selection) {
- if(selection instanceof IStructuredSelection) {
- this.selection = (IStructuredSelection) selection;
- }
- }
-
- /**
- * Creates menu items in given menu manager.
- */
- public abstract void createMenu(IMenuManager mgr);
-
- /**
- * A helper method to create IAction instance from given IActionDelegate.
- */
- protected IAction getAction(IActionDelegate delegate, String id, String text) {
- return getAction(delegate, id, text, (ImageDescriptor) null);
- }
-
- /**
- * A helper method to create IAction instance from given IActionDelegate.
- */
- protected IAction getAction(IActionDelegate delegate, String id, String text, String image) {
- return getAction(delegate, id, text, MavenPlugin.getImageDescriptor(image));
- }
-
- protected IAction getAction(IActionDelegate delegate, String id, String text, ImageDescriptor image) {
- ActionProxy action = new ActionProxy(id, text, delegate);
- if(image!=null) {
- action.setImageDescriptor(image);
- }
- return action;
- }
-
- class ActionProxy extends Action {
- private IActionDelegate action;
-
- public ActionProxy(String id, String text, IActionDelegate action) {
- super(text);
- this.action = action;
- setId(id);
- }
-
- public ActionProxy(String id, String text, IActionDelegate action, int style) {
- super(text, style);
- this.action = action;
- setId(id);
- }
-
- public void run() {
- action.selectionChanged(this, selection);
- action.run(this);
- }
- }
-
-}
-
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenMenuAction.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenMenuAction.java
deleted file mode 100644
index 6c67de47..00000000
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/actions/MavenMenuAction.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.m2e.core.actions;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.events.MenuAdapter;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-import org.eclipse.m2e.core.core.IMavenConstants;
-import org.eclipse.m2e.core.core.MavenLogger;
-import org.eclipse.m2e.core.internal.actions.DefaultMavenMenuCreator;
-
-
-/**
- * Maven menu action
- *
- * @author Eugene Kuleshov
- */
-public class MavenMenuAction implements IObjectActionDelegate, IMenuCreator {
-
- private static final String EXTENSION_MENU_ITEMS = IMavenConstants.PLUGIN_ID + ".m2menu"; //$NON-NLS-1$
-
- boolean fillMenu;
-
- IAction delegateAction;
-
- List<AbstractMavenMenuCreator> creators = null;
-
- // IObjectActionDelegate
-
- public void run(IAction action) {
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- if(selection instanceof IStructuredSelection) {
- // this.selection = (IStructuredSelection) selection;
- this.fillMenu = true;
-
- if(delegateAction != action) {
- delegateAction = action;
- delegateAction.setMenuCreator(this);
- }
-
- action.setEnabled(!selection.isEmpty());
-
- for(AbstractMavenMenuCreator creator : getCreators()) {
- creator.selectionChanged(action, selection);
- }
- }
- }
-
- // IMenuCreator
-
- public void dispose() {
- }
-
- public Menu getMenu(Control parent) {
- return null;
- }
-
- public Menu getMenu(Menu parent) {
- Menu menu = new Menu(parent);
-
- /**
- * Add listener to re-populate the menu each time it is shown because MenuManager.update(boolean, boolean) doesn't
- * dispose pull-down ActionContribution items for each popup menu.
- */
- menu.addMenuListener(new MenuAdapter() {
- public void menuShown(MenuEvent e) {
- if(fillMenu) {
- Menu m = (Menu) e.widget;
-
- for(MenuItem item : m.getItems()) {
- item.dispose();
- }
-
- IMenuManager mgr = new MenuManager("#maven"); //$NON-NLS-1$
- mgr.add(new GroupMarker(AbstractMavenMenuCreator.NEW));
- mgr.insertAfter(AbstractMavenMenuCreator.NEW, new GroupMarker(AbstractMavenMenuCreator.UPDATE));
- mgr.insertAfter(AbstractMavenMenuCreator.UPDATE, new GroupMarker(AbstractMavenMenuCreator.OPEN));
- mgr.insertAfter(AbstractMavenMenuCreator.OPEN, new GroupMarker(AbstractMavenMenuCreator.NATURE));
- mgr.insertAfter(AbstractMavenMenuCreator.NATURE, new GroupMarker(AbstractMavenMenuCreator.IMPORT));
-
- for(AbstractMavenMenuCreator creator : getCreators()) {
- creator.createMenu(mgr);
- }
-
- for(IContributionItem item : mgr.getItems()) {
- item.fill(m, -1);
- }
-
- fillMenu = false;
- }
- }
- });
-
- return menu;
- }
-
- List<AbstractMavenMenuCreator> getCreators() {
- if(creators == null) {
- creators = new ArrayList<AbstractMavenMenuCreator>();
- creators.add(new DefaultMavenMenuCreator());
-
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint = registry.getExtensionPoint(EXTENSION_MENU_ITEMS);
- if(extensionPoint!=null) {
- for(IExtension extension : extensionPoint.getExtensions()) {
- IConfigurationElement[] elements = extension.getConfigurationElements();
- for(IConfigurationElement element : elements) {
- try {
- AbstractMavenMenuCreator creator = (AbstractMavenMenuCreator) element.createExecutableExtension("class"); //$NON-NLS-1$
- creators.add(creator);
- } catch(CoreException ex) {
- MavenLogger.log(ex);
- }
- }
- }
- }
- }
- return creators;
- }
-
-}
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/actions/DefaultMavenMenuCreator.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/actions/DefaultMavenMenuCreator.java
deleted file mode 100644
index 40221b63..00000000
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/actions/DefaultMavenMenuCreator.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.m2e.core.internal.actions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.ui.PlatformUI;
-
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.actions.AbstractMavenMenuCreator;
-import org.eclipse.m2e.core.actions.AddDependencyAction;
-import org.eclipse.m2e.core.actions.AddPluginAction;
-import org.eclipse.m2e.core.actions.ChangeNatureAction;
-import org.eclipse.m2e.core.actions.DisableNatureAction;
-import org.eclipse.m2e.core.actions.EnableNatureAction;
-import org.eclipse.m2e.core.actions.ModuleProjectWizardAction;
-import org.eclipse.m2e.core.actions.OpenPomAction;
-import org.eclipse.m2e.core.actions.OpenUrlAction;
-import org.eclipse.m2e.core.actions.RefreshMavenModelsAction;
-import org.eclipse.m2e.core.actions.SelectionUtil;
-import org.eclipse.m2e.core.actions.UpdateConfigurationAction;
-import org.eclipse.m2e.core.core.Messages;
-import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.MavenProjectManager;
-import org.eclipse.m2e.core.project.ResolverConfiguration;
-
-
-/**
- * Default Maven menu creator
- *
- * @author Eugene Kuleshov
- */
-public class DefaultMavenMenuCreator extends AbstractMavenMenuCreator {
-
- public void createMenu(IMenuManager mgr) {
- int selectionType = SelectionUtil.getSelectionType(selection);
- if(selectionType == SelectionUtil.UNSUPPORTED) {
- return;
- }
-
- if(selection.size() == 1 && selectionType == SelectionUtil.POM_FILE) {
- mgr.appendToGroup(NEW, getAction(new AddDependencyAction(), //
- AddDependencyAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_dependency));
- mgr.appendToGroup(NEW, getAction(new AddPluginAction(), AddPluginAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_plugin));
- mgr.appendToGroup(NEW, getAction(new ModuleProjectWizardAction(), //
- ModuleProjectWizardAction.ID, Messages.getString("action.moduleProjectWizardAction"))); //$NON-NLS-1$
-
- mgr.prependToGroup(OPEN, new Separator());
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_PROJECT), //
- OpenUrlAction.ID_PROJECT, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_project_page));
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_ISSUES), //
- OpenUrlAction.ID_ISSUES, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_issues));
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_SCM), //
- OpenUrlAction.ID_SCM, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_scm));
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_CI), //
- OpenUrlAction.ID_CI, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_ci));
- }
-
- if(selectionType == SelectionUtil.PROJECT_WITHOUT_NATURE) {
- mgr.appendToGroup(NATURE, getAction(new EnableNatureAction(), //
- EnableNatureAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_enable_dm));
- }
-
- if(selectionType == SelectionUtil.PROJECT_WITH_NATURE) {
- if(selection.size() == 1) {
- mgr.appendToGroup(NEW, getAction(new AddDependencyAction(), AddDependencyAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_dependency));
- mgr.appendToGroup(NEW, getAction(new AddPluginAction(), AddPluginAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_plugin));
- mgr.appendToGroup(NEW, getAction(new ModuleProjectWizardAction(), //
- ModuleProjectWizardAction.ID, Messages.getString("action.moduleProjectWizardAction"))); //$NON-NLS-1$
- mgr.prependToGroup(UPDATE, new Separator());
- }
-
-
- mgr.appendToGroup(UPDATE, getAction(new RefreshMavenModelsAction(), RefreshMavenModelsAction.ID,
- org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_deps, "icons/update_dependencies.gif")); //$NON-NLS-2$
- mgr.appendToGroup(UPDATE, getAction(new RefreshMavenModelsAction(true), RefreshMavenModelsAction.ID_SNAPSHOTS,
- org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_snapshots));
- mgr.appendToGroup(UPDATE, getAction(new UpdateConfigurationAction(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()), //
- UpdateConfigurationAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_config, "icons/update_source_folders.gif")); //$NON-NLS-2$
-
- mgr.prependToGroup(OPEN, new Separator());
- mgr.appendToGroup(OPEN, getAction(new OpenPomAction(), OpenPomAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_open_pom));
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_PROJECT), //
- OpenUrlAction.ID_PROJECT, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_project));
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_ISSUES), OpenUrlAction.ID_ISSUES,
- org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_issues));
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_SCM), OpenUrlAction.ID_SCM,
- org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_scm));
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_CI), OpenUrlAction.ID_CI,
- org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_ci));
-
- boolean enableWorkspaceResolution = true;
- if(selection.size() == 1) {
- IProject project = SelectionUtil.getType(selection.getFirstElement(), IProject.class);
- if(project != null) {
- MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
- IMavenProjectFacade projectFacade = projectManager.create(project, new NullProgressMonitor());
- if(projectFacade != null) {
- ResolverConfiguration configuration = projectFacade.getResolverConfiguration();
- enableWorkspaceResolution = !configuration.shouldResolveWorkspaceProjects();
- }
- }
- }
-
- mgr.prependToGroup(NATURE, new Separator());
- if(enableWorkspaceResolution) {
- mgr.appendToGroup(NATURE, getAction(new ChangeNatureAction(ChangeNatureAction.ENABLE_WORKSPACE),
- ChangeNatureAction.ID_ENABLE_WORKSPACE, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_enable_workspace));
- } else {
- mgr.appendToGroup(NATURE, getAction(new ChangeNatureAction(ChangeNatureAction.DISABLE_WORKSPACE),
- ChangeNatureAction.ID_DISABLE_WORKSPACE, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_disable_workspace));
- }
-
- mgr.appendToGroup(NATURE, getAction(new DisableNatureAction(), //
- DisableNatureAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_disable_management));
- }
-
- if(selectionType == SelectionUtil.WORKING_SET) {
- mgr.appendToGroup(UPDATE, getAction(new RefreshMavenModelsAction(), RefreshMavenModelsAction.ID,
- org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_deps, "icons/update_dependencies.gif")); //$NON-NLS-2$
- mgr.appendToGroup(UPDATE, getAction(new RefreshMavenModelsAction(true), RefreshMavenModelsAction.ID_SNAPSHOTS,
- org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_snapshots));
- mgr.appendToGroup(UPDATE, getAction(new UpdateConfigurationAction(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()), //
- UpdateConfigurationAction.ID, org.eclipse.m2e.core.internal.Messages.DefaultMavenMenuCreator_action_update_config, "icons/update_source_folders.gif")); //$NON-NLS-2$
- }
- }
-
-}
diff --git a/org.eclipse.m2e.editor/plugin.xml b/org.eclipse.m2e.editor/plugin.xml
index 04731592..6bc301dd 100644
--- a/org.eclipse.m2e.editor/plugin.xml
+++ b/org.eclipse.m2e.editor/plugin.xml
@@ -24,10 +24,6 @@
</editor>
</extension>
- <!--extension point="org.eclipse.m2e.core.m2menu">
- <factory class="org.eclipse.m2e.editor.internal.actions.PomEditorMenuCreator"/>
- </extension-->
-
<extension point="org.eclipse.ui.popupMenus">
<objectContribution id="org.eclipse.m2e.classpathMenuWrapper.showDependencyHierarchy"
diff --git a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/PomEditorMenuCreator.java b/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/PomEditorMenuCreator.java
deleted file mode 100644
index f2676969..00000000
--- a/org.eclipse.m2e.editor/src/org/eclipse/m2e/editor/internal/actions/PomEditorMenuCreator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.m2e.editor.internal.actions;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.m2e.core.actions.AbstractMavenMenuCreator;
-import org.eclipse.m2e.core.actions.SelectionUtil;
-import org.eclipse.m2e.editor.MavenEditorImages;
-import org.eclipse.m2e.editor.internal.Messages;
-
-
-/**
- * @author Eugene Kuleshov
- */
-public class PomEditorMenuCreator extends AbstractMavenMenuCreator {
-
- public void createMenu(IMenuManager mgr) {
- int selectionType = SelectionUtil.getSelectionType(selection);
- if(selectionType == SelectionUtil.JAR_FILE) {
- mgr.appendToGroup(OPEN, getAction(new ShowDependencyHierarchyAction(), //
- ShowDependencyHierarchyAction.ID,
- Messages.PomEditorMenuCreator_action_showDependencyHierarchy, MavenEditorImages.HIERARCHY));
- }
- }
-
-}
diff --git a/org.eclipse.m2e.jdt/plugin.xml b/org.eclipse.m2e.jdt/plugin.xml
index 727ac674..f84eb178 100644
--- a/org.eclipse.m2e.jdt/plugin.xml
+++ b/org.eclipse.m2e.jdt/plugin.xml
@@ -77,10 +77,6 @@
</factory>
</extension>
- <!--extension point="org.eclipse.m2e.core.m2menu">
- <factory class="org.eclipse.m2e.jdt.internal.ui.MavenJdtMenuCreator"/>
- </extension-->
-
<extension point="org.eclipse.jdt.ui.javaElementFilters">
<filter id="org.eclipse.m2e.MavenModuleFilter"
targetId="org.eclipse.jdt.ui.PackageExplorer"
diff --git a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenJdtMenuCreator.java b/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenJdtMenuCreator.java
deleted file mode 100644
index c4c83e63..00000000
--- a/org.eclipse.m2e.jdt/src/org/eclipse/m2e/jdt/internal/ui/MavenJdtMenuCreator.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.m2e.jdt.internal.ui;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-
-import org.eclipse.m2e.core.MavenPlugin;
-import org.eclipse.m2e.core.actions.AbstractMavenMenuCreator;
-import org.eclipse.m2e.core.actions.MaterializeAction;
-import org.eclipse.m2e.core.actions.OpenPomAction;
-import org.eclipse.m2e.core.actions.OpenUrlAction;
-import org.eclipse.m2e.core.actions.SelectionUtil;
-import org.eclipse.m2e.core.embedder.ArtifactKey;
-import org.eclipse.m2e.core.project.IMavenProjectFacade;
-import org.eclipse.m2e.core.project.MavenProjectManager;
-import org.eclipse.m2e.jdt.internal.MavenJdtImages;
-import org.eclipse.m2e.jdt.internal.Messages;
-import org.eclipse.m2e.jdt.internal.actions.DownloadSourcesAction;
-import org.eclipse.m2e.jdt.internal.actions.OpenJavaDocAction;
-
-
-/**
- * Maven menu creator for JDT
- *
- * @author Eugene Kuleshov
- */
-public class MavenJdtMenuCreator extends AbstractMavenMenuCreator {
-
- private static final String ID_SOURCES = "org.eclipse.m2e.downloadSourcesAction"; //$NON-NLS-1$
-
- private static final String ID_JAVADOC = "org.eclipse.m2e.downloadJavaDocAction"; //$NON-NLS-1$
-
- /* (non-Javadoc)
- * @see org.eclipse.m2e.internal.actions.AbstractMavenMenuCreator#createMenu(org.eclipse.jface.action.MenuManager)
- */
- public void createMenu(IMenuManager mgr) {
- int selectionType = SelectionUtil.getSelectionType(selection);
- if(selectionType == SelectionUtil.UNSUPPORTED) {
- return;
- }
-
- if(selectionType == SelectionUtil.PROJECT_WITH_NATURE) {
- mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_JAVADOC), //
- DownloadSourcesAction.ID_JAVADOC, Messages.MavenJdtMenuCreator_action_javadoc));
- mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_SOURCES), //
- DownloadSourcesAction.ID_SOURCES, Messages.MavenJdtMenuCreator_action_sources));
- }
-
- if(selectionType == SelectionUtil.JAR_FILE) {
- boolean isProject = false;
- if(selection.size() == 1) {
- ArtifactKey key = SelectionUtil.getType(selection.getFirstElement(), ArtifactKey.class);
- if(key != null) {
- MavenProjectManager projectManager = MavenPlugin.getDefault().getMavenProjectManager();
- IMavenProjectFacade mavenProject = null;
- mavenProject = projectManager.getMavenProject( //
- key.getGroupId(), key.getArtifactId(), key.getVersion());
- if(mavenProject!=null) {
- isProject = true;
- }
- }
- }
-
- if(!isProject) {
- mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_SOURCES), //
- DownloadSourcesAction.ID_SOURCES, Messages.MavenJdtMenuCreator_action_sources));
- mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_JAVADOC), //
- DownloadSourcesAction.ID_JAVADOC, Messages.MavenJdtMenuCreator_action_javadoc));
- mgr.prependToGroup(OPEN, new Separator());
- }
-
- mgr.appendToGroup(OPEN, getAction(new OpenPomAction(), OpenPomAction.ID, Messages.MavenJdtMenuCreator_action_openPom));
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_PROJECT), //
- OpenUrlAction.ID_PROJECT, Messages.MavenJdtMenuCreator_action_openProject));
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_ISSUES), //
- OpenUrlAction.ID_ISSUES, Messages.MavenJdtMenuCreator_action_open_issue));
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_SCM), //
- OpenUrlAction.ID_SCM, Messages.MavenJdtMenuCreator_axtion_openScm));
- mgr.appendToGroup(OPEN, getAction(new OpenUrlAction(OpenUrlAction.ID_CI), //
- OpenUrlAction.ID_CI, Messages.MavenJdtMenuCreator_action_openCI));
- mgr.appendToGroup(OPEN, getAction(new OpenJavaDocAction(), //
- OpenJavaDocAction.ID, Messages.MavenJdtMenuCreator_action_openJavadoc, MavenJdtImages.JAVA_DOC));
-
- if(!isProject) {
- mgr.prependToGroup(IMPORT, new Separator());
- mgr.appendToGroup(IMPORT, getAction(new MaterializeAction(), //
- MaterializeAction.ID, //
- selection.size() == 1 ? Messages.MavenJdtMenuCreator_action_materialize1 : Messages.MavenJdtMenuCreator_action_materializeMany, "icons/import_m2_project.gif")); //$NON-NLS-3$
- }
- }
-
- if(selectionType == SelectionUtil.WORKING_SET) {
- mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_SOURCES), //
- DownloadSourcesAction.ID_SOURCES, Messages.MavenJdtMenuCreator_action_downloadSources));
- mgr.appendToGroup(UPDATE, getAction(new DownloadSourcesAction(ID_JAVADOC), //
- DownloadSourcesAction.ID_JAVADOC, Messages.MavenJdtMenuCreator_action_downloadJavadoc));
- }
- }
-
-}
diff --git a/org.eclipse.m2e.refactoring/plugin.xml b/org.eclipse.m2e.refactoring/plugin.xml
index f7bf62fa..8dd7e3b1 100644
--- a/org.eclipse.m2e.refactoring/plugin.xml
+++ b/org.eclipse.m2e.refactoring/plugin.xml
@@ -104,8 +104,4 @@
</extension>
- <!--extension point="org.eclipse.m2e.core.m2menu">
- <factory class="org.eclipse.m2e.refactoring.internal.RefactoringMavenMenuCreator"/>
- </extension-->
-
</plugin>
diff --git a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringMavenMenuCreator.java b/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringMavenMenuCreator.java
deleted file mode 100644
index 781599cd..00000000
--- a/org.eclipse.m2e.refactoring/src/org/eclipse/m2e/refactoring/internal/RefactoringMavenMenuCreator.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008-2010 Sonatype, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Sonatype, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.m2e.refactoring.internal;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.m2e.core.actions.AbstractMavenMenuCreator;
-import org.eclipse.m2e.core.actions.SelectionUtil;
-import org.eclipse.m2e.refactoring.Messages;
-import org.eclipse.m2e.refactoring.exclude.DependencyExcludeAction;
-
-/**
- * @author Eugene Kuleshov
- */
-public class RefactoringMavenMenuCreator extends AbstractMavenMenuCreator {
-
- public void createMenu(IMenuManager mgr) {
- int selectionType = SelectionUtil.getSelectionType(selection);
- if(selectionType == SelectionUtil.JAR_FILE) {
- mgr.appendToGroup(OPEN, getAction(new DependencyExcludeAction(), //
- DependencyExcludeAction.ID, //
- Messages.RefactoringMavenMenuCreator_action_exclude, //
- RefactoringImages.EXCLUDE));
- }
- }
-
-}
-

Back to the top