mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-09-10 12:03:16 +02:00
[176211][api] Moving SystemHostPool to Core
This commit is contained in:
parent
86f6db17bd
commit
f31cc68a3c
5 changed files with 37 additions and 36 deletions
|
@ -22,6 +22,9 @@ import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.PlatformObject;
|
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;
|
import org.osgi.framework.Bundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -171,6 +174,10 @@ public abstract class AbstractRSESystemType extends PlatformObject implements IR
|
||||||
|| testProperty(IRSESystemType.PROPERTY_IS_WINDOWS, true);
|
|| testProperty(IRSESystemType.PROPERTY_IS_WINDOWS, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IHost createNewHostInstance(ISystemProfile profile) {
|
||||||
|
return new Host(profile);
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see java.lang.Object#toString()
|
* @see java.lang.Object#toString()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
package org.eclipse.rse.core;
|
package org.eclipse.rse.core;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IAdaptable;
|
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;
|
import org.osgi.framework.Bundle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -282,18 +285,27 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
*/
|
*/
|
||||||
public Bundle getDefiningBundle();
|
public Bundle getDefiningBundle();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of fully qualified known subsystem configuration id's that
|
* Returns a list of fully qualified known subsystem configuration id's that
|
||||||
* this system type wants to be registered against.
|
* this system type wants to be registered against.
|
||||||
* More subsystem configurations can be added through the <tt>subsystemConfigurations</tt>
|
* More subsystem configurations can be added through the <tt>subsystemConfigurations</tt>
|
||||||
* extension point.
|
* extension point.
|
||||||
* <p>
|
* <p>
|
||||||
* <b>Note:</b> The list returned here does not imply that the corresponding
|
* <b>Note:</b> 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.
|
* requirements.
|
||||||
*
|
*
|
||||||
* @return The list of subsystem configuration id's. May be empty,
|
* @return The list of subsystem configuration id's. May be empty,
|
||||||
* but never <code>null</code>.
|
* but never <code>null</code>.
|
||||||
*/
|
*/
|
||||||
public String[] getSubsystemConfigurationIds();
|
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);
|
||||||
}
|
}
|
|
@ -20,7 +20,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
* 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.ArrayList;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.Iterator;
|
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.ISystemProfile;
|
||||||
import org.eclipse.rse.core.model.RSEModelObject;
|
import org.eclipse.rse.core.model.RSEModelObject;
|
||||||
import org.eclipse.rse.internal.core.RSECoreMessages;
|
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!!!
|
// delegate the creation of the host object instance to the system type provider!!!
|
||||||
if (systemType != null) {
|
if (systemType != null) {
|
||||||
Object adapter = systemType.getAdapter(RSESystemTypeAdapter.class);
|
conn = systemType.createNewHostInstance(profile);
|
||||||
if (adapter instanceof RSESystemTypeAdapter) {
|
|
||||||
conn = ((RSESystemTypeAdapter)adapter).createNewHostInstance(profile);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Fallback to create host object instance here if failed by system type provider.
|
// Fallback to create host object instance here if failed by system type provider.
|
||||||
if (conn == null) conn = new Host(profile);
|
if (conn == null) conn = new Host(profile);
|
||||||
|
@ -626,4 +621,4 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
|
||||||
commit();
|
commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -32,9 +32,7 @@ import org.eclipse.rse.core.IRSESystemType;
|
||||||
import org.eclipse.rse.core.IRSESystemTypeConstants;
|
import org.eclipse.rse.core.IRSESystemTypeConstants;
|
||||||
import org.eclipse.rse.core.RSECorePlugin;
|
import org.eclipse.rse.core.RSECorePlugin;
|
||||||
import org.eclipse.rse.core.RSEPreferencesManager;
|
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.IHost;
|
||||||
import org.eclipse.rse.core.model.ISystemProfile;
|
|
||||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||||
import org.eclipse.rse.internal.ui.RSEAdapter;
|
import org.eclipse.rse.internal.ui.RSEAdapter;
|
||||||
|
@ -339,16 +337,4 @@ public class RSESystemTypeAdapter extends RSEAdapter {
|
||||||
return false;
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -79,6 +79,7 @@ import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
|
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
|
import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
|
||||||
import org.eclipse.rse.internal.core.filters.SystemFilterStartHere;
|
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.SystemModelChangeEvent;
|
||||||
import org.eclipse.rse.internal.core.model.SystemModelChangeEventManager;
|
import org.eclipse.rse.internal.core.model.SystemModelChangeEventManager;
|
||||||
import org.eclipse.rse.internal.core.model.SystemPreferenceChangeManager;
|
import org.eclipse.rse.internal.core.model.SystemPreferenceChangeManager;
|
||||||
|
|
Loading…
Add table
Reference in a new issue