intellij-community
intellij-community copied to clipboard
Refactor ExportAction
- Split ExportAction into 2 actions and add them into "InspectionToolWindow.ExportPopup" action group to allow plugins to add more actions there.
- Add "InspectionToolWindow.Toolbar" action group to allow plugins to add actions into toolbar of "Inspection Results".
Have you submitted a contributor license agreement? If not, please follow the steps described at http://www.jetbrains.com/agreements/cla/ to sign it.
@klikh Ok, I've done it.
Any updates? :)
@ekudel there are simple merge conflicts now
@ekudel Please rebase the PR on top of current master.
@akozlova @batya239 please take a look at the PR.
@klikh Done
@ekudel Now it's possible to add any action to "InspectionToolWindow.ExportPopup". I don't think it should be a kind of public API. I believe export html/xml actions should be unified and single abstract class should be extracted to export results to arbitrary given format
@batya239 Well, now the only common part of ExportToHTMLAction and ExportToXMLAction is showing "Export" dialog. All other code is completely different: visiting, etc (perhaps it can be changed, but it looks like a quite big task, so I'm just suggesting a small refactoring now). However this dialog is actually HTML-specific (for example it contains "open in browser" checkbox), and for our custom action we don't need it, so I hardly understand what that abstract class (user for all "export" actions) should contain. By the way we want to provide a custom action for exporting to Hybris-compatible XLSX format. However there could be other ways to export inspection results to XLSX provided by the platform or another plugin, so one-to-one relationship between formats and handlers wouldn't seem to work here.
@klikh @batya239 any updates?
If needed, I'd prefer the approach which is done for exporting tests