1 /******************************************************************************* 2 * Copyright (c) 2000, 2006 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 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 12 package org.eclipse.ui.views.tasklist; 13 14 import org.eclipse.core.resources.IResource; 15 import org.eclipse.core.runtime.IAdaptable; 16 17 /** 18 * <code>ITaskListResourceAdapter</code> is an adapter interface that 19 * supplies the resource to query for markers to display in the task list. 20 * <p> 21 * The Tasks view checks for this adapter before the <code>IResource</code> 22 * adapter, allowing the object to provide a resource to the Tasks view without 23 * necessarily exposing it to other components that look for an <code>IResource</code> 24 * adapter. 25 * </p> 26 * <p> 27 * Implementors of this interface are typically registered with an 28 * IAdapterFactory for lookup via the getAdapter() mechanism. 29 * </p> 30 */ 31 public interface ITaskListResourceAdapter { 32 33 /** 34 * Returns the resource to query for the markers to display 35 * for the given adaptable. 36 * 37 * @param adaptable the adaptable being queried. 38 * @return the resource or <code>null</code> if there 39 * is no adapted resource for this object. 40 */ 41 public IResource getAffectedResource(IAdaptable adaptable); 42 43 } 44