How to specify a special file to preview

In the RStudio File panel, some files can be opened directly through the editor on the left panel, but some files (such as excel) will pop up a menu when clicked, and then we can preview the data of the file (as you can see from the second image is also programmed).


My question is how do I specify certain files (such as XPT) to preview in this way?