1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 from muntjac.data import container
17
18
19 -class ICollapsible(container.IHierarchical, container.IOrdered):
20 """Container needed by large lazy loading hierarchies displayed in
21 TreeTable.
22
23 Container of this type gets notified when a subtree is opened/closed
24 in a component displaying its content. This allows container to lazy
25 load subtrees and release memory when a sub-tree is no longer displayed.
26
27 Methods from L{IOrdered} (and from L{IIndexed} if implemented) are
28 expected to work as in "preorder" of the currently visible hierarchy.
29 This means for example that the return value of size method changes
30 when subtree is collapsed/expanded. In other words items in collapsed
31 sub trees should be "ignored" by container when the container is accessed
32 with methods introduced in L{IOrdered} or L{IIndexed}. From the accessors
33 point of view, items in collapsed subtrees don't exist.
34 """
35
37 """Collapsing the L{Item} indicated by C{itemId} hides all
38 children, and their respective children, from the L{Container}.
39
40 If called on a leaf L{Item}, this method does nothing.
41
42 @param itemId:
43 the identifier of the collapsed L{Item}
44 @param collapsed:
45 True if you want to collapse the children below
46 this L{Item}. False if you want to uncollapse the
47 children.
48 """
49 raise NotImplementedError
50
51
53 """Checks whether the L{Item}, identified by C{itemId} is
54 collapsed or not.
55
56 If an L{Item} is "collapsed" its children are not included in
57 methods used to list Items in this container.
58
59 @param itemId:
60 The L{Item}'s identifier that is to be checked.
61 @return: C{True} iff the L{Item} identified by C{itemId} is
62 currently collapsed, otherwise C{False}.
63 """
64 raise NotImplementedError
65