From f431b44e9b6ff3477760bf2731eab7f89465daca Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Mon, 14 May 2007 13:33:45 +0000 Subject: [PATCH] [186779] Fix IRSESystemType.getAdapter() --- .../ui/RSESystemTypeAdapterFactory.java | 23 +++++++++++++------ .../rse/internal/ui/view/SystemView.java | 3 ++- .../ui/view/SystemViewConnectionAdapter.java | 19 +++++++-------- .../rse/internal/ui/view/SystemViewPart.java | 3 ++- .../UI/org/eclipse/rse/ui/RSEUIPlugin.java | 5 ++-- .../eclipse/rse/ui/SystemConnectionForm.java | 3 ++- .../propertypages/SystemTypeFieldEditor.java | 10 ++++---- .../RSENewConnectionWizardDescriptor.java | 3 ++- .../RSENewConnectionWizardSelectionPage.java | 3 ++- ...wConnectionWizardSelectionTreeElement.java | 5 ++-- .../rse/ui/internal/model/SystemHostPool.java | 3 ++- .../SystemNewConnectionPromptObject.java | 5 ++-- .../rse/ui/internal/model/SystemRegistry.java | 3 ++- 13 files changed, 54 insertions(+), 34 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/RSESystemTypeAdapterFactory.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/RSESystemTypeAdapterFactory.java index 9d6ae94c243..8fe72b89e58 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/RSESystemTypeAdapterFactory.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/RSESystemTypeAdapterFactory.java @@ -1,5 +1,5 @@ /******************************************************************************** - * Copyright (c) 2006 IBM Corporation. All rights reserved. + * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved. * This program and the accompanying materials are made available under the terms * of the Eclipse Public License v1.0 which accompanies this distribution, and is * available at http://www.eclipse.org/legal/epl-v10.html @@ -11,11 +11,12 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() ********************************************************************************/ package org.eclipse.rse.internal.ui; import org.eclipse.core.runtime.IAdapterFactory; +import org.eclipse.core.runtime.IAdapterManager; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.ui.RSESystemTypeAdapter; @@ -23,8 +24,19 @@ public class RSESystemTypeAdapterFactory implements IAdapterFactory { private RSESystemTypeAdapter adapter = new RSESystemTypeAdapter(); - public RSESystemTypeAdapterFactory() { - super(); + public Class[] getAdapterList() + { + return new Class[] {RSESystemTypeAdapter.class}; + } + + /** + * Called by our plugin's startup method to register our adaptable object types + * with the platform. We prefer to do it here to isolate/encapsulate all factory + * logic in this one place. + */ + public void registerWithManager(IAdapterManager manager) + { + manager.registerAdapters(this, IRSESystemType.class); } public Object getAdapter(Object adaptableObject, Class adapterType) { @@ -36,7 +48,4 @@ public class RSESystemTypeAdapterFactory implements IAdapterFactory { } } - public Class[] getAdapterList() { - return new Class[] {IRSESystemType.class}; - } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java index 60033b95b9e..2117551114d 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java @@ -24,6 +24,7 @@ * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() ********************************************************************************/ package org.eclipse.rse.internal.ui.view; @@ -1011,7 +1012,7 @@ public class SystemView extends SafeTreeViewer IRSESystemType[] systemTypes = RSECorePlugin.getTheCoreRegistry().getSystemTypes(); for (int i = 0; i < systemTypes.length; i++) { IRSESystemType systemType = systemTypes[i]; - Object adapter = systemType.getAdapter(IRSESystemType.class); + Object adapter = systemType.getAdapter(RSESystemTypeAdapter.class); if (adapter instanceof RSESystemTypeAdapter) { ((RSESystemTypeAdapter)adapter).addCustomMenuGroups(menu); } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewConnectionAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewConnectionAdapter.java index 6202d67c8b4..af52df69486 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewConnectionAdapter.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewConnectionAdapter.java @@ -23,6 +23,7 @@ * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() ********************************************************************************/ package org.eclipse.rse.internal.ui.view; @@ -135,7 +136,7 @@ public class SystemViewConnectionAdapter // _Never_ add any action without the system type provider having said ok to this. IHost host = (IHost)selection.getFirstElement(); IRSESystemType sysType = getSystemTypeForHost(host); - Object adapter = sysType != null ? sysType.getAdapter(IRSESystemType.class) : null; + Object adapter = sysType != null ? sysType.getAdapter(RSESystemTypeAdapter.class) : null; RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null; //updateAction.setValue(null); // reset @@ -174,7 +175,7 @@ public class SystemViewConnectionAdapter private void addConnectOrDisconnectAction(SystemMenuManager menu, String menuGroup, IStructuredSelection selection) { IHost host = (IHost)selection.getFirstElement(); IRSESystemType sysType = getSystemTypeForHost(host); - Object adapter = sysType != null ? sysType.getAdapter(IRSESystemType.class) : null; + Object adapter = sysType != null ? sysType.getAdapter(RSESystemTypeAdapter.class) : null; RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null; ISystemRegistry sysReg = RSECorePlugin.getTheSystemRegistry(); @@ -225,7 +226,7 @@ public class SystemViewConnectionAdapter // _Never_ add any action without the system type provider having said ok to this. if (element instanceof IHost) { IRSESystemType sysType = getSystemTypeForHost((IHost)element); - Object adapter = sysType != null ? sysType.getAdapter(IRSESystemType.class) : null; + Object adapter = sysType != null ? sysType.getAdapter(RSESystemTypeAdapter.class) : null; RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null; if (sysTypeAdapter != null) { return sysTypeAdapter.acceptContextMenuActionContribution((IHost)element, SystemCommonDeleteAction.class); @@ -242,7 +243,7 @@ public class SystemViewConnectionAdapter // _Never_ add any action without the system type provider having said ok to this. if (element instanceof IHost) { IRSESystemType sysType = getSystemTypeForHost((IHost)element); - Object adapter = sysType != null ? sysType.getAdapter(IRSESystemType.class) : null; + Object adapter = sysType != null ? sysType.getAdapter(RSESystemTypeAdapter.class) : null; RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null; if (sysTypeAdapter != null) { boolean accepted = false; @@ -264,7 +265,7 @@ public class SystemViewConnectionAdapter // _Never_ add any action without the system type provider having said ok to this. if (element instanceof IHost) { IRSESystemType sysType = getSystemTypeForHost((IHost)element); - Object adapter = sysType != null ? sysType.getAdapter(IRSESystemType.class) : null; + Object adapter = sysType != null ? sysType.getAdapter(RSESystemTypeAdapter.class) : null; RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null; if (sysTypeAdapter != null) { return sysTypeAdapter.acceptContextMenuActionContribution((IHost)element, SystemOpenExplorerPerspectiveAction.class); @@ -281,7 +282,7 @@ public class SystemViewConnectionAdapter // _Never_ add any action without the system type provider having said ok to this. if (element instanceof IHost) { IRSESystemType sysType = getSystemTypeForHost((IHost)element); - Object adapter = sysType != null ? sysType.getAdapter(IRSESystemType.class) : null; + Object adapter = sysType != null ? sysType.getAdapter(RSESystemTypeAdapter.class) : null; RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null; if (sysTypeAdapter != null) { return sysTypeAdapter.acceptContextMenuActionContribution((IHost)element, PropertyDialogAction.class); @@ -298,7 +299,7 @@ public class SystemViewConnectionAdapter // _Never_ add any action without the system type provider having said ok to this. if (element instanceof IHost) { IRSESystemType sysType = getSystemTypeForHost((IHost)element); - Object adapter = sysType != null ? sysType.getAdapter(IRSESystemType.class) : null; + Object adapter = sysType != null ? sysType.getAdapter(RSESystemTypeAdapter.class) : null; RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null; if (sysTypeAdapter != null) { return sysTypeAdapter.acceptContextMenuActionContribution((IHost)element, SystemRefreshAction.class); @@ -315,7 +316,7 @@ public class SystemViewConnectionAdapter // _Never_ add any action without the system type provider having said ok to this. if (element instanceof IHost) { IRSESystemType sysType = getSystemTypeForHost((IHost)element); - Object adapter = sysType != null ? sysType.getAdapter(IRSESystemType.class) : null; + Object adapter = sysType != null ? sysType.getAdapter(RSESystemTypeAdapter.class) : null; RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null; if (sysTypeAdapter != null) { return sysTypeAdapter.acceptContextMenuActionContribution((IHost)element, SystemCommonRenameAction.class); @@ -334,7 +335,7 @@ public class SystemViewConnectionAdapter ImageDescriptor descriptor = null; IRSESystemType systemType = getSystemTypeForHost(connection); if (systemType != null) { - RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(systemType.getAdapter(RSESystemTypeAdapter.class)); if (anyConnected) { descriptor = sysTypeAdapter.getLiveImageDescriptor(systemType); } else { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewPart.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewPart.java index eda9e781028..cec6ed7b4e4 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewPart.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemViewPart.java @@ -18,6 +18,7 @@ * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [185552] Remove remoteSystemsViewPreferencesActions extension point * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() ********************************************************************************/ package org.eclipse.rse.internal.ui.view; @@ -677,7 +678,7 @@ public class SystemViewPart IRSESystemType[] systemTypes = RSECorePlugin.getTheCoreRegistry().getSystemTypes(); for (int i = 0; i < systemTypes.length; i++) { IRSESystemType systemType = systemTypes[i]; - Object adapter = systemType.getAdapter(IRSESystemType.class); + Object adapter = systemType.getAdapter(RSESystemTypeAdapter.class); if (adapter instanceof RSESystemTypeAdapter) { ((RSESystemTypeAdapter)adapter).addCustomToolbarGroups(this); } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java index 5aeb085b8ee..3949e0d31e8 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java @@ -22,6 +22,7 @@ * Martin Oberhuber (Wind River) - [186523] Move subsystemConfigurations from UI to core * Martin Oberhuber (Wind River) - [185552] Remove remoteSystemsViewPreferencesActions extension point * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() ********************************************************************************/ package org.eclipse.rse.ui; @@ -107,7 +108,7 @@ public class RSEUIPlugin extends SystemBasePlugin implements ISystemMessageProvi // create the connection only if the local system type is enabled! IRSESystemType systemType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID); if (systemType != null) { - RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(RSESystemTypeAdapter.class)); if (adapter != null && adapter.isEnabled(systemType)) { ISystemProfileManager profileManager = SystemProfileManager.getDefault(); ISystemProfile profile = profileManager.getDefaultPrivateSystemProfile(); @@ -462,7 +463,7 @@ public class RSEUIPlugin extends SystemBasePlugin implements ISystemMessageProvi ssfaf.registerWithManager(manager); RSESystemTypeAdapterFactory rseSysTypeFactory = new RSESystemTypeAdapterFactory(); - manager.registerAdapters(rseSysTypeFactory, IRSESystemType.class); + rseSysTypeFactory.registerWithManager(manager); manager.registerAdapters(new SubSystemConfigurationProxyAdapterFactory(), ISubSystemConfigurationProxy.class); diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java index b4b478b477d..8c6460b1bb8 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/SystemConnectionForm.java @@ -19,6 +19,7 @@ * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() ********************************************************************************/ package org.eclipse.rse.ui; @@ -501,7 +502,7 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab if (!updateMode) { return false; } - RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(defaultSystemType.getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(defaultSystemType.getAdapter(RSESystemTypeAdapter.class)); return sysTypeAdapter.isEnableOffline(defaultSystemType); } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java index 0b9dc456ad5..0120bd6413e 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemTypeFieldEditor.java @@ -16,9 +16,9 @@ * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() ********************************************************************************/ - package org.eclipse.rse.ui.propertypages; import java.util.ArrayList; @@ -361,7 +361,7 @@ public class SystemTypeFieldEditor extends FieldEditor public Object getValue(Object element, String property) { IRSESystemType row = (IRSESystemType)element; - RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(row.getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(row.getAdapter(RSESystemTypeAdapter.class)); Object value = ""; //$NON-NLS-1$ if (property.equals(P_NAME)) @@ -387,7 +387,7 @@ public class SystemTypeFieldEditor extends FieldEditor public void modify(Object element, String property, Object value) { IRSESystemType row = (IRSESystemType)(((TableItem)element).getData()); - RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(row.getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(row.getAdapter(RSESystemTypeAdapter.class)); if (property.equals(P_ENABLED)) { @@ -424,7 +424,7 @@ public class SystemTypeFieldEditor extends FieldEditor public String getColumnText(Object element, int columnIndex) { IRSESystemType currType = (IRSESystemType)element; - RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(currType.getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(currType.getAdapter(RSESystemTypeAdapter.class)); if (columnIndex == COLUMN_NAME) return currType.getLabel(); @@ -530,7 +530,7 @@ public class SystemTypeFieldEditor extends FieldEditor // } // // find this system type in the array... // IRSESystemType matchingType = RSECorePlugin.getTheCoreRegistry().getSystemType(key); -// RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(matchingType.getAdapter(IRSESystemType.class)); +// RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(matchingType.getAdapter(RSESystemTypeAdapter.class)); // // // update this system type's attributes as per preferences... // { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardDescriptor.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardDescriptor.java index bf0f16f9ffe..f9ae8b8111a 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardDescriptor.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardDescriptor.java @@ -8,6 +8,7 @@ * Contributors: * Uwe Stieber (Wind River) - initial API and implementation. * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() *******************************************************************************/ package org.eclipse.rse.ui.wizards.newconnection; @@ -70,7 +71,7 @@ public class RSENewConnectionWizardDescriptor extends RSEWizardDescriptor implem IRSESystemType[] systemTypes = RSECorePlugin.getTheCoreRegistry().getSystemTypes(); for (int i = 0; i < systemTypes.length; i++) { IRSESystemType systemType = systemTypes[i]; - RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(RSESystemTypeAdapter.class)); if (systemTypeMatcher.matches(systemType) || (adapter != null && adapter.acceptWizardDescriptor(getConfigurationElement().getName(), this))) { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardSelectionPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardSelectionPage.java index 0c269117fd0..f3c49bebbc6 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardSelectionPage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardSelectionPage.java @@ -7,6 +7,7 @@ * * Contributors: * Uwe Stieber (Wind River) - initial API and implementation. + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() *******************************************************************************/ package org.eclipse.rse.ui.wizards.newconnection; @@ -111,7 +112,7 @@ public class RSENewConnectionWizardSelectionPage extends WizardPage { } // Second, double check if the system type passed the viewer filter but is disabled. - RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(RSESystemTypeAdapter.class)); if (adapter != null && !adapter.isEnabled(systemType)) { return false; } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardSelectionTreeElement.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardSelectionTreeElement.java index 8317a96634b..96dbac46763 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardSelectionTreeElement.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/newconnection/RSENewConnectionWizardSelectionTreeElement.java @@ -7,6 +7,7 @@ * * Contributors: * Uwe Stieber (Wind River) - initial API and implementation. + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() *******************************************************************************/ package org.eclipse.rse.ui.wizards.newconnection; @@ -62,7 +63,7 @@ public class RSENewConnectionWizardSelectionTreeElement extends RSEWizardSelecti String key = getSystemType().getId() + "::" + getWizardRegistryElement().getId(); //$NON-NLS-1$ Image image = imageRegistry.get(key); if (image == null) { - RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(getSystemType().getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(getSystemType().getAdapter(RSESystemTypeAdapter.class)); if (adapter != null) { ImageDescriptor descriptor = adapter.getImageDescriptor(getSystemType()); image = descriptor.createImage(); @@ -81,7 +82,7 @@ public class RSENewConnectionWizardSelectionTreeElement extends RSEWizardSelecti // not come up with a description itself. String description = super.getDescription(); if (description == null) { - RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(getSystemType().getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(getSystemType().getAdapter(RSESystemTypeAdapter.class)); if (adapter != null) { description = adapter.getDescription(getSystemType()); } diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemHostPool.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemHostPool.java index 2020f370677..1c4bbb698c4 100644 --- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemHostPool.java +++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemHostPool.java @@ -17,6 +17,7 @@ * David Dykstal (IBM) - 142806: refactoring persistence framework * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() ********************************************************************************/ package org.eclipse.rse.ui.internal.model; @@ -192,7 +193,7 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool // delegate the creation of the host object instance to the system type provider!!! if (systemType != null) { - Object adapter = systemType.getAdapter(IRSESystemType.class); + Object adapter = systemType.getAdapter(RSESystemTypeAdapter.class); if (adapter instanceof RSESystemTypeAdapter) { conn = ((RSESystemTypeAdapter)adapter).createNewHostInstance(profile); } diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemNewConnectionPromptObject.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemNewConnectionPromptObject.java index 75c6db1792d..2eae7bc61eb 100644 --- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemNewConnectionPromptObject.java +++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemNewConnectionPromptObject.java @@ -14,6 +14,7 @@ * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() ********************************************************************************/ package org.eclipse.rse.ui.internal.model; @@ -185,7 +186,7 @@ public class SystemNewConnectionPromptObject implements ISystemPromptableObject, } if (enabled) { - RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(RSESystemTypeAdapter.class)); if (adapter != null && !adapter.isEnabled(systemType)) { enabled = false; } @@ -224,7 +225,7 @@ public class SystemNewConnectionPromptObject implements ISystemPromptableObject, if (hasChildren()) return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTION_ID); else { - RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemTypes[0].getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemTypes[0].getAdapter(RSESystemTypeAdapter.class)); return adapter.getImageDescriptor(systemTypes[0]); } } diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistry.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistry.java index 5de26b8f968..6b3f2d94a6c 100644 --- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistry.java +++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/ui/internal/model/SystemRegistry.java @@ -25,6 +25,7 @@ * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() * Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry + * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter() ********************************************************************************/ package org.eclipse.rse.ui.internal.model; @@ -268,7 +269,7 @@ public class SystemRegistry implements ISystemRegistry, ISystemRegistryUI, ISyst IHost con = connections[i]; IRSESystemType sysType = con.getSystemType(); if (sysType != null) { // sysType can be null if workspace contains a host that is no longer defined by the workbench - RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(sysType.getAdapter(IRSESystemType.class)); + RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(sysType.getAdapter(RSESystemTypeAdapter.class)); // Note: System types without registered subsystems get disabled by the adapter itself! // There is no need to re-check this here again. if (adapter.isEnabled(sysType)) result.add(con);