1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-03 22:35:43 +02:00

[180519][api] declaratively register rse.processes.ui adapter factories

This commit is contained in:
Martin Oberhuber 2007-04-04 12:10:00 +00:00
parent 0f90b154a2
commit 202c9a5fe6
10 changed files with 75 additions and 54 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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
@ -12,11 +12,40 @@ Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
Contributors:
{Name} (company) - description of contribution.
Martin Oberhuber (Wind River) - [180519][api] declaratively register rse.processes.ui adapter factories
-->
<?eclipse version="3.1"?>
<plugin>
<!-- ============================================ -->
<!-- Register Adapter Factories -->
<!-- ============================================ -->
<extension point="org.eclipse.core.runtime.adapters">
<!-- IRemoteProcess -->
<factory
class="org.eclipse.rse.internal.processes.ui.view.SystemViewProcessAdapterFactory"
adaptableType="org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess">
<adapter type="org.eclipse.rse.ui.view.ISystemViewElementAdapter"/>
<adapter type="org.eclipse.rse.ui.view.ISystemDragDropAdapter"/>
<adapter type="org.eclipse.rse.ui.view.ISystemRemoteElementAdapter"/>
<adapter type="org.eclipse.ui.views.properties.IPropertySource"/>
<adapter type="org.eclipse.ui.model.IWorkbenchAdapter"/>
<adapter type="org.eclipse.ui.IActionFilter"/>
<!-- TODO Check: These are not in the adapter factories
getAdapterList() Although the adapter implements them
<adapter type="org.eclipse.ui.progress.IDeferredWorkbenchAdapter"/>
<adapter type="org.eclipse.rse.core.subsystems.IRemoteObjectIdentifier"/>
-->
</factory>
<!-- IRemoteProcessSubSystemConfiguration -->
<factory
class="org.eclipse.rse.internal.processes.ui.view.RemoteProcessSubSystemConfigurationAdapterFactory"
adaptableType="org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessSubSystemConfiguration">
<adapter type="org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter"/>
</factory>
</extension>
<!-- ============================================== -->
<!-- Define subsystem configurations for processes... -->
<!-- ============================================== -->
@ -39,7 +68,7 @@ Contributors:
point="org.eclipse.ui.propertyPages">
<page
name="%PropertyPage.ServerLauncherSettings"
class="org.eclipse.rse.ui.propertypages.ServerLauncherPropertyPage"
class="org.eclipse.rse.internal.ui.propertypages.ServerLauncherPropertyPage"
id="org.eclipse.rse.ui.propertypages.serverLauncherPropertyPage">
<filter name="serverLaunchPP" value="true"/>
<enabledWhen>

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
* Copyright (c) 2002, 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,13 +11,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* Martin Oberhuber (Wind River) - [180519][api] declaratively register adapter factories
********************************************************************************/
package org.eclipse.rse.internal.processes.ui.view;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.core.runtime.IAdapterManager;
import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessSubSystemConfiguration;
@ -34,15 +33,17 @@ public class RemoteProcessSubSystemConfigurationAdapterFactory implements IAdapt
{
return new Class[] {ISubSystemConfigurationAdapter.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, IRemoteProcessSubSystemConfiguration.class);
}
// /**
// * Register this factory with the Platform's Adapter Manager.
// * Can be used for explicit registration, but we prefer doing it
// * declaratively in plugin.xml so this is currently not used.
// */
// public void registerWithManager(IAdapterManager manager)
// {
// manager.registerAdapters(this, IRemoteProcessSubSystemConfiguration.class);
// }
/**
* @see IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2005, 2006 IBM Corporation. All rights reserved.
* Copyright (c) 2005, 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,13 +11,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* Martin Oberhuber (Wind River) - [180519][api] declaratively register adapter factories
********************************************************************************/
package org.eclipse.rse.internal.processes.ui.view;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.core.runtime.IAdapterManager;
import org.eclipse.rse.core.SystemBasePlugin;
import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess;
import org.eclipse.rse.ui.view.AbstractSystemRemoteAdapterFactory;
@ -29,15 +28,16 @@ public class SystemViewProcessAdapterFactory extends AbstractSystemRemoteAdapter
{
private SystemViewRemoteProcessAdapter processAdapter = new SystemViewRemoteProcessAdapter();
/**
* 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, IRemoteProcess.class);
}
// /**
// * Register this factory with the Platform's Adapter Manager.
// * Can be used for explicit registration, but we prefer doing it
// * declaratively in plugin.xml so this is currently not used.
// */
// public void registerWithManager(IAdapterManager manager)
// {
// manager.registerAdapters(this, IRemoteProcess.class);
// }
/**
* @see IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
*/

View file

@ -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,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* Martin Oberhuber (Wind River) - [180519][api] declaratively register rse.processes.ui adapter factories
********************************************************************************/
package org.eclipse.rse.processes.ui;
@ -19,12 +19,8 @@ package org.eclipse.rse.processes.ui;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
import org.eclipse.core.runtime.IAdapterManager;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.rse.core.SystemBasePlugin;
import org.eclipse.rse.internal.processes.ui.view.RemoteProcessSubSystemConfigurationAdapterFactory;
import org.eclipse.rse.internal.processes.ui.view.SystemViewProcessAdapterFactory;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.services.clientserver.messages.SystemMessageFile;
import org.eclipse.ui.plugin.AbstractUIPlugin;
@ -39,7 +35,7 @@ public class ProcessesPlugin extends SystemBasePlugin {
private static ProcessesPlugin plugin;
//Resource bundle.
private ResourceBundle resourceBundle;
private SystemViewProcessAdapterFactory svpaf;
private static SystemMessageFile messageFile = null;
private static SystemMessageFile defaultMessageFile = null;
@ -61,13 +57,6 @@ public class ProcessesPlugin extends SystemBasePlugin {
super.start(context);
messageFile = getMessageFile("processmessages.xml"); //$NON-NLS-1$
defaultMessageFile = getDefaultMessageFile("processmessages.xml"); //$NON-NLS-1$
IAdapterManager manager = Platform.getAdapterManager();
svpaf = new SystemViewProcessAdapterFactory();
svpaf.registerWithManager(manager);
RemoteProcessSubSystemConfigurationAdapterFactory rpssfaf = new RemoteProcessSubSystemConfigurationAdapterFactory();
rpssfaf.registerWithManager(manager);
}
/**

View file

@ -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,12 +11,14 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* Martin Oberhuber (Wind River) - [180519][api] declaratively register rse.processes.ui adapter factories
********************************************************************************/
package org.eclipse.rse.internal.subsystems.processes.core;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.rse.subsystems.processes.core.subsystem.impl.RemoteProcessImpl;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@ -38,6 +40,13 @@ public class Activator extends AbstractUIPlugin {
public void start(BundleContext context) throws Exception
{
super.start(context);
// make sure that required adapters factories are loaded
//(will typically activate org.eclipse.rse.processes.ui)
//TODO Check that this does not fire up the UI if we want to be headless
Platform.getAdapterManager().loadAdapter(new RemoteProcessImpl(null,null),
"org.eclipse.rse.ui.view.ISystemViewElementAdapter"); //$NON-NLS-1$
//others will be loaded automatically when the processes.ui plugin is activated
}
/**

View file

@ -13,7 +13,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.dstore.extra,
org.eclipse.rse.connectorservice.dstore,
org.eclipse.rse.subsystems.processes.core,
org.eclipse.rse.processes.ui,
org.eclipse.rse.core,
org.eclipse.rse.ui
Eclipse-LazyStart: true

View file

@ -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,13 +11,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* Martin Oberhuber (Wind River) - [180519] declaratively register rse.processes.ui adapter factories
********************************************************************************/
package org.eclipse.rse.internal.subsystems.processes.dstore;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.rse.processes.ui.ProcessesPlugin;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@ -41,7 +40,6 @@ public class Activator extends AbstractUIPlugin {
*/
public void start(BundleContext context) throws Exception {
super.start(context);
ProcessesPlugin.getDefault();
}
/**

View file

@ -11,7 +11,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.rse.services.local,
org.eclipse.rse.connectorservice.local,
org.eclipse.rse.subsystems.processes.core,
org.eclipse.rse.processes.ui,
org.eclipse.rse.core,
org.eclipse.rse.ui
Eclipse-LazyStart: true

View file

@ -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,13 +11,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* Martin Oberhuber (Wind River) - [180519] declaratively register rse.processes.ui adapter factories
********************************************************************************/
package org.eclipse.rse.internal.subsystems.processes.local;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.rse.processes.ui.ProcessesPlugin;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@ -41,7 +40,6 @@ public class Activator extends AbstractUIPlugin {
*/
public void start(BundleContext context) throws Exception {
super.start(context);
ProcessesPlugin.getDefault();
}
/**

View file

@ -11,7 +11,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.rse.services,
org.eclipse.rse.core,
org.eclipse.rse.subsystems.processes.core,
org.eclipse.rse.shells.ui,
org.eclipse.rse.subsystems.shells.core
Eclipse-LazyStart: true
Bundle-Vendor: %providerName