Search in sources :

Example 1 with StartBuildJob

use of org.jboss.tools.openshift.internal.ui.job.StartBuildJob in project jbosstools-openshift by jbosstools.

the class StartBuildHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    ISelection selection = UIUtils.getCurrentSelection(event);
    IResource buildAble = UIUtils.getFirstElement(selection, IResource.class);
    if (buildAble == null || buildAble.getCapability(IBuildTriggerable.class) == null) {
        MessageDialog.openInformation(HandlerUtil.getActiveShell(event), "Trigger Build", "A build or build config must be selected in order to trigger a build.");
        return null;
    }
    new StartBuildJob(buildAble).schedule();
    return null;
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) StartBuildJob(org.jboss.tools.openshift.internal.ui.job.StartBuildJob) IResource(com.openshift.restclient.model.IResource)

Aggregations

IResource (com.openshift.restclient.model.IResource)1 ISelection (org.eclipse.jface.viewers.ISelection)1 StartBuildJob (org.jboss.tools.openshift.internal.ui.job.StartBuildJob)1