1 11 12 package org.eclipse.jdt.internal.ui; 13 14 15 import org.eclipse.core.resources.IProject; 16 import org.eclipse.core.runtime.IAdapterFactory; 17 import org.eclipse.jdt.core.IJavaProject; 18 19 22 public class JavaProjectAdapterFactory implements IAdapterFactory { 23 24 private static Class [] PROPERTIES= new Class [] { 25 IProject.class, 26 }; 27 28 public Class [] getAdapterList() { 29 return PROPERTIES; 30 } 31 32 public Object getAdapter(Object element, Class key) { 33 if (IProject.class.equals(key)) { 34 IJavaProject javaProject= (IJavaProject)element; 35 return javaProject.getProject(); 36 } 37 return null; 38 } 39 } 40 | Popular Tags |