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.google.gwt.user.client.Element;
11: import com.gwtext.client.core.EventObject;
12: import com.gwtext.client.widgets.DataView;
13:
14: /**
15: * {@link com.gwtext.client.widgets.DataView} listener.
16: */
17: public interface DataViewListener extends BoxComponentListener {
18:
19: /**
20: * Fires before a click is processed. Returns false to cancel the default action.
21: *
22: * @param source this
23: * @param index The index of the target node
24: * @param node The target node
25: * @param e The raw event object
26: * @return false to cancel
27: */
28: boolean doBeforeClick(DataView source, int index, Element node,
29: EventObject e);
30:
31: /**
32: * Fires before a selection is made. If any handlers return false, the selection is cancelled.
33: *
34: * @param source this
35: * @param node The node to be selected
36: * @param selections Array of currently selected nodes
37: * @return false to cancel
38: */
39: boolean doBeforeSelect(DataView source, Element node,
40: Element[] selections);
41:
42: /**
43: * Fires when a template node is clicked.
44: *
45: * @param source this
46: * @param index The index of the target node
47: * @param node The target node
48: * @param e The raw event object
49: */
50: void onClick(DataView source, int index, Element node, EventObject e);
51:
52: /**
53: * Fires when a click occurs and it is not on a template node.
54: *
55: * @param source this
56: * @param e The raw event object
57: */
58: void onContainerClick(DataView source, EventObject e);
59:
60: /**
61: * Fires when a template node is right clicked.
62: *
63: * @param source this
64: * @param index The index of the target node
65: * @param node The target node
66: * @param e The raw event object
67: */
68: void onContextMenu(DataView source, int index, Element node,
69: EventObject e);
70:
71: /**
72: * Fires when a template node is double clicked.
73: *
74: * @param source this
75: * @param index The index of the target node
76: * @param node The target node
77: * @param e The raw event object
78: */
79: void onDblClick(DataView source, int index, Element node,
80: EventObject e);
81:
82: /**
83: * Fires when the selected nodes change.
84: *
85: * @param view this
86: * @param selections array of the selected nodes
87: */
88: void onSelectionChange(DataView view, Element[] selections);
89:
90: }
|