diff options
author | cbridgha | 2005-02-11 16:15:41 +0000 |
---|---|---|
committer | cbridgha | 2005-02-11 16:15:41 +0000 |
commit | b54f641c43cbef6356c28fb35d047d42678b66a4 (patch) | |
tree | df290c1758bf8320d5004ec5aa98adc53ba5735a /plugins | |
parent | f107c3fce978ef90c05f65996e5b224940158feb (diff) | |
download | webtools.javaee-b54f641c43cbef6356c28fb35d047d42678b66a4.tar.gz webtools.javaee-b54f641c43cbef6356c28fb35d047d42678b66a4.tar.xz webtools.javaee-b54f641c43cbef6356c28fb35d047d42678b66a4.zip |
remove dependency of org.eclipse.core.runtime.compatibility
Diffstat (limited to 'plugins')
23 files changed, 112 insertions, 121 deletions
diff --git a/plugins/org.eclipse.jst.common.annotations.controller/plugin.xml b/plugins/org.eclipse.jst.common.annotations.controller/plugin.xml index 444e8c2b3..b149fc482 100644 --- a/plugins/org.eclipse.jst.common.annotations.controller/plugin.xml +++ b/plugins/org.eclipse.jst.common.annotations.controller/plugin.xml @@ -14,7 +14,7 @@ </runtime> <requires> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.core.resources"/> <import plugin="org.eclipse.emf.ecore"/> <import plugin="org.eclipse.wst.common.frameworks"/> diff --git a/plugins/org.eclipse.jst.common.annotations.ui/plugin.xml b/plugins/org.eclipse.jst.common.annotations.ui/plugin.xml index 86a9593fc..34d99811e 100644 --- a/plugins/org.eclipse.jst.common.annotations.ui/plugin.xml +++ b/plugins/org.eclipse.jst.common.annotations.ui/plugin.xml @@ -25,7 +25,7 @@ <import plugin="org.eclipse.ui.ide"/> <import plugin="org.eclipse.swt"/> <import plugin="org.eclipse.core.runtime"/> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.jst.common.annotations.core"/> <import plugin="org.eclipse.jst.common.annotations.controller"/> </requires> diff --git a/plugins/org.eclipse.jst.common.annotations.ui/src/org/eclipse/jst/common/internal/annotations/ui/UiPlugin.java b/plugins/org.eclipse.jst.common.annotations.ui/src/org/eclipse/jst/common/internal/annotations/ui/UiPlugin.java index e3053a698..6e96f4cb3 100644 --- a/plugins/org.eclipse.jst.common.annotations.ui/src/org/eclipse/jst/common/internal/annotations/ui/UiPlugin.java +++ b/plugins/org.eclipse.jst.common.annotations.ui/src/org/eclipse/jst/common/internal/annotations/ui/UiPlugin.java @@ -13,7 +13,6 @@ package org.eclipse.jst.common.internal.annotations.ui; import java.util.MissingResourceException; import java.util.ResourceBundle; -import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; /** @@ -28,8 +27,8 @@ public class UiPlugin extends AbstractUIPlugin { /** * The constructor. */ - public UiPlugin(IPluginDescriptor descriptor) { - super(descriptor); + public UiPlugin() { + super(); plugin = this; try { resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.common.internal.annotations.ui.UiPluginResources"); //$NON-NLS-1$ diff --git a/plugins/org.eclipse.jst.common.frameworks/plugin.xml b/plugins/org.eclipse.jst.common.frameworks/plugin.xml index 7f8ee6600..ce4876d3c 100644 --- a/plugins/org.eclipse.jst.common.frameworks/plugin.xml +++ b/plugins/org.eclipse.jst.common.frameworks/plugin.xml @@ -13,7 +13,7 @@ </library> </runtime> <requires> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.jdt.core"/> <import plugin="org.eclipse.wst.common.frameworks"/> <import plugin="com.ibm.wtp.common.util"/> diff --git a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/J2EECorePlugin.java b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/J2EECorePlugin.java index 73f333ecb..ae884790b 100644 --- a/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/J2EECorePlugin.java +++ b/plugins/org.eclipse.jst.j2ee.core/j2eeCorePlugin/org/eclipse/jst/j2ee/core/internal/plugin/J2EECorePlugin.java @@ -9,10 +9,9 @@ * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jst.j2ee.core.internal.plugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.core.runtime.Plugin; import org.eclipse.jst.j2ee.internal.IEJBModelExtenderManager; +import org.osgi.framework.BundleContext; import com.ibm.wtp.common.logger.proxy.Logger; import com.ibm.wtp.logger.proxyrender.DefaultPluginTraceRenderer; @@ -36,13 +35,13 @@ public class J2EECorePlugin extends Plugin { /** * @param descriptor */ - public J2EECorePlugin(IPluginDescriptor descriptor) { - super(descriptor); + public J2EECorePlugin() { + super(); if (inst==null) inst = this; } - public void startup() throws CoreException { - super.startup(); + public void start(BundleContext context) throws Exception { + super.start(context); IEJBModelExtenderManager.INSTANCE.setProvider(EclipseEJBModelExtenderProvider.getInstance()); } diff --git a/plugins/org.eclipse.jst.j2ee.core/plugin.xml b/plugins/org.eclipse.jst.j2ee.core/plugin.xml index 9a71fd0c4..588a95c7a 100644 --- a/plugins/org.eclipse.jst.j2ee.core/plugin.xml +++ b/plugins/org.eclipse.jst.j2ee.core/plugin.xml @@ -29,7 +29,7 @@ <import plugin="org.eclipse.wst.common.frameworks"/> <import plugin="org.eclipse.emf.ecore.xmi"/> <import plugin="org.eclipse.wst.common.emf"/> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.wst.validation"/> </requires> diff --git a/plugins/org.eclipse.jst.j2ee.jca.ui/jca_ui/org/eclipse/jst/j2ee/jca/ui/internal/plugin/JCAUIPlugin.java b/plugins/org.eclipse.jst.j2ee.jca.ui/jca_ui/org/eclipse/jst/j2ee/jca/ui/internal/plugin/JCAUIPlugin.java index 1741ae600..4512bc927 100644 --- a/plugins/org.eclipse.jst.j2ee.jca.ui/jca_ui/org/eclipse/jst/j2ee/jca/ui/internal/plugin/JCAUIPlugin.java +++ b/plugins/org.eclipse.jst.j2ee.jca.ui/jca_ui/org/eclipse/jst/j2ee/jca/ui/internal/plugin/JCAUIPlugin.java @@ -8,7 +8,6 @@ package org.eclipse.jst.j2ee.jca.ui.internal.plugin; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; /** @@ -28,13 +27,9 @@ public class JCAUIPlugin extends AbstractUIPlugin { /** * The constructor. */ - public JCAUIPlugin(IPluginDescriptor descriptor) { - super(descriptor); - plugin = this; - } - public JCAUIPlugin() { - //Default constructor + super(); + plugin = this; } /** diff --git a/plugins/org.eclipse.jst.j2ee.jca/jca/org/eclipse/jst/j2ee/jca/internal/plugin/JcaPlugin.java b/plugins/org.eclipse.jst.j2ee.jca/jca/org/eclipse/jst/j2ee/jca/internal/plugin/JcaPlugin.java index d2966d768..707bece1a 100644 --- a/plugins/org.eclipse.jst.j2ee.jca/jca/org/eclipse/jst/j2ee/jca/internal/plugin/JcaPlugin.java +++ b/plugins/org.eclipse.jst.j2ee.jca/jca/org/eclipse/jst/j2ee/jca/internal/plugin/JcaPlugin.java @@ -16,14 +16,14 @@ import java.net.URL; import java.text.MessageFormat; import java.util.MissingResourceException; +import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IPluginRegistry; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; import org.eclipse.wst.common.frameworks.internal.WTPPlugin; +import org.osgi.framework.Bundle; /** @@ -35,7 +35,7 @@ import org.eclipse.wst.common.frameworks.internal.WTPPlugin; public class JcaPlugin extends WTPPlugin implements ResourceLocator { // Default instance of the receiver private static JcaPlugin inst; - protected final IPath iconsFolder = new Path(getDescriptor().getInstallURL().getFile()).append("icons"); //$NON-NLS-1$ + protected final IPath iconsFolder = new Path(Platform.getBundle(PLUGIN_ID).getEntry("icons").getPath()); //$NON-NLS-1$ public static final String PLUGIN_ID = "org.eclipse.jst.j2ee.jca"; //$NON-NLS-1$ // Validation part of the plugin @@ -54,8 +54,8 @@ public class JcaPlugin extends WTPPlugin implements ResourceLocator { /** * Create the J2EE plugin and cache its default instance */ - public JcaPlugin(IPluginDescriptor descriptor) { - super(descriptor); + public JcaPlugin() { + super(); if (inst == null) inst = this; } @@ -72,19 +72,19 @@ public class JcaPlugin extends WTPPlugin implements ResourceLocator { * Javadoc copied from interface. */ public URL getBaseURL() { - return getDescriptor().getInstallURL(); + return getBundle().getEntry("/"); } /** * This gets a .gif from the icons folder. */ public Object getImage(String key) { - return J2EEPlugin.getImageURL(key, getDescriptor()); + return J2EEPlugin.getImageURL(key, getBundle()); } public static URL getInstallURL() { - return getDefault().getDescriptor().getInstallURL(); + return getDefault().getBundle().getEntry("/"); } /** @@ -99,11 +99,11 @@ public class JcaPlugin extends WTPPlugin implements ResourceLocator { * d:\installdir\plugin) */ public static IPath getPluginLocation(String pluginId) { - IPluginRegistry registry = Platform.getPluginRegistry(); - IPluginDescriptor pd = registry.getPluginDescriptor(pluginId); - if (pd != null) { + IExtensionRegistry registry = Platform.getExtensionRegistry(); + Bundle bundle = Platform.getBundle(pluginId); + if (bundle != null) { try { - IPath installPath = new Path(pd.getInstallURL().toExternalForm()).removeTrailingSeparator(); + IPath installPath = new Path(bundle.getEntry("/").toExternalForm()).removeTrailingSeparator(); String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile(); return new Path(installStr); } catch (IOException e) { diff --git a/plugins/org.eclipse.jst.j2ee.jca/plugin.xml b/plugins/org.eclipse.jst.j2ee.jca/plugin.xml index 32de077e8..6a5b52735 100644 --- a/plugins/org.eclipse.jst.j2ee.jca/plugin.xml +++ b/plugins/org.eclipse.jst.j2ee.jca/plugin.xml @@ -28,7 +28,7 @@ <import plugin="org.eclipse.jem.workbench"/> <import plugin="org.eclipse.wst.validation"/> <import plugin="org.eclipse.emf.edit"/> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.jst.common.frameworks"/> </requires> diff --git a/plugins/org.eclipse.jst.j2ee.navigator.ui/j2ee-navigator/org/eclipse/jst/j2ee/navigator/internal/plugin/J2EENavigatorPlugin.java b/plugins/org.eclipse.jst.j2ee.navigator.ui/j2ee-navigator/org/eclipse/jst/j2ee/navigator/internal/plugin/J2EENavigatorPlugin.java index 137b7766b..5b8784573 100644 --- a/plugins/org.eclipse.jst.j2ee.navigator.ui/j2ee-navigator/org/eclipse/jst/j2ee/navigator/internal/plugin/J2EENavigatorPlugin.java +++ b/plugins/org.eclipse.jst.j2ee.navigator.ui/j2ee-navigator/org/eclipse/jst/j2ee/navigator/internal/plugin/J2EENavigatorPlugin.java @@ -12,7 +12,6 @@ package org.eclipse.jst.j2ee.navigator.internal.plugin; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; /** @@ -25,8 +24,8 @@ public class J2EENavigatorPlugin extends AbstractUIPlugin { /** * The constructor. */ - public J2EENavigatorPlugin(IPluginDescriptor descriptor) { - super(descriptor); + public J2EENavigatorPlugin() { + super(); plugin = this; } diff --git a/plugins/org.eclipse.jst.j2ee.navigator.ui/plugin.xml b/plugins/org.eclipse.jst.j2ee.navigator.ui/plugin.xml index 896c11973..c015ad324 100644 --- a/plugins/org.eclipse.jst.j2ee.navigator.ui/plugin.xml +++ b/plugins/org.eclipse.jst.j2ee.navigator.ui/plugin.xml @@ -16,7 +16,7 @@ <requires> <import plugin="org.eclipse.ui"/> <import plugin="org.eclipse.core.resources"/> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.wst.common.navigator.views"/> <import plugin="org.eclipse.wst.common.navigator.workbench"/> <import plugin="org.eclipse.jst.j2ee.core"/> diff --git a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPlugin.java b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPlugin.java index a5c7c2f3e..fbcb2d8b6 100644 --- a/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPlugin.java +++ b/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/plugin/J2EEUIPlugin.java @@ -19,7 +19,6 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.core.runtime.Path; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; @@ -47,8 +46,8 @@ public class J2EEUIPlugin extends AbstractUIPlugin { /** * The constructor. */ - public J2EEUIPlugin(IPluginDescriptor descriptor) { - super(descriptor); + public J2EEUIPlugin() { + super(); plugin = this; } @@ -80,7 +79,7 @@ public class J2EEUIPlugin extends AbstractUIPlugin { } public static URL getInstallURL() { - return getDefault().getDescriptor().getInstallURL(); + return getDefault().getBundle().getEntry("/"); } public static String getArchiveDefaultProjectName(Archive anArchive) { @@ -235,7 +234,7 @@ public class J2EEUIPlugin extends AbstractUIPlugin { * @return */ private URL getImageURL(String key) { - return J2EEPlugin.getImageURL(key, getDescriptor()); + return J2EEPlugin.getImageURL(key, getBundle()); } public static IWorkbenchWindow getActiveWorkbenchWindow() { diff --git a/plugins/org.eclipse.jst.j2ee.ui/plugin.xml b/plugins/org.eclipse.jst.j2ee.ui/plugin.xml index b33bb3dbd..aaab50af2 100644 --- a/plugins/org.eclipse.jst.j2ee.ui/plugin.xml +++ b/plugins/org.eclipse.jst.j2ee.ui/plugin.xml @@ -32,7 +32,7 @@ <import plugin="org.eclipse.ui.workbench"/> <import plugin="org.eclipse.jem.workbench"/> <import plugin="org.eclipse.jem"/> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.wst.common.frameworks"/> <import plugin="org.eclipse.jdt.core"/> <import plugin="org.eclipse.wst.server.core"/> diff --git a/plugins/org.eclipse.jst.j2ee.web/plugin.xml b/plugins/org.eclipse.jst.j2ee.web/plugin.xml index d59e398d7..314c365c9 100644 --- a/plugins/org.eclipse.jst.j2ee.web/plugin.xml +++ b/plugins/org.eclipse.jst.j2ee.web/plugin.xml @@ -27,7 +27,7 @@ <import plugin="org.eclipse.emf.edit"/> <import plugin="org.eclipse.jem"/> <import plugin="org.eclipse.jem.workbench"/> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.core.resources"/> <import plugin="org.eclipse.jdt.core"/> <import plugin="org.eclipse.wst.common.migration"/> diff --git a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/plugin/WebPlugin.java b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/plugin/WebPlugin.java index 95b74e332..1d2450c5a 100644 --- a/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/plugin/WebPlugin.java +++ b/plugins/org.eclipse.jst.j2ee.web/web/org/eclipse/jst/j2ee/internal/web/plugin/WebPlugin.java @@ -22,14 +22,12 @@ import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.core.resources.IResourceStatus; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdapterManager; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IPluginRegistry; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; @@ -48,7 +46,8 @@ import org.eclipse.wst.common.modulecore.ArtifactEditModel; import org.eclipse.wst.common.modulecore.IModuleConstants; import org.eclipse.wst.common.modulecore.WTPResourceFactoryRegistry; import org.eclipse.wst.common.modulecore.builder.DeployableModuleBuilderFactoryRegistry; -import org.eclipse.wst.common.modulecore.util.ArtifactEditAdapterFactory; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; /** @@ -60,7 +59,7 @@ import org.eclipse.wst.common.modulecore.util.ArtifactEditAdapterFactory; public class WebPlugin extends WTPPlugin implements ResourceLocator { // Default instance of the receiver private static WebPlugin inst; - protected final IPath iconsFolder = new Path(getDescriptor().getInstallURL().getFile()).append("icons"); //$NON-NLS-1$ + protected final IPath iconsFolder = new Path(Platform.getBundle(PLUGIN_ID).getEntry("icons").getPath()); //$NON-NLS-1$ // Links View part of the plugin //public static final String LINKS_BUILDER_ID = // "com.ibm.etools.links.management.linksbuilder";//$NON-NLS-1$ @@ -89,8 +88,8 @@ public class WebPlugin extends WTPPlugin implements ResourceLocator { /** * Create the J2EE plugin and cache its default instance */ - public WebPlugin(IPluginDescriptor descriptor) { - super(descriptor); + public WebPlugin() { + super(); if (inst == null) inst = this; } @@ -106,13 +105,13 @@ public class WebPlugin extends WTPPlugin implements ResourceLocator { * Javadoc copied from interface. */ public URL getBaseURL() { - return getDescriptor().getInstallURL(); + return getBundle().getEntry("/"); } public Object[] getJ2EEWebProjectMigrationExtensions() { - IPluginRegistry registry = Platform.getPluginRegistry(); - IExtensionPoint pct = registry.getExtensionPoint(getDescriptor().getUniqueIdentifier(), "J2EEWebProjectMigrationExtension"); //$NON-NLS-1$ + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IExtensionPoint pct = registry.getExtensionPoint(getBundle().getSymbolicName(), "J2EEWebProjectMigrationExtension"); //$NON-NLS-1$ IExtension[] extension = pct.getExtensions(); List ret = new Vector(); @@ -141,7 +140,7 @@ public class WebPlugin extends WTPPlugin implements ResourceLocator { * This gets a .gif from the icons folder. */ public Object getImage(String key) { - return J2EEPlugin.getImageURL(key, getDescriptor()); + return J2EEPlugin.getImageURL(key, getBundle()); } public static IPath getInstallLocation() { @@ -158,7 +157,7 @@ public class WebPlugin extends WTPPlugin implements ResourceLocator { } public static URL getInstallURL() { - return getDefault().getDescriptor().getInstallURL(); + return getDefault().getBundle().getEntry("/"); } /** @@ -173,11 +172,11 @@ public class WebPlugin extends WTPPlugin implements ResourceLocator { * d:\installdir\plugin) */ public static IPath getPluginLocation(String pluginId) { - IPluginRegistry registry = Platform.getPluginRegistry(); - IPluginDescriptor pd = registry.getPluginDescriptor(pluginId); - if (pd != null) { + IExtensionRegistry registry = Platform.getExtensionRegistry(); + Bundle bundle = Platform.getBundle(pluginId); + if (bundle != null) { try { - IPath installPath = new Path(pd.getInstallURL().toExternalForm()).removeTrailingSeparator(); + IPath installPath = new Path(bundle.getEntry("/").toExternalForm()).removeTrailingSeparator(); String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile(); return new Path(installStr); } catch (IOException e) { @@ -265,7 +264,7 @@ public class WebPlugin extends WTPPlugin implements ResourceLocator { * Javadoc copied from interface. */ public String getString(String key) { - return getDescriptor().getResourceBundle().getString(key); + return Platform.getResourceString(getBundle(), key); } /* @@ -298,8 +297,8 @@ public class WebPlugin extends WTPPlugin implements ResourceLocator { - public void shutdown() throws CoreException { - super.shutdown(); + public void stop(BundleContext context) throws Exception { + super.stop(context); if (this.taglibRegistryManager != null) this.taglibRegistryManager.dispose(); @@ -311,8 +310,8 @@ public class WebPlugin extends WTPPlugin implements ResourceLocator { return new TaglibRegistryManager(); } - public void startup() throws CoreException { - super.startup(); + public void start(BundleContext context) throws Exception { + super.start(context); // register the listener for link refactoring of moved/renamed files // add listener for web content changes addWebContentListener(); diff --git a/plugins/org.eclipse.jst.j2ee.webservice/plugin.xml b/plugins/org.eclipse.jst.j2ee.webservice/plugin.xml index 161f00961..7014912a6 100644 --- a/plugins/org.eclipse.jst.j2ee.webservice/plugin.xml +++ b/plugins/org.eclipse.jst.j2ee.webservice/plugin.xml @@ -22,7 +22,7 @@ <import plugin="org.eclipse.emf.ecore.xmi"/> <import plugin="org.eclipse.emf.edit"/> <import plugin="org.eclipse.jem"/> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.core.resources"/> <import plugin="org.eclipse.jdt.core"/> <import plugin="org.eclipse.jface"/> diff --git a/plugins/org.eclipse.jst.j2ee.webservice/webservice/org/eclipse/jst/j2ee/internal/webservice/plugin/WebServicePlugin.java b/plugins/org.eclipse.jst.j2ee.webservice/webservice/org/eclipse/jst/j2ee/internal/webservice/plugin/WebServicePlugin.java index 9fe446e8f..bf0d04226 100644 --- a/plugins/org.eclipse.jst.j2ee.webservice/webservice/org/eclipse/jst/j2ee/internal/webservice/plugin/WebServicePlugin.java +++ b/plugins/org.eclipse.jst.j2ee.webservice/webservice/org/eclipse/jst/j2ee/internal/webservice/plugin/WebServicePlugin.java @@ -21,11 +21,11 @@ import java.net.URL; import java.text.MessageFormat; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.core.runtime.Platform; import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.wst.common.frameworks.internal.WTPPlugin; +import org.osgi.framework.BundleContext; /** @@ -46,8 +46,8 @@ public class WebServicePlugin extends WTPPlugin implements ResourceLocator { /** * @param descriptor */ - public WebServicePlugin(IPluginDescriptor descriptor) { - super(descriptor); + public WebServicePlugin() { + super(); if (singleton == null) singleton = this; @@ -70,7 +70,7 @@ public class WebServicePlugin extends WTPPlugin implements ResourceLocator { */ public static ImageDescriptor getImageDescriptor(String name) { try { - URL installURL = singleton.getDescriptor().getInstallURL(); + URL installURL = getInstance().getBundle().getEntry("/");; URL imageURL = new URL(installURL, name); return ImageDescriptor.createFromURL(imageURL); } catch (MalformedURLException e) { @@ -99,7 +99,7 @@ public class WebServicePlugin extends WTPPlugin implements ResourceLocator { * @return The locale-specific message. */ public static String getMessage(String key) { - return singleton.getDescriptor().getResourceString(key); + return Platform.getResourceString(getInstance().getBundle(), key); } /** @@ -164,7 +164,7 @@ public class WebServicePlugin extends WTPPlugin implements ResourceLocator { public String getPluginInstallLocation() { try { - return Platform.resolve(getDescriptor().getInstallURL()).getFile(); + return Platform.resolve(getInstance().getBundle().getEntry("/")).getFile(); } catch (Throwable t) { return null; } @@ -202,8 +202,8 @@ public class WebServicePlugin extends WTPPlugin implements ResourceLocator { * @throws CoreException * If this plugin fails to start. */ - public void startup() throws CoreException { - super.startup(); + public void start(BundleContext context) throws Exception { + super.start(context); } /** @@ -212,7 +212,7 @@ public class WebServicePlugin extends WTPPlugin implements ResourceLocator { * @throws CoreException * If this plugin fails to shutdown. */ - public void shutdown() throws CoreException { - super.shutdown(); + public void stop(BundleContext context) throws Exception { + super.stop(context); } }
\ No newline at end of file diff --git a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPlugin.java b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPlugin.java index 7c6a3bf64..eaf6783f8 100644 --- a/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPlugin.java +++ b/plugins/org.eclipse.jst.j2ee/j2eeplugin/org/eclipse/jst/j2ee/internal/plugin/J2EEPlugin.java @@ -19,6 +19,7 @@ import java.text.MessageFormat; import java.util.ArrayList; import java.util.List; import java.util.MissingResourceException; +import java.util.ResourceBundle; import java.util.Vector; import org.eclipse.core.internal.boot.PlatformURLConnection; @@ -32,9 +33,8 @@ import org.eclipse.core.runtime.IAdapterManager; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IExtension; import org.eclipse.core.runtime.IExtensionPoint; +import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IPluginDescriptor; -import org.eclipse.core.runtime.IPluginRegistry; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; @@ -61,6 +61,8 @@ import org.eclipse.wst.common.modulecore.IModuleConstants; import org.eclipse.wst.common.modulecore.builder.DeployableModuleBuilderFactoryRegistry; import org.eclipse.wst.validation.internal.operations.ValidatorManager; import org.eclipse.wst.validation.internal.plugin.ValidationPlugin; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; import com.ibm.wtp.common.UIContextDetermination; import com.ibm.wtp.emf.workbench.ProjectUtilities; @@ -76,13 +78,15 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { private static J2EEPlugin inst; public static final String PLUGIN_ID = "org.eclipse.jst.j2ee"; //$NON-NLS-1$ public static final String UI_PLUGIN_ID = "org.eclipse.jst.j2ee.ui"; //$NON-NLS-1$ - protected final IPath iconsFolder = new Path(getDescriptor().getInstallURL().getFile()).append("icons"); //$NON-NLS-1$ + protected final IPath iconsFolder = new Path(Platform.getBundle(PLUGIN_ID).getEntry("icons").getPath()); //$NON-NLS-1$ // LibDir Change Listener public static final String LIBDIRCHANGE_BUILDER_ID = "org.eclipse.jst.j2ee.web.LibDirBuilder"; //$NON-NLS-1$ // LibCopy builder ID public static final String LIBCOPY_BUILDER_ID = PLUGIN_ID + ".LibCopyBuilder"; //$NON-NLS-1$ // Validation part of the plugin public static final String VALIDATION_BUILDER_ID = ValidationPlugin.VALIDATION_BUILDER_ID; // plugin + private static final String KEY_PREFIX = "%"; //$NON-NLS-1$ + private static final String KEY_DOUBLE_PREFIX = "%%"; //$NON-NLS-1$ // id // of // the @@ -115,10 +119,15 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { /** * Create the J2EE plugin and cache its default instance */ - public J2EEPlugin(IPluginDescriptor descriptor) { - super(descriptor); + public J2EEPlugin() { + super(); if (inst == null) inst = this; + try { + resourceBundle = ResourceBundle.getBundle("org.eclipse.jst.j2ee"); //$NON-NLS-1$ + } catch (MissingResourceException x) { + resourceBundle = null; + } } /** @@ -155,14 +164,14 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { * Javadoc copied from interface. */ public URL getBaseURL() { - return getDescriptor().getInstallURL(); + return getBundle().getEntry("/"); } public Object[] getJ2EEWebProjectMigrationExtensions() { - IPluginRegistry registry = Platform.getPluginRegistry(); - IExtensionPoint pct = registry.getExtensionPoint(getDescriptor().getUniqueIdentifier(), "J2EEWebProjectMigrationExtension"); //$NON-NLS-1$ + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IExtensionPoint pct = registry.getExtensionPoint("J2EEWebProjectMigrationExtension"); //$NON-NLS-1$ List ret = new Vector(); if (pct != null) { IExtension[] extension = pct.getExtensions(); @@ -189,8 +198,8 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { public EditModel getExtendedEditModel(String editModelKey) { - IPluginRegistry registry = Platform.getPluginRegistry(); - IExtensionPoint pct = registry.getExtensionPoint(getDescriptor().getUniqueIdentifier(), "EditModelExtension"); //$NON-NLS-1$ + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IExtensionPoint pct = registry.getExtensionPoint("EditModelExtension"); //$NON-NLS-1$ IExtension[] extension = pct.getExtensions(); for (int l = 0; l < extension.length; ++l) { @@ -219,8 +228,8 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { if (fextendedEditModels != null) return fextendedEditModels; List editModels = new ArrayList(); - IPluginRegistry registry = Platform.getPluginRegistry(); - IExtensionPoint pct = registry.getExtensionPoint(getDescriptor().getUniqueIdentifier(), "EditModelExtension"); //$NON-NLS-1$ + IExtensionRegistry registry = Platform.getExtensionRegistry(); + IExtensionPoint pct = registry.getExtensionPoint("EditModelExtension"); //$NON-NLS-1$ IExtension[] extension = pct.getExtensions(); for (int l = 0; l < extension.length; ++l) { @@ -248,15 +257,15 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { /** * This gets a .gif from the icons folder. */ - public static URL getImageURL(String key, IPluginDescriptor descriptor) { + public static URL getImageURL(String key, Bundle bundle) { String gif = "/" + key + ".gif"; //$NON-NLS-1$ //$NON-NLS-2$ IPath path = null; for (int i = 0; i < ICON_DIRS.length; i++) { path = new Path(ICON_DIRS[i]).append(gif); - if (descriptor.find(path) == null) + if (Platform.find(bundle,path) == null) continue; try { - return new URL(descriptor.getInstallURL(), path.toString()); + return new URL( bundle.getEntry("/"), path.toString()); } catch (MalformedURLException exception) { com.ibm.wtp.common.logger.proxy.Logger.getLogger().logWarning(J2EEPluginResourceHandler.getString("Load_Image_Error_", new Object[]{key})); //$NON-NLS-1$ exception.printStackTrace(); @@ -270,7 +279,7 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { * This gets a .gif from the icons folder. */ public Object getImage(String key) { - return getImageURL(key, getDescriptor()); + return getImageURL(key,this.getBundle()); } public static IPath getInstallLocation() { @@ -287,7 +296,7 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { } public static URL getInstallURL() { - return getDefault().getDescriptor().getInstallURL(); + return getDefault().getBundle().getEntry("/"); } protected static JavaModel getJavaModel() { @@ -337,11 +346,11 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { * d:\installdir\plugin) */ public static IPath getPluginLocation(String pluginId) { - IPluginRegistry registry = Platform.getPluginRegistry(); - IPluginDescriptor pd = registry.getPluginDescriptor(pluginId); - if (pd != null) { + IExtensionRegistry registry = Platform.getExtensionRegistry(); + Bundle bundle = Platform.getBundle(pluginId); + if (bundle != null) { try { - IPath installPath = new Path(pd.getInstallURL().toExternalForm()).removeTrailingSeparator(); + IPath installPath = new Path(bundle.getEntry("/").toExternalForm()).removeTrailingSeparator(); String installStr = Platform.asLocalURL(new URL(installPath.toString())).getFile(); return new Path(installStr); } catch (IOException e) { @@ -405,7 +414,7 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { */ public String getString(String key) { try { - return getDescriptor().getResourceBundle().getString(key); + return Platform.getResourceString(getBundle(), key); } catch (MissingResourceException ex) { //TODO Don't throw error - just show unresolved key //Logger.getLogger().logError(ex); @@ -470,12 +479,12 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { * org.eclipse.wst.common.frameworks.internal.logger.proxy.Logger.getLogger(PLUGIN_ID).setTraceMode( * ml.getMsgLoggerConfig().get(LoggerStateHashKeys.LEVEL).equals(Level.getLevelName(Level.FINEST))); } */ - public void shutdown() throws CoreException { - super.shutdown(); + public void stop(BundleContext bundle) throws Exception { + super.stop(bundle); } - public void startup() throws CoreException { - super.startup(); + public void start(BundleContext context) throws Exception { + super.start(context); //Have to do the next line immediately to fix timing problems with factory registration ArchiveInit.init(false); //ModuleMaps are the maps from modules in an ear project to the j2ee projects for the @@ -518,7 +527,7 @@ public class J2EEPlugin extends WTPPlugin implements ResourceLocator { */ public static boolean hasDevelopmentRole() { if (HAS_DEV_ROLE == null) { - IPluginDescriptor desc = Platform.getPluginRegistry().getPluginDescriptor("org.eclipse.jst.j2ee.assembly"); //$NON-NLS-1$ + Bundle desc = Platform.getBundle("org.eclipse.jst.j2ee.assembly"); //$NON-NLS-1$ HAS_DEV_ROLE = desc != null ? Boolean.FALSE : Boolean.TRUE; } return HAS_DEV_ROLE.booleanValue(); diff --git a/plugins/org.eclipse.jst.j2ee/plugin.xml b/plugins/org.eclipse.jst.j2ee/plugin.xml index a01f0c4bc..a00fd5cc0 100644 --- a/plugins/org.eclipse.jst.j2ee/plugin.xml +++ b/plugins/org.eclipse.jst.j2ee/plugin.xml @@ -35,7 +35,7 @@ <import plugin="org.eclipse.wst.common.emfworkbench.integration"/> <import plugin="org.eclipse.jem"/> <import plugin="org.eclipse.wst.common.frameworks"/> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.core.resources"/> <import plugin="org.eclipse.wst.common.migration"/> <import plugin="org.eclipse.emf.codegen"/> diff --git a/plugins/org.eclipse.wst.web.ui/plugin.xml b/plugins/org.eclipse.wst.web.ui/plugin.xml index 7f066b5e4..f6d2d0ce4 100644 --- a/plugins/org.eclipse.wst.web.ui/plugin.xml +++ b/plugins/org.eclipse.wst.web.ui/plugin.xml @@ -16,7 +16,7 @@ <requires> <import plugin="org.eclipse.core.resources"/> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="org.eclipse.ui"/> <import plugin="org.eclipse.ui.ide"/> <import plugin="org.eclipse.emf.common"/> diff --git a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebUIPlugin.java b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebUIPlugin.java index 58ef7e055..c814ed710 100644 --- a/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebUIPlugin.java +++ b/plugins/org.eclipse.wst.web.ui/static_web_ui/org/eclipse/wst/web/ui/internal/WSTWebUIPlugin.java @@ -8,7 +8,6 @@ **************************************************************************************************/ package org.eclipse.wst.web.ui.internal; -import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; @@ -27,13 +26,6 @@ public class WSTWebUIPlugin extends AbstractUIPlugin { plugin = this; } /** - * The constructor. - */ - public WSTWebUIPlugin(IPluginDescriptor descriptor) { - super(descriptor); - plugin = this; - } - /** * This method is called upon plug-in activation */ public void start(BundleContext context) throws Exception { diff --git a/plugins/org.eclipse.wst.web/plugin.xml b/plugins/org.eclipse.wst.web/plugin.xml index 695795502..603fc1f91 100644 --- a/plugins/org.eclipse.wst.web/plugin.xml +++ b/plugins/org.eclipse.wst.web/plugin.xml @@ -15,7 +15,7 @@ </runtime> <requires> <import plugin="org.eclipse.core.resources"/> - <import plugin="org.eclipse.core.runtime.compatibility"/> + <import plugin="org.eclipse.core.runtime"/> <import plugin="com.ibm.wtp.emf.workbench"/> <import plugin="org.eclipse.ui"/> <import plugin="org.eclipse.emf.common"/> diff --git a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/WSTWebPlugin.java b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/WSTWebPlugin.java index 21a07b635..483d929a8 100644 --- a/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/WSTWebPlugin.java +++ b/plugins/org.eclipse.wst.web/static_web_project/org/eclipse/wst/web/internal/WSTWebPlugin.java @@ -15,11 +15,11 @@ import java.net.URL; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IPluginDescriptor; import org.eclipse.core.runtime.Path; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.wst.validation.internal.plugin.ValidationPlugin; +import org.osgi.framework.Bundle; /** * The main plugin class to be used in the desktop. @@ -42,8 +42,8 @@ public class WSTWebPlugin extends AbstractUIPlugin /** * The constructor. */ - public WSTWebPlugin(IPluginDescriptor descriptor) { - super(descriptor); + public WSTWebPlugin() { + super(); plugin = this; } @@ -59,7 +59,7 @@ public class WSTWebPlugin extends AbstractUIPlugin */ public ImageDescriptor getImageDescriptor(String key) { ImageDescriptor imageDescriptor = null; - URL gifImageURL = getImageURL(key, getDescriptor()); + URL gifImageURL = getImageURL(key, getBundle()); if (gifImageURL != null) imageDescriptor = ImageDescriptor.createFromURL(gifImageURL); return imageDescriptor; @@ -67,15 +67,15 @@ public class WSTWebPlugin extends AbstractUIPlugin /** * This gets a .gif from the icons folder. */ - public static URL getImageURL(String key, IPluginDescriptor descriptor) { + public static URL getImageURL(String key, Bundle bundle) { String gif = "/" + key + ".gif"; //$NON-NLS-1$ //$NON-NLS-2$ IPath path = null; for (int i = 0; i < ICON_DIRS.length; i++) { path = new Path(ICON_DIRS[i]).append(gif); - if (descriptor.find(path) == null) + if (bundle.getEntry(path.toString()) == null) continue; try { - return new URL(descriptor.getInstallURL(), path.toString()); + return new URL(bundle.getEntry("/"), path.toString()); } catch (MalformedURLException exception) { com.ibm.wtp.common.logger.proxy.Logger.getLogger().logWarning("Load_Image_Error_"); //$NON-NLS-1$ exception.printStackTrace(); |