Eclipse插件:如何使用组合键为Eclipse插件创建新菜单?
我一直在寻找这个问题,但找不到。我需要创建一个新的“弹出菜单”并分配一个按下的键(换句话说,我需要按“F3+右键单击”(例如),此操作将出现一个新的弹出菜单,我的操作在我的工作台)。我不需要右键单击子菜单...我需要一个新的单独菜单
示例,在 Eclipse 中,当我在工作台上右键单击鼠标时,我会看到一个弹出菜单,其中包含:“撤消、恢复文件、保存” 、剪切、复制...”等等,但我需要创建一个新菜单而不是 Eclipse 菜单,因此,当我按“F3+右键单击”(示例)时,我需要通过我的操作查看弹出菜单。这是我的问题,我需要创建一个新菜单并用键/鼠标组合调用它...
我一直在阅读论坛,但我不知道在哪里发布这个问题,我也不知道在哪里发布搜索(也许我在搜索中写了一个错误的问题......我想......)。
我希望有人能帮助我。
非常感谢;)
I've been looking about this question but I couldn't find it. I need to create a new "popup menu" and assign a key pressed (in other words, I need press "F3+right-click" (for example) and this action will be appear a new popup menu, with my actions in my workbench). I don't need a submenu for my right-click... i need a new and alone menu
Example, in eclipse, when i right-click with my mouse over workbench I see a popmenu with: "undo, revert file, save, cut, copy..." and more, but i need create a new menu instead of eclipse menu, so, when I press "F3+right-click" (example) i need see my popup-menu with my actions... this is my problem, i need to create a new menu and call it with key/mouse combination...
I've been reading the forums but i don't know where to post this question and I don't know where to search (maybe i write a wrong question in the search... i think...).
I hope someone can help me.
Thank you very much;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您希望在编辑器中看到此菜单(而不是在视图中,因为那会略有不同)。这里您需要做的大部分工作是通过在插件的plugin.xml 中声明扩展点来扩展Eclipse 扩展点。
值得庆幸的是,Eclipse 附带了一些扩展点向导来帮助您开始使用此功能。要到达那里,请执行以下操作
这是实现按键绑定所需执行的一组非常粗略的步骤(是的,它比需要的要复杂得多)。有关更多详细信息,您可以访问此处:
http://www.vogella.de/articles/ EclipseCommands/article.html
I assume that you would like to see this menu in an editor (rather than in a view because that would be slightly different). Most of what you need to do here is to extend eclipse extension points through declaring them in the plugin.xml for your plugin.
Thankfully, Eclipse ships with a few extension point wizards to help you get started with this. To get there, do the following
This is a very rough set of steps you need to do to implement the keybindinds (and, yes, it is way more complicated than it needs to be). For more detail, you can go here:
http://www.vogella.de/articles/EclipseCommands/article.html