Search in sources :

Example 16 with IAdapterManager

use of org.eclipse.core.runtime.IAdapterManager in project ecf by eclipse.

the class XmppPlugin method getAdapterManager.

public IAdapterManager getAdapterManager() {
    // First, try to get the adapter manager via
    if (adapterManagerTracker == null) {
        adapterManagerTracker = new ServiceTracker(this.context, IAdapterManager.class.getName(), null);
        adapterManagerTracker.open();
    }
    IAdapterManager adapterManager = (IAdapterManager) adapterManagerTracker.getService();
    // PlatformHelper class
    if (adapterManager == null)
        adapterManager = PlatformHelper.getPlatformAdapterManager();
    if (adapterManager == null)
        // $NON-NLS-1$
        getDefault().log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "Cannot get adapter manager", null));
    return adapterManager;
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) ServiceTracker(org.osgi.util.tracker.ServiceTracker) IAdapterManager(org.eclipse.core.runtime.IAdapterManager)

Aggregations

IAdapterManager (org.eclipse.core.runtime.IAdapterManager)16 ServiceTracker (org.osgi.util.tracker.ServiceTracker)4 IAdapterFactory (org.eclipse.core.runtime.IAdapterFactory)3 CoreException (org.eclipse.core.runtime.CoreException)2 IStatus (org.eclipse.core.runtime.IStatus)2 Status (org.eclipse.core.runtime.Status)2 File (java.io.File)1 FileNotFoundException (java.io.FileNotFoundException)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ICountable (org.eclipse.core.expressions.ICountable)1 IIterable (org.eclipse.core.expressions.IIterable)1 IAdaptable (org.eclipse.core.runtime.IAdaptable)1 ID (org.eclipse.ecf.core.identity.ID)1 AdapterManagerTracker (org.eclipse.ecf.core.util.AdapterManagerTracker)1 IFileTransferInfo (org.eclipse.ecf.filetransfer.IFileTransferInfo)1 IFileTransferListener (org.eclipse.ecf.filetransfer.IFileTransferListener)1