/*******************************************************************************
* Copyright (c) 2009 the CHISEL group and contributors.
* 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:
* Del Myers - initial API and implementation
*******************************************************************************/
package ca.uvic.chisel.javasketch.ui.internal.views;
import java.util.Date;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IAdapterFactory;
import ca.uvic.chisel.javasketch.IProgramSketch;
import ca.uvic.chisel.javasketch.data.model.ITraceModel;
public class TreeNodeViewAdapterFactory implements IAdapterFactory {
@SuppressWarnings("unchecked")
@Override
public Object getAdapter(Object adaptableObject, Class adapterType) {
if (adaptableObject instanceof IAdaptable) {
return ((IAdaptable)adaptableObject).getAdapter(adapterType);
}
return null;
}
@SuppressWarnings("unchecked")
@Override
public Class[] getAdapterList() {
return new Class[] {ITraceModel.class, IProgramSketch.class, Date.class, IProject.class};
}
}