MCPcopy
hub / github.com/alibaba/lowcode-engine / Workspace

Class Workspace

packages/workspace/src/workspace.ts:72–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72export class Workspace implements IWorkspace {
73 context: BasicContext;
74
75 enableAutoOpenFirstWindow: boolean;
76
77 resourceTypeMap: Map<string, ResourceType> = new Map();
78
79 private emitter: IEventBus = createModuleEventBus('workspace');
80
81 private _isActive = false;
82
83 private resourceList: IResource[] = [];
84
85 get skeleton() {
86 return this.context.innerSkeleton;
87 }
88
89 get plugins() {
90 return this.context.innerPlugins;
91 }
92
93 get isActive() {
94 return this._isActive;
95 }
96
97 get defaultResourceType(): ResourceType | null {
98 if (this.resourceTypeMap.size >= 1) {
99 return Array.from(this.resourceTypeMap.values())[0];
100 }
101
102 return null;
103 }
104
105 @obx.ref windows: IEditorWindow[] = [];
106
107 editorWindowMap: Map<string, IEditorWindow> = new Map<string, IEditorWindow>();
108
109 @obx.ref window: IEditorWindow;
110
111 windowQueue: ({
112 name: string;
113 title: string;
114 options: Object;
115 viewName?: string;
116 } | IResource)[] = [];
117
118 constructor(
119 readonly registryInnerPlugin: (designer: IDesigner, editor: IEditor, plugins: IPublicApiPlugins) => Promise<IPublicTypeDisposable>,
120 readonly shellModelFactory: any,
121 ) {
122 this.context = new BasicContext(this, '', IPublicEnumPluginRegisterLevel.Workspace);
123 this.context.innerHotkey.activate(true);
124 makeObservable(this);
125 }
126
127 checkWindowQueue() {
128 if (!this.windowQueue || !this.windowQueue.length) {
129 return;

Callers

nothing calls this directly

Calls 1

createModuleEventBusFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…