mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-05 07:15:39 +02:00
[186779] Fix IRSESystemType.getAdapter()
This commit is contained in:
parent
5ba7489961
commit
f431b44e9b
13 changed files with 54 additions and 34 deletions
|
@ -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
|
* 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
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* 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.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* {Name} (company) - description of contribution.
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
package org.eclipse.rse.internal.ui;
|
package org.eclipse.rse.internal.ui;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IAdapterFactory;
|
import org.eclipse.core.runtime.IAdapterFactory;
|
||||||
|
import org.eclipse.core.runtime.IAdapterManager;
|
||||||
import org.eclipse.rse.core.IRSESystemType;
|
import org.eclipse.rse.core.IRSESystemType;
|
||||||
import org.eclipse.rse.ui.RSESystemTypeAdapter;
|
import org.eclipse.rse.ui.RSESystemTypeAdapter;
|
||||||
|
|
||||||
|
@ -23,8 +24,19 @@ public class RSESystemTypeAdapterFactory implements IAdapterFactory {
|
||||||
|
|
||||||
private RSESystemTypeAdapter adapter = new RSESystemTypeAdapter();
|
private RSESystemTypeAdapter adapter = new RSESystemTypeAdapter();
|
||||||
|
|
||||||
public RSESystemTypeAdapterFactory() {
|
public Class[] getAdapterList()
|
||||||
super();
|
{
|
||||||
|
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) {
|
public Object getAdapter(Object adaptableObject, Class adapterType) {
|
||||||
|
@ -36,7 +48,4 @@ public class RSESystemTypeAdapterFactory implements IAdapterFactory {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Class[] getAdapterList() {
|
|
||||||
return new Class[] {IRSESystemType.class};
|
|
||||||
}
|
|
||||||
}
|
}
|
|
@ -24,6 +24,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||||
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.ui.view;
|
package org.eclipse.rse.internal.ui.view;
|
||||||
|
@ -1011,7 +1012,7 @@ public class SystemView extends SafeTreeViewer
|
||||||
IRSESystemType[] systemTypes = RSECorePlugin.getTheCoreRegistry().getSystemTypes();
|
IRSESystemType[] systemTypes = RSECorePlugin.getTheCoreRegistry().getSystemTypes();
|
||||||
for (int i = 0; i < systemTypes.length; i++) {
|
for (int i = 0; i < systemTypes.length; i++) {
|
||||||
IRSESystemType systemType = systemTypes[i];
|
IRSESystemType systemType = systemTypes[i];
|
||||||
Object adapter = systemType.getAdapter(IRSESystemType.class);
|
Object adapter = systemType.getAdapter(RSESystemTypeAdapter.class);
|
||||||
if (adapter instanceof RSESystemTypeAdapter) {
|
if (adapter instanceof RSESystemTypeAdapter) {
|
||||||
((RSESystemTypeAdapter)adapter).addCustomMenuGroups(menu);
|
((RSESystemTypeAdapter)adapter).addCustomMenuGroups(menu);
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
|
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
|
||||||
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.ui.view;
|
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.
|
// _Never_ add any action without the system type provider having said ok to this.
|
||||||
IHost host = (IHost)selection.getFirstElement();
|
IHost host = (IHost)selection.getFirstElement();
|
||||||
IRSESystemType sysType = getSystemTypeForHost(host);
|
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;
|
RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null;
|
||||||
|
|
||||||
//updateAction.setValue(null); // reset
|
//updateAction.setValue(null); // reset
|
||||||
|
@ -174,7 +175,7 @@ public class SystemViewConnectionAdapter
|
||||||
private void addConnectOrDisconnectAction(SystemMenuManager menu, String menuGroup, IStructuredSelection selection) {
|
private void addConnectOrDisconnectAction(SystemMenuManager menu, String menuGroup, IStructuredSelection selection) {
|
||||||
IHost host = (IHost)selection.getFirstElement();
|
IHost host = (IHost)selection.getFirstElement();
|
||||||
IRSESystemType sysType = getSystemTypeForHost(host);
|
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;
|
RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null;
|
||||||
|
|
||||||
ISystemRegistry sysReg = RSECorePlugin.getTheSystemRegistry();
|
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.
|
// _Never_ add any action without the system type provider having said ok to this.
|
||||||
if (element instanceof IHost) {
|
if (element instanceof IHost) {
|
||||||
IRSESystemType sysType = getSystemTypeForHost((IHost)element);
|
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;
|
RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null;
|
||||||
if (sysTypeAdapter != null) {
|
if (sysTypeAdapter != null) {
|
||||||
return sysTypeAdapter.acceptContextMenuActionContribution((IHost)element, SystemCommonDeleteAction.class);
|
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.
|
// _Never_ add any action without the system type provider having said ok to this.
|
||||||
if (element instanceof IHost) {
|
if (element instanceof IHost) {
|
||||||
IRSESystemType sysType = getSystemTypeForHost((IHost)element);
|
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;
|
RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null;
|
||||||
if (sysTypeAdapter != null) {
|
if (sysTypeAdapter != null) {
|
||||||
boolean accepted = false;
|
boolean accepted = false;
|
||||||
|
@ -264,7 +265,7 @@ public class SystemViewConnectionAdapter
|
||||||
// _Never_ add any action without the system type provider having said ok to this.
|
// _Never_ add any action without the system type provider having said ok to this.
|
||||||
if (element instanceof IHost) {
|
if (element instanceof IHost) {
|
||||||
IRSESystemType sysType = getSystemTypeForHost((IHost)element);
|
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;
|
RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null;
|
||||||
if (sysTypeAdapter != null) {
|
if (sysTypeAdapter != null) {
|
||||||
return sysTypeAdapter.acceptContextMenuActionContribution((IHost)element, SystemOpenExplorerPerspectiveAction.class);
|
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.
|
// _Never_ add any action without the system type provider having said ok to this.
|
||||||
if (element instanceof IHost) {
|
if (element instanceof IHost) {
|
||||||
IRSESystemType sysType = getSystemTypeForHost((IHost)element);
|
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;
|
RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null;
|
||||||
if (sysTypeAdapter != null) {
|
if (sysTypeAdapter != null) {
|
||||||
return sysTypeAdapter.acceptContextMenuActionContribution((IHost)element, PropertyDialogAction.class);
|
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.
|
// _Never_ add any action without the system type provider having said ok to this.
|
||||||
if (element instanceof IHost) {
|
if (element instanceof IHost) {
|
||||||
IRSESystemType sysType = getSystemTypeForHost((IHost)element);
|
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;
|
RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null;
|
||||||
if (sysTypeAdapter != null) {
|
if (sysTypeAdapter != null) {
|
||||||
return sysTypeAdapter.acceptContextMenuActionContribution((IHost)element, SystemRefreshAction.class);
|
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.
|
// _Never_ add any action without the system type provider having said ok to this.
|
||||||
if (element instanceof IHost) {
|
if (element instanceof IHost) {
|
||||||
IRSESystemType sysType = getSystemTypeForHost((IHost)element);
|
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;
|
RSESystemTypeAdapter sysTypeAdapter = adapter instanceof RSESystemTypeAdapter ? (RSESystemTypeAdapter)adapter : null;
|
||||||
if (sysTypeAdapter != null) {
|
if (sysTypeAdapter != null) {
|
||||||
return sysTypeAdapter.acceptContextMenuActionContribution((IHost)element, SystemCommonRenameAction.class);
|
return sysTypeAdapter.acceptContextMenuActionContribution((IHost)element, SystemCommonRenameAction.class);
|
||||||
|
@ -334,7 +335,7 @@ public class SystemViewConnectionAdapter
|
||||||
ImageDescriptor descriptor = null;
|
ImageDescriptor descriptor = null;
|
||||||
IRSESystemType systemType = getSystemTypeForHost(connection);
|
IRSESystemType systemType = getSystemTypeForHost(connection);
|
||||||
if (systemType != null) {
|
if (systemType != null) {
|
||||||
RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class));
|
RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(systemType.getAdapter(RSESystemTypeAdapter.class));
|
||||||
if (anyConnected) {
|
if (anyConnected) {
|
||||||
descriptor = sysTypeAdapter.getLiveImageDescriptor(systemType);
|
descriptor = sysTypeAdapter.getLiveImageDescriptor(systemType);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||||
* Martin Oberhuber (Wind River) - [185552] Remove remoteSystemsViewPreferencesActions extension point
|
* Martin Oberhuber (Wind River) - [185552] Remove remoteSystemsViewPreferencesActions extension point
|
||||||
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.ui.view;
|
package org.eclipse.rse.internal.ui.view;
|
||||||
|
@ -677,7 +678,7 @@ public class SystemViewPart
|
||||||
IRSESystemType[] systemTypes = RSECorePlugin.getTheCoreRegistry().getSystemTypes();
|
IRSESystemType[] systemTypes = RSECorePlugin.getTheCoreRegistry().getSystemTypes();
|
||||||
for (int i = 0; i < systemTypes.length; i++) {
|
for (int i = 0; i < systemTypes.length; i++) {
|
||||||
IRSESystemType systemType = systemTypes[i];
|
IRSESystemType systemType = systemTypes[i];
|
||||||
Object adapter = systemType.getAdapter(IRSESystemType.class);
|
Object adapter = systemType.getAdapter(RSESystemTypeAdapter.class);
|
||||||
if (adapter instanceof RSESystemTypeAdapter) {
|
if (adapter instanceof RSESystemTypeAdapter) {
|
||||||
((RSESystemTypeAdapter)adapter).addCustomToolbarGroups(this);
|
((RSESystemTypeAdapter)adapter).addCustomToolbarGroups(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [186523] Move subsystemConfigurations from UI to core
|
* Martin Oberhuber (Wind River) - [186523] Move subsystemConfigurations from UI to core
|
||||||
* Martin Oberhuber (Wind River) - [185552] Remove remoteSystemsViewPreferencesActions extension point
|
* Martin Oberhuber (Wind River) - [185552] Remove remoteSystemsViewPreferencesActions extension point
|
||||||
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui;
|
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!
|
// create the connection only if the local system type is enabled!
|
||||||
IRSESystemType systemType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID);
|
IRSESystemType systemType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID);
|
||||||
if (systemType != null) {
|
if (systemType != null) {
|
||||||
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class));
|
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(RSESystemTypeAdapter.class));
|
||||||
if (adapter != null && adapter.isEnabled(systemType)) {
|
if (adapter != null && adapter.isEnabled(systemType)) {
|
||||||
ISystemProfileManager profileManager = SystemProfileManager.getDefault();
|
ISystemProfileManager profileManager = SystemProfileManager.getDefault();
|
||||||
ISystemProfile profile = profileManager.getDefaultPrivateSystemProfile();
|
ISystemProfile profile = profileManager.getDefaultPrivateSystemProfile();
|
||||||
|
@ -462,7 +463,7 @@ public class RSEUIPlugin extends SystemBasePlugin implements ISystemMessageProvi
|
||||||
ssfaf.registerWithManager(manager);
|
ssfaf.registerWithManager(manager);
|
||||||
|
|
||||||
RSESystemTypeAdapterFactory rseSysTypeFactory = new RSESystemTypeAdapterFactory();
|
RSESystemTypeAdapterFactory rseSysTypeFactory = new RSESystemTypeAdapterFactory();
|
||||||
manager.registerAdapters(rseSysTypeFactory, IRSESystemType.class);
|
rseSysTypeFactory.registerWithManager(manager);
|
||||||
|
|
||||||
manager.registerAdapters(new SubSystemConfigurationProxyAdapterFactory(), ISubSystemConfigurationProxy.class);
|
manager.registerAdapters(new SubSystemConfigurationProxyAdapterFactory(), ISubSystemConfigurationProxy.class);
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,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) - [184095] Replace systemTypeName by IRSESystemType
|
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||||
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui;
|
package org.eclipse.rse.ui;
|
||||||
|
@ -501,7 +502,7 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
|
||||||
if (!updateMode) {
|
if (!updateMode) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(defaultSystemType.getAdapter(IRSESystemType.class));
|
RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(defaultSystemType.getAdapter(RSESystemTypeAdapter.class));
|
||||||
return sysTypeAdapter.isEnableOffline(defaultSystemType);
|
return sysTypeAdapter.isEnableOffline(defaultSystemType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||||
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
package org.eclipse.rse.ui.propertypages;
|
package org.eclipse.rse.ui.propertypages;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -361,7 +361,7 @@ public class SystemTypeFieldEditor extends FieldEditor
|
||||||
public Object getValue(Object element, String property)
|
public Object getValue(Object element, String property)
|
||||||
{
|
{
|
||||||
IRSESystemType row = (IRSESystemType)element;
|
IRSESystemType row = (IRSESystemType)element;
|
||||||
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(row.getAdapter(IRSESystemType.class));
|
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(row.getAdapter(RSESystemTypeAdapter.class));
|
||||||
Object value = ""; //$NON-NLS-1$
|
Object value = ""; //$NON-NLS-1$
|
||||||
|
|
||||||
if (property.equals(P_NAME))
|
if (property.equals(P_NAME))
|
||||||
|
@ -387,7 +387,7 @@ public class SystemTypeFieldEditor extends FieldEditor
|
||||||
public void modify(Object element, String property, Object value)
|
public void modify(Object element, String property, Object value)
|
||||||
{
|
{
|
||||||
IRSESystemType row = (IRSESystemType)(((TableItem)element).getData());
|
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))
|
if (property.equals(P_ENABLED))
|
||||||
{
|
{
|
||||||
|
@ -424,7 +424,7 @@ public class SystemTypeFieldEditor extends FieldEditor
|
||||||
public String getColumnText(Object element, int columnIndex)
|
public String getColumnText(Object element, int columnIndex)
|
||||||
{
|
{
|
||||||
IRSESystemType currType = (IRSESystemType)element;
|
IRSESystemType currType = (IRSESystemType)element;
|
||||||
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(currType.getAdapter(IRSESystemType.class));
|
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(currType.getAdapter(RSESystemTypeAdapter.class));
|
||||||
|
|
||||||
if (columnIndex == COLUMN_NAME)
|
if (columnIndex == COLUMN_NAME)
|
||||||
return currType.getLabel();
|
return currType.getLabel();
|
||||||
|
@ -530,7 +530,7 @@ public class SystemTypeFieldEditor extends FieldEditor
|
||||||
// }
|
// }
|
||||||
// // find this system type in the array...
|
// // find this system type in the array...
|
||||||
// IRSESystemType matchingType = RSECorePlugin.getTheCoreRegistry().getSystemType(key);
|
// 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...
|
// // update this system type's attributes as per preferences...
|
||||||
// {
|
// {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Uwe Stieber (Wind River) - initial API and implementation.
|
* Uwe Stieber (Wind River) - initial API and implementation.
|
||||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.rse.ui.wizards.newconnection;
|
package org.eclipse.rse.ui.wizards.newconnection;
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@ public class RSENewConnectionWizardDescriptor extends RSEWizardDescriptor implem
|
||||||
IRSESystemType[] systemTypes = RSECorePlugin.getTheCoreRegistry().getSystemTypes();
|
IRSESystemType[] systemTypes = RSECorePlugin.getTheCoreRegistry().getSystemTypes();
|
||||||
for (int i = 0; i < systemTypes.length; i++) {
|
for (int i = 0; i < systemTypes.length; i++) {
|
||||||
IRSESystemType systemType = systemTypes[i];
|
IRSESystemType systemType = systemTypes[i];
|
||||||
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class));
|
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(RSESystemTypeAdapter.class));
|
||||||
if (systemTypeMatcher.matches(systemType)
|
if (systemTypeMatcher.matches(systemType)
|
||||||
|| (adapter != null
|
|| (adapter != null
|
||||||
&& adapter.acceptWizardDescriptor(getConfigurationElement().getName(), this))) {
|
&& adapter.acceptWizardDescriptor(getConfigurationElement().getName(), this))) {
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Uwe Stieber (Wind River) - initial API and implementation.
|
* Uwe Stieber (Wind River) - initial API and implementation.
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui.wizards.newconnection;
|
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.
|
// 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)) {
|
if (adapter != null && !adapter.isEnabled(systemType)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Uwe Stieber (Wind River) - initial API and implementation.
|
* Uwe Stieber (Wind River) - initial API and implementation.
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.rse.ui.wizards.newconnection;
|
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$
|
String key = getSystemType().getId() + "::" + getWizardRegistryElement().getId(); //$NON-NLS-1$
|
||||||
Image image = imageRegistry.get(key);
|
Image image = imageRegistry.get(key);
|
||||||
if (image == null) {
|
if (image == null) {
|
||||||
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(getSystemType().getAdapter(IRSESystemType.class));
|
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(getSystemType().getAdapter(RSESystemTypeAdapter.class));
|
||||||
if (adapter != null) {
|
if (adapter != null) {
|
||||||
ImageDescriptor descriptor = adapter.getImageDescriptor(getSystemType());
|
ImageDescriptor descriptor = adapter.getImageDescriptor(getSystemType());
|
||||||
image = descriptor.createImage();
|
image = descriptor.createImage();
|
||||||
|
@ -81,7 +82,7 @@ public class RSENewConnectionWizardSelectionTreeElement extends RSEWizardSelecti
|
||||||
// not come up with a description itself.
|
// not come up with a description itself.
|
||||||
String description = super.getDescription();
|
String description = super.getDescription();
|
||||||
if (description == null) {
|
if (description == null) {
|
||||||
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(getSystemType().getAdapter(IRSESystemType.class));
|
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(getSystemType().getAdapter(RSESystemTypeAdapter.class));
|
||||||
if (adapter != null) {
|
if (adapter != null) {
|
||||||
description = adapter.getDescription(getSystemType());
|
description = adapter.getDescription(getSystemType());
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
* David Dykstal (IBM) - 142806: refactoring persistence framework
|
* David Dykstal (IBM) - 142806: refactoring persistence framework
|
||||||
* 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) - [184095] Replace systemTypeName by IRSESystemType
|
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui.internal.model;
|
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!!!
|
// delegate the creation of the host object instance to the system type provider!!!
|
||||||
if (systemType != null) {
|
if (systemType != null) {
|
||||||
Object adapter = systemType.getAdapter(IRSESystemType.class);
|
Object adapter = systemType.getAdapter(RSESystemTypeAdapter.class);
|
||||||
if (adapter instanceof RSESystemTypeAdapter) {
|
if (adapter instanceof RSESystemTypeAdapter) {
|
||||||
conn = ((RSESystemTypeAdapter)adapter).createNewHostInstance(profile);
|
conn = ((RSESystemTypeAdapter)adapter).createNewHostInstance(profile);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* 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) - [184095] Replace systemTypeName by IRSESystemType
|
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui.internal.model;
|
package org.eclipse.rse.ui.internal.model;
|
||||||
|
@ -185,7 +186,7 @@ public class SystemNewConnectionPromptObject implements ISystemPromptableObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enabled) {
|
if (enabled) {
|
||||||
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class));
|
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(RSESystemTypeAdapter.class));
|
||||||
if (adapter != null && !adapter.isEnabled(systemType)) {
|
if (adapter != null && !adapter.isEnabled(systemType)) {
|
||||||
enabled = false;
|
enabled = false;
|
||||||
}
|
}
|
||||||
|
@ -224,7 +225,7 @@ public class SystemNewConnectionPromptObject implements ISystemPromptableObject,
|
||||||
if (hasChildren())
|
if (hasChildren())
|
||||||
return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTION_ID);
|
return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTION_ID);
|
||||||
else {
|
else {
|
||||||
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemTypes[0].getAdapter(IRSESystemType.class));
|
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemTypes[0].getAdapter(RSESystemTypeAdapter.class));
|
||||||
return adapter.getImageDescriptor(systemTypes[0]);
|
return adapter.getImageDescriptor(systemTypes[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
|
* 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) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util
|
||||||
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
|
||||||
|
* Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui.internal.model;
|
package org.eclipse.rse.ui.internal.model;
|
||||||
|
@ -268,7 +269,7 @@ public class SystemRegistry implements ISystemRegistry, ISystemRegistryUI, ISyst
|
||||||
IHost con = connections[i];
|
IHost con = connections[i];
|
||||||
IRSESystemType sysType = con.getSystemType();
|
IRSESystemType sysType = con.getSystemType();
|
||||||
if (sysType != null) { // sysType can be null if workspace contains a host that is no longer defined by the workbench
|
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!
|
// Note: System types without registered subsystems get disabled by the adapter itself!
|
||||||
// There is no need to re-check this here again.
|
// There is no need to re-check this here again.
|
||||||
if (adapter.isEnabled(sysType)) result.add(con);
|
if (adapter.isEnabled(sysType)) result.add(con);
|
||||||
|
|
Loading…
Add table
Reference in a new issue