78
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2006, 2007 IBM Corporation and others.
|
|
3 * All rights reserved. This program and the accompanying materials
|
|
4 * are made available under the terms of the Eclipse Public License v1.0
|
|
5 * which accompanies this distribution, and is available at
|
|
6 * http://www.eclipse.org/legal/epl-v10.html
|
|
7 *
|
|
8 * Contributors:
|
|
9 * IBM Corporation - initial API and implementation
|
|
10 *******************************************************************************/
|
|
11
|
|
12 module org.eclipse.core.internal.databinding.observable.tree.IObservableTree;
|
|
13
|
|
14 import java.lang.all;
|
|
15
|
|
16 import org.eclipse.core.databinding.observable.IObservable;
|
|
17
|
|
18 /**
|
|
19 *
|
|
20 * A tree whose changes can be tracked by tree change listeners. If the tree is
|
|
21 * ordered ({@link #isOrdered()}), the order of children for a given tree path
|
|
22 * matters, and tree change notifications will always specify indices. If the
|
|
23 * tree is unordered, the children of a tree path are an unordered set and
|
|
24 * indices in change notifications are not specified.
|
|
25 *
|
|
26 * <p>
|
|
27 * This interface is not intended to be implemented by clients. Clients should
|
|
28 * instead subclass one of the framework classes that implement this interface.
|
|
29 * Note that direct implementers of this interface outside of the framework will
|
|
30 * be broken in future releases when methods are added to this interface.
|
|
31 * </p>
|
|
32 *
|
|
33 * @since 1.1
|
|
34 */
|
|
35 public interface IObservableTree : IObservable {
|
|
36
|
|
37 /**
|
|
38 * Element that can be returned from synchronous getters if this observable
|
|
39 * tree is lazy.
|
|
40 */
|
|
41 public final static Object UNKNOWN_ELEMENT = new Object();
|
|
42
|
|
43 /**
|
|
44 * @param listener
|
|
45 */
|
|
46 public void addTreeChangeListener(ITreeChangeListener listener);
|
|
47
|
|
48 /**
|
|
49 * @param listener
|
|
50 */
|
|
51 public void removeTreeChangeListener(ITreeChangeListener listener);
|
|
52
|
|
53 /**
|
|
54 * Returns whether the order of children for a given parent is important. If
|
|
55 * this tree is ordered, tree change notifications will always specify
|
|
56 * indices.
|
|
57 *
|
|
58 * @return true if the order of children for a given parent is important
|
|
59 */
|
|
60 public bool isOrdered();
|
|
61
|
|
62 /**
|
|
63 * Returns whether this tree is optimized to fetch subsets of children
|
|
64 * lazily and possibly asynchronously. Implies {@link #isOrdered()}.
|
|
65 *
|
|
66 * @return true if this tree
|
|
67 */
|
|
68 public bool isLazy();
|
|
69
|
|
70 /**
|
|
71 * @param parentPath
|
|
72 * @return the children at the given parent path
|
|
73 */
|
|
74 public Object[] getChildren(TreePath parentPath);
|
|
75
|
|
76 /**
|
|
77 * @param parentPath
|
|
78 * @param children
|
|
79 */
|
|
80 public void setChildren(TreePath parentPath, Object[] children);
|
|
81
|
|
82 /**
|
|
83 * @param parentPath
|
|
84 * @param childElement
|
|
85 */
|
|
86 public void addChild(TreePath parentPath, Object childElement);
|
|
87
|
|
88 /**
|
|
89 * @param parentPath
|
|
90 * @param childElement
|
|
91 */
|
|
92 public void removeChild(TreePath parentPath, Object childElement);
|
|
93
|
|
94 /**
|
|
95 * @param parentPath
|
|
96 * @param index
|
|
97 * @param childElement
|
|
98 */
|
|
99 public void insertChild(TreePath parentPath, int index, Object childElement);
|
|
100
|
|
101 /**
|
|
102 * @param parentPath
|
|
103 * @param index
|
|
104 */
|
|
105 public void removeChild(TreePath parentPath, int index);
|
|
106
|
|
107 /**
|
|
108 * @param parentPath
|
|
109 * @return <code>true</code> if the element at the given path has children
|
|
110 */
|
|
111 public bool hasChildren(TreePath parentPath);
|
|
112
|
|
113 /**
|
|
114 * @param parentPath
|
|
115 * @return the number of children of the element at the given path
|
|
116 */
|
|
117 public int getChildCount(TreePath parentPath);
|
|
118
|
|
119 /**
|
|
120 * @param parentPath
|
|
121 * @param count
|
|
122 */
|
|
123 public void setChildCount(TreePath parentPath, int count);
|
|
124
|
|
125 /**
|
|
126 * Updates the number of children for the given parent elements in the
|
|
127 * specified request.
|
|
128 *
|
|
129 * @param update specifies counts to update and stores result
|
|
130 */
|
|
131 public void updateChildrenCount(IChildrenCountUpdate update);
|
|
132
|
|
133 /**
|
|
134 * Updates children as requested by the update.
|
|
135 *
|
|
136 * @param update specifies children to update and stores result
|
|
137 */
|
|
138 public void updateChildren(IChildrenUpdate update);
|
|
139
|
|
140 /**
|
|
141 * Updates whether elements have children.
|
|
142 *
|
|
143 * @param update specifies elements to update and stores result
|
|
144 */
|
|
145 public void updateHasChildren(IHasChildrenUpdate update);
|
|
146
|
|
147 }
|