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

[fix] bug 248685: new connection wizard does not check the default selection against the restricted system type list

This commit is contained in:
Uwe Stieber 2008-10-11 16:10:11 +00:00
parent d4f336f20b
commit 33a35a5cd2

View file

@ -230,11 +230,22 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS
public void setSelection(ISelection selection) {
if (selection instanceof IStructuredSelection) {
IStructuredSelection sel = (IStructuredSelection)selection;
if (sel.getFirstElement() instanceof IRSESystemType) {
// update the selected system type.
selectedSystemType = (IRSESystemType)((IStructuredSelection)selection).getFirstElement();
} else {
// Reset previous selected system type
selectedSystemType = null;
// Only if the first element of the selection is of type IRSESystemType,
// we re-new the selected system type from the selection
if (sel.getFirstElement() instanceof IRSESystemType) {
// Get the system type candidate from the selection.
IRSESystemType candidate = (IRSESystemType)((IStructuredSelection)selection).getFirstElement();
// Accept only system types as selection which are enabled or if
// the wizard has a restricted list of system types, is within the list
// of restricted system types
if (candidate.isEnabled() &&
(restrictedSystemTypes == null ||
restrictedSystemTypes.length == 0 ||
Arrays.asList(restrictedSystemTypes).contains(candidate))) {
selectedSystemType = candidate;
}
}
// signal the system type change