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:
09: package com.gwtext.client.data.event;
10:
11: import com.gwtext.client.data.Record;
12: import com.gwtext.client.data.Store;
13:
14: /**
15: * {@link Store} listener interface.
16: */
17: public interface StoreListener {
18:
19: /**
20: * Fires when Records have been added to the Store
21: *
22: * @param store this
23: * @param records the records added
24: * @param index the index at which the record(s) were added
25: */
26: void onAdd(Store store, Record[] records, int index);
27:
28: //todo : currently removed second "options" arg
29: /**
30: * Fires before a request is made for a new data object. If the beforeload handler returns false the load action will be canceled.
31: *
32: * @param store this
33: * @return false to cancel the load action
34: */
35: boolean doBeforeLoad(Store store);
36:
37: /**
38: * Fires when the data cache has been cleared.
39: *
40: * @param store this
41: */
42: void onClear(Store store);
43:
44: /**
45: * Fires when the data cache has changed, and a widget which is using this Store as a Record cache should refresh its view.
46: *
47: * @param store this
48: */
49: void onDataChanged(Store store);
50:
51: //todo : currently removed second "options" arg
52: /**
53: * Fires after a new set of Records has been loaded.
54: *
55: * @param store this
56: * @param records the Records that were loaded
57: */
58: void onLoad(Store store, Record[] records);
59:
60: /**
61: * Fires if an exception occurs in the Proxy during loading. When using HttpProxy,
62: * {@link com.gwtext.client.data.HttpStoreLoadException} is raised if an exception occurs.
63: *
64: * @param error the error
65: */
66: void onLoadException(Throwable error);
67:
68: //todo json meta
69: //void onMetaChange(Store store, String meta);
70:
71: /**
72: * Fires when a Record has been removed from the Store.
73: *
74: * @param store this
75: * @param record the Record that was removed
76: * @param index the index at which the record was removed
77: */
78: void onRemove(Store store, Record record, int index);
79:
80: /**
81: * Fires when a Record has been updated.
82: *
83: * @param store this
84: * @param record the Record that was updated
85: * @param operation the update operation being performed
86: * @see com.gwtext.client.data.Record#EDIT
87: * @see com.gwtext.client.data.Record#REJECT
88: * @see com.gwtext.client.data.Record#COMMIT
89: */
90: void onUpdate(Store store, Record record, Record.Operation operation);
91: }
|