Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java
index 8231c4bdd..7ff6ad328 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/actions/ProfileModificationAction.java
@@ -35,7 +35,6 @@ import org.eclipse.ui.statushandlers.StatusManager;
public abstract class ProfileModificationAction extends ProvisioningAction {
public static final int ACTION_NOT_RUN = -1;
String profileId;
- String userChosenProfileId;
int result = ACTION_NOT_RUN;
protected ProfileModificationAction(ProvisioningUI ui, String text, ISelectionProvider selectionProvider, String profileId) {
@@ -48,7 +47,7 @@ public abstract class ProfileModificationAction extends ProvisioningAction {
public void run() {
Collection<IInstallableUnit> ius = getSelectedIUs();
// No ius or no profile?
- if (profileId == null || ius.size() == 0) {
+ if (isInvalidProfileId() || ius.size() == 0) {
ProvUI.reportStatus(getNoProfileOrSelectionStatus(profileId, ius), StatusManager.BLOCK);
runCanceled();
return;
@@ -56,6 +55,10 @@ public abstract class ProfileModificationAction extends ProvisioningAction {
run(ius, profileId);
}
+ protected boolean isInvalidProfileId() {
+ return profileId == null;
+ }
+
public IProfile getProfile() {
String id = profileId == null ? ui.getProfileId() : profileId;
return ProvUI.getProfileRegistry(ui.getSession()).getProfile(id);
@@ -81,7 +84,6 @@ public abstract class ProfileModificationAction extends ProvisioningAction {
public void run() {
if (validateOperation(operation))
performAction(operation, ius);
- userChosenProfileId = null;
}
});
}
@@ -202,10 +204,9 @@ public abstract class ProfileModificationAction extends ProvisioningAction {
return profile.getInstallableUnitProperty(iu, propertyName);
}
- private void runCanceled() {
+ protected void runCanceled() {
// The action was canceled, do any cleanup needed before
// it is run again.
- userChosenProfileId = null;
result = Window.CANCEL;
}
}

Back to the top