简体   繁体   English

Eclipse 插件显示 Windows 资源管理器上下文菜单

[英]Eclipse Plugin to show Windows Explorer context menu

I am looking for a good plugin showing Windows Explorer context menu directly from editor window in Eclipse.我正在寻找一个很好的插件,它直接从 Eclipse 中的编辑器 window 中显示 Windows Explorer 上下文菜单。 Does anybody know such plugin?有人知道这样的插件吗?

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. http://www.eclipsezone.com/eclipse/forums/t77655.html有一个答案可以简单地解决这个问题。

under Window -> External Tools -> External Tools Configuration Window下->外部工具->外部工具配置

(1) Create a new Program (select Program in the tree) (1) 创建一个新程序(在树中选择程序)
(2) name it shell (or whatever you want) (3) set the location to ${env_var:SystemRoot}\explorer.exe (2) 将其命名为 shell (或任何你想要的) (3) 将位置设置为 ${env_var:SystemRoot}\explorer.exe
(4) set the arguments to /select,${resource_loc} (4) 将 arguments 设置为 /select,${resource_loc}
(5) run it (5) 运行它

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.简单、有效且不需要任何安装,尤其是当我真正需要的是专注于文件并快速访问包含它的 windows 文件夹时。

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):对于不想安装 Aptana(它有点大)的人,这里有一些 Eclipse 中 windows 上下文菜单的插件(以及更多):

  1. contextmenu上下文菜单
    • Basic基本的
  2. Eclipse Navigator Extension Eclipse 导航器扩展
    • 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:尝试后有关 Eclipse 资源管理器菜单的更多信息:

  1. Failed to install (Some error with osgi)安装失败(osgi 出现一些错误)
  2. Has 2 Eclipse context menu's:有 2 个 Eclipse 上下文菜单:
    • 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:有 1 个 Eclipse 上下文菜单 (StartExplorer) 和子菜单:
    • Show in File manager在文件管理器中显示
    • Start Shell here从这里开始 Shell
    • 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.因此,尽管 (3) StartExplorer并没有真正的上下文菜单,并且所有内容都位于子菜单中,但我认为自定义命令占主导地位。 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.对于我的自定义粘贴,我没有使用 eclipse 中的粘贴,我通过添加新命令创建了一个新的上下文菜单粘贴对象。 I have added the handler: PasteObjectsHandler for the command which extends AbstractHandler.我为扩展 AbstractHandler 的命令添加了处理程序:PasteObjectsHandler。

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 {公共 class PasteObjectsHandler 扩展 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.我在这里得到 null。

I have written a plug-in that can open the Windows Explorer context menu: ContextMenuPlugin我写了一个可以打开Windows Explorer上下文菜单的插件: ContextMenuPlugin

I wrote it a long time ago, but I still maintain it.我很久以前写过它,但我仍然保持它。

I will add EasyShell plugin for Eclipse, it has that functionality and more.我将为 Eclipse 添加EasyShell 插件,它具有该功能等等。

Have a look at that:看看那个:

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

Aptana, it will give you context menu. Aptana,它会给你上下文菜单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何显示 Windows 资源管理器上下文(右键单击)菜单? - How to show Windows Explorer context (right click) menu? 在 Windows Explorer 上下文菜单中订购 - Order in the Windows Explorer context menu 在Windows资源管理器上下文菜单中添加分隔符(不在子菜单中) - Add a separator in the Windows Explorer context menu (not in a submenu) 涵盖Windows资源管理器上下文菜单应用程序! - Getting Coverage for Windows Explorer Context Menu Application! 将程序添加到Windows资源管理器上下文菜单 - Adding program to the windows explorer context menu 使用Windows资源管理器的“打印”上下文菜单项 - Using Windows Explorer 'Print' context menu entry Windows资源管理器上下文菜单上的InfoTip - InfoTip on Windows explorer context menu item Windows资源管理器不显示标记为可删除的虚拟设备的“弹出”上下文菜单项 - Windows Explorer does not show an “Eject” context menu entry for a virtual device marked removeable 是否可以将Windows资源管理器上下文菜单替换为菜单以外的其他菜单? - Is it possible to replace the windows explorer context menu with something other than a menu? 如何为Java应用程序向Windows资源管理器添加上下文菜单? - How can I add a context menu to the Windows Explorer for a Java application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM