Skip to content

Commit

Permalink
update WorkflowDocumentWidget, createNewWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-i committed Dec 19, 2024
1 parent 6310535 commit 66a7305
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/workflows/workflowWidgetFactory.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { ABCWidgetFactory, DocumentRegistry } from '@jupyterlab/docregistry';
import {
ABCWidgetFactory,
DocumentRegistry,
DocumentWidget
} from '@jupyterlab/docregistry';
import { Widget } from '@lumino/widgets';
import { IWorkflowModel } from './workflowModel';

Expand Down Expand Up @@ -50,13 +54,29 @@ export class WorkflowWidget extends Widget {
private _input: HTMLInputElement;
}

export class WorkflowWidgetFactory extends ABCWidgetFactory<
export class WorkflowDocumentWidget extends DocumentWidget<
Widget,
IWorkflowModel
> {
constructor(options: DocumentWidget.IOptions<Widget, IWorkflowModel>) {
super(options);
}
}

export class WorkflowWidgetFactory extends ABCWidgetFactory<
WorkflowDocumentWidget,
IWorkflowModel
> {
protected createNewWidget(
context: DocumentRegistry.IContext<IWorkflowModel>
): Widget {
return new WorkflowWidget(context);
): WorkflowDocumentWidget {
const content = new WorkflowWidget(context);

const widget = new WorkflowDocumentWidget({
context,
content
});

return widget;
}
}

0 comments on commit 66a7305

Please sign in to comment.