Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2008-06-19 18:23:28 -0400
committerChris Goldthorpe2008-06-19 18:23:28 -0400
commit4051539b1b35b89bcc2cc42f9db0108eda27f622 (patch)
tree32f6d17d913aa2ca0288f08d23d876725d638e79 /org.eclipse.help
parent957034579152439b7cf262c7355aaaa568f65d3c (diff)
downloadeclipse.platform.ua-4051539b1b35b89bcc2cc42f9db0108eda27f622.tar.gz
eclipse.platform.ua-4051539b1b35b89bcc2cc42f9db0108eda27f622.tar.xz
eclipse.platform.ua-4051539b1b35b89bcc2cc42f9db0108eda27f622.zip
Bug 237577 – [Webapp] Infocenter problems with locales, breadcrumbs and failure to read pages
Diffstat (limited to 'org.eclipse.help')
-rw-r--r--org.eclipse.help/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/index/IndexAssembler.java8
-rw-r--r--org.eclipse.help/src/org/eclipse/help/internal/toc/TocManager.java46
3 files changed, 30 insertions, 26 deletions
diff --git a/org.eclipse.help/META-INF/MANIFEST.MF b/org.eclipse.help/META-INF/MANIFEST.MF
index ace0a2ab5..f6b4438f5 100644
--- a/org.eclipse.help/META-INF/MANIFEST.MF
+++ b/org.eclipse.help/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %help_plugin_name
Bundle-SymbolicName: org.eclipse.help; singleton:=true
-Bundle-Version: 3.3.100.qualifier
+Bundle-Version: 3.3.200.qualifier
Bundle-Activator: org.eclipse.help.internal.HelpPlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/index/IndexAssembler.java b/org.eclipse.help/src/org/eclipse/help/internal/index/IndexAssembler.java
index dff337140..2cee39669 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/index/IndexAssembler.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/index/IndexAssembler.java
@@ -184,7 +184,7 @@ public class IndexAssembler {
}
}
- private static class IndexComparator implements Comparator {
+ private class IndexComparator implements Comparator {
public int compare(Object o1, Object o2) {
/*
* First separate the objects into different groups by type;
@@ -213,7 +213,7 @@ public class IndexAssembler {
* 4. entries starting with alpha
* 5. other
*/
- private static int getCategory(UAElement element) {
+ private int getCategory(UAElement element) {
if (element instanceof Topic) {
return 0;
}
@@ -240,11 +240,11 @@ public class IndexAssembler {
* Returns the string that will be displayed for the given object,
* used for sorting.
*/
- private static String getLabel(UAElement element) {
+ private String getLabel(UAElement element) {
if (element instanceof Topic) {
Topic topic = (Topic)element;
if (topic.getLabel() == null) {
- ITopic topic2 = HelpPlugin.getTocManager().getTopic(topic.getHref());
+ ITopic topic2 = HelpPlugin.getTocManager().getTopic(topic.getHref(), locale);
if (topic2 != null) {
topic.setLabel(topic2.getLabel());
}
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/toc/TocManager.java b/org.eclipse.help/src/org/eclipse/help/internal/toc/TocManager.java
index e48f7f431..0d6a6ac00 100644
--- a/org.eclipse.help/src/org/eclipse/help/internal/toc/TocManager.java
+++ b/org.eclipse.help/src/org/eclipse/help/internal/toc/TocManager.java
@@ -114,8 +114,8 @@ public class TocManager {
return (Toc)tocsByTopic.get(href);
}
- public synchronized Topic getTopic(String href) {
- Toc[] tocs = HelpPlugin.getTocManager().getTocs(Platform.getNL());
+ public synchronized Topic getTopic(String href, String locale) {
+ Toc[] tocs = HelpPlugin.getTocManager().getTocs(locale);
for (int i=0;i<tocs.length;++i) {
Topic topic = (Topic)tocs[i].getTopic(href);
if (topic != null) {
@@ -124,32 +124,36 @@ public class TocManager {
}
int index = href.indexOf('#');
if (index != -1) {
- return getTopic(href.substring(0, index));
+ return getTopic(href.substring(0, index), locale);
}
return null;
}
- public synchronized int[] getTopicPath(String href) {
- Topic topic = getTopic(href);
- if (topic != null) {
- List path = new ArrayList();
- UAElement element = topic;
- while (!(element instanceof Toc)) {
- UAElement parent = element.getParentElement();
- path.add(new Integer(indexOf(parent, (Topic)element)));
- element = parent;
- }
- Toc[] tocs = getTocs(Platform.getNL());
- for (int i=0;i<tocs.length;++i) {
- if (tocs[i] == element) {
- path.add(new Integer(i));
- int[] array = new int[path.size()];
- for (int j=0;j<array.length;++j) {
- array[j] = ((Integer)path.get(array.length - 1 - j)).intValue();
+ public synchronized int[] getTopicPath(String href, String locale) {
+ Topic topic = getTopic(href, locale);
+ try {
+ if (topic != null) {
+ List path = new ArrayList();
+ UAElement element = topic;
+ while (!(element instanceof Toc)) {
+ UAElement parent = element.getParentElement();
+ path.add(new Integer(indexOf(parent, (Topic)element)));
+ element = parent;
+ }
+ Toc[] tocs = getTocs(locale);
+ for (int i=0;i<tocs.length;++i) {
+ if (tocs[i] == element) {
+ path.add(new Integer(i));
+ int[] array = new int[path.size()];
+ for (int j=0;j<array.length;++j) {
+ array[j] = ((Integer)path.get(array.length - 1 - j)).intValue();
+ }
+ return array;
}
- return array;
}
}
+ } catch (Exception e) {
+ return null;
}
// no path; not in toc
return null;

Back to the top