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

[174992] default wizard hides special ones

This commit is contained in:
Martin Oberhuber 2007-02-21 23:13:08 +00:00
parent 0e825c6f88
commit 6f3727b8ae

View file

@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - initial API and implementation. * Uwe Stieber (Wind River) - initial API and implementation.
* Javier Montalvo Orus (Symbian) - [174992] default wizard hides special ones
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.ui.wizards.newconnection; package org.eclipse.rse.ui.wizards.newconnection;
@ -93,7 +94,8 @@ public class RSENewConnectionWizardRegistry extends RSEAbstractWizardRegistry {
*/ */
public IRSENewConnectionWizardDescriptor getWizardForSystemType(IRSESystemType systemType) { public IRSENewConnectionWizardDescriptor getWizardForSystemType(IRSESystemType systemType) {
assert systemType != null; assert systemType != null;
IRSENewConnectionWizardDescriptor defaultDescriptor = (IRSENewConnectionWizardDescriptor)findElementById("org.eclipse.rse.ui.wizards.newconnection.RSEDefaultNewConnectionWizard"); //$NON-NLS-1$
IRSENewConnectionWizardDescriptor descriptor = null; IRSENewConnectionWizardDescriptor descriptor = null;
String id = systemType.getId(); String id = systemType.getId();
@ -116,14 +118,17 @@ public class RSENewConnectionWizardRegistry extends RSEAbstractWizardRegistry {
IRSEWizardRegistryElement element = elements[i]; IRSEWizardRegistryElement element = elements[i];
if (element instanceof IRSENewConnectionWizardDescriptor) { if (element instanceof IRSENewConnectionWizardDescriptor) {
IRSENewConnectionWizardDescriptor candidate = (IRSENewConnectionWizardDescriptor)element; IRSENewConnectionWizardDescriptor candidate = (IRSENewConnectionWizardDescriptor)element;
String[] systemTypeIds = candidate.getSystemTypeIds(); if(candidate != defaultDescriptor)
if (Arrays.asList(systemTypeIds).contains(id)) { {
if (descriptor == null) { String[] systemTypeIds = candidate.getSystemTypeIds();
descriptor = candidate; if (Arrays.asList(systemTypeIds).contains(id)) {
} else { if (descriptor == null) {
String message = "Duplicated new connection wizard registration for system type ''{0}'' (wizard id = {1})."; //$NON-NLS-1$ descriptor = candidate;
message = MessageFormat.format(message, new Object[] { id, candidate.getId()}); } else {
RSECorePlugin.getDefault().getLogger().logWarning(message); String message = "Duplicated new connection wizard registration for system type ''{0}'' (wizard id = {1})."; //$NON-NLS-1$
message = MessageFormat.format(message, new Object[] { id, candidate.getId()});
RSECorePlugin.getDefault().getLogger().logWarning(message);
}
} }
} }
} }
@ -132,10 +137,7 @@ public class RSENewConnectionWizardRegistry extends RSEAbstractWizardRegistry {
// if the descriptor here is still null, always return the default RSE // if the descriptor here is still null, always return the default RSE
// new connection wizard descriptor // new connection wizard descriptor
if (descriptor == null) { if (descriptor == null) {
IRSEWizardRegistryElement element = findElementById("org.eclipse.rse.ui.wizards.newconnection.RSEDefaultNewConnectionWizard"); //$NON-NLS-1$ descriptor = defaultDescriptor;
if (element instanceof IRSENewConnectionWizardDescriptor) {
descriptor = (IRSENewConnectionWizardDescriptor)element;
}
} }
} }