| 64 | } |
| 65 | |
| 66 | export class TabGroup extends CompositeDisposable implements ITabGroup { |
| 67 | private _label: string; |
| 68 | private _color: string | undefined; |
| 69 | private _collapsed = false; |
| 70 | private _componentParams: Record<string, unknown> | undefined; |
| 71 | private readonly _panelIds: string[] = []; |
| 72 | |
| 73 | private readonly _onDidChange = new Emitter<void>(); |
| 74 | readonly onDidChange: Event<void> = this._onDidChange.event; |
| 75 | |
| 76 | private readonly _onDidPanelChange = new Emitter<{ |
| 77 | panelId: string; |
| 78 | type: 'add' | 'remove'; |
| 79 | }>(); |
| 80 | readonly onDidPanelChange = this._onDidPanelChange.event; |
| 81 | |
| 82 | private readonly _onDidCollapseChange = new Emitter<boolean>(); |
| 83 | readonly onDidCollapseChange: Event<boolean> = |
| 84 | this._onDidCollapseChange.event; |
| 85 | |
| 86 | private readonly _onDidDestroy = new Emitter<void>(); |
| 87 | readonly onDidDestroy: Event<void> = this._onDidDestroy.event; |
| 88 | |
| 89 | get label(): string { |
| 90 | return this._label; |
| 91 | } |
| 92 | |
| 93 | get color(): string | undefined { |
| 94 | return this._color; |
| 95 | } |
| 96 | |
| 97 | get componentParams(): Record<string, unknown> | undefined { |
| 98 | return this._componentParams; |
| 99 | } |
| 100 | |
| 101 | setLabel(value: string): void { |
| 102 | if (this.isDisposed || this._label === value) { |
| 103 | return; |
| 104 | } |
| 105 | this._label = value; |
| 106 | this._onDidChange.fire(); |
| 107 | } |
| 108 | |
| 109 | setColor(value: string | undefined): void { |
| 110 | if (this.isDisposed) { |
| 111 | return; |
| 112 | } |
| 113 | const next = value === '' ? undefined : value; |
| 114 | if (this._color === next) { |
| 115 | return; |
| 116 | } |
| 117 | this._color = next; |
| 118 | this._onDidChange.fire(); |
| 119 | } |
| 120 | |
| 121 | setComponentParams(value: Record<string, unknown> | undefined): void { |
| 122 | if (this.isDisposed) { |
| 123 | return; |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…