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