[英]Fire eclipse event programmatically C#
I add a menu item to eclipse in plugin, which do something where the user click on it. 我在插件中为eclipse添加了一个菜单项,该菜单项在用户单击该菜单项时执行。
I want to open eclipse in c#, and immediately do the same thing. 我想在c#中打开eclipse,然后立即做同样的事情。 ie run eclipse, and then fire the
MouseListener
of the menu item. 即运行eclipse,然后触发菜单项的
MouseListener
。
Is there any way to do that? 有什么办法吗?
You want to use a C# application to simulate triggering an Eclipse menu action? 您是否要使用C#应用程序来模拟触发Eclipse菜单操作? As far as I know it cannot be done directly.
据我所知,这不能直接完成。
But there is a testing framework, SWTbot , that can run and trigger Eclipse actions and compare the results. 但是有一个测试框架SWTbot ,它可以运行和触发Eclipse操作并比较结果。 It's a bit difficult to learn, but you have a lot of possibilities for testing.
这有点难学,但是您有很多测试的可能性。 So I guess what you could do... Is to setup your C# application to run a SWTBot testcase which starts up Eclipse, triggers the menu item, and report back the results.
因此,我想您可以做什么...是设置您的C#应用程序以运行SWTBot测试用例,该用例启动Eclipse,触发菜单项并报告结果。 But its not really a good idea.
但这并不是一个好主意。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.