1 package org.simantics.project.management.install;
\r
3 import org.eclipse.core.runtime.IPath;
\r
4 import org.eclipse.core.runtime.IProgressMonitor;
\r
5 import org.eclipse.core.runtime.IStatus;
\r
6 import org.eclipse.equinox.internal.provisional.p2.installer.IInstallOperation;
\r
7 import org.eclipse.equinox.internal.provisional.p2.installer.InstallAdvisor;
\r
8 import org.eclipse.equinox.internal.provisional.p2.installer.InstallDescription;
\r
12 * @author Marko Luukkainen <marko.luukkainen@vtt.fi>
\r
15 public class DefaultInstallAdvisor extends InstallAdvisor{
\r
17 private IProgressMonitor monitor = null;
\r
19 public DefaultInstallAdvisor() {
\r
22 public IProgressMonitor getMonitor() {
\r
26 public void setMonitor(IProgressMonitor monitor) {
\r
27 this.monitor = monitor;
\r
31 public IStatus performInstall(IInstallOperation operation) {
\r
32 return operation.install(getMonitor());
\r
36 public InstallDescription prepareInstallDescription(
\r
37 InstallDescription description) {
\r
38 if (description.getInstallLocation() == null)
\r
39 throw new IllegalArgumentException("Install location is missing!");
\r
40 IPath location = description.getInstallLocation();
\r
41 description.setAgentLocation(location.append("p2")); //$NON-NLS-1$
\r
47 public boolean promptForLaunch(InstallDescription description) {
\r
52 public void setResult(IStatus status) {
\r
53 if (monitor != null) {
\r
59 public void start() {
\r
64 public void stop() {
\r