From 655da9c58585ff4ad1b741f498a6a84e230b1d2f Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Sat, 12 May 2007 01:40:42 +0000 Subject: [PATCH] [186523][api] Move subsystemConfigurations extension point from UI to core --- .../org.eclipse.rse.discovery/plugin.xml | 6 +- .../discovery/ServiceDiscoveryWizard.java | 3 +- .../ServiceDiscoveryWizardDisplayPage.java | 5 +- .../guide/Extensions.html | 4 +- .../guide/plugin/subsystem.html | 4 +- .../guide/tutorial/subsystem.html | 4 +- .../reference/extension-points/index.html | 2 +- .../topics_Reference.xml | 6 +- .../plugin.xml | 7 +- .../plugin.xml | 5 +- .../org.eclipse.rse.core/plugin.properties | 2 + rse/plugins/org.eclipse.rse.core/plugin.xml | 56 ++++++++++++++++ .../schema/keystoreProviders.exsd | 2 +- .../schema/subsystemConfigurations.exsd | 7 +- .../schema/systemTypes.exsd | 5 +- .../org/eclipse/rse/core/RSECorePlugin.java | 64 +++++++++++++++++-- .../org.eclipse.rse.processes.ui/plugin.xml | 3 +- .../plugin.xml | 5 +- .../plugin.xml | 5 +- .../plugin.xml | 6 +- .../plugin.xml | 5 +- .../plugin.xml | 5 +- .../plugin.xml | 5 +- .../ShellProcessSubSystemConfiguration.java | 3 +- .../plugin.xml | 5 +- .../plugin.xml | 11 ++-- .../plugin.xml | 5 +- .../plugin.xml | 5 +- .../UI/org/eclipse/rse/ui/RSEUIPlugin.java | 60 +---------------- .../org.eclipse.rse.ui/plugin.properties | 2 +- rse/plugins/org.eclipse.rse.ui/plugin.xml | 60 +---------------- rse/tests/org.eclipse.rse.tests/plugin.xml | 2 +- 32 files changed, 190 insertions(+), 179 deletions(-) rename rse/plugins/{org.eclipse.rse.ui => org.eclipse.rse.core}/schema/subsystemConfigurations.exsd (97%) diff --git a/discovery/org.eclipse.rse.discovery/plugin.xml b/discovery/org.eclipse.rse.discovery/plugin.xml index ca6d9982547..e69de9180df 100644 --- a/discovery/org.eclipse.rse.discovery/plugin.xml +++ b/discovery/org.eclipse.rse.discovery/plugin.xml @@ -1,8 +1,7 @@ - @@ -38,7 +38,7 @@ Contributors: + point="org.eclipse.rse.core.subsystemConfigurations"> - + Remote System Explorer Extension Points @@ -56,7 +56,7 @@ Here are the extension points that are defined by the RSE: For defining new system types that show up in the New Connection wizard. - org.eclipse.rse.ui.subsystemConfigurations + org.eclipse.rse.core.subsystemConfigurations For defining new subsystems that appear when a connection is expanded. diff --git a/rse/doc/org.eclipse.rse.doc.isv/guide/plugin/subsystem.html b/rse/doc/org.eclipse.rse.doc.isv/guide/plugin/subsystem.html index 475d3afb8a4..2701b528732 100755 --- a/rse/doc/org.eclipse.rse.doc.isv/guide/plugin/subsystem.html +++ b/rse/doc/org.eclipse.rse.doc.isv/guide/plugin/subsystem.html @@ -11,7 +11,7 @@

Plugging In SubSystems

-

The org.eclipse.rse.ui.subsystemConfigurations +

The org.eclipse.rse.core.subsystemConfigurations extension point is defined in the plugin org.eclipse.rse.ui. This is the most complex extension point to use, but also the most powerful. It enables tool providers to register a class that creates subsystem objects, which appear under @@ -189,7 +189,7 @@ following summarizes the minimum set of classes you will be creating in order to

  • Creating a subclass of DefaultSubSystemFactoryImpl.
  • -
  • Defining your subsystemConfigurations extension in your plugin.xml file.
  • +
  • Defining your subsystemConfigurations extension in your plugin.xml file.
  • For each remote resource class you created in step 4, you need to create an adapter class, which extends AbstractSystemViewAdapter and which implements ISystemRemoteElementAdapter. diff --git a/rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/subsystem.html b/rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/subsystem.html index eae79cf48d5..d7e960d1683 100755 --- a/rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/subsystem.html +++ b/rse/doc/org.eclipse.rse.doc.isv/guide/tutorial/subsystem.html @@ -10,7 +10,7 @@

    Creating a Subsystem Configuration

    -

    In this tutorial you will use the RSE subsystemConfigurations extension point to show new subsystems within connections, which will then appear when those connections are expanded. Effectively, you will add a new remote-accessing tool to the Remote System Explorer.

    +

    In this tutorial you will use the RSE subsystemConfigurations extension point to show new subsystems within connections, which will then appear when those connections are expanded. Effectively, you will add a new remote-accessing tool to the Remote System Explorer.

    A full-blown tutorial to illustrate this extension point is a bit difficult without inventing server-side code and a communication layer for that server-side code to communication with the @@ -77,7 +77,7 @@ add the line highlighted here. <!-- ======================================= --> <!-- SubSystem Configuration --> <!-- ======================================= --> - <extension point="org.eclipse.rse.ui.subsystemConfigurations"> + <extension point="org.eclipse.rse.core.subsystemConfigurations"> <configuration id="samples.subsystems.factory" systemTypeIds="org.eclipse.rse.systemtype.linux;org.eclipse.rse.systemtype.unix;org.eclipse.rse.systemtype.windows" diff --git a/rse/doc/org.eclipse.rse.doc.isv/reference/extension-points/index.html b/rse/doc/org.eclipse.rse.doc.isv/reference/extension-points/index.html index b799ac2052c..567dcf15954 100755 --- a/rse/doc/org.eclipse.rse.doc.isv/reference/extension-points/index.html +++ b/rse/doc/org.eclipse.rse.doc.isv/reference/extension-points/index.html @@ -15,6 +15,7 @@

  • org.eclipse.rse.core.persistenceProviders
  • org.eclipse.rse.core.systemTypes
  • org.eclipse.rse.core.systemTypeProviders
  • +
  • org.eclipse.rse.core.subsystemConfigurations
  • org.eclipse.rse.services.archivehandlers
  • @@ -24,7 +25,7 @@ Javier Montalvo Orus (Symbian) - [plan] Improve Discovery and Autodetect in RSE + point="org.eclipse.rse.core.subsystemConfigurations"> @@ -59,7 +60,7 @@ Martin Oberhuber (Wind River) - Adapted original tutorial code to Open RSE. + point="org.eclipse.rse.core.subsystemConfigurations"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rse/plugins/org.eclipse.rse.core/schema/keystoreProviders.exsd b/rse/plugins/org.eclipse.rse.core/schema/keystoreProviders.exsd index 716513f8b33..af9c3df0d53 100644 --- a/rse/plugins/org.eclipse.rse.core/schema/keystoreProviders.exsd +++ b/rse/plugins/org.eclipse.rse.core/schema/keystoreProviders.exsd @@ -1,6 +1,6 @@ - + diff --git a/rse/plugins/org.eclipse.rse.ui/schema/subsystemConfigurations.exsd b/rse/plugins/org.eclipse.rse.core/schema/subsystemConfigurations.exsd similarity index 97% rename from rse/plugins/org.eclipse.rse.ui/schema/subsystemConfigurations.exsd rename to rse/plugins/org.eclipse.rse.core/schema/subsystemConfigurations.exsd index 1a752315844..5afff96a9e1 100644 --- a/rse/plugins/org.eclipse.rse.ui/schema/subsystemConfigurations.exsd +++ b/rse/plugins/org.eclipse.rse.core/schema/subsystemConfigurations.exsd @@ -1,9 +1,9 @@ - + - + This extension point allows tool-writers to extend the capability of the Remote System Explorer, by identifying a subsystem configuration that produces a subsystem whenever a new connection is created. This subsystem appears under the connection when it is expanded in the Remote Systems view of the Remote System Explorer perspective. The subsystem configuration is called by the Remote System framework when the user creates a new connection, when the connection's system type is one of the types identified as supported by this subsystem configuration extension. @@ -183,7 +183,7 @@ For example, this attribute could be <code>serviceType="_ftp._tcp;_ft <p> <pre> <extension - point="org.eclipse.rse.ui.subsystemConfigurations"> + point="org.eclipse.rse.core.subsystemConfigurations"> <configuration systemTypeIds="org.eclipse.rse.systemtype.unix;*.rse.systemtype.linux" name="Databases" @@ -247,6 +247,7 @@ Contributors: IBM Corporation - initial API and implementation Uwe Stieber (Wind River) - systemTypeIds attribute extensions Javier Montalvo Orus (Symbian) - [plan] Improve Discovery and Autodetect in RSE +Martin Oberhuber (Wind River) - [186523] Move subsystemConfigurations from UI to core diff --git a/rse/plugins/org.eclipse.rse.core/schema/systemTypes.exsd b/rse/plugins/org.eclipse.rse.core/schema/systemTypes.exsd index eb0d66aa025..88623659bc1 100644 --- a/rse/plugins/org.eclipse.rse.core/schema/systemTypes.exsd +++ b/rse/plugins/org.eclipse.rse.core/schema/systemTypes.exsd @@ -6,7 +6,7 @@ - This extension point is used in combination with the "org.eclipse.rse.ui.subsystemConfigurations" extension point for defining new subsystems, which appear under a connection when it is expanded in the Remote Systems view. The systemTypes extension point allows subsystem providers to define a new system type that appears in the list of valid system types in the New Connection wizard, used by users when defining a new connection to a remote system. The system type is simply a string identifying the operating system type, such as Solaris, and an pair of icons used to identify connections to systems of this type. One icon is used when the connection is not connected, while the other is used when there is a live connection. + This extension point is used in combination with the "org.eclipse.rse.core.subsystemConfigurations" extension point for defining new subsystems, which appear under a connection when it is expanded in the Remote Systems view. The systemTypes extension point allows subsystem providers to define a new system type that appears in the list of valid system types in the New Connection wizard, used by users when defining a new connection to a remote system. The system type is simply a string identifying the operating system type, such as Solaris, and an pair of icons used to identify connections to systems of this type. One icon is used when the connection is not connected, while the other is used when there is a live connection. @@ -217,13 +217,14 @@ If not specified, a default icon will be used by RSE. - Copyright (c) 2002, 2006 IBM Corporation. All Rights Reserved. + Copyright (c) 2002, 2007 IBM Corporation and others. 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: IBM Corporation - initial API and implementation +Martin Oberhuber (Wind River) - [186523] Move subsystemConfigurations from UI to core diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java index 2ed2f35625b..9babbd8157f 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java @@ -20,6 +20,8 @@ package org.eclipse.rse.core; import java.net.InetAddress; import java.net.UnknownHostException; +import java.util.Arrays; +import java.util.Vector; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtensionRegistry; @@ -27,7 +29,10 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Plugin; import org.eclipse.rse.core.comm.SystemKeystoreProviderManager; import org.eclipse.rse.core.model.ISystemRegistry; +import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy; import org.eclipse.rse.internal.core.RSECoreRegistry; +import org.eclipse.rse.internal.core.subsystems.SubSystemConfigurationProxy; +import org.eclipse.rse.internal.core.subsystems.SubSystemConfigurationProxyComparator; import org.eclipse.rse.internal.persistence.RSEPersistenceManager; import org.eclipse.rse.logging.Logger; import org.eclipse.rse.logging.LoggerFactory; @@ -43,20 +48,21 @@ import org.osgi.framework.BundleContext; public class RSECorePlugin extends Plugin { /** - * Current release as a number (multiplied by 10). E.g. 30 is for release 3.0. + * Current release as a number (multiplied by 100). E.g. 300 is for release 3.0.0 */ - public static final int CURRENT_RELEASE = 100; // updated to new release + public static final int CURRENT_RELEASE = 200; // updated to new release /** * Current release as a string. */ - public static final String CURRENT_RELEASE_NAME = "1.0.0"; //$NON-NLS-1$ + public static final String CURRENT_RELEASE_NAME = "2.0.0"; //$NON-NLS-1$ private static RSECorePlugin plugin = null; // the singleton instance of this plugin private Logger logger = null; private ISystemRegistry _registry = null; private IRSEPersistenceManager _persistenceManager = null; - + private ISubSystemConfigurationProxy[] _subsystemConfigurations = null; + /** * Returns the singleton instance of RSECorePlugin. * @return the singleton instance. @@ -246,5 +252,53 @@ public class RSECorePlugin extends Plugin { } } } - + + /** + * Return all elements that extend the org.eclipse.rse.core.subsystemConfigurations extension point + */ + private IConfigurationElement[] getSubSystemConfigurationPlugins() + { + // Get reference to the plug-in registry + IExtensionRegistry registry = Platform.getExtensionRegistry(); + // Get configured extenders + IConfigurationElement[] subsystemFactoryExtensions = + registry.getConfigurationElementsFor("org.eclipse.rse.core","subsystemConfigurations"); //$NON-NLS-1$ //$NON-NLS-2$ + + return subsystemFactoryExtensions; + } + + /** + * Return an array of SubSystemConfigurationProxy objects. + * These represent all extensions to our subsystemConfigurations extension point. + */ + public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxies() + { + if (_subsystemConfigurations != null) // added by PSC + return _subsystemConfigurations; + + IConfigurationElement[] factoryPlugins = getSubSystemConfigurationPlugins(); + if (factoryPlugins != null) + { + Vector v = new Vector(); + for (int idx=0; idx @@ -52,7 +53,7 @@ Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core + point="org.eclipse.rse.core.subsystemConfigurations"> @@ -28,7 +29,7 @@ Javier Montalvo Orus (Symbian) - Fixing 176216 - [api] FTP sould provide API to id="org.eclipse.rse.systemtype.ftp" name="FTP Only"/> - + + point="org.eclipse.rse.core.subsystemConfigurations"> + point="org.eclipse.rse.core.subsystemConfigurations"> @@ -23,7 +24,7 @@ Javier Montalvo Orus (Symbian) - [plan] Improve Discovery and Autodetect in RSE + point="org.eclipse.rse.core.subsystemConfigurations"> + point="org.eclipse.rse.core.subsystemConfigurations"> @@ -20,7 +21,7 @@ Javier Montalvo Orus (Symbian) - [plan] Improve Discovery and Autodetect in RSE + point="org.eclipse.rse.core.subsystemConfigurations"> - - - - + + point="org.eclipse.rse.core.subsystemConfigurations"> + point="org.eclipse.rse.core.subsystemConfigurations"> @@ -21,7 +22,7 @@ Martin Oberhuber - initial API and implementation name="Telnet Only"/> + point="org.eclipse.rse.core.subsystemConfigurations"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rse/tests/org.eclipse.rse.tests/plugin.xml b/rse/tests/org.eclipse.rse.tests/plugin.xml index f6468bab3fa..28cdbc2be91 100644 --- a/rse/tests/org.eclipse.rse.tests/plugin.xml +++ b/rse/tests/org.eclipse.rse.tests/plugin.xml @@ -16,7 +16,7 @@ - +