Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2011-02-10 18:26:30 +0000
committerChris Goldthorpe2011-02-10 18:26:30 +0000
commitaf6488768f1b955e6f12fdaad14c1121d40e4dfc (patch)
tree74cf647881b6e500cc330ac0e4175e47643724d0 /org.eclipse.help.webapp/src/org
parent0c3415b1094ccddd092976bff65a6efd0b9a552c (diff)
downloadeclipse.platform.ua-af6488768f1b955e6f12fdaad14c1121d40e4dfc.tar.gz
eclipse.platform.ua-af6488768f1b955e6f12fdaad14c1121d40e4dfc.tar.xz
eclipse.platform.ua-af6488768f1b955e6f12fdaad14c1121d40e4dfc.zip
Bug 334592 - IWorkbenchHelpSystem#displayHelpResource() no longer works for file: URLs
Diffstat (limited to 'org.eclipse.help.webapp/src/org')
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/UrlUtil.java12
-rw-r--r--org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/EclipseConnector.java3
2 files changed, 12 insertions, 3 deletions
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/UrlUtil.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/UrlUtil.java
index 2f2380864..f307bb282 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/UrlUtil.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/data/UrlUtil.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -158,9 +158,10 @@ public class UrlUtil {
public static boolean isValidTopicParamOrWasOpenedFromHelpDisplay(String path) {
// Topics opened via the help display ( including cheat sheets and intro )
// are are always valid
- if (path.equals(BaseHelpSystem.getHelpDisplay().getHrefOpenedFromHelpDisplay())) {
+ if (wasOpenedFromHelpDisplay(path)) {
return true;
}
+
if (new WebappPreferences().isRestrictTopicParameter()) {
if (path.indexOf("://") >= 0) { //$NON-NLS-1$
return false;
@@ -168,6 +169,13 @@ public class UrlUtil {
}
return true;
}
+
+ public static boolean wasOpenedFromHelpDisplay(String path) {
+ if (path.equals(BaseHelpSystem.getHelpDisplay().getHrefOpenedFromHelpDisplay())) {
+ return true;
+ }
+ return path.equals(getHelpURL(BaseHelpSystem.getHelpDisplay().getHrefOpenedFromHelpDisplay()));
+ }
/**
* Returns a path to the given topic in the form of child indexes. For
diff --git a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/EclipseConnector.java b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/EclipseConnector.java
index 398894866..66ce98a9e 100644
--- a/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/EclipseConnector.java
+++ b/org.eclipse.help.webapp/src/org/eclipse/help/internal/webapp/servlet/EclipseConnector.java
@@ -94,7 +94,8 @@ public class EclipseConnector {
}
String lowerCaseuRL = url.toLowerCase(Locale.ENGLISH);
if (lowerCaseuRL.startsWith("jar:") //$NON-NLS-1$
- || lowerCaseuRL.startsWith("platform:")) { //$NON-NLS-1$
+ || lowerCaseuRL.startsWith("platform:") //$NON-NLS-1$
+ || (lowerCaseuRL.startsWith("file:") && UrlUtil.wasOpenedFromHelpDisplay(url))) { //$NON-NLS-1$
int i = url.indexOf('?');
if (i != -1)
url = url.substring(0, i);

Back to the top