01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08: package com.gwtext.client.widgets.event;
09:
10: import com.gwtext.client.core.EventObject;
11: import com.gwtext.client.core.ExtElement;
12: import com.gwtext.client.widgets.Editor;
13: import com.gwtext.client.widgets.form.Field;
14:
15: public interface EditorListener extends ComponentListener {
16:
17: /**
18: * Fires after a change has been made to the field, but before the change is reflected in the underlying field.
19: * Saving the change to the field can be canceled by returning false from the handler of this event. Note that
20: * if the value has not changed and ignoreNoChange = true, the editing will still end but this event will not fire since no edit actually occurred.
21: *
22: * @param source this
23: * @param value the current field value
24: * @param startValue the original field value
25: * @return false to cancel the field edit
26: */
27: boolean doBeforeComplete(Editor source, Object value,
28: Object startValue);
29:
30: /**
31: * Fires when editing is initiated, but before the value changes. Editing can be canceled by returning false from
32: * the handler of this event.
33: *
34: * @param source this
35: * @param boundEl the underlying element bound to this editor
36: * @param value the field value beign set
37: * @return fale to cancel the editing
38: */
39: boolean doBeforeStartEdit(Editor source, ExtElement boundEl,
40: Object value);
41:
42: /**
43: * Fires after editing is complete and any changed value has been written to the underlying field.
44: *
45: * @param source this
46: * @param value the current field value
47: * @param startValue the original field value
48: */
49: void onComplete(Editor source, Object value, Object startValue);
50:
51: //todo not firing?
52: /**
53: * Fires when any key related to navigation (arrows, tab, enter, esc, etc.) is pressed. You can check
54: * {@link EventObject#getKey} to determine which key was pressed.
55: *
56: * @param field this
57: * @param e the event object
58: */
59: void onSpeciakKey(Field field, EventObject e);
60: }
|