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.ui; 12 13 import org.eclipse.core.resources.IFile; 14 15 /** 16 * This interface defines a file-oriented input to an editor. 17 * <p> 18 * Clients implementing this editor input interface should override 19 * <code>Object.equals(Object)</code> to answer true for two inputs 20 * that are the same. The <code>IWorbenchPage.openEditor</code> APIs 21 * are dependent on this to find an editor with the same input. 22 * </p><p> 23 * File-oriented editors should support this as a valid input type, and allow 24 * full read-write editing of its content. 25 * </p><p> 26 * A default implementation of this interface is provided by 27 * org.eclipse.ui.part.FileEditorInput. 28 * </p><p> 29 * All editor inputs must implement the <code>IAdaptable</code> interface; 30 * extensions are managed by the platform's adapter manager. 31 * </p> 32 * 33 * @see org.eclipse.core.resources.IFile 34 */ 35 public interface IFileEditorInput extends IStorageEditorInput { 36 /** 37 * Returns the file resource underlying this editor input. 38 * <p> 39 * The <code>IFile</code> returned can be a handle to a resource 40 * that does not exist in the workspace. As such, an editor should 41 * provide appropriate feedback to the user instead of simply failing 42 * during input validation. For example, a text editor could open 43 * in read-only mode with a message in the text area to inform the 44 * user that the file does not exist. 45 * </p> 46 * 47 * @return the underlying file 48 */ 49 public IFile getFile(); 50 } 51