Hello everyone,
I’m working on an extension which consists in a React Widget.
Looking at different extension examples I had created a Factory to create my widget and everything works fine. I defined the following behavior of opening the widget for the .pipeline files:
// Add the default behavior of opening the widget for .pipeline files
app.docRegistry.addFileType(
{
name: 'react-pipeline',
displayName: 'Pipeline',
extensions: ['.pipeline'],
icon: pipelineIcon,
fileFormat: 'text'
},
[PIPELINE_FACTORY, 'JSON']
);
app.docRegistry.addWidgetFactory(pipelineEditorFactory);
And my PipelineEditorFactory extends ABCWidgetFactory.
export class PipelineEditorFactory extends ABCWidgetFactory<DocumentWidget> { ... }
I now want to attach a Kernel to my extension alongside the React Widget. I am using this example.
If I understood correctly I need to create a panel which will tie together a Widget and a Kernel session.
I’m wondering what’s the best strategy to refactor my code to address the addition of the Kernel. Should I create a different Factory that will create panels (which in turns create a new Kernel session and Widget) when opening .pipeline files ? If so, what type of Factory ?
Do I need to use a Panel? Could I attach a session to a Widget?
Any pointers would be helpful, thank you in advance.