简体   繁体   English

如何从我的自定义Eclipse插件调用现有的Eclipse对话框?

[英]How to call an existing Eclipse dialog from my custom Eclipse plugin?

I'm creating an Eclipse plugin that need to invoke the Eclipse Refactor - Move dialog box and pass the source file and destination location values dynamically. 我正在创建一个Eclipse插件,该插件需要调用Eclipse Refactor - Move对话框并动态传递源文件目标位置值。 Since I already have the source file and destination location, I can skip the "Choose destination" page and directly go to the "Preview" page where the user will review the rafactored code caused by the move. 由于我已经有了源文件和目标位置,因此我可以跳过“选择目标”页面,直接转到“预览”页面,用户将在其中查看由移动引起的分解代码。

My questions is, how can I call the existing Eclipse dialog from my plugin? 我的问题是,如何从插件调用现有的Eclipse对话框? What are the extension points should I use? 我应该使用哪些扩展点?

通常,您只是追逐调用对话框的尾声(例如,在调试器中运行Eclipse,在org.eclipse.swt.widgets.Shell ctor中设置一个断点,然后从弹出菜单中调用操作)。

Hit Shift - Alt - F2 to activate the plugin menu spy in Eclipse. Shift - Alt - F2激活Eclipse中的插件菜单间谍 Then open the context menu on one of your classes and select the refactoring menu you are interested in (like Refactor->Move). 然后在您的一个类上打开上下文菜单,然后选择您感兴趣的重构菜单(例如Refactor-> Move)。

Plugin menu spy will show you the related action like org.eclipse.jdt.ui.actions.MoveAction which you can click to open and inspect how it invokes the refactoring. 插件菜单间谍将向您显示相关操作,例如org.eclipse.jdt.ui.actions.MoveAction ,您可以单击以打开并检查其如何调用重构。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM