Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 424724a3673181eed620fa30f41da9de6527bb64 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*******************************************************************************
 * 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;


/**
 * Interface for parties interested in standardized element changes. These
 * changes are:
 * <ul>
 * <li> dirty state changes
 * <li> content replacements
 * <li> moves
 * <li> deletions
 * </ul>
 * The notifications sent to the element state listeners inform about those standardized,
 * abstract changes. The concrete change applied might differ from the one the listeners
 * are notified about, but should be interpreted as the one the listeners receive.
 * <p>
 * In order to provided backward compatibility for clients of <code>IElementStateListener</code>,
 * extension interfaces are used to provide a means of evolution. The following extension interface
 * exists:
 * <ul>
 * <li>{@link org.eclipse.ui.texteditor.IElementStateListenerExtension} since version 2.0 introducing
 * 		state validation events.</li>
 * </ul>
 * </p>
 *
 * @see org.eclipse.ui.texteditor.IElementStateListenerExtension
 */
public interface IElementStateListener {

	/**
	 * Notifies that the dirty state of the given element has changed.
	 *
	 * @param element the element
	 * @param isDirty the new dirty state
	 */
	void elementDirtyStateChanged(Object element, boolean isDirty);

	/**
	 * Notifies that the content of the given element is about to be replaced.
	 *
	 * @param element the element
	 */
	void elementContentAboutToBeReplaced(Object element);

	/**
	 * Notifies that the content of the given element has been replaced.
	 *
	 * @param element the element
	 */
	void elementContentReplaced(Object element);

	/**
	 * Notifies that the given element has been deleted.
	 *
	 * @param element the element
	 */
	void elementDeleted(Object element);

	/**
	 * Notifies that the element has moved. If <code>movedElement</code>
	 * is <code>null</code> it is similar to <code>elementDeleted(originalElement)</code>.
	 *
	 * @param originalElement the element before the move
	 * @param movedElement the element after the move
	 */
	void elementMoved(Object originalElement, Object movedElement);
}

Back to the top