1 /******************************************************************************* 2 * Copyright (c) 2000, 2005 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.texteditor; 13 14 /** 15 * Extension interface for {@link org.eclipse.ui.texteditor.ITextEditor}. Adds 16 * the following functions: 17 * <ul> 18 * <li>modifiable state of the editor's input</li> 19 * <li>validate state of editor input</li> 20 * </ul> 21 * 22 * @since 2.1 23 */ 24 public interface ITextEditorExtension2 { 25 26 /** 27 * Returns whether the editor's input can be persistently be modified. 28 * This is orthogonal to <code>ITextEditorExtension.isEditorInputReadOnly</code> as read-only elements may be modifiable and 29 * writable elements may not be modifiable. If the given element is not connected to this document 30 * provider, the result is undefined. Document providers are allowed to use a cache to answer this 31 * question, i.e. there can be a difference between the "real" state of the element and the return 32 * value. 33 * 34 * @return <code>true</code> if the editor input is modifiable 35 */ 36 boolean isEditorInputModifiable(); 37 38 /** 39 * Validates the state of the given editor input. The predominate intent 40 * of this method is to take any action probably necessary to ensure that 41 * the input can persistently be changed. 42 * 43 * @return <code>true</code> if the input was validated, <code>false</code> otherwise 44 */ 45 boolean validateEditorInputState(); 46 47 } 48