1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 04:55:22 +02:00

[181939] avoid subsystem plugin activation just for enablement checking

This commit is contained in:
Martin Oberhuber 2007-07-18 07:50:13 +00:00
parent 1f63baca56
commit b63bcbea48

View file

@ -17,6 +17,7 @@
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Martin Oberhuber (Wind River) - [181939] avoid subsystem plugin activation just for enablement checking
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui; package org.eclipse.rse.ui;
@ -35,6 +36,7 @@ import org.eclipse.rse.core.RSEPreferencesManager;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
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.core.subsystems.ISubSystemConfigurationProxy;
import org.eclipse.rse.internal.ui.RSEAdapter; import org.eclipse.rse.internal.ui.RSEAdapter;
import org.eclipse.rse.internal.ui.actions.SystemClearAllPasswordsAction; import org.eclipse.rse.internal.ui.actions.SystemClearAllPasswordsAction;
import org.eclipse.rse.internal.ui.actions.SystemWorkOfflineAction; import org.eclipse.rse.internal.ui.actions.SystemWorkOfflineAction;
@ -191,17 +193,18 @@ public class RSESystemTypeAdapter extends RSEAdapter {
* not a system type or if it is not enabled. * not a system type or if it is not enabled.
*/ */
public boolean isEnabled(Object object) { public boolean isEnabled(Object object) {
boolean result = false;
IRSESystemType systemType = getSystemType(object); IRSESystemType systemType = getSystemType(object);
if ( systemType != null) { if ( systemType != null && RSEPreferencesManager.getIsSystemTypeEnabled(systemType)) {
result = RSEPreferencesManager.getIsSystemTypeEnabled(systemType);
// if enabled, check if the system type has any registered subsystems. If // if enabled, check if the system type has any registered subsystems. If
// not, this will auto-disable the system type. // not, this will auto-disable the system type.
if (result && RSECorePlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(systemType, true).length == 0) { ISubSystemConfigurationProxy[] proxies = RSECorePlugin.getTheSystemRegistry().getSubSystemConfigurationProxies();
result = false; for (int i=0; i<proxies.length; i++) {
if (proxies[i].appliesToSystemType(systemType)) {
return true;
}
} }
} }
return result; return false;
} }
/** /**