1 /*******************************************************************************
2 * Copyright (c) 2000, 2011 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
12 package org.eclipse.jdt.internal.ui;
15 import org.eclipse.core.runtime.IAdapterFactory;
17 import org.eclipse.core.resources.IProject;
19 import org.eclipse.jdt.core.IJavaProject;
22 * An adapter factory for IJavaProjects.
24 public class JavaProjectAdapterFactory implements IAdapterFactory {
26 private static Class<?>[] PROPERTIES= new Class[] {
30 public Class[] getAdapterList() {
34 public Object getAdapter(Object element, Class key) {
35 if (IProject.class.equals(key)) {
36 IJavaProject javaProject= (IJavaProject)element;
37 return javaProject.getProject();