1 /*******************************************************************************
2 * Copyright (c) 2008, 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
.workbench
.update
;
13 import org
.eclipse
.core
.runtime
.jobs
.Job
;
14 import org
.eclipse
.equinox
.p2
.ui
.LoadMetadataRepositoryJob
;
17 * InstallNewSoftwareHandler invokes the install wizard
21 public class InstallNewSoftwareHandler
extends PreloadingRepositoryHandler
{
26 public InstallNewSoftwareHandler() {
31 protected void doExecute(LoadMetadataRepositoryJob job
) {
32 getProvisioningUI().openInstallWizard(null, null, job
);
36 protected boolean waitForPreload() {
37 // If the user cannot see repositories, then we may as well wait
38 // for existing repos to load so that content is available.
39 // If the user can manipulate the repositories, then we don't wait,
40 // because we don't know which ones they want to work with.
41 return !getProvisioningUI().getPolicy().getRepositoriesVisible();
45 protected void setLoadJobProperties(Job loadJob
) {
46 super.setLoadJobProperties(loadJob
);
47 // If we are doing a background load, we do not wish to authenticate, as the
48 // user is unaware that loading was needed
49 if (!waitForPreload()) {
50 loadJob
.setProperty(LoadMetadataRepositoryJob
.SUPPRESS_AUTHENTICATION_JOB_MARKER
, Boolean
.toString(true));
51 loadJob
.setProperty(LoadMetadataRepositoryJob
.SUPPRESS_REPOSITORY_EVENTS
, Boolean
.toString(true));