How to open windows explorer on selected resource in Eclipse

后端 未结 11 985
既然无缘
既然无缘 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:23

    Actually you can do that through the built in External tool manager. Here are the instructions : http://www.eclipsezone.com/eclipse/forums/t77655.html I'm trying to get it work with Nautilus. However it works under Windows as I tried it.

    0 讨论(0)
  • 2020-12-22 17:25

    I use this plugin, it seems ok

    New Eclipse Update Link https://fabioz.github.com/startexplorer/update/

    Old link for reference

    • http://sourceforge.net/projects/startexplorer/*

    • http://basti1302.github.com/startexplorer/update/

    0 讨论(0)
  • 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:/"));
        }
    
    0 讨论(0)
  • 2020-12-22 17:27

    In Eclipse Luna and later select a resource, then:

    Alt + shift + W > System Explorer

    or

    Right click > Show In > System Explorer

    The exact command that should be executed to open the System Explorer can be configured here:

    Window > Preferences > General > Workspace > Command for launching system explorer

    0 讨论(0)
  • 2020-12-22 17:30

    I use EasyShell plugin for Eclipse, it has that functionality and more.

    Have a look at that:

    https://anb0s.github.io/EasyShell/

    0 讨论(0)
  • 2020-12-22 17:32

    The command configured by default on a Linux platform (dbus-send ...) fails on CentOS 6 and CentOS 7. Changing it to nautilus "${selected_resource_parent_loc}" makes it work. I got this info from this documentation page, which I got from this bug report.

    I'm creating an RCP app, and I don't want my users to have to manually change this setting. Using plug-in spy I found the relevant preference store and key. So this non-API call will set the preference programmatically:

        IDEWorkbenchPlugin.getDefault().getPreferenceStore().setValue(IDEInternalPreferences.WORKBENCH_SYSTEM_EXPLORER,
    "nautilus \"${selected_resource_parent_loc}\"");
    

    With newer versions of nautilus you can specify ${selected_resource_loc} instead, in which case it opens the parent folder with the specified resource selected. I observed this with nautilus v 3.14, but version 2.28 throws an error is the resource is not a folder.

    0 讨论(0)
提交回复
热议问题