Search in sources :

Example 1 with MavenJob

use of org.absmodels.abs.plugin.actions.MavenJob in project abstools by abstools.

the class MavenAction method run.

@Override
public void run() {
    if (selection != null && selection instanceof TreeSelection) {
        final IProject project = getProject((TreeSelection) selection);
        new Job("Maven") {

            protected IStatus run(IProgressMonitor monitor) {
                final MavenJob mavenJob = new MavenJob(project);
                mavenJob.setUser(true);
                try {
                    mavenJob.runMavenUpdates();
                } catch (NoABSNatureException e) {
                    showErrorMessage(e.getMessage());
                } catch (AbsJobException e) {
                    showErrorMessage(e.getMessage());
                } catch (IOException e) {
                    showErrorMessage(e.getMessage());
                }
                MavenAction.super.run();
                return new Status(IStatus.OK, PLUGIN_ID, "done");
            }
        }.schedule();
    }
}
Also used : Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) NoABSNatureException(org.absmodels.abs.plugin.exceptions.NoABSNatureException) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IStatus(org.eclipse.core.runtime.IStatus) TreeSelection(org.eclipse.jface.viewers.TreeSelection) MavenJob(org.absmodels.abs.plugin.actions.MavenJob) IOException(java.io.IOException) Job(org.eclipse.core.runtime.jobs.Job) MavenJob(org.absmodels.abs.plugin.actions.MavenJob) IProject(org.eclipse.core.resources.IProject) AbsJobException(org.absmodels.abs.plugin.exceptions.AbsJobException)

Aggregations

IOException (java.io.IOException)1 MavenJob (org.absmodels.abs.plugin.actions.MavenJob)1 AbsJobException (org.absmodels.abs.plugin.exceptions.AbsJobException)1 NoABSNatureException (org.absmodels.abs.plugin.exceptions.NoABSNatureException)1 IProject (org.eclipse.core.resources.IProject)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 Job (org.eclipse.core.runtime.jobs.Job)1 TreeSelection (org.eclipse.jface.viewers.TreeSelection)1