2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
22 * Created by rcohen on 9/25/2016.
25 import {SchemaPropertyGroupModel} from "./schema-property";
26 import {PropertyModel} from "./properties";
28 export class DataTypePropertyModel extends PropertyModel{
32 childrenProperties:Array<DataTypePropertyModel>;
33 isAllChildrenLevelsCalculated:boolean;
35 parent:DataTypePropertyModel;
36 expandedChildPropertyId:string;
38 constructor(property?:PropertyModel);
39 constructor(name:string, type:string, treeNodeId:string, parent:DataTypePropertyModel, valueObjectRef:any, schema?:SchemaPropertyGroupModel);
40 constructor(nameOrPropertyObj?:string | PropertyModel, type?:string, treeNodeId?:string, parent?:DataTypePropertyModel, valueObjectRef?:any, schema?:SchemaPropertyGroupModel){
41 super(typeof nameOrPropertyObj === "string" ? null : nameOrPropertyObj);
42 if ( typeof nameOrPropertyObj === "string" ) {
43 this.name = nameOrPropertyObj;
45 this.treeNodeId = treeNodeId;
47 this.valueObjectRef = valueObjectRef;
52 public updateExpandedChildPropertyId = (childPropertyId:string):void =>{
53 if(this.expandedChildPropertyId == childPropertyId){
54 this.expandedChildPropertyId = "";
56 this.expandedChildPropertyId = childPropertyId;