From 672368f0afbcd00b96f982e297b565d54a32f679 Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Fri, 9 Feb 2007 15:56:31 +0000 Subject: [PATCH] [173265] [api] Need systemType -> subsystemConfiguration association. Part 2: Added systemType extension point additional attribut --- .../schema/systemTypes.exsd | 24 +++++++------ .../org/eclipse/rse/core/IRSESystemType.java | 7 ++-- .../rse/core/internal/RSESystemType.java | 35 +++++++++++++------ 3 files changed, 43 insertions(+), 23 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.core/schema/systemTypes.exsd b/rse/plugins/org.eclipse.rse.core/schema/systemTypes.exsd index eb21c1363f7..49ec7c56b7f 100644 --- a/rse/plugins/org.eclipse.rse.core/schema/systemTypes.exsd +++ b/rse/plugins/org.eclipse.rse.core/schema/systemTypes.exsd @@ -6,13 +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.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. @@ -123,6 +117,16 @@ If not specified, a default icon will be used by RSE. + + + + A semicolon separated list of fully qualified subsystem configuration ids this system type wants to get registered against. +<p> +<b>Note:</b> The list specified here does not imply that the corresponding subsystem configurations exist. The list contains only possibilites, not requirements. + + + + @@ -170,9 +174,9 @@ If not specified, a default icon will be used by RSE. <systemType id="com.acme.systemtype.Solaris" name="Solaris" description="Connects to Solaris systems." - icon="icons/solaris.gif" - iconLive="icons/solarisLive.gif"> - </systemType> + icon="icons/solaris.gif" + iconLive="icons/solarisLive.gif"> + </systemType> </extension> </pre> </p> diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java index 4560b5b5e30..377fe1bb7ec 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java @@ -115,11 +115,12 @@ public interface IRSESystemType extends IAdaptable { /** * Returns a list of fully qualified known subsystem configuration id's that - * this system type wants to be registered against. More subsystem configurations - * can be added through the subsystemConfigurations extension point. + * this system type wants to be registered against. + * More subsystem configurations can be added through the subsystemConfigurations + * extension point. *

* Note: The list returned here does not imply that the corresponding - * subsystem configurations exist. The list contains only possibilites not + * subsystem configurations exist. The list contains only possibilites not, * requirements. * * @return The list of subsystem configuration id or null. diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/internal/RSESystemType.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/internal/RSESystemType.java index f37fbe06e03..f614279a847 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/internal/RSESystemType.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/internal/RSESystemType.java @@ -16,6 +16,9 @@ package org.eclipse.rse.core.internal; import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.Platform; @@ -35,13 +38,15 @@ public class RSESystemType implements IRSESystemType { private static final String ATTR_ICONLIVE = "iconLive"; //$NON-NLS-1$ private static final String ATTR_ENABLEOFFLINE = "enableOffline"; //$NON-NLS-1$ private static final String ATTR_VALUE = "value"; //$NON-NLS-1$ + private static final String ATTR_SUBSYSTEMCONFIGURATIONS = "subsystemConfigurationIds"; //$NON-NLS-1$ - String id = null; - String name = null; - String description = null; - HashMap properties; - Bundle definingBundle = null; - + private String id = null; + private String name = null; + private String description = null; + private Map properties; + private Bundle definingBundle = null; + private String[] subsystemConfigurationIds; + /** * Constructor for an object representing a system type. * @param element the configuration element describing the system type @@ -60,8 +65,20 @@ public class RSESystemType implements IRSESystemType { if (iconLive != null) properties.put(IRSESystemTypeConstants.ICON_LIVE, iconLive); String enableOffline = element.getAttribute(ATTR_ENABLEOFFLINE); if (enableOffline != null) properties.put(IRSESystemTypeConstants.ENABLE_OFFLINE, enableOffline); - + definingBundle = Platform.getBundle(element.getContributor().getName()); + + List subsystemConfigs = new LinkedList(); + String attribute = element.getAttribute(ATTR_SUBSYSTEMCONFIGURATIONS); + if (attribute != null) { + // split the list of subsystem configuration ids. + String[] splitted = attribute.split(";"); //$NON-NLS-1$ + // normalize the list of subsystem configuration ids + for (int i = 0; i < splitted.length; i++) { + subsystemConfigs.add(splitted[i].trim()); + } + } + subsystemConfigurationIds = (String[])subsystemConfigs.toArray(new String[subsystemConfigs.size()]); } /** @@ -125,9 +142,7 @@ public class RSESystemType implements IRSESystemType { * @see org.eclipse.rse.core.IRSESystemType#getSubsystemConfigurationIds() */ public String[] getSubsystemConfigurationIds() { - // We are not proposing any subsystem configuration here - // by default. - return null; + return subsystemConfigurationIds; } /**