1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 16:55:38 +02:00

[245154][api] add getSubSystemConfigurationProxiesBySystemType()

This commit is contained in:
Martin Oberhuber 2009-03-19 23:37:51 +00:00
parent c3a6d1600f
commit 0509ec1b0f
2 changed files with 54 additions and 15 deletions

View file

@ -31,6 +31,7 @@
* David Dykstal (IBM) - [235800] Document naming restriction for profiles and filter pools
* David Dykstal (IBM) - [236516] Bug in user code causes failure in RSE initialization
* Martin Oberhuber (Wind River) - [261486][api][cleanup] Mark @noimplement interfaces as @noextend
* Martin Oberhuber (Wind River) - [245154][api] add getSubSystemConfigurationProxiesBySystemType()
********************************************************************************/
package org.eclipse.rse.core.model;
@ -84,23 +85,44 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
// ----------------------------
/**
* Public method to retrieve list of subsystem factory proxies registered by extension points.
* Public method to retrieve list of subsystem configuration proxies
* registered by extension points.
*
* @return all subsystem configuration proxies.
*/
public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxies();
/**
* Return all subsystem factory proxies matching a subsystem factory category.
* Return all subsystem configuration proxies matching a subsystem
* configuration category.
*
* @param configurationCategory a subsystem configuration category.
* @return all subsystem configuration proxies matching the given category,
* or an empty array if none matches.
* @see ISubSystemConfigurationCategories
*/
public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxiesByCategory(String factoryCategory);
public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxiesByCategory(String configurationCategory);
/**
* Return all subsystem configuration proxies that are registered against
* the given system type.
*
* @param systemType system type to filter
* @return all subsystem configuration proxies matching the given system
* type, or an empty array if none matches.
* @since 3.1
*/
public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxiesBySystemType(IRSESystemType systemType);
/**
* Return all subsystem factories.
*
* Be careful when you call this, as it activates all subsystem configurations.
* @deprecated use {@link #getSubSystemConfigurationProxies()} and filter the
* list of needed subsystem configurations in order to activate only those
* that are really needed.
* Be careful when you call this, as it activates all subsystem
* configurations.
*
* @deprecated use {@link #getSubSystemConfigurationProxies()} and filter
* the list of needed subsystem configurations in order to
* activate only those that are really needed.
*/
public ISubSystemConfiguration[] getSubSystemConfigurations();

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
* Copyright (c) 2006, 2009 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
@ -57,7 +57,8 @@
* David McKnight (IBM) - [240991] RSE startup creates display on worker thread before workbench.
* David Dykstal (IBM) - [236516] Bug in user code causes failure in RSE initialization
* David McKnight (IBM) - [249247] Expand New Connections
* David McKnight (IBM( - [254590] When disconnecting a subsystem with COLLAPSE option, subsystems of other connector services also get collapsed
* David McKnight (IBM) - [254590] When disconnecting a subsystem with COLLAPSE option, subsystems of other connector services also get collapsed
* Martin Oberhuber (Wind River) - [245154][api] add getSubSystemConfigurationProxiesBySystemType()
********************************************************************************/
package org.eclipse.rse.internal.core.model;
@ -301,6 +302,22 @@ public class SystemRegistry implements ISystemRegistry
return proxies;
}
/*
* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystemConfigurationProxiesBySystemType(org.eclipse.rse.core.IRSESystemType)
*/
public ISubSystemConfigurationProxy[] getSubSystemConfigurationProxiesBySystemType(IRSESystemType systemType)
{
List l = new ArrayList();
if (subsystemConfigurationProxies != null)
{
for (int idx = 0; idx < subsystemConfigurationProxies.length; idx++)
if (Arrays.asList(subsystemConfigurationProxies[idx].getSystemTypes()).contains(systemType))
l.add(subsystemConfigurationProxies[idx]);
}
return (ISubSystemConfigurationProxy[]) l.toArray(new ISubSystemConfigurationProxy[l.size()]);
}
/**
* Return the subsystem configuration, given its plugin.xml-declared id.
*/
@ -1814,7 +1831,7 @@ public class SystemRegistry implements ISystemRegistry
ISubSystem ss = subSystems[s];
fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_SUBSYSTEM, ss, null);
}
// for bug 249247 - expand the connection after completing the wizard
if (expandHost){
SystemResourceChangeEvent expandEvent = new SystemResourceChangeEvent(conn, ISystemResourceChangeEvents.EVENT_SELECT_EXPAND, reg);
@ -2321,9 +2338,9 @@ public class SystemRegistry implements ISystemRegistry
public void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected, boolean collapseTree)
{
IHost conn = subsystem.getHost();
IConnectorService effectedConnectorService = subsystem.getConnectorService();
if (connected != wasConnected)
{
int eventId = ISystemResourceChangeEvents.EVENT_ICON_CHANGE;
@ -2332,13 +2349,13 @@ public class SystemRegistry implements ISystemRegistry
SystemResourceChangeEvent event = new SystemResourceChangeEvent(subsystem, eventId, conn);
fireEvent(event);
// fire for each subsystem
ISubSystem[] sses = getSubSystems(conn);
for (int i = 0; i < sses.length; i++)
{
ISubSystem ss = sses[i];
// only fire the event for subsystems that share the effected connector service
if (ss != subsystem && ss.getConnectorService().equals(effectedConnectorService))
{
@ -2367,7 +2384,7 @@ public class SystemRegistry implements ISystemRegistry
for (int i = 0; i < sses.length; i++)
{
ISubSystem ss = sses[i];
// only fire the event for subsystems that share the effected connector service
if (ss != subsystem && ss.getConnectorService().equals(effectedConnectorService) && !ss.isConnected())
{