(readonly resourceData: IPublicResourceData, readonly resourceType: IResourceType, readonly workspace: IWorkspace)
| 83 | } |
| 84 | |
| 85 | constructor(readonly resourceData: IPublicResourceData, readonly resourceType: IResourceType, readonly workspace: IWorkspace) { |
| 86 | this.context = new BasicContext(workspace, `resource-${resourceData.resourceName || resourceType.name}`, IPublicEnumPluginRegisterLevel.Resource); |
| 87 | this.resourceTypeInstance = resourceType.resourceTypeModel(this.context.innerPlugins._getLowCodePluginContext({ |
| 88 | pluginName: '', |
| 89 | }), this.options); |
| 90 | this.init(); |
| 91 | if (this.resourceTypeInstance.editorViews) { |
| 92 | this.resourceTypeInstance.editorViews.forEach((d: any) => { |
| 93 | this.editorViewMap.set(d.viewName, d); |
| 94 | }); |
| 95 | } |
| 96 | if (!resourceType) { |
| 97 | logger.error(`resourceType[${resourceType}] is unValid.`); |
| 98 | } |
| 99 | this.children = this.resourceData?.children?.map(d => new Resource(d, this.workspace.getResourceType(d.resourceName || this.resourceType.name), this.workspace)) || []; |
| 100 | } |
| 101 | |
| 102 | async init() { |
| 103 | await this.resourceTypeInstance.init?.(); |
nothing calls this directly
no test coverage detected