Eclipse Plugin to show Windows Explorer context menu Eclipse Plugin to show Windows Explorer context menu windows windows

Eclipse Plugin to show Windows Explorer context menu


I'm a little late to the game with this answer, however since I found this article when trying to find a solution to this i'll post it here. There's an answer over at http://www.eclipsezone.com/eclipse/forums/t77655.html that solves this simply.

under Window -> External Tools -> External Tools Configuration

(1) Create a new Program (select Program in the tree)
(2) name it shell (or whatever you want) (3) set the location to ${env_var:SystemRoot}\explorer.exe
(4) set the arguments to /select,${resource_loc}
(5) run it

for me it appears up in the tool bar at the top in it the little external tool run (run with a toolbox)

simple, effective and doesn't require any installation especially when all i really needed was to have a file focused, and rapidly get to the windows folder that contains it.


For people who don't want to install Aptana (It's kinda huge), here are a few plugins for a windows context menu in eclipse(and more):

  1. contextmenu
    • Basic
  2. Eclipse Navigator Extension
    • Basic + copy path
  3. StartExplorer
    • Only opens explorer, but also does it on selected text (if it's a path) and has custom commands.

Some more info on Eclipse explorer menu's after trying them:

  1. Failed to install (Some error with osgi)
  2. Has 2 Eclipse context menu's:
    • Copy path (full, file, parent)
    • Show Context Menu (it's the basic version though, some of the context menu items that I can see in real Explorer don't show up here)
  3. Has 1 Eclipse context menu (StartExplorer) with submenu's:
    • Show in File manager
    • Start Shell here
    • Open file with default application
    • Copy resource path to clipboard
    • Custom commands, which you can set in preferences and default ones:
      • Edit in notepad
      • echo to temp file

So, although (3) StartExplorer doesn't really have a context menu and everything sits in a submenu, the custom commands dominates in my opinion. It should allow a contextmenu through it (command to be found) or achieve what you want by cloning the behavior you want from your context menu.It also seems like the code has been updated more recently than the others (and it supports multiple platforms)


For my custom paste I am not using the Paste from eclipse , I have created a new context menu Paste Objects by adding a new command .I have added the handler : PasteObjectsHandler for the command which extends AbstractHandler .

Command

  <command        categoryId="org.eclipse.ui.category.edit"        description="%pasteobjectscommand.description_xmsg"        id="com.test.pasteobjectscommand"        name="%pasteobjectscommand.name_xtit">  </command>

Handler

 <handler        class="com.test.PasteObjectsHandler"        commandId=" com.test.pasteobjectscommand ">  </handler>

public class PasteObjectsHandler extends AbstractHandler {

   @Override   public Object execute(ExecutionEvent event) {    Clipboard clipBoard = new Clipboard(Display.getDefault());    LocalTransfer instance = LocalTransfer.getInstance();    IResource clipboardData = (IResource) clipBoard.getContents(instance);}

}

And in the handler I try to access the clipboard in the execute method . And I get null here .