Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2011-05-06 17:59:50 +0000
committerAndrew Niefer2011-05-06 17:59:50 +0000
commit4973e39b1c15ff1312567f627d32f3d8b8ddab64 (patch)
tree375ae6a468dc36986956c23c632c183e77a510e2 /bundles/org.eclipse.equinox.p2.ui
parent11cf66ed6b03d7a19737e1842f236776a2d91ecb (diff)
downloadrt.equinox.p2-4973e39b1c15ff1312567f627d32f3d8b8ddab64.tar.gz
rt.equinox.p2-4973e39b1c15ff1312567f627d32f3d8b8ddab64.tar.xz
rt.equinox.p2-4973e39b1c15ff1312567f627d32f3d8b8ddab64.zip
bug 344977 - unable to update M7
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionStatusPage.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/AvailableUpdateElement.java15
3 files changed, 13 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionStatusPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionStatusPage.java
index cdd7c6734..ffb344c70 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionStatusPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/ResolutionStatusPage.java
@@ -294,7 +294,7 @@ public abstract class ResolutionStatusPage extends ProvisioningWizardPage {
private boolean isLocked(AvailableIUElement elementToBeUpdated) {
if (elementToBeUpdated instanceof AvailableUpdateElement)
- return ((AvailableUpdateElement) elementToBeUpdated).isLocked();
+ return ((AvailableUpdateElement) elementToBeUpdated).isLockedForUpdate();
return false;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
index 897df3669..16dfec241 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/SelectableIUsPage.java
@@ -112,7 +112,7 @@ public class SelectableIUsPage extends ResolutionStatusPage implements IResoluti
// If the checkEvent is on a locked update element, uncheck it and select it.
if (event.getElement() instanceof AvailableUpdateElement) {
AvailableUpdateElement checkedElement = (AvailableUpdateElement) event.getElement();
- if (checkedElement.isLocked()) {
+ if (checkedElement.isLockedForUpdate()) {
event.getCheckable().setChecked(checkedElement, false);
// Select the element so that the locked description is displayed
CheckboxTableViewer viewer = ((CheckboxTableViewer) event.getSource());
@@ -237,7 +237,7 @@ public class SelectableIUsPage extends ResolutionStatusPage implements IResoluti
for (int i = 0; i < initialSelections.length; i++) {
if (initialSelections[i] instanceof AvailableUpdateElement) {
AvailableUpdateElement element = (AvailableUpdateElement) initialSelections[i];
- if (element.isLocked()) {
+ if (element.isLockedForUpdate()) {
continue;
}
}
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 bc7afe2b2..3ba9708e2 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
@@ -30,7 +30,7 @@ import org.eclipse.equinox.p2.planner.IProfileChangeRequest;
public class AvailableUpdateElement extends AvailableIUElement {
IInstallableUnit iuToBeUpdated;
- boolean isLocked = false;
+ boolean isLockedForUpdate = false;
public AvailableUpdateElement(Object parent, IInstallableUnit iu, IInstallableUnit iuToBeUpdated, String profileID, boolean shouldShowChildren) {
super(parent, iu, profileID, shouldShowChildren);
@@ -43,11 +43,16 @@ public class AvailableUpdateElement extends AvailableIUElement {
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;
+ String property = profile.getInstallableUnitProperty(iuToBeUpdated, IProfile.PROP_PROFILE_LOCKED_IU);
+ try {
+ isLockedForUpdate = property == null ? false : (Integer.parseInt(property) & IProfile.LOCK_UPDATE) > 0;
+ } catch (NumberFormatException e) {
+ isLockedForUpdate = false;
+ }
}
- public boolean isLocked() {
- return isLocked;
+ public boolean isLockedForUpdate() {
+ return isLockedForUpdate;
}
public IInstallableUnit getIUToBeUpdated() {
@@ -92,7 +97,7 @@ public class AvailableUpdateElement extends AvailableIUElement {
protected String getImageId(Object obj) {
String imageId = super.getImageId(obj);
- if (ProvUIImages.IMG_IU.equals(imageId) && isLocked())
+ if (imageId.equals(ProvUIImages.IMG_IU) && isLockedForUpdate())
return ProvUIImages.IMG_DISABLED_IU;
return imageId;
}

Back to the top