]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.project/src/org/eclipse/equinox/internal/provisional/p2/installer/InstallAdvisor.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.project / src / org / eclipse / equinox / internal / provisional / p2 / installer / InstallAdvisor.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2008 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package org.eclipse.equinox.internal.provisional.p2.installer;
12
13 import org.eclipse.core.runtime.IProgressMonitor;
14 import org.eclipse.core.runtime.IStatus;
15 import org.eclipse.core.runtime.OperationCanceledException;
16
17 /**
18  * The install advisor helps to make decisions during install, and is the conduit
19  * for reporting progress and results back to an end user or log.
20  */
21 public abstract class InstallAdvisor {
22         /**
23          * Performs the actual install. The advisor is responsible for handling progress
24          * monitoring and cancelation. The advisor may perform the install in
25          * another thread, but must block the calling thread until the install
26          * completes.
27          * 
28          * @param operation The install operation to run
29          * @return IStatus The result of the install operation. This is typically
30          * just the return value of {@link IInstallOperation#install(IProgressMonitor)},
31          * but the advisor may alter the result status if desired.
32          */
33         public abstract IStatus performInstall(IInstallOperation operation);
34
35         /**
36          * Allows the advisor to modify or fill in missing values in the install description.  
37          * @param description The initial install description
38          * @return The install description to be used for the install.
39          * @exception OperationCanceledException if the install should be canceled.
40          */
41         public abstract InstallDescription prepareInstallDescription(InstallDescription description);
42
43         /**
44          * Prompts for whether the installed application should be launched immediately.
45          * This method is only called after a successful install.
46          * 
47          * @param description The initial install description
48          * @return <code>true</code> if the product should be launched, and 
49          * <code>false</code> otherwise.
50          */
51         public abstract boolean promptForLaunch(InstallDescription description);
52
53         /**
54          * Reports some result information to the context.  The status may be
55          * information, warning, or an error.
56          */
57         public abstract void setResult(IStatus status);
58
59         /**
60          * Initializes the install advisor.  This method must be called before calling any 
61          * other methods on the advisor are called.  Subsequent invocations of this
62          * method are ignored.
63          */
64         public abstract void start();
65
66         /**
67          * Stops the install advisor. The advisor becomes invalid after it has been
68          * stopped; a stopped advisor cannot be restarted.
69          */
70         public abstract void stop();
71 }