How to open windows explorer on selected resource in Eclipse

后端 未结 11 997
既然无缘
既然无缘 2020-12-22 16:43

I was looking for a small plugin for Eclipse that would allow to open windows explorer on currently selected resource from Package Explorer tree.

I know that Aptana

11条回答
  •  再見小時候
    2020-12-22 17:25

    Create a new Plug-In project using Eclipse PDE. Hook your bundle's Activator class into the Common Navigator API to receive selections for IResource. For each IResource selected, use the FileLocator to get a file URI, with which you can construct a java.io.File object. This can then be opened in the operating system's native file explorer using Java 6 Desktop integration:

        if (Desktop.isDesktopSupported()) {
            Desktop desktop = Desktop.getDesktop();
            desktop.open(new File("C:/"));
        }
    

提交回复
热议问题