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 package org.eclipse.pde.core; 12 import org.eclipse.core.resources.IFile; 13 /** 14 * Classes that implement this interface are responsible for holding a table of 15 * models associated with the underlying objects. They have several 16 * responsibilities: 17 * <ul> 18 * <li>To hold model objects in one place 19 * <li>To allow requesters to connect to the models or to disconnect from them. 20 * <li>To notify interested parties when models are added and removed. 21 * </ul> 22 * Model providers are responsible for listening to the workspace, updating 23 * models whose underlying resources have been updated, and removing them from 24 * the table when those resources have been deleted. 25 * 26 * @since 2.0 27 */ 28 public interface IModelProvider { 29 /** 30 * Registers a listener that will be notified about changes in the managed 31 * models. 32 * 33 * @param listener 34 * the listener that will be registered 35 */ 36 void addModelProviderListener(IModelProviderListener listener); 37 /** 38 * Returns the model for the provided file resource. 39 * 40 * @param file 41 * the file resource we need the model for 42 * @return the object that represents a structured representation of the 43 * file content 44 */ 45 public IModel getModel(IFile file); 46 /** 47 * Deregisters a listener from notification. 48 * 49 * @param listener 50 * the listener to be deregistered 51 */ 52 void removeModelProviderListener(IModelProviderListener listener); 53 } 54