Adding editor Component by Code
Hello all,
I have been trying to add swing components dynamically by code for my project, I have tried to add editor cells by using the following code from an intention:
execute(node, editorContext)->void
{
EditorCell createEditorComponentCell = editorContext.getCellFactory().createEditorComponentCell(node, "SimulationOutputChecker.editor.comp");
EditorCell_Collection createIndent2 = EditorCell_Collection.createIndent2(editorContext, node);
createIndent2.setBig(true);
createIndent2.addEditorCell(createEditorComponentCell);
editorContext.flushEvents();
}
Could anyone point me to right the direction? Thanks in advance.
Salman
Please sign in to leave a comment.
Dear Salman,
Usually, there is no need to create the editor cells dynamically.
If you want to show the cell by an intention, the most common way is the following:
Add the cell within the editor for the concept. Add the "show if" condition in the cell inspector.
Add the boolean flag property to the concept. Let the cell be shown when the flag is set to true.
The intention then may switch the flag from false to true and otherwise.
The editor will be updated automatically and the cell will show/hide