comparison org.eclipse.core.databinding/src/org/eclipse/core/internal/databinding/observable/tree/AbstractObservableTree.d @ 85:6be48cf9f95c

Work on databinding
author Frank Benoit <benoit@tionex.de>
date Sat, 18 Apr 2009 13:54:50 +0200
parents 383ce7bd736b
children
comparison
equal deleted inserted replaced
84:fcf926c91ca4 85:6be48cf9f95c
37 public abstract class AbstractObservableTree : AbstractObservable 37 public abstract class AbstractObservableTree : AbstractObservable
38 , IObservableTree { 38 , IObservableTree {
39 39
40 private bool stale; 40 private bool stale;
41 41
42 private ListenerList treeListeners = new ListenerListcast(ListenerList.IDENTITY); 42 private ListenerList treeListeners;
43 43
44 /** 44 /**
45 * @param realm 45 * @param realm
46 */ 46 */
47 public this(Realm realm) { 47 public this(Realm realm) {
48 treeListeners = new ListenerList(ListenerList.IDENTITY);
48 super(realm); 49 super(realm);
49 } 50 }
50 51
51 public void addChild(TreePath parentPath, Object childElement) { 52 public void addChild(TreePath parentPath, Object childElement) {
52 throw new UnsupportedOperationException(); 53 throw new UnsupportedOperationException();
53 } 54 }
54 55
55 public void addTreeChangeListener(ITreeChangeListener listener) { 56 public void addTreeChangeListener(ITreeChangeListener listener) {
56 treeListeners.add(listener); 57 treeListeners.add(cast(Object)listener);
57 } 58 }
58 59
59 public int getChildCount(TreePath parentPath) { 60 public int getChildCount(TreePath parentPath) {
60 return getChildren(parentPath).length; 61 return getChildren(parentPath).length;
61 } 62 }
83 public void removeChild(TreePath parentPath, int index) { 84 public void removeChild(TreePath parentPath, int index) {
84 throw new UnsupportedOperationException(); 85 throw new UnsupportedOperationException();
85 } 86 }
86 87
87 public void removeTreeChangeListener(ITreeChangeListener listener) { 88 public void removeTreeChangeListener(ITreeChangeListener listener) {
88 treeListeners.remove(listener); 89 treeListeners.remove(cast(Object)listener);
89 } 90 }
90 91
91 public void setChildCount(TreePath parentPath, int count) { 92 public void setChildCount(TreePath parentPath, int count) {
92 throw new UnsupportedOperationException(); 93 throw new UnsupportedOperationException();
93 } 94 }
108 .setStatus(new Status( 109 .setStatus(new Status(
109 IStatus.WARNING, 110 IStatus.WARNING,
110 Policy.JFACE_DATABINDING, 111 Policy.JFACE_DATABINDING,
111 IStatus.OK, 112 IStatus.OK,
112 BindingMessages 113 BindingMessages
113 .getStringcast(BindingMessages.INDEX_OUT_OF_RANGE), 114 .getString(BindingMessages.INDEX_OUT_OF_RANGE),
114 null)); 115 null));
115 } 116 }
116 } 117 }
117 update.done(); 118 update.done();
118 } 119 }