Getting the editor for a root node from the list of opened editors
1. Consider i have a node(root node - concept instance can be root)
2. I got the opened editors in current project using the code below.
FileEditorManager fileEditorManager = FileEditorManager.getInstance(ideaProject);
sequence<MPSFileNodeEditor> editors = fileEditorManager.getAllEditors().asSequence.ofType<MPSFileNodeEditor>;
3. Is there a way to get the editor corresponding to my root node from the list of available editors?
Please sign in to leave a comment.
Okay. Currently am doing it like
FileEditorManager fileEditorManager = FileEditorManager.getInstance(ideaProject);
sequence<MPSFileNodeEditor> editors = fileEditorManager.getAllEditors().asSequence.ofType<MPSFileNodeEditor>;
sequence<Editor> seq = editors.select({~it => it.getNodeEditor(); });
Editor editor = seq.findFirst({~it => it.getEditorContext().getEditorComponent().getEditedNode() :eq: myNode; });
Hello,
Can this help you?
Regards,
Sérgio Ribeiro
Porto - Portugal
Thank you Sérgio. The solution you gave is working fine.
I have a very basic doubt. I understand the meaning of Editor, Editor_Cell, and EditorCell_Collection.
Can you explain the exact meaning of "EditorContext" and "EditorComponent"?