Skip to main content
summaryrefslogtreecommitdiffstats
blob: 2c9baf987c4a9559b19ff8b55a82fc36aad166fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*******************************************************************************
 * Copyright (c) 2004, 2007 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.ote.ui.test.manager.batches.navigate;

import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.logging.Level;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.svn.CheckoutProjectSetJob;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
import org.eclipse.osee.framework.ui.swt.KeyedImage;
import org.eclipse.osee.ote.ui.test.manager.internal.TestManagerPlugin;

/**
 * @author Roberto E. Escobar
 */
final class ProjectSetupItem extends XNavigateItem implements Runnable {
   private URI projectSetFile;
   private String jobName;

   public ProjectSetupItem(XNavigateItem parent, String name, KeyedImage oseeImage, URI projectSetFile) {
      super(parent, name, oseeImage);
      this.jobName = String.format("Project Configuration: [%s]", name);
      this.projectSetFile = projectSetFile;
   }

   public void run() {
      try {
         URL url = projectSetFile.toURL();
         Job job = new CheckoutProjectSetJob(jobName, getName(), url);
         job.setUser(true);
         job.schedule();
      } catch (MalformedURLException ex) {
         OseeLog.log(TestManagerPlugin.class, Level.SEVERE, ex);
      }
   }
}

Back to the top