01: /*******************************************************************************
02: * Copyright (c) 2000, 2007 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.jface.viewers;
11:
12: /**
13: * A listener which is notified of significant events in the
14: * life of a cell editor.
15: * <p>
16: * This interface should be implemented by classes that wish to
17: * react to cell editor activity.
18: * </p>
19: * <p>
20: * Note: the cell editor is not passed as a parameter to any
21: * of these methods; so the assumption is that the listener
22: * knows which cell editor is talking to it.
23: * </p>
24: */
25: public interface ICellEditorListener {
26: /**
27: * Notifies that the end user has requested applying a value.
28: * All cell editors send this notification.
29: * <p>
30: * The normal reaction is to update the model with the current cell editor value.
31: * However, if the value is not valid, it should not be applied.
32: * A typical text-based cell editor would send this message
33: * when the end user hits Return, whereas other editors would
34: * send it whenever their value changes.
35: * </p>
36: */
37: public void applyEditorValue();
38:
39: /**
40: * Notifies that the end user has canceled editing.
41: * All cell editors send this notification.
42: * A listener should <b>not</b> update the model based on this
43: * notification; see <code>applyEditorValue</code>.
44: */
45: public void cancelEditor();
46:
47: /**
48: * Notifies that the end user is changing the value in the cell editor. This
49: * notification is normally sent only by text-based editors in response to a
50: * keystroke, so that the listener may show an error message reflecting the
51: * current valid state. This notification is sent while the value is being
52: * actively edited, before the value is applied or canceled. A listener should
53: * <b>not</b> update the model based on this notification; see
54: * <code>applyEditorValue</code>.
55: * <p>
56: * If the <code>newValidState</code> parameter is <code>true</code>,
57: * the new value may be retrieved by calling <code>ICellEditor.getValue</code>
58: * on the appropriate cell editor.
59: * </p>
60: *
61: * @param oldValidState the valid state before the end user changed the value
62: * @param newValidState the current valid state
63: */
64: public void editorValueChanged(boolean oldValidState,
65: boolean newValidState);
66: }
|