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: * Interface for parties interested in standardized element changes. These
14: * changes are:
15: * <ul>
16: * <li> dirty state changes
17: * <li> content replacements
18: * <li> moves
19: * <li> deletions
20: * </ul>
21: * The notifications sent to the element state listeners inform about those standardized,
22: * abstract changes. The concrete change applied might differ from the one the listeners
23: * are notified about, but should be interpreted as the one the listeners receive.
24: * <p>
25: * In order to provided backward compatibility for clients of <code>IElementStateListener</code>,
26: * extension interfaces are used to provide a means of evolution. The following extension interface
27: * exists:
28: * <ul>
29: * <li>{@link org.eclipse.ui.texteditor.IElementStateListenerExtension} since version 2.0 introducing
30: * state validation events.</li>
31: * </ul>
32: * </p>
33: *
34: * @see org.eclipse.ui.texteditor.IElementStateListenerExtension
35: */
36: public interface IElementStateListener {
37:
38: /**
39: * Notifies that the dirty state of the given element has changed.
40: *
41: * @param element the element
42: * @param isDirty the new dirty state
43: */
44: void elementDirtyStateChanged(Object element, boolean isDirty);
45:
46: /**
47: * Notifies that the content of the given element is about to be replaced.
48: *
49: * @param element the element
50: */
51: void elementContentAboutToBeReplaced(Object element);
52:
53: /**
54: * Notifies that the content of the given element has been replaced.
55: *
56: * @param element the element
57: */
58: void elementContentReplaced(Object element);
59:
60: /**
61: * Notifies that the given element has been deleted.
62: *
63: * @param element the element
64: */
65: void elementDeleted(Object element);
66:
67: /**
68: * Notifies that the element has moved. If <code>movedElement</code>
69: * is <code>null</code> it is similar to <code>elementDeleted(originalElement)</code>.
70: *
71: * @param originalElement the element before the move
72: * @param movedElement the element after the move
73: */
74: void elementMoved(Object originalElement, Object movedElement);
75: }
|