mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-08 17:45:24 +02:00
Bug 148969
This commit is contained in:
parent
0590f6e4b0
commit
2c92c2ccb0
2 changed files with 47 additions and 3 deletions
|
@ -15,12 +15,14 @@
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui;
|
package org.eclipse.rse.ui;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
import org.eclipse.rse.core.RSECorePlugin;
|
import org.eclipse.rse.core.RSECorePlugin;
|
||||||
import org.eclipse.rse.core.SystemBasePlugin;
|
import org.eclipse.rse.core.SystemBasePlugin;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
|
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
|
||||||
|
import org.eclipse.rse.internal.model.SystemRegistry;
|
||||||
import org.eclipse.rse.model.IHost;
|
import org.eclipse.rse.model.IHost;
|
||||||
import org.eclipse.rse.ui.widgets.InheritableEntryField;
|
import org.eclipse.rse.ui.widgets.InheritableEntryField;
|
||||||
import org.eclipse.rse.ui.widgets.SystemHistoryCombo;
|
import org.eclipse.rse.ui.widgets.SystemHistoryCombo;
|
||||||
|
@ -1072,8 +1074,26 @@ public class SystemWidgetHelpers {
|
||||||
*/
|
*/
|
||||||
public static Combo createSystemTypeCombo(Composite parent, Listener listener, String[] systemTypes) {
|
public static Combo createSystemTypeCombo(Composite parent, Listener listener, String[] systemTypes) {
|
||||||
Combo combo = createReadonlyCombo(parent, listener, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
|
Combo combo = createReadonlyCombo(parent, listener, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
|
||||||
String[] typeItems = ((systemTypes == null) ? RSECorePlugin.getDefault().getRegistry().getSystemTypeNames() :
|
String[] typeItems = ((systemTypes == null) ? RSECorePlugin.getDefault().getRegistry().getSystemTypeNames() : systemTypes);
|
||||||
systemTypes);
|
|
||||||
|
ArrayList list = new ArrayList();
|
||||||
|
|
||||||
|
if (systemTypes == null) {
|
||||||
|
for (int i = 0; i < typeItems.length; i++) {
|
||||||
|
ISubSystemConfiguration[] configurations = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(typeItems[i]);
|
||||||
|
|
||||||
|
if (configurations != null && configurations.length > 0) {
|
||||||
|
list.add(typeItems[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
typeItems = new String[list.size()];
|
||||||
|
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
typeItems[i] = (String)(list.get(i));
|
||||||
|
}
|
||||||
|
|
||||||
combo.setItems(typeItems);
|
combo.setItems(typeItems);
|
||||||
combo.select(0);
|
combo.select(0);
|
||||||
return combo;
|
return combo;
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package org.eclipse.rse.ui.propertypages;
|
package org.eclipse.rse.ui.propertypages;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
import java.util.StringTokenizer;
|
import java.util.StringTokenizer;
|
||||||
|
@ -37,6 +38,7 @@ import org.eclipse.jface.viewers.TextCellEditor;
|
||||||
import org.eclipse.jface.viewers.Viewer;
|
import org.eclipse.jface.viewers.Viewer;
|
||||||
import org.eclipse.rse.core.IRSESystemType;
|
import org.eclipse.rse.core.IRSESystemType;
|
||||||
import org.eclipse.rse.core.RSECorePlugin;
|
import org.eclipse.rse.core.RSECorePlugin;
|
||||||
|
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
|
||||||
import org.eclipse.rse.ui.ISystemPreferencesConstants;
|
import org.eclipse.rse.ui.ISystemPreferencesConstants;
|
||||||
import org.eclipse.rse.ui.RSESystemTypeAdapter;
|
import org.eclipse.rse.ui.RSESystemTypeAdapter;
|
||||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||||
|
@ -308,7 +310,29 @@ public class SystemTypeFieldEditor extends FieldEditor
|
||||||
|
|
||||||
private IRSESystemType[] getSystemTypes(boolean defaults)
|
private IRSESystemType[] getSystemTypes(boolean defaults)
|
||||||
{
|
{
|
||||||
return RSECorePlugin.getDefault().getRegistry().getSystemTypes();
|
IRSESystemType[] types = RSECorePlugin.getDefault().getRegistry().getSystemTypes();
|
||||||
|
|
||||||
|
ArrayList list = new ArrayList();
|
||||||
|
|
||||||
|
if (systemTypes == null) {
|
||||||
|
|
||||||
|
for (int i = 0; i < types.length; i++) {
|
||||||
|
|
||||||
|
ISubSystemConfiguration[] configurations = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(types[i].getName());
|
||||||
|
|
||||||
|
if (configurations != null && configurations.length > 0) {
|
||||||
|
list.add(types[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
types = new IRSESystemType[list.size()];
|
||||||
|
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
types[i] = (IRSESystemType)(list.get(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
|
|
Loading…
Add table
Reference in a new issue