Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCurtis D'Entremont2006-12-12 23:46:40 +0000
committerCurtis D'Entremont2006-12-12 23:46:40 +0000
commit4a37c1b08fbad46769d1cdda844389eaa21afa42 (patch)
tree8878ec2149b721f67c63214faf1c3eab1289591e
parent9137e300c5779fe2f88a75ff94325c3427ae5341 (diff)
downloadeclipse.platform.ua-4a37c1b08fbad46769d1cdda844389eaa21afa42.tar.gz
eclipse.platform.ua-4a37c1b08fbad46769d1cdda844389eaa21afa42.tar.xz
eclipse.platform.ua-4a37c1b08fbad46769d1cdda844389eaa21afa42.zip
167532 [Webapp] CS help opened from infopop displays "nothing found" in links viewv20061212
-rw-r--r--org.eclipse.help.base/src/org/eclipse/help/internal/base/HelpDisplay.java24
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/context/Context.java19
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/context/ContextManager.java4
3 files changed, 34 insertions, 13 deletions
diff --git a/org.eclipse.help.base/src/org/eclipse/help/internal/base/HelpDisplay.java b/org.eclipse.help.base/src/org/eclipse/help/internal/base/HelpDisplay.java
index 4ecc56d2b..8ea86f145 100644
--- a/org.eclipse.help.base/src/org/eclipse/help/internal/base/HelpDisplay.java
+++ b/org.eclipse.help.base/src/org/eclipse/help/internal/base/HelpDisplay.java
@@ -10,14 +10,16 @@
*******************************************************************************/
package org.eclipse.help.internal.base;
-import java.io.*;
-import java.net.*;
-
-import org.eclipse.core.runtime.*;
-import org.eclipse.help.*;
-import org.eclipse.help.internal.*;
-import org.eclipse.help.internal.appserver.*;
-import org.eclipse.help.internal.context.*;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.help.IContext;
+import org.eclipse.help.IHelpResource;
+import org.eclipse.help.IToc;
+import org.eclipse.help.internal.HelpPlugin;
+import org.eclipse.help.internal.appserver.WebappManager;
+import org.eclipse.help.internal.context.Context;
import org.eclipse.osgi.util.NLS;
/**
@@ -192,8 +194,10 @@ public class HelpDisplay {
}
private String getContextID(IContext context) {
- if (context instanceof Context)
- return ((Context)context).getId();
+ if (context instanceof Context) {
+ Context c = (Context)context;
+ return c.getPluginId() + '.' + c.getId();
+ }
return HelpPlugin.getContextManager().addContext(context);
}
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/context/Context.java b/org.eclipse.help/src/org/eclipse/help/internal/context/Context.java
index eb9cb8ff3..c69e0836c 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/context/Context.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/context/Context.java
@@ -26,6 +26,7 @@ public class Context extends NodeAdapter implements IContext {
public static final String NAME = "context"; //$NON-NLS-1$
public static final String ELEMENT_DESCRIPTION = "description"; //$NON-NLS-1$
public static final String ATTRIBUTE_ID = "id"; //$NON-NLS-1$
+ public static final String ATTRIBUTE_PLUGIN_ID = "pluginId"; //$NON-NLS-1$
/*
* Constructs a new context adapter for an empty context node.
@@ -50,12 +51,19 @@ public class Context extends NodeAdapter implements IContext {
}
/*
- * Returns the Context's unique id.
+ * Returns the Context's short id.
*/
public String getId() {
return getAttribute(ATTRIBUTE_ID);
}
+ /*
+ * Returns the Context's source plug-in.
+ */
+ public String getPluginId() {
+ return getAttribute(ATTRIBUTE_PLUGIN_ID);
+ }
+
/* (non-Javadoc)
* @see org.eclipse.help.IContext#getText()
*/
@@ -72,13 +80,20 @@ public class Context extends NodeAdapter implements IContext {
}
/*
- * Sets the Context's unique id.
+ * Sets the Context's short id.
*/
public void setId(String id) {
setAttribute(ATTRIBUTE_ID, id);
}
/*
+ * Sets the Context's source plug-in id.
+ */
+ public void setPluginId(String pluginId) {
+ setAttribute(ATTRIBUTE_PLUGIN_ID, pluginId);
+ }
+
+ /*
* Sets the Context's description text.
*/
public void setText(String text) {
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/context/ContextManager.java b/org.eclipse.help/src/org/eclipse/help/internal/context/ContextManager.java
index 40ece8a6d..42e2f549b 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/context/ContextManager.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/context/ContextManager.java
@@ -79,7 +79,9 @@ public class ContextManager {
try {
Node node = provider.getContext(contextId, locale);
if (node != null) {
- return node instanceof Context ? (Context)node : new Context(node);
+ Context context = node instanceof Context ? (Context)node : new Context(node);
+ context.setPluginId(pluginId);
+ return context;
}
}
catch (Throwable t) {

Back to the top