Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[che-dev] How to set the content to the editor

Hi!
I'm trying to create an IDE action that will reload the opened file from disk. I've found how to get the file content. I'm doing it this way:

    public void actionPerformed(ActionEvent e) {
        EditorPartPresenter activeEditor = editorAgent.getActiveEditor();
        if (activeEditor != null) {
            VirtualFile file = activeEditor.getEditorInput().getFile();
            file.getContent().then(new Operation<String>() {
                @Override
                public void apply(String result) throws OperationException {
                    notificationManager.notify(result);
                }
            }).catchError(new Operation<PromiseError>() {
                @Override
                public void apply(PromiseError arg) throws OperationException {
                }
            });
        }
    }

Please, give me a hint what is the proper way to set the content to the opened editor.

--
Regards,
Maxim Gorbunkov

Back to the top