1 /*******************************************************************************
2 * Copyright (c) 2007, 2009 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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package eu
.etaxonomy
.taxeditor
.update
;
13 import org
.eclipse
.equinox
.internal
.p2
.ui
.dialogs
.UpdateSingleIUWizard
;
14 import org
.eclipse
.equinox
.p2
.operations
.RepositoryTracker
;
15 import org
.eclipse
.equinox
.p2
.operations
.UpdateOperation
;
16 import org
.eclipse
.equinox
.p2
.ui
.LoadMetadataRepositoryJob
;
17 import org
.eclipse
.jface
.wizard
.WizardDialog
;
20 * UpdateHandler invokes the check for updates UI
24 public class UpdateHandler
extends PreloadingRepositoryHandler
{
26 boolean hasNoRepos
= false;
29 protected void doExecute(LoadMetadataRepositoryJob job
) {
33 UpdateOperation operation
= getProvisioningUI().getUpdateOperation(null, null);
37 operation
.resolveModal(null);
38 if (getProvisioningUI().getPolicy().continueWorkingWithOperation(operation
, getShell())) {
39 if (UpdateSingleIUWizard
.validFor(operation
)) {
40 // Special case for only updating a single root
41 UpdateSingleIUWizard wizard
= new UpdateSingleIUWizard(getProvisioningUI(), operation
);
42 WizardDialog dialog
= new WizardDialog(getShell(), wizard
);
46 // Open the normal version of the update wizard
47 getProvisioningUI().openUpdateWizard(false, operation
, job
);
53 protected boolean preloadRepositories() {
55 RepositoryTracker repoMan
= getProvisioningUI().getRepositoryTracker();
56 if (repoMan
.getKnownRepositories(getProvisioningUI().getSession()).length
== 0) {
60 return super.preloadRepositories();