Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2011-05-22 00:11:39 -0400
committerIgor Fedorenko2011-05-22 00:11:39 -0400
commitbe241dfb99b18f07e7209cb048edf40e149c63ff (patch)
tree2fe6a3cfc6ff4b0966af7040c1df78d02671ed56 /org.eclipse.m2e.discovery
parent14ca2eb531ab86b43d0372b0652c61d724f0472b (diff)
downloadm2e-core-be241dfb99b18f07e7209cb048edf40e149c63ff.tar.gz
m2e-core-be241dfb99b18f07e7209cb048edf40e149c63ff.tar.xz
m2e-core-be241dfb99b18f07e7209cb048edf40e149c63ff.zip
346703 get rid of Help->m2e_marketplace menu item
Removed Help->m2e_marketplace menu item as requested. Introduced seriously ugly Maven/Disovery preference page that shows m2e catalog descriptor url and provides a button to open m2e discovery wizard. Ain't pretty, but better than nothing. Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.discovery')
-rw-r--r--org.eclipse.m2e.discovery/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.m2e.discovery/plugin.properties4
-rw-r--r--org.eclipse.m2e.discovery/plugin.xml18
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscovery.java2
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/Messages.java7
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/messages.properties29
-rw-r--r--org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/preferences/DiscoveryPreferencePage.java70
7 files changed, 105 insertions, 26 deletions
diff --git a/org.eclipse.m2e.discovery/META-INF/MANIFEST.MF b/org.eclipse.m2e.discovery/META-INF/MANIFEST.MF
index aaf0e501..00657518 100644
--- a/org.eclipse.m2e.discovery/META-INF/MANIFEST.MF
+++ b/org.eclipse.m2e.discovery/META-INF/MANIFEST.MF
@@ -28,6 +28,7 @@ Export-Package: org.eclipse.m2e.internal.discovery;x-internal:=true,
org.eclipse.m2e.internal.discovery.handlers;x-internal:=true,
org.eclipse.m2e.internal.discovery.markers;x-internal:=true,
org.eclipse.m2e.internal.discovery.operation;x-internal:=true,
+ org.eclipse.m2e.internal.discovery.preferences;x-internal:=true,
org.eclipse.m2e.internal.discovery.startup;x-internal:=true,
org.eclipse.m2e.internal.discovery.strategy;x-internal:=true,
org.eclipse.m2e.internal.discovery.wizards;x-internal:=true
diff --git a/org.eclipse.m2e.discovery/plugin.properties b/org.eclipse.m2e.discovery/plugin.properties
index d1b9c1dc..b0b084e7 100644
--- a/org.eclipse.m2e.discovery/plugin.properties
+++ b/org.eclipse.m2e.discovery/plugin.properties
@@ -9,4 +9,6 @@
Bundle-Vendor = Eclipse.org - m2e
Bundle-Name = m2e Marketplace
Maven.discovery = m2e Marketplace
-Maven.discovery.mnemonic = m \ No newline at end of file
+Maven.discovery.mnemonic = m
+
+preferecepage.discovery.name=Discovery \ No newline at end of file
diff --git a/org.eclipse.m2e.discovery/plugin.xml b/org.eclipse.m2e.discovery/plugin.xml
index 04b83705..dbf87a12 100644
--- a/org.eclipse.m2e.discovery/plugin.xml
+++ b/org.eclipse.m2e.discovery/plugin.xml
@@ -7,15 +7,6 @@
-->
<?eclipse version="3.4"?>
<plugin>
- <extension point="org.eclipse.ui.menus">
- <menuContribution allPopups="false" locationURI="menu:help?after=additions">
- <command
- commandId="org.eclipse.m2e.discovery.ui"
- id="org.eclipse.m2e.discovery.ui"
- mnemonic="%Maven.discovery.mnemonic">
- </command>
- </menuContribution>
- </extension>
<extension point="org.eclipse.ui.commands">
<command id="org.eclipse.m2e.discovery.ui"
name="%Maven.discovery">
@@ -55,4 +46,13 @@
class="org.eclipse.m2e.internal.discovery.MavenDiscoveryLauncher">
</launcher>
</extension>
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ category="org.eclipse.m2e.core.preferences.Maven2PreferencePage"
+ class="org.eclipse.m2e.discovery.internal.preferences.DiscoveryPreferencePage"
+ id="org.eclipse.m2e.discovery.internal.preferences.DiscoveryPreferencePage"
+ name="%preferecepage.discovery.name">
+ </page>
+ </extension>
</plugin>
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscovery.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscovery.java
index 708731be..dd6ab0ac 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscovery.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/MavenDiscovery.java
@@ -59,7 +59,7 @@ public class MavenDiscovery {
private static final Tag MAVEN_TAG = new Tag("maven", Messages.MavenDiscovery_Wizard_MavenTag); //$NON-NLS-1$
- private static final String PATH = "http://download.eclipse.org/technology/m2e/discovery/directory.xml"; //$NON-NLS-1$
+ public static final String PATH = "http://download.eclipse.org/technology/m2e/discovery/directory.xml"; //$NON-NLS-1$
public static final String LIFECYCLE_PATH = "lifecycle/"; //$NON-NLS-1$
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/Messages.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/Messages.java
index 8d190a43..cc8e8216 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/Messages.java
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/Messages.java
@@ -67,6 +67,13 @@ public class Messages extends NLS {
public static String UpdateConfigurationStartup_MarkerError;
+ public static String DiscoveryPreferencePage_title;
+
+ public static String DiscoveryPreferencePage_catalogUrl;
+
+ public static String DiscoveryPreferencePage_openCatalog;
+ public static String DiscoveryPreferencePage_link_text;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/messages.properties b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/messages.properties
index c00eaa74..a9583250 100644
--- a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/messages.properties
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/messages.properties
@@ -1,32 +1,31 @@
-#
-# Copyright (c) 2011 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
-#
-BundleDiscoveryStrategy_3={0}: {1}
-BundleDiscoveryStrategy_categoryDisallowed=Cannot create category ''{0}'' with id ''{1}'' from {2}: disallowed
+#Eclipse modern messages class
+#Sat May 21 23:55:49 EDT 2011
+BundleDiscoveryStrategy_3={0}\: {1}
+BundleDiscoveryStrategy_categoryDisallowed=Cannot create category ''{0}'' with id ''{1}'' from {2}\: disallowed
BundleDiscoveryStrategy_task_processing_extensions=Processing extensions
BundleDiscoveryStrategy_unexpected_element=unexpected element ''{0}''
ConnectorDiscoveryExtensionReader_unexpected_element_icon=Unexpected element icon
ConnectorDiscoveryExtensionReader_unexpected_element_overview=Unexpected element overview
ConnectorDiscoveryExtensionReader_unexpected_value_kind=Unexpected value for kind
-DiscoveryWizardProposal_description=Opens the m2e Marketplace dialog and lets you find the appropriate m2e connectors
+DiscoveryPreferencePage_catalogUrl=Catalog URL
+DiscoveryPreferencePage_link_text=<a>See also</a>
+DiscoveryPreferencePage_openCatalog=Open Catalog
+DiscoveryPreferencePage_title=m2e marketplace discovery
DiscoveryWizardProposal_Label=Discover new m2e connectors
+DiscoveryWizardProposal_description=Opens the m2e Marketplace dialog and lets you find the appropriate m2e connectors
MavenCatalogPage_Descripton=Select updates and extensions to install. Press Finish to proceed with installation.\nPress the information button to see a detailed overview and a link to more information.
MavenCatalogPage_Title=Install m2e connectors
+MavenCatalogViewer_Error_loading_lifecycle=An error occurred loading lifecycle data for catalog item\: {0}
MavenCatalogViewer_allInstalled=All available entries are installed.
-MavenCatalogViewer_Error_loading_lifecycle=An error occurred loading lifecycle data for catalog item: {0}
MavenCatalogViewer_noApplicableMarketplaceItems=No marketplace items are applicable.
MavenCatalogViewer_unexpectedException=Unexpected exception
+MavenDiscoveryInstallOperation_Configuring=Configuring installation selection
+MavenDiscoveryInstallOperation_ErrorMessage=Error(s) occurred gathering items for installation
+MavenDiscoveryInstallOperation_missingIU=Error installing {0} unable to locate installable unit {1}
+MavenDiscoveryInstallOperation_missingRepository=Error installing {0} contacting repository {1}
MavenDiscoveryWizard_Title=m2e Marketplace
MavenDiscovery_Wizard_Applicable_Tag=Applicable
MavenDiscovery_Wizard_ExtrasTag=Extras
MavenDiscovery_Wizard_LifecyclesTag=Lifecycles
MavenDiscovery_Wizard_MavenTag=Maven
-MavenDiscoveryInstallOperation_Configuring=Configuring installation selection
-MavenDiscoveryInstallOperation_ErrorMessage=Error(s) occurred gathering items for installation
-MavenDiscoveryInstallOperation_missingIU=Error installing {0} unable to locate installable unit {1}
-MavenDiscoveryInstallOperation_missingRepository=Error installing {0} contacting repository {1}
UpdateConfigurationStartup_MarkerError=Error(s) collecting projects
diff --git a/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/preferences/DiscoveryPreferencePage.java b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/preferences/DiscoveryPreferencePage.java
new file mode 100644
index 00000000..bc853938
--- /dev/null
+++ b/org.eclipse.m2e.discovery/src/org/eclipse/m2e/internal/discovery/preferences/DiscoveryPreferencePage.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.internal.discovery.preferences;
+
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.m2e.internal.discovery.MavenDiscovery;
+import org.eclipse.m2e.internal.discovery.Messages;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+public class DiscoveryPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ IWorkbench workbench;
+
+ public DiscoveryPreferencePage() {
+ super(Messages.DiscoveryPreferencePage_title);
+ noDefaultAndApplyButton();
+ }
+
+ public void init(IWorkbench workbench) {
+ this.workbench = workbench;
+ }
+
+ @Override
+ protected Control createContents(Composite parent) {
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setLayout(new GridLayout(2, false));
+
+ Label lblCatalogUrl = new Label(composite, SWT.NONE);
+ lblCatalogUrl.setText(Messages.DiscoveryPreferencePage_catalogUrl);
+
+ Text catalogUrl = new Text(composite, SWT.BORDER);
+ catalogUrl.setEditable(false);
+ catalogUrl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
+ catalogUrl.setText(MavenDiscovery.PATH);
+
+ Button btnOpenCatalog = new Button(composite, SWT.NONE);
+ btnOpenCatalog.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ MavenDiscovery.launchWizard(workbench.getModalDialogShellProvider().getShell());
+ }
+ });
+ btnOpenCatalog.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
+ btnOpenCatalog.setSize(92, 29);
+ btnOpenCatalog.setText(Messages.DiscoveryPreferencePage_openCatalog);
+ new Label(composite, SWT.NONE);
+ return composite;
+ }
+}

Back to the top