Search in sources :

Example 1 with SonarDataExporter

use of org.eclipse.titanium.utils.SonarDataExporter in project titan.EclipsePlug-ins by eclipse.

the class ExportDataForSonarAction method execute.

@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
    final IWorkbenchPage iwPage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    final List<IProject> res = SelectionUtils.getProjectsFromSelection(iwPage.getSelection());
    for (final IProject project : res) {
        new ProjectAnalyzerJob("Exporting sonar data for project " + project.getName()) {

            @Override
            public IStatus doPostWork(final IProgressMonitor monitor) {
                try {
                    final SonarDataExporter exporter = new SonarDataExporter(project);
                    exporter.exportDataForProject();
                } catch (IOException e) {
                    ErrorReporter.logExceptionStackTrace("Error while exporting data for project " + project.getName(), e);
                }
                return Status.OK_STATUS;
            }
        }.quickSchedule(project);
    }
    return null;
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IStatus(org.eclipse.core.runtime.IStatus) SonarDataExporter(org.eclipse.titanium.utils.SonarDataExporter) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IOException(java.io.IOException) ProjectAnalyzerJob(org.eclipse.titanium.utils.ProjectAnalyzerJob) IProject(org.eclipse.core.resources.IProject)

Aggregations

IOException (java.io.IOException)1 IProject (org.eclipse.core.resources.IProject)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IStatus (org.eclipse.core.runtime.IStatus)1 ProjectAnalyzerJob (org.eclipse.titanium.utils.ProjectAnalyzerJob)1 SonarDataExporter (org.eclipse.titanium.utils.SonarDataExporter)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1