blob: 6ff3382e45131cfd61f8c977a5411661e955c6d7 (
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
/*******************************************************************************
* Copyright (c) 2013 IBM Corporation and others.
* 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:
* IBM Corporation - initial API and implementation
* Ericsson AB (Hamdan Msheik) - Bypass install license wizard page via plugin_customization
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.dialogs;
import org.eclipse.equinox.internal.p2.ui.ProvUIImages;
import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
import org.eclipse.equinox.p2.operations.UpdateOperation;
import org.eclipse.equinox.p2.ui.AcceptLicensesWizardPage;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.jface.wizard.Wizard;
/**
* An update wizard that is invoked when there is only one thing to update, only
* one update to choose, and the resolution is known to be successful.
*
* @since 3.6
*/
public class UpdateSingleIUWizard extends Wizard {
UpdateSingleIUPage mainPage;
ProvisioningUI ui;
UpdateOperation operation;
public static boolean validFor(UpdateOperation operation) {
return operation.hasResolved() && operation.getResolutionResult().isOK() && operation.getSelectedUpdates().length == 1;
}
public UpdateSingleIUWizard(ProvisioningUI ui, UpdateOperation operation) {
super();
this.ui = ui;
this.operation = operation;
setWindowTitle(ProvUIMessages.UpdateIUOperationLabel);
setDefaultPageImageDescriptor(ProvUIImages.getImageDescriptor(ProvUIImages.WIZARD_BANNER_UPDATE));
}
protected UpdateSingleIUPage createMainPage() {
mainPage = new UpdateSingleIUPage(operation, ui);
return mainPage;
}
/*
* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
*/
@Override
public void addPages() {
mainPage = createMainPage();
addPage(mainPage);
if (!WizardWithLicenses.canBypassLicencePage()) {
AcceptLicensesWizardPage page = createLicensesPage();
page.update(null, operation);
if (page.hasLicensesToAccept())
addPage(page);
}
}
protected AcceptLicensesWizardPage createLicensesPage() {
return new AcceptLicensesWizardPage(ui.getLicenseManager(), null, operation);
}
@Override
public boolean performFinish() {
return mainPage.performFinish();
}
}
|