Open xml file in Idea

This is what I have so far.

DataContext dataContext= event.getDataContext();

Project project = (Project) dataContext.getData(DataConstants.PROJECT);

OpenFileDescriptor desc = (OpenFileDescriptor) dataContext.getData(DataConstants.OPEN_FILE_DESCRIPTOR);

Editor editor = (Editor) dataContext.getData(DataConstants.EDITOR);

String selectedText = editor.getSelectionModel().getSelectedText();

Once I have the name of the xml file, I would like to see if the file exists in the current project, and if it does then open it in Idea.

Please sign in to leave a comment.