View | Details | Raw Unified | Return to bug 99013
Collapse All | Expand All

(-)src/org/eclipse/update/internal/ui/views/FindUpdatesAction.java (-21 / +23 lines)
Lines 10-27 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.update.internal.ui.views;
11
package org.eclipse.update.internal.ui.views;
12
12
13
import org.eclipse.core.runtime.*;
13
import org.eclipse.core.runtime.IStatus;
14
import org.eclipse.jface.action.*;
14
import org.eclipse.core.runtime.jobs.Job;
15
import org.eclipse.jface.dialogs.*;
15
import org.eclipse.jface.action.Action;
16
import org.eclipse.jface.wizard.*;
16
import org.eclipse.jface.dialogs.ErrorDialog;
17
import org.eclipse.swt.custom.*;
17
import org.eclipse.jface.dialogs.MessageDialog;
18
import org.eclipse.swt.widgets.*;
18
import org.eclipse.swt.widgets.Shell;
19
import org.eclipse.update.core.*;
19
import org.eclipse.ui.IWorkbenchWindow;
20
import org.eclipse.update.internal.operations.*;
20
import org.eclipse.update.core.IFeature;
21
import org.eclipse.update.internal.ui.*;
21
import org.eclipse.update.internal.ui.UpdateUI;
22
import org.eclipse.update.internal.ui.wizards.*;
22
import org.eclipse.update.internal.ui.UpdateUIMessages;
23
import org.eclipse.update.operations.*;
23
import org.eclipse.update.internal.ui.wizards.InstallWizard;
24
import org.eclipse.update.search.*;
24
import org.eclipse.update.internal.ui.wizards.InstallWizardOperation;
25
import org.eclipse.update.operations.OperationsManager;
26
import org.eclipse.update.ui.UpdateJob;
25
27
26
public class FindUpdatesAction extends Action {
28
public class FindUpdatesAction extends Action {
27
29
Lines 58-73 Link Here
58
		IFeature [] features=null;
60
		IFeature [] features=null;
59
		if (feature!=null)
61
		if (feature!=null)
60
			features = new IFeature[] { feature };
62
			features = new IFeature[] { feature };
61
		final UpdateSearchRequest searchRequest = UpdateUtils.createNewUpdatesRequest(features);
63
	
64
        UpdateJob job = new UpdateJob(UpdateUIMessages.InstallWizard_jobName, false, false, features);  
65
         
66
		job.setUser(true);
67
		job.setPriority(Job.INTERACTIVE);
68
		
69
		InstallWizardOperation operation = new InstallWizardOperation();
70
		IWorkbenchWindow window = UpdateUI.getActiveWorkbenchWindow();
71
		operation.run(shell, job);
62
72
63
		BusyIndicator.showWhile(shell.getDisplay(), new Runnable() {
64
			public void run() {
65
				InstallWizard wizard = new InstallWizard(searchRequest);
66
				WizardDialog dialog = new ResizableInstallWizardDialog(shell, wizard, UpdateUIMessages.FindUpdatesAction_updates); 
67
				dialog.create();
68
				dialog.open();				
69
			}
70
		});
71
	}
73
	}
72
	
74
	
73
	private boolean confirm(String message) {
75
	private boolean confirm(String message) {
(-)src/org/eclipse/update/ui/UpdateJob.java (-1 / +11 lines)
Lines 68-78 Link Here
68
     * @param download download updates automatically
68
     * @param download download updates automatically
69
     */
69
     */
70
	public UpdateJob( String name, boolean isAutomatic, boolean download ) {
70
	public UpdateJob( String name, boolean isAutomatic, boolean download ) {
71
		this(name,isAutomatic,download, null);
72
	}
73
    /**
74
     * Use this constructor to search for updates to installed features
75
     * @param isAutomatic true if automatically searching for updates   
76
     * @param name the job name
77
     * @param download download updates automatically
78
     * @param features the features to search for updates. If you want to search all features, pass a null array or use the other constructor. 
79
     */
80
	public UpdateJob( String name, boolean isAutomatic, boolean download, IFeature[] features ) {
71
		super(name);
81
		super(name);
72
        this.isUpdate = true;
82
        this.isUpdate = true;
73
        this.isAutomatic = isAutomatic;
83
        this.isAutomatic = isAutomatic;
74
        this.download = download;
84
        this.download = download;
75
		updates = new ArrayList();
85
		updates = new ArrayList();
86
		searchRequest = UpdateUtils.createNewUpdatesRequest(features);
76
		setPriority(Job.DECORATE);
87
		setPriority(Job.DECORATE);
77
	}
88
	}
78
89
Lines 144-150 Link Here
144
            else
155
            else
145
                UpdateCore.debug("Update search started."); //$NON-NLS-1$
156
                UpdateCore.debug("Update search started."); //$NON-NLS-1$
146
        }
157
        }
147
        searchRequest = UpdateUtils.createNewUpdatesRequest(null);
148
158
149
        if (resultCollector == null)
159
        if (resultCollector == null)
150
            resultCollector = new ResultCollectorWithMirrors();
160
            resultCollector = new ResultCollectorWithMirrors();

Return to bug 99013