Extending a 3rd party Eclipse plugin to fire procedure on NewWizard finish

我只是一个虾纸丫 提交于 2019-12-25 02:28:24

问题


We are looking to create a new Eclipse plugin to perform certain tasks when another commercial 3rd party plugin creates new classes in Eclipse.

The other plugin is ABAP Development Tools by SAP, which unfortunately doesn't provide source code for easy extension (as far as I can see). I'm not too familiar with Eclipse plugin development nor Java, coming from a JS, Delphi, C# background, but I have a main idea that I was hoping to work with. I've not been able to find any documentation for it so I'm not sure that it's possible.

Basically the SAP plugin creates 4 new wizards for different types of entity (Class, Interface, Program and Package) and we want to fire off a new procedure when any of these finish. Ideally, I would want to listen for a 'WizardComplete' event and run if the parameters are correct, but I can't see any such event documented.

The other obvious solution would be to 'decorate' these plugins and wrap a new 'PerformFinish', but I'm not sure on the licensing implications of doing this with commercial code nor am I keen on having to distribute a new wrapper every time SAP release a new version.

Is there an obvious way of firing off a procedure from completion of a Wizard? Possibly also on detection of creation of a new 'class' from the IDE could be an option.


回答1:


There is no way to detect the completion of a Wizard.

You can listen for changes in resources (files, folders, projects) by using the IResourceChangeListener see here

IWorkspace workspace = ResourcesPlugin.getWorkspace();

workspace.addResourceChangeListener(... your listener ...);

The listener is given quite a lot of details about changes so you should be see the creation of the class.



来源:https://stackoverflow.com/questions/51241640/extending-a-3rd-party-eclipse-plugin-to-fire-procedure-on-newwizard-finish

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!