01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.texteditor;
11:
12: /**
13: * Extension interface for {@link org.eclipse.ui.texteditor.ITextEditor}. Adds
14: * the following functions:
15: * <ul>
16: * <li>modifiable state of the editor's input</li>
17: * <li>validate state of editor input</li>
18: * </ul>
19: *
20: * @since 2.1
21: */
22: public interface ITextEditorExtension2 {
23:
24: /**
25: * Returns whether the editor's input can be persistently be modified.
26: * This is orthogonal to <code>ITextEditorExtension.isEditorInputReadOnly</code> as read-only elements may be modifiable and
27: * writable elements may not be modifiable. If the given element is not connected to this document
28: * provider, the result is undefined. Document providers are allowed to use a cache to answer this
29: * question, i.e. there can be a difference between the "real" state of the element and the return
30: * value.
31: *
32: * @return <code>true</code> if the editor input is modifiable
33: */
34: boolean isEditorInputModifiable();
35:
36: /**
37: * Validates the state of the given editor input. The predominate intent
38: * of this method is to take any action probably necessary to ensure that
39: * the input can persistently be changed.
40: *
41: * @return <code>true</code> if the input was validated, <code>false</code> otherwise
42: */
43: boolean validateEditorInputState();
44:
45: }
|