summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-08-21 12:23:16 (EDT)
committerGerrit Code Review @ Eclipse.org2013-08-21 16:52:09 (EDT)
commit13c66fbc10081891b55495b916d7a2d3432dbbb0 (patch)
tree812e56ba131801e77342ecab81293542199ac001
parent18ffafb5a74c1c191fece9a2696947c52877dae7 (diff)
downloadeclipse.pde.ui-13c66fbc10081891b55495b916d7a2d3432dbbb0.zip
eclipse.pde.ui-13c66fbc10081891b55495b916d7a2d3432dbbb0.tar.gz
eclipse.pde.ui-13c66fbc10081891b55495b916d7a2d3432dbbb0.tar.bz2
Bug 415608 - Use FrameworkUtil.getBundle instead of deprecatedrefs/changes/43/15743/2
PackageAdmin.getBundle Change-Id: I2ec3111c293bd546d6af7befd7331c34705194f2 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/SpyFormToolkit.java3
-rw-r--r--ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveDialogPageSection.java12
-rw-r--r--ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveMenuSection.java9
-rw-r--r--ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveWizardSection.java16
4 files changed, 12 insertions, 28 deletions
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/SpyFormToolkit.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/SpyFormToolkit.java
index 38da77c..6f69d15 100644
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/SpyFormToolkit.java
+++ b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/SpyFormToolkit.java
@@ -30,6 +30,7 @@ import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.forms.widgets.*;
import org.osgi.framework.Bundle;
+import org.osgi.framework.FrameworkUtil;
/**
* @since 3.4
@@ -222,7 +223,7 @@ public class SpyFormToolkit extends FormToolkit {
}
private void createClassReference(StringBuffer buffer, Class clazz) {
- Bundle bundle = PDERuntimePlugin.HAS_IDE_BUNDLES ? PDERuntimePlugin.getDefault().getPackageAdmin().getBundle(clazz) : null;
+ Bundle bundle = PDERuntimePlugin.HAS_IDE_BUNDLES ? FrameworkUtil.getBundle(clazz) : null;
if (bundle != null) {
bundleClassByName.put(clazz.getName(), bundle);
buffer.append("<a href=\"").append(CLASS_PROTOCOL_PREFIX).append( //$NON-NLS-1$
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveDialogPageSection.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveDialogPageSection.java
index 3a88455..a58ae24 100644
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveDialogPageSection.java
+++ b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveDialogPageSection.java
@@ -16,17 +16,12 @@ import org.eclipse.jface.dialogs.IDialogPage;
import org.eclipse.jface.dialogs.IPageChangeProvider;
import org.eclipse.osgi.util.NLS;
import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.pde.internal.runtime.PDERuntimePlugin;
import org.eclipse.pde.internal.runtime.spy.SpyFormToolkit;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.*;
import org.eclipse.ui.handlers.HandlerUtil;
import org.osgi.framework.Bundle;
-import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.framework.FrameworkUtil;
/**
* @since 3.4
@@ -68,8 +63,7 @@ public class ActiveDialogPageSection implements ISpySection {
buffer.append(toolkit.createClassSection(text, PDERuntimeMessages.SpyDialog_activeDialogPageSection_desc, new Class[] {clazz}));
- PackageAdmin admin = PDERuntimePlugin.getDefault().getPackageAdmin();
- Bundle bundle = admin.getBundle(clazz);
+ Bundle bundle = FrameworkUtil.getBundle(clazz);
toolkit.generatePluginDetailsText(bundle, null, "dialog page", buffer, text); //$NON-NLS-1$
buffer.append("</form>"); //$NON-NLS-1$
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveMenuSection.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveMenuSection.java
index 7c8d159..ed96b82 100644
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveMenuSection.java
+++ b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveMenuSection.java
@@ -17,7 +17,6 @@ import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.jface.action.*;
import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.pde.internal.runtime.PDERuntimePlugin;
import org.eclipse.pde.internal.runtime.spy.SpyFormToolkit;
import org.eclipse.swt.widgets.*;
import org.eclipse.ui.IActionDelegate;
@@ -26,7 +25,7 @@ import org.eclipse.ui.forms.widgets.*;
import org.eclipse.ui.internal.*;
import org.eclipse.ui.menus.CommandContributionItem;
import org.osgi.framework.Bundle;
-import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.framework.FrameworkUtil;
/**
* @since 3.5
@@ -131,8 +130,7 @@ public class ActiveMenuSection implements ISpySection {
// normal JFace Actions
Class clazz = action.getClass();
buffer.append(toolkit.createClassSection(text, PDERuntimeMessages.ActiveMenuSection_5, new Class[] {clazz}));
- PackageAdmin admin = PDERuntimePlugin.getDefault().getPackageAdmin();
- Bundle bundle = admin.getBundle(clazz);
+ Bundle bundle = FrameworkUtil.getBundle(clazz);
toolkit.generatePluginDetailsText(bundle, null, "meow", buffer, text); //$NON-NLS-1$
}
@@ -161,8 +159,7 @@ public class ActiveMenuSection implements ISpySection {
}
}
buffer.append(toolkit.createClassSection(text, PDERuntimeMessages.ActiveMenuSection_6, new Class[] {(retargetAction == null) ? delegate.getClass() : retargetAction.getActionHandler().getClass()}));
- PackageAdmin admin = PDERuntimePlugin.getDefault().getPackageAdmin();
- Bundle bundle = admin.getBundle(clazz);
+ Bundle bundle = FrameworkUtil.getBundle(clazz);
toolkit.generatePluginDetailsText(bundle, null, "menu item", buffer, text); //$NON-NLS-1$
} catch (Exception e) {
diff --git a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveWizardSection.java b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveWizardSection.java
index 5fc3b50..5484fe2 100644
--- a/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveWizardSection.java
+++ b/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/spy/sections/ActiveWizardSection.java
@@ -11,22 +11,15 @@
package org.eclipse.pde.internal.runtime.spy.sections;
import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.*;
import org.eclipse.osgi.util.NLS;
import org.eclipse.pde.internal.runtime.PDERuntimeMessages;
-import org.eclipse.pde.internal.runtime.PDERuntimePlugin;
import org.eclipse.pde.internal.runtime.spy.SpyFormToolkit;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.FormText;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.forms.widgets.TableWrapData;
+import org.eclipse.ui.forms.widgets.*;
import org.eclipse.ui.handlers.HandlerUtil;
import org.osgi.framework.Bundle;
-import org.osgi.service.packageadmin.PackageAdmin;
+import org.osgi.framework.FrameworkUtil;
/**
* @since 3.4
@@ -63,8 +56,7 @@ public class ActiveWizardSection implements ISpySection {
buffer.append(toolkit.createClassSection(text, PDERuntimeMessages.SpyDialog_activeWizard_desc, new Class[] {clazz}));
- PackageAdmin admin = PDERuntimePlugin.getDefault().getPackageAdmin();
- Bundle bundle = admin.getBundle(clazz);
+ Bundle bundle = FrameworkUtil.getBundle(clazz);
toolkit.generatePluginDetailsText(bundle, null, "wizard", buffer, text); //$NON-NLS-1$
buffer.append("</form>"); //$NON-NLS-1$