Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDejan Gloszic2005-11-28 11:15:09 -0500
committerDejan Gloszic2005-11-28 11:15:09 -0500
commit9708b046ff311916e7fdf4279c3605266b5d5d5e (patch)
tree7255c4d5bf2e3a0a1d12034533eb78fc0f7dc588 /org.eclipse.help
parent5e18bdb5768c62ded7a01fc2430b18929ab3ab3c (diff)
downloadeclipse.platform.ua-9708b046ff311916e7fdf4279c3605266b5d5d5e.tar.gz
eclipse.platform.ua-9708b046ff311916e7fdf4279c3605266b5d5d5e.tar.xz
eclipse.platform.ua-9708b046ff311916e7fdf4279c3605266b5d5d5e.zip
*** empty log message ***v20051128
Diffstat (limited to 'org.eclipse.help')
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/util/ResourceLocator.java46
1 files changed, 29 insertions, 17 deletions
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/util/ResourceLocator.java b/org.eclipse.help/src/org/eclipse/help/internal/util/ResourceLocator.java
index 3f0995581..c8eebfe20 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/util/ResourceLocator.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/util/ResourceLocator.java
@@ -56,8 +56,8 @@ public class ResourceLocator {
static class ProducerDescriptor {
- IHelpContentProducer producer;
- IConfigurationElement config;
+ private IHelpContentProducer producer;
+ private IConfigurationElement config;
public ProducerDescriptor(IConfigurationElement config) {
this.config = config;
@@ -68,6 +68,25 @@ public class ResourceLocator {
String id = ex.getUniqueIdentifier();
return id != null && id.equals(refId);
}
+
+ public void reset() {
+ producer = null;
+ }
+
+ public IHelpContentProducer getProducer() {
+ if (producer == null) {
+ try {
+ Object o = config.createExecutableExtension("producer"); //$NON-NLS-1$
+ if (o instanceof IHelpContentProducer)
+ producer = (IHelpContentProducer) o;
+ } catch (CoreException ce) {
+ HelpPlugin
+ .logError(
+ "Exception occurred creating help content producer for plug-in " + config.getNamespace() + ".", ce); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ }
+ return producer;
+ }
}
static {
Platform.getExtensionRegistry().addRegistryChangeListener(new IRegistryChangeListener() {
@@ -86,7 +105,11 @@ public class ResourceLocator {
// reset producer for the affected plugin,
// it will be recreated on demand
synchronized (contentProducers) {
- contentProducers.remove(affectedPlugin);
+ Object obj = contentProducers.get(affectedPlugin);
+ if (obj instanceof ProducerDescriptor) {
+ ProducerDescriptor desc = (ProducerDescriptor) obj;
+ desc.reset();
+ }
}
}
}
@@ -114,7 +137,7 @@ public class ResourceLocator {
if (descriptor == STATIC_DOCS_ONLY) {
return null;
}
- return ((ProducerDescriptor) descriptor).producer;
+ return ((ProducerDescriptor) descriptor).getProducer();
}
}
@@ -137,25 +160,14 @@ public class ResourceLocator {
continue;
}
if (BINDING.equals(element.getName())) {
- //producer binding - locate the descriptor
+ // producer binding - locate the descriptor
// with the matching reference Id
String refId = element.getAttribute("producerId");
if (refId != null) {
return findContentProducer(refId);
}
} else if (CONTENTPRODUCER_XP_NAME.equals(element.getName())) {
- try {
- Object o = element.createExecutableExtension("producer"); //$NON-NLS-1$
- if (o instanceof IHelpContentProducer) {
- ProducerDescriptor ad = new ProducerDescriptor(element);
- ad.producer = (IHelpContentProducer)o;
- return ad;
- }
- } catch (CoreException ce) {
- HelpPlugin
- .logError(
- "Exception occurred creating help content producer for plug-in " + pluginId + ".", ce); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ return new ProducerDescriptor(element);
}
}
return null;

Back to the top