Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan Franklin2010-03-08 23:12:08 +0000
committerSusan Franklin2010-03-08 23:12:08 +0000
commit1d4913bf89a5f8289f1f375936de4e8c907b453a (patch)
tree2f9700f521c3d7955fd2e37934e32ddbd5450ad3 /bundles/org.eclipse.equinox.p2.ui.admin
parent50f813b9e67526689b6e01a899b0fad229479806 (diff)
downloadrt.equinox.p2-1d4913bf89a5f8289f1f375936de4e8c907b453a.tar.gz
rt.equinox.p2-1d4913bf89a5f8289f1f375936de4e8c907b453a.tar.xz
rt.equinox.p2-1d4913bf89a5f8289f1f375936de4e8c907b453a.zip
Bug 304942 - remove deprecated method use in RuntimeInstallJob
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.admin')
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddProfileJob.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfileFactory.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveProfilesJob.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUProfilePropertiesGroup.java4
6 files changed, 15 insertions, 10 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddProfileJob.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddProfileJob.java
index 4a3efe470..ecc86f052 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddProfileJob.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/AddProfileJob.java
@@ -10,10 +10,9 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin;
-import org.eclipse.equinox.p2.core.ProvisionException;
-
import java.util.Map;
import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.operations.ProvisioningJob;
import org.eclipse.equinox.p2.operations.ProvisioningSession;
@@ -35,7 +34,7 @@ public class AddProfileJob extends ProvisioningJob {
public IStatus runModal(IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS;
try {
- getSession().getProfileRegistry().addProfile(profileId, profileProperties);
+ ProvAdminUIActivator.getDefault().getProfileRegistry().addProfile(profileId, profileProperties);
} catch (ProvisionException e) {
status = getErrorStatus(null, e);
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfileFactory.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfileFactory.java
index cae6b67f1..831213fe9 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfileFactory.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfileFactory.java
@@ -10,13 +10,12 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin;
-import org.eclipse.equinox.p2.core.ProvisionException;
-
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.Platform;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.ui.ProvUIActivator;
+import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.osgi.service.environment.EnvironmentInfo;
@@ -40,7 +39,7 @@ public class ProfileFactory {
profileProperties.put(IProfile.PROP_NL, getDefaultNL());
try {
- return ProvAdminUIActivator.getDefault().getProvisioningUI(null).getSession().getProfileRegistry().addProfile(profileId, profileProperties);
+ return ProvAdminUIActivator.getDefault().getProfileRegistry().addProfile(profileId, profileProperties);
} catch (ProvisionException e) {
// log
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java
index df5cef119..7946d1215 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProfilesView.java
@@ -199,7 +199,7 @@ public class ProfilesView extends ProvView {
}
String[] getKnownProfileIds() {
- IProfile[] allProfiles = getProvisioningUI().getSession().getProfileRegistry().getProfiles();
+ IProfile[] allProfiles = ProvAdminUIActivator.getDefault().getProfileRegistry().getProfiles();
String[] ids = new String[allProfiles.length];
for (int i = 0; i < allProfiles.length; i++)
ids[i] = allProfiles[i].getProfileId();
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java
index a12b2b396..0b93343fa 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/ProvAdminUIActivator.java
@@ -13,6 +13,8 @@ package org.eclipse.equinox.internal.p2.ui.admin;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.ui.ProvUIActivator;
import org.eclipse.equinox.internal.p2.ui.admin.preferences.PreferenceConstants;
+import org.eclipse.equinox.p2.core.IProvisioningAgent;
+import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.engine.query.UserVisibleRootQuery;
import org.eclipse.equinox.p2.operations.RepositoryTracker;
import org.eclipse.equinox.p2.query.QueryUtil;
@@ -141,6 +143,11 @@ public class ProvAdminUIActivator extends AbstractUIPlugin {
return policy;
}
+ public IProfileRegistry getProfileRegistry() {
+ IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper.getService(context, IProvisioningAgent.SERVICE_NAME);
+ return (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME);
+ }
+
public ProvisioningUI getProvisioningUI(String profileId) {
return new ProvisioningUI(ProvisioningUI.getDefaultUI().getSession(), profileId, policy);
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveProfilesJob.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveProfilesJob.java
index 94d1eec82..b43a74ce8 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveProfilesJob.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/RemoveProfilesJob.java
@@ -29,7 +29,7 @@ public class RemoveProfilesJob extends ProvisioningJob {
public IStatus runModal(IProgressMonitor monitor) {
for (int i = 0; i < profileIds.length; i++) {
- getSession().getProfileRegistry().removeProfile(profileIds[i]);
+ ProvAdminUIActivator.getDefault().getProfileRegistry().removeProfile(profileIds[i]);
}
return Status.OK_STATUS;
diff --git a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUProfilePropertiesGroup.java b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUProfilePropertiesGroup.java
index 468b5ed93..db4f4c612 100644
--- a/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUProfilePropertiesGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui.admin/src/org/eclipse/equinox/internal/p2/ui/admin/dialogs/IUProfilePropertiesGroup.java
@@ -10,10 +10,10 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.ui.admin.dialogs;
+import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIActivator;
import org.eclipse.equinox.internal.p2.ui.admin.ProvAdminUIMessages;
import org.eclipse.equinox.internal.p2.ui.model.InstalledIUElement;
import org.eclipse.equinox.p2.engine.IProfile;
-import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
@@ -75,6 +75,6 @@ public class IUProfilePropertiesGroup extends IUGroup {
}
private IProfile getProfile(InstalledIUElement element) {
- return ProvisioningUI.getDefaultUI().getSession().getProfileRegistry().getProfile(element.getProfileId());
+ return ProvAdminUIActivator.getDefault().getProfileRegistry().getProfile(element.getProfileId());
}
}

Back to the top