blob: 679722578693ac627a856d6d3bd69ab32146719b [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011 Tasktop Technologies.
* 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
*
* Contributors:
* Tasktop Technologies - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.internal.sandbox.search.ui;
import org.eclipse.core.runtime.IAdapterFactory;
import org.eclipse.mylyn.sandbox.search.ui.SearchResult;
import org.eclipse.ui.model.IWorkbenchAdapter;
/**
* @author David Green
*/
public class DesktopSearchAdapterFactory implements IAdapterFactory {
@SuppressWarnings("rawtypes")
private static Class[] ADAPTER_LIST = new Class[] { IWorkbenchAdapter.class };
@SuppressWarnings("rawtypes")
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adapterType == IWorkbenchAdapter.class && adaptableObject instanceof SearchResult) {
return DesktopSearchWorkbenchAdapter.instance();
}
return null;
}
@SuppressWarnings("rawtypes")
public Class[] getAdapterList() {
return ADAPTER_LIST;
}
}