]> git.wh0rd.org - tt-rss.git/blob - lib/dijit/tree/model.js.uncompressed.js
upgrade dojo to 1.8.3 (refs #570)
[tt-rss.git] / lib / dijit / tree / model.js.uncompressed.js
1 define("dijit/tree/model", ["dojo/_base/declare"], function(declare){
2
3 return declare(
4 "dijit.tree.model",
5 null,
6 {
7 // summary:
8 // Contract for any data provider object for the tree.
9 // description:
10 // Tree passes in values to the constructor to specify the callbacks.
11 // "item" is typically a dojo/data/Item but it's just a black box so
12 // it could be anything.
13 //
14 // This (like `dojo/data/api/Read`) is just documentation, and not meant to be used.
15
16 destroy: function(){
17 // summary:
18 // Destroys this object, releasing connections to the store
19 // tags:
20 // extension
21 },
22
23 // =======================================================================
24 // Methods for traversing hierarchy
25
26 getRoot: function(onItem){
27 // summary:
28 // Calls onItem with the root item for the tree, possibly a fabricated item.
29 // Throws exception on error.
30 // tags:
31 // extension
32 },
33
34 mayHaveChildren: function(item){
35 // summary:
36 // Tells if an item has or may have children. Implementing logic here
37 // avoids showing +/- expando icon for nodes that we know don't have children.
38 // (For efficiency reasons we may not want to check if an element actually
39 // has children until user clicks the expando node)
40 // item: dojo/data/Item
41 // tags:
42 // extension
43 },
44
45 getChildren: function(parentItem, onComplete){
46 // summary:
47 // Calls onComplete() with array of child items of given parent item, all loaded.
48 // Throws exception on error.
49 // parentItem: dojo/data/Item
50 // onComplete: function(items)
51 // tags:
52 // extension
53 },
54
55 // =======================================================================
56 // Inspecting items
57
58 isItem: function(something){
59 // summary:
60 // Returns true if *something* is an item and came from this model instance.
61 // Returns false if *something* is a literal, an item from another model instance,
62 // or is any object other than an item.
63 // tags:
64 // extension
65 },
66
67 fetchItemByIdentity: function(keywordArgs){
68 // summary:
69 // Given the identity of an item, this method returns the item that has
70 // that identity through the onItem callback. Conforming implementations
71 // should return null if there is no item with the given identity.
72 // Implementations of fetchItemByIdentity() may sometimes return an item
73 // from a local cache and may sometimes fetch an item from a remote server.
74 // tags:
75 // extension
76 },
77
78 getIdentity: function(item){
79 // summary:
80 // Returns identity for an item
81 // tags:
82 // extension
83 },
84
85 getLabel: function(item){
86 // summary:
87 // Get the label for an item
88 // tags:
89 // extension
90 },
91
92 // =======================================================================
93 // Write interface
94
95 newItem: function(args, parent, insertIndex, before){
96 // summary:
97 // Creates a new item. See `dojo/data/api/Write` for details on args.
98 // args: dijit/tree/dndSource.__Item
99 // parent: Item
100 // insertIndex: int?
101 // Allows to insert the new item as the n'th child of `parent`.
102 // before: Item?
103 // Insert the new item as the previous sibling of this item. `before` must be a child of `parent`.
104 // tags:
105 // extension
106 },
107
108 pasteItem: function(childItem, oldParentItem, newParentItem, bCopy, insertIndex, before){
109 // summary:
110 // Move or copy an item from one parent item to another.
111 // Used in drag & drop.
112 // If oldParentItem is specified and bCopy is false, childItem is removed from oldParentItem.
113 // If newParentItem is specified, childItem is attached to newParentItem.
114 // childItem: Item
115 // oldParentItem: Item
116 // newParentItem: Item
117 // bCopy: Boolean
118 // insertIndex: int?
119 // Allows to insert the new item as the n'th child of `parent`.
120 // before: Item?
121 // Insert the new item as the previous sibling of this item. `before` must be a child of `parent`.
122 // tags:
123 // extension
124 },
125
126 // =======================================================================
127 // Callbacks
128
129 onChange: function(item){
130 // summary:
131 // Callback whenever an item has changed, so that Tree
132 // can update the label, icon, etc. Note that changes
133 // to an item's children or parent(s) will trigger an
134 // onChildrenChange() so you can ignore those changes here.
135 // item: dojo/data/Item
136 // tags:
137 // callback
138 },
139
140 onChildrenChange: function(parent, newChildrenList){
141 // summary:
142 // Callback to do notifications about new, updated, or deleted items.
143 // parent: dojo/data/Item
144 // newChildrenList: dojo/data/Item[]
145 // tags:
146 // callback
147 }
148 });
149
150 });