| /* |
| * Created on Feb 7, 2005 |
| * |
| * TODO To change the template for this generated file go to |
| * Window - Preferences - Java - Code Style - Code Templates |
| */ |
| package org.eclipse.jst.j2ee.internal.web.util; |
| |
| import org.eclipse.core.runtime.IAdapterFactory; |
| import org.eclipse.wst.common.modulecore.ArtifactEditModel; |
| import org.eclipse.wst.common.modulecore.util.ArtifactEdit; |
| |
| |
| /** |
| * @author cbridgha |
| * |
| * TODO To change the template for this generated type comment go to Window - Preferences - Java - |
| * Code Style - Code Templates |
| */ |
| public class WebEditAdapterFactory implements IAdapterFactory { |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class) |
| */ |
| public Object getAdapter(Object adaptableObject, Class adapterType) { |
| if (adapterType == WebEdit.ADAPTER_TYPE || adapterType == ArtifactEdit.ADAPTER_TYPE) { |
| ArtifactEditModel editModel = (ArtifactEditModel) adaptableObject; |
| if (editModel.getModuleType().equals(WebEdit.TYPE_ID)) |
| return new WebEdit((ArtifactEditModel) adaptableObject); |
| } |
| return null; |
| } |
| |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() |
| */ |
| public Class[] getAdapterList() { |
| return new Class[]{ArtifactEdit.class, WebEdit.class}; |
| } |
| } |