Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/AbstractImportPage_c.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/AbstractImportPage_c.java126
1 files changed, 0 insertions, 126 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/AbstractImportPage_c.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/AbstractImportPage_c.java
deleted file mode 100644
index 5c9ff866f..000000000
--- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/migration/AbstractImportPage_c.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 WindRiver 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:
- * WindRiver Corporation - initial API and implementation
- * Ericsson AB (Pascal Rapicault) - Bug 395210
- * Ericsson AB (Hamdan Msheik) - Bug 398833
- *******************************************************************************/
-package org.eclipse.equinox.internal.p2.ui.sdk.scheduler.migration;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.internal.p2.ui.ProvUI;
-import org.eclipse.equinox.internal.p2.ui.dialogs.ProvisioningOperationWizard;
-import org.eclipse.equinox.p2.engine.IProfile;
-import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.VersionRange;
-import org.eclipse.equinox.p2.query.IQueryResult;
-import org.eclipse.equinox.p2.query.QueryUtil;
-import org.eclipse.equinox.p2.ui.ProvisioningUI;
-import org.eclipse.jface.viewers.ICheckStateProvider;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.*;
-
-public abstract class AbstractImportPage_c extends AbstractPage_c {
-
- IProfile profile = null;
- private final ProvisioningOperationWizard wizard;
- private final ProvisioningUI ui;
-
- public AbstractImportPage_c(String pageName, ProvisioningUI ui, ProvisioningOperationWizard wizard) {
- super(pageName);
- this.wizard = wizard;
- this.ui = ui;
- profile = getSelfProfile();
- }
-
- protected ProvisioningOperationWizard getProvisioningWizard() {
- return wizard;
- }
-
- protected ProvisioningUI getProvisioningUI() {
- return ui;
- }
-
- @Override
- protected void createInstallationTable(Composite parent) {
- super.createInstallationTable(parent);
- viewer.getTree().addListener(SWT.Selection, new Listener() {
-
- public void handleEvent(Event event) {
- if (event.detail == SWT.CHECK) {
- if (hasInstalled(ProvUI.getAdapter(event.item.getData(), IInstallableUnit.class))) {
- viewer.getTree().setRedraw(false);
- ((TreeItem) event.item).setChecked(false);
- viewer.getTree().setRedraw(true);
- }
- }
- updatePageCompletion();
- }
- });
- }
-
- public boolean hasInstalled(IInstallableUnit iu) {
- IQueryResult<IInstallableUnit> results = profile.query(QueryUtil.createIUQuery(iu.getId(), new VersionRange(iu.getVersion(), true, null, false)), null);
- return !results.isEmpty();
- }
-
- public String getIUNameWithDetail(IInstallableUnit iu) {
- IQueryResult<IInstallableUnit> results = profile.query(QueryUtil.createIUQuery(iu.getId(), new VersionRange(iu.getVersion(), true, null, false)), null);
- String text = iu.getProperty(IProfile.PROP_NAME, null);
- text = (text != null) ? text : iu.getId();
- if (!results.isEmpty()) {
- boolean hasHigherVersion = false;
- boolean hasEqualVersion = false;
- for (IInstallableUnit installedIU : results.toSet()) {
- int compareValue = installedIU.getVersion().compareTo(iu.getVersion());
- if (compareValue > 0) {
- hasHigherVersion = true;
- break;
- } else if (compareValue == 0)
- hasEqualVersion = true;
- }
- if (hasHigherVersion)
- return NLS.bind(ProvUIMessages.AbstractImportPage_HigherVersionInstalled, text);
- else if (hasEqualVersion)
- return NLS.bind(ProvUIMessages.AbstractImportPage_SameVersionInstalled, text);
- }
- return text;
- }
-
- @Override
- protected ICheckStateProvider getViewerDefaultState() {
- return new ICheckStateProvider() {
-
- public boolean isGrayed(Object element) {
- return false;
- }
-
- public boolean isChecked(Object element) {
- if (profile != null) {
- IInstallableUnit iu = ProvUI.getAdapter(element, IInstallableUnit.class);
- IQueryResult<IInstallableUnit> collector = profile.query(QueryUtil.createIUQuery(iu.getId(), new VersionRange(iu.getVersion(), true, null, false)), new NullProgressMonitor());
- if (collector.isEmpty()) {
- return true;
- }
- }
- return false;
- }
- };
- }
-
- @Override
- protected void doFinish() throws Exception {
- // do nothing
- }
-
- @Override
- public boolean canFlipToNextPage() {
- return isPageComplete();
- }
-} \ No newline at end of file

Back to the top