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; 13 14 /** 15 * Implements a reference to a editor. 16 * The IEditorPart will not be instanciated until 17 * the editor becomes visible or the API getEditor 18 * is sent with true; 19 * <p> 20 * This interface is not intended to be implemented by clients. 21 * </p> 22 */ 23 public interface IEditorReference extends IWorkbenchPartReference { 24 /** 25 * Returns the factory id of the factory used to 26 * restore this editor. Returns null if the editor 27 * is not persistable. 28 */ 29 public String getFactoryId(); 30 31 /** 32 * Returns the editor input name. May return null is the 33 * name is not available or if the editor failed to be 34 * restored. 35 */ 36 public String getName(); 37 38 /** 39 * Returns the editor referenced by this object. 40 * Returns <code>null</code> if the editor was not instantiated or 41 * it failed to be restored. Tries to restore the editor 42 * if <code>restore</code> is true. 43 */ 44 public IEditorPart getEditor(boolean restore); 45 46 /** 47 * Returns true if the editor is pinned otherwise returns false. 48 */ 49 public boolean isPinned(); 50 51 /** 52 * Returns the editor input for the editor referenced by this object. 53 * <p> 54 * Unlike most of the other methods on this type, this method 55 * can trigger plug-in activation. 56 * </p> 57 * 58 * @return the editor input for the editor referenced by this object 59 * @throws PartInitException if there was an error restoring the editor input 60 * @since 3.1 61 */ 62 public IEditorInput getEditorInput() throws PartInitException; 63 } 64