(view: ViewBase, atIndex?: number)
| 984 | |
| 985 | @profile |
| 986 | public _addView(view: ViewBase, atIndex?: number) { |
| 987 | if (Trace.isEnabled()) { |
| 988 | Trace.write(`${this}._addView(${view}, ${atIndex})`, Trace.categories.ViewHierarchy); |
| 989 | } |
| 990 | |
| 991 | if (!view) { |
| 992 | throw new Error('Expecting a valid View instance.'); |
| 993 | } |
| 994 | if (!(view instanceof ViewBase)) { |
| 995 | throw new Error(view + ' is not a valid View instance.'); |
| 996 | } |
| 997 | if (view.parent) { |
| 998 | throw new Error('View already has a parent. View: ' + view + ' Parent: ' + view.parent); |
| 999 | } |
| 1000 | |
| 1001 | view.parent = this; |
| 1002 | this._addViewCore(view, atIndex); |
| 1003 | view._parentChanged(null); |
| 1004 | |
| 1005 | if (this.domNode) { |
| 1006 | this.domNode.onChildAdded(view); |
| 1007 | } |
| 1008 | } |
| 1009 | |
| 1010 | /** |
| 1011 | * Method is intended to be overridden by inheritors and used as "protected" |
nothing calls this directly
no test coverage detected