summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (JBoss)2013-04-02 22:34:06 (EDT)
committerPascal Rapicault2013-04-09 08:01:24 (EDT)
commitc8228c99177812776f4214fa1eaa5e4a0227c0a7 (patch)
treef6ccda47b16bc9d58ab6e57d8b1c7c1300667422
parent278913d6064f30f8d3e26c004fd10dd5ff042661 (diff)
downloadrt.equinox.p2-c8228c99177812776f4214fa1eaa5e4a0227c0a7.zip
rt.equinox.p2-c8228c99177812776f4214fa1eaa5e4a0227c0a7.tar.gz
rt.equinox.p2-c8228c99177812776f4214fa1eaa5e4a0227c0a7.tar.bz2
Downgrade/Update icons Checkboxes only visible if "Build my own solution" is selected
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIImages.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationPage.java13
2 files changed, 6 insertions, 9 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIImages.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIImages.java
index c68aafb..02f64dd 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIImages.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIImages.java
@@ -40,6 +40,8 @@ public class ProvUIImages {
public final static String IMG_IU = "obj/iu_obj.gif"; //$NON-NLS-1$
public final static String IMG_DISABLED_IU = "obj/iu_disabled_obj.gif"; //$NON-NLS-1$
public final static String IMG_UPDATED_IU = "obj/iu_update_obj.gif"; //$NON-NLS-1$
+ public final static String IMG_UPGRADE_IU = "obj/iu_upgrade_obj.gif"; //$NON-NLS-1$
+ public final static String IMG_DOWNGRADE_IU = "obj/iu_downgrade_obj.gif"; //$NON-NLS-1$
public final static String IMG_ADDED_IU = "obj/iu_add.gif"; //$NON-NLS-1$
public final static String IMG_REMOVED_IU = "obj/iu_remove.gif"; //$NON-NLS-1$
public final static String IMG_PATCH_IU = "obj/iu_patch_obj.gif"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationPage.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationPage.java
index e979293..cdd0673 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RemediationPage.java
@@ -76,7 +76,7 @@ public class RemediationPage extends ResolutionStatusPage {
checkboxes.get(ALLOWINSTALLEDREMOVAL_INDEX).setSelection(remedy != null && remedy.getConfig().allowInstalledRemoval);
for (Iterator<Button> iterator = checkboxes.iterator(); iterator.hasNext();) {
Button btn1 = iterator.next();
- btn1.setEnabled(remedy == null);
+ btn1.setVisible(remedy == null);
}
refreshResultComposite();
}
@@ -239,14 +239,9 @@ public class RemediationPage extends ResolutionStatusPage {
AvailableIUElement element = new AvailableIUElement(root, addedIU, getProfileId(), true);
for (IInstallableUnit removedIU : selectedRemedy.getRequest().getRemovals()) {
if (removedIU.getId().equals(addedIU.getId())) {
- //if (remediationOperation.isCheckForUpdates()) {
- // for (IInstallableUnit originalUpdatedIU : remediationOperation.getOriginalRequest().getAdditions()) {
- // int q = addedIU.getVersion().compareTo(originalUpdatedIU.getVersion());
- //
- // if (addedIU.getId() == originalUpdatedIU.getId() && addedIU.getVersion().compareTo(originalUpdatedIU.getVersion()) < 0) {
- // }
- // }
- // }
+ int addedComparedToRemoved = addedIU.getVersion().compareTo(removedIU.getVersion());
+ element.setDowngrade(addedComparedToRemoved < 0);
+ element.setUpgrade(addedComparedToRemoved > 0);
element.setIsUpdate(true);
updateIds.add(addedIU.getId());
break;