From 55e431223312f09dc042ee404992d9d8a395b519 Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Sat, 10 Feb 2007 17:17:29 +0000 Subject: [PATCH] [162081] deprecated "systemTypes" attribute of subsystemConfigurations extension point has been removed --- .../plugin.xml | 2 + .../plugin.xml | 1 + .../ISubSystemConfigurationProxy.java | 6 -- .../org.eclipse.rse.processes.ui/plugin.xml | 1 + .../plugin.xml | 2 + .../plugin.xml | 1 + .../plugin.xml | 1 + .../plugin.xml | 1 + .../plugin.xml | 1 + .../plugin.xml | 1 + .../plugin.xml | 1 + .../plugin.xml | 1 + rse/plugins/org.eclipse.rse.ui/plugin.xml | 1 + .../schema/subsystemConfigurations.exsd | 98 +++++++++---------- .../SubSystemConfigurationProxy.java | 62 ++---------- rse/tests/org.eclipse.rse.tests/plugin.xml | 7 +- .../SubSystemConfigurationProxyTestCase.java | 16 +-- 17 files changed, 79 insertions(+), 124 deletions(-) diff --git a/rse/examples/org.eclipse.rse.examples.daytime/plugin.xml b/rse/examples/org.eclipse.rse.examples.daytime/plugin.xml index 2f8514345a8..cdac087b09c 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/plugin.xml +++ b/rse/examples/org.eclipse.rse.examples.daytime/plugin.xml @@ -25,6 +25,7 @@ Martin Oberhuber (Wind River) - initial API and implementation point="org.eclipse.rse.ui.subsystemConfigurations"> systemTypes xml attribute. - * Return the system type names this subsystem configuration supports. - */ - public String getDeclaredSystemTypeNames(); - /** * Return value of the systemTypeIds xml attribute. * Return the system type ids this subsystem configuration supports. diff --git a/rse/plugins/org.eclipse.rse.processes.ui/plugin.xml b/rse/plugins/org.eclipse.rse.processes.ui/plugin.xml index 442f5b1a417..bbf1f61a6a7 100644 --- a/rse/plugins/org.eclipse.rse.processes.ui/plugin.xml +++ b/rse/plugins/org.eclipse.rse.processes.ui/plugin.xml @@ -25,6 +25,7 @@ Contributors: point="org.eclipse.rse.ui.subsystemConfigurations"> --> + diff --git a/rse/plugins/org.eclipse.rse.ui/schema/subsystemConfigurations.exsd b/rse/plugins/org.eclipse.rse.ui/schema/subsystemConfigurations.exsd index 325b66072a6..aceec8db492 100644 --- a/rse/plugins/org.eclipse.rse.ui/schema/subsystemConfigurations.exsd +++ b/rse/plugins/org.eclipse.rse.ui/schema/subsystemConfigurations.exsd @@ -66,50 +66,6 @@ as a folder name for information contained by the subsystem configuration, or by - - - - Name of the vendor supplying this subsystem configuration. - - - - - - - - - - The icon to dipslay for subsystems of this configuration, when not connected. -Specify the path of the .gif file, relative to your plugin directory. - - - - - - - - - - The icon to display for subsystems of this configuration, when there is a live connection. This -is usually derived from the normal icon, but adorned with a bright green arrow. Specify -a path to the icon's .gif file, relative to your plugin directory. - - - - - - - - - - A class that implements <samp>org.eclipse.rse.core.subsystems.ISubSystemConfiguration</samp>. -It is recommended to extend <samp>org.eclipse.rse.core.subsystems.SubSystemConfiguration</samp> or <samp>org.eclipse.rse.core.servicesubsystem.ServiceSubSystemConfiguration</samp>. - - - - - - @@ -132,27 +88,64 @@ These appear in configuration and properties pages for subsystems. - + - A semicolon separated list of system type names that subsystems from this configuration support. For example, "Unix;Linux". -If not specified and the "systemTypeIds" attribute is not specified, defaults to all system types. The wildcards '*' and '?' are accepted. -<p> -<b>Deprecated:</b> Use the systemTypeIds attribute instead. + Name of the vendor supplying this subsystem configuration. - + + + + + A class that implements <samp>org.eclipse.rse.core.subsystems.ISubSystemConfiguration</samp>. +It is recommended to extend <samp>org.eclipse.rse.core.subsystems.SubSystemConfiguration</samp> or <samp>org.eclipse.rse.core.servicesubsystem.ServiceSubSystemConfiguration</samp>. + + + + + + + + + + A boolean attribute to mark the subsystem configuration compatible with all contributed system types. + + + - A semicolon separated list of system type ids that subsystems from this configuration support. For example, "org.eclipse.rse.systemtype.unix;org.eclipse.rse.systemtype.linux". -If not specified and the "systemTypes" attribute is not specified, defaults to all system types. The wildcards '*' and '?' are accepted. + A semicolon separated list of system type ids that subsystems from this configuration support. For example, "org.eclipse.rse.systemtype.unix;org.eclipse.rse.systemtype.linux". The wildcards '*' and '?' are accepted. The attribute will be not considered if the attribute 'supportsAllSystemTypes' is set to 'true'. + + + + The icon to dipslay for subsystems of this configuration, when not connected. +Specify the path of the .gif file, relative to your plugin directory. + + + + + + + + + + The icon to display for subsystems of this configuration, when there is a live connection. This +is usually derived from the normal icon, but adorned with a bright green arrow. Specify +a path to the icon's .gif file, relative to your plugin directory. + + + + + + @@ -187,6 +180,7 @@ Note that ServiceSubSystems that share the same service should always use the sa point="org.eclipse.rse.ui.subsystemConfigurations"> <configuration systemTypes="Unix;Linux;Local" + supportsAllSystemTypes="false" name="Databases" icon="icons/dbsubsys.gif" iconlive="icons/dbsubsyslive.gif" diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/internal/subsystems/SubSystemConfigurationProxy.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/internal/subsystems/SubSystemConfigurationProxy.java index 76035ad58f9..6e5226ca78a 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/internal/subsystems/SubSystemConfigurationProxy.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/internal/subsystems/SubSystemConfigurationProxy.java @@ -51,8 +51,6 @@ public class SubSystemConfigurationProxy implements ISubSystemConfigurationProxy private String name; // The subsystem configuration description private String description; - // The list of associated system types by name as it appears in the plugin.xml - private String systemTypeNames; // The list of associated system types by id as it appears in the plugin.xml private String systemTypeIds; @@ -95,26 +93,6 @@ public class SubSystemConfigurationProxy implements ISubSystemConfigurationProxy } private final class SystemTypeMatcher implements ISystemTypeMatcher { - private final class SystemTypeNamePattern implements ISystemTypeMatcher { - private final Pattern pattern; - - /** - * Constructor. - */ - public SystemTypeNamePattern(Pattern pattern) { - assert pattern != null; - this.pattern = pattern; - } - - /* (non-Javadoc) - * @see org.eclipse.rse.core.internal.subsystems.SubSystemConfigurationProxy.ISystemTypePattern#matches(org.eclipse.rse.core.IRSESystemType) - */ - public boolean matches(IRSESystemType systemType) { - assert systemType != null; - return pattern.matcher(systemType.getName()).matches(); - } - } - private final class SystemTypeIdPattern implements ISystemTypeMatcher { private final Pattern pattern; @@ -141,21 +119,10 @@ public class SubSystemConfigurationProxy implements ISubSystemConfigurationProxy /** * Constructor. * - * @param declaredSystemTypeNames The list of declared system type names. Might be null. * @param declaredSystemTypeIds The list of declared system type ids. Might be null. */ - public SystemTypeMatcher(String declaredSystemTypeNames, String declaredSystemTypeIds) { + public SystemTypeMatcher(String declaredSystemTypeIds) { // Compile the list of patterns out of given lists of declared system types - if (declaredSystemTypeNames != null) { - String[] names = declaredSystemTypeNames.split(";"); //$NON-NLS-1$ - if (names != null && names.length > 0) { - for (int i = 0; i < names.length; i++) { - SystemTypeNamePattern pattern = new SystemTypeNamePattern(Pattern.compile(makeRegex(names[i]))); - patterns.add(pattern); - } - } - } - if (declaredSystemTypeIds != null) { String[] ids = declaredSystemTypeIds.split(";"); //$NON-NLS-1$ if (ids != null && ids.length > 0) { @@ -204,37 +171,31 @@ public class SubSystemConfigurationProxy implements ISubSystemConfigurationProxy this.id = element.getAttribute("id"); //$NON-NLS-1$ this.name = element.getAttribute("name").trim(); //$NON-NLS-1$ this.description = element.getAttribute("description").trim(); //$NON-NLS-1$ - this.systemTypeNames = element.getAttribute("systemTypes"); //$NON-NLS-1$ this.systemTypeIds = element.getAttribute("systemTypeIds"); //$NON-NLS-1$ this.vendor = element.getAttribute("vendor"); //$NON-NLS-1$ this.category = element.getAttribute("category"); //$NON-NLS-1$ this.priority = Integer.MAX_VALUE; String priorityStr = element.getAttribute("priority"); //$NON-NLS-1$ - - // Normalize the attributes now try { if (priorityStr != null) priority = Integer.parseInt(priorityStr); } catch (NumberFormatException e) { - priority = Integer.MAX_VALUE; SystemBasePlugin.logError("Exception reading priority for subsystem configuration " + name + " defined in plugin " + element.getDeclaringExtension().getNamespaceIdentifier(), e); //$NON-NLS-1$ //$NON-NLS-2$ } + String supportsAllSystemTypes = element.getAttribute("supportsAllSystemTypes"); //$NON-NLS-1$ + if (supportsAllSystemTypes != null) this.allTypes = Boolean.TRUE.equals(Boolean.valueOf(supportsAllSystemTypes)); + if (vendor == null) vendor = "Unknown"; //$NON-NLS-1$ if (category == null) category = "Unknown"; //$NON-NLS-1$ - // We default to all system types if neither systemTypeNames nor systemTypeIds are specified. - if (systemTypeNames == null && systemTypeIds == null) systemTypeIds = "*"; //$NON-NLS-1$ - - this.allTypes = systemTypeIds != null && systemTypeIds.equals("*"); //$NON-NLS-1$ - this.image = getPluginImage(element, element.getAttribute("icon")); //$NON-NLS-1$ if (this.image == null) this.image = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CONNECTION_ID); this.liveImage = getPluginImage(element, element.getAttribute("iconlive")); //$NON-NLS-1$ if (this.liveImage == null) this.liveImage = RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_CONNECTIONLIVE_ID); - systemTypeMatcher = new SystemTypeMatcher(getDeclaredSystemTypeNames(), getDeclaredSystemTypeIds()); + systemTypeMatcher = new SystemTypeMatcher(getDeclaredSystemTypeIds()); } /* (non-Javadoc) @@ -277,14 +238,7 @@ public class SubSystemConfigurationProxy implements ISubSystemConfigurationProxy * @see org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy#getDeclaredSystemTypeIds() */ public String getDeclaredSystemTypeIds() { - return "*".equals(systemTypeIds) ? null : systemTypeIds; //$NON-NLS-1$ - } - - /* (non-Javadoc) - * @see org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy#getDeclaredSystemTypeNames() - */ - public String getDeclaredSystemTypeNames() { - return "*".equals(systemTypeNames) ? null : systemTypeNames; //$NON-NLS-1$ + return systemTypeIds; } /* (non-Javadoc) @@ -310,7 +264,9 @@ public class SubSystemConfigurationProxy implements ISubSystemConfigurationProxy if (isMatchingDeclaredSystemTypes(systemType) || (systemType.getSubsystemConfigurationIds() != null && Arrays.asList(systemType.getSubsystemConfigurationIds()).contains(getId()))) { - resolvedSystemTypes.add(systemType.getName()); + if (!resolvedSystemTypes.contains(systemType.getName())) { + resolvedSystemTypes.add(systemType.getName()); + } } } } diff --git a/rse/tests/org.eclipse.rse.tests/plugin.xml b/rse/tests/org.eclipse.rse.tests/plugin.xml index a835e5a81b3..9450eb44a5c 100644 --- a/rse/tests/org.eclipse.rse.tests/plugin.xml +++ b/rse/tests/org.eclipse.rse.tests/plugin.xml @@ -19,7 +19,8 @@