diff options
author | DJ Houghton | 2011-03-21 18:14:37 +0000 |
---|---|---|
committer | DJ Houghton | 2011-03-21 18:14:37 +0000 |
commit | 92ed7a697cfced51f367b4a7172ab153d8c233da (patch) | |
tree | 8f8d938f7674e2407ca0a3c132d0da174175b424 /bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java | |
parent | 3fefc7d4aff6785c7ae144853b622cd8266db53d (diff) | |
download | rt.equinox.p2-92ed7a697cfced51f367b4a7172ab153d8c233da.tar.gz rt.equinox.p2-92ed7a697cfced51f367b4a7172ab153d8c233da.tar.xz rt.equinox.p2-92ed7a697cfced51f367b4a7172ab153d8c233da.zip |
Bug 322477 - Support for elevated privileges for updates in shared installv20110321-2120
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java index f04063350..bc7afe2b2 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 IBM Corporation and others. + * Copyright (c) 2007, 2011 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 @@ -13,8 +13,8 @@ package org.eclipse.equinox.internal.p2.ui.model; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest; -import org.eclipse.equinox.p2.engine.IProvisioningPlan; -import org.eclipse.equinox.p2.engine.ProvisioningContext; +import org.eclipse.equinox.internal.p2.ui.ProvUIImages; +import org.eclipse.equinox.p2.engine.*; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.operations.Update; import org.eclipse.equinox.p2.planner.IPlanner; @@ -30,11 +30,24 @@ import org.eclipse.equinox.p2.planner.IProfileChangeRequest; public class AvailableUpdateElement extends AvailableIUElement { IInstallableUnit iuToBeUpdated; + boolean isLocked = false; public AvailableUpdateElement(Object parent, IInstallableUnit iu, IInstallableUnit iuToBeUpdated, String profileID, boolean shouldShowChildren) { super(parent, iu, profileID, shouldShowChildren); setIsInstalled(false); this.iuToBeUpdated = iuToBeUpdated; + init(); + + } + + private void init() { + IProfileRegistry profileRegistry = (IProfileRegistry) getProvisioningUI().getSession().getProvisioningAgent().getService(IProfileRegistry.SERVICE_NAME); + IProfile profile = profileRegistry.getProfile(profileID); + isLocked = profile.getInstallableUnitProperty(iuToBeUpdated, IProfile.PROP_PROFILE_LOCKED_IU) != null; + } + + public boolean isLocked() { + return isLocked; } public IInstallableUnit getIUToBeUpdated() { @@ -76,4 +89,11 @@ public class AvailableUpdateElement extends AvailableIUElement { public Update getUpdate() { return new Update(iuToBeUpdated, getIU()); } + + protected String getImageId(Object obj) { + String imageId = super.getImageId(obj); + if (ProvUIImages.IMG_IU.equals(imageId) && isLocked()) + return ProvUIImages.IMG_DISABLED_IU; + return imageId; + } } |