1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 18:05:33 +02:00

[176211][api] Moving SystemHostPool to Core

This commit is contained in:
Martin Oberhuber 2007-05-23 12:41:24 +00:00
parent 86f6db17bd
commit f31cc68a3c
5 changed files with 37 additions and 36 deletions

View file

@ -22,6 +22,9 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.rse.core.model.Host;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemProfile;
import org.osgi.framework.Bundle;
/**
@ -171,6 +174,10 @@ public abstract class AbstractRSESystemType extends PlatformObject implements IR
|| testProperty(IRSESystemType.PROPERTY_IS_WINDOWS, true);
}
public IHost createNewHostInstance(ISystemProfile profile) {
return new Host(profile);
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/

View file

@ -19,6 +19,9 @@
package org.eclipse.rse.core;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.internal.core.model.SystemHostPool;
import org.osgi.framework.Bundle;
/**
@ -282,18 +285,27 @@ public interface IRSESystemType extends IAdaptable {
*/
public Bundle getDefiningBundle();
/**
* 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 <tt>subsystemConfigurations</tt>
* extension point.
* <p>
* <b>Note:</b> The list returned here does not imply that the corresponding
* subsystem configurations exist. The list contains only possibilites not,
* requirements.
*
* @return The list of subsystem configuration id's. May be empty,
* but never <code>null</code>.
*/
public String[] getSubsystemConfigurationIds();
/**
* 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 <tt>subsystemConfigurations</tt>
* extension point.
* <p>
* <b>Note:</b> The list returned here does not imply that the corresponding
* subsystem configurations exist. The list contains only possibilites not,
* requirements.
*
* @return The list of subsystem configuration id's. May be empty,
* but never <code>null</code>.
*/
public String[] getSubsystemConfigurationIds();
/**
* Creates a new <code>IHost</code> object instance. This method is
* called from {@link SystemHostPool#createHost(IRSESystemType, String, String, String, String, int)}.
*
* @param profile The system profile to associate with the host.
* @return A new <code>IHost</code> object instance.
*/
public IHost createNewHostInstance(ISystemProfile profile);
}

View file

@ -20,7 +20,7 @@
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
********************************************************************************/
package org.eclipse.rse.ui.internal.model;
package org.eclipse.rse.internal.core.model;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
@ -36,8 +36,6 @@ import org.eclipse.rse.core.model.ISystemHostPool;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.RSEModelObject;
import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.internal.core.model.SystemProfileManager;
import org.eclipse.rse.ui.RSESystemTypeAdapter;
/**
@ -193,10 +191,7 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
// delegate the creation of the host object instance to the system type provider!!!
if (systemType != null) {
Object adapter = systemType.getAdapter(RSESystemTypeAdapter.class);
if (adapter instanceof RSESystemTypeAdapter) {
conn = ((RSESystemTypeAdapter)adapter).createNewHostInstance(profile);
}
conn = systemType.createNewHostInstance(profile);
}
// Fallback to create host object instance here if failed by system type provider.
if (conn == null) conn = new Host(profile);
@ -626,4 +621,4 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
commit();
}
}
}

View file

@ -32,9 +32,7 @@ import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSESystemTypeConstants;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.RSEPreferencesManager;
import org.eclipse.rse.core.model.Host;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.subsystems.IConnectorService;
import org.eclipse.rse.internal.ui.RSEAdapter;
@ -339,16 +337,4 @@ public class RSESystemTypeAdapter extends RSEAdapter {
return false;
}
/**
* Creates a new <code>IHost</code> object instance. This method is
* called from {@link org.eclipse.rse.ui.internal.model.SystemHostPool#createHost(IRSESystemType, String, String, String, String, int)}.
*
* @param profile The system profile to associate with the host.
* @return A new <code>IHost</code> object instance.
*/
public IHost createNewHostInstance(ISystemProfile profile) {
return new Host(profile);
}
}

View file

@ -79,6 +79,7 @@ import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
import org.eclipse.rse.internal.core.filters.SystemFilterStartHere;
import org.eclipse.rse.internal.core.model.SystemHostPool;
import org.eclipse.rse.internal.core.model.SystemModelChangeEvent;
import org.eclipse.rse.internal.core.model.SystemModelChangeEventManager;
import org.eclipse.rse.internal.core.model.SystemPreferenceChangeManager;