1 /******************************************************************************* 2 * Copyright (c) 2000, 2015 IBM Corporation and others. 3 * 4 * This program and the accompanying materials 5 * are made available under the terms of the Eclipse Public License 2.0 6 * which accompanies this distribution, and is available at 7 * https://www.eclipse.org/legal/epl-2.0/ 8 * 9 * SPDX-License-Identifier: EPL-2.0 10 * 11 * Contributors: 12 * IBM Corporation - initial API and implementation 13 *******************************************************************************/ 14 15 package org.eclipse.ui; 16 17 /** 18 * Implements a reference to an editor. The IEditorPart will not be instantiated 19 * until the editor becomes visible or the API {@link #getEditor(boolean)} is 20 * called with true. 21 * <p> 22 * This interface is not intended to be implemented by clients. 23 * </p> 24 * 25 * @noimplement This interface is not intended to be implemented by clients. 26 */ 27 public interface IEditorReference extends IWorkbenchPartReference { 28 /** 29 * Returns the factory id of the factory used to restore this editor. Returns 30 * null if the editor is not persistable. 31 * 32 * @return the factory ID 33 */ getFactoryId()34 String getFactoryId(); 35 36 /** 37 * Returns the editor input's name. May return null if the name is not available 38 * or if the editor failed to be restored. 39 * 40 * @return the name 41 */ getName()42 String getName(); 43 44 /** 45 * Returns the editor referenced by this object. Returns <code>null</code> if 46 * the editor was not instantiated or it failed to be restored. Tries to restore 47 * the editor if <code>restore</code> is true. 48 * 49 * @param restore true to try to restore, false otherwise. 50 * @return the {@link IEditorPart} 51 */ getEditor(boolean restore)52 IEditorPart getEditor(boolean restore); 53 54 /** 55 * @return true if the editor is pinned, otherwise returns false. 56 */ isPinned()57 boolean isPinned(); 58 59 /** 60 * Returns the editor input for the editor referenced by this object. 61 * <p> 62 * Unlike most of the other methods on this type, this method can trigger 63 * plug-in activation. 64 * </p> 65 * 66 * @return the editor input for the editor referenced by this object 67 * @throws PartInitException if there was an error restoring the editor input 68 * @since 3.1 69 */ getEditorInput()70 IEditorInput getEditorInput() throws PartInitException; 71 } 72