Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Goldthorpe2010-06-24 21:58:58 +0000
committerChris Goldthorpe2010-06-24 21:58:58 +0000
commit2ed9f979af0085f8e69e192d4edfd79937e1d917 (patch)
treecb68518df586abb52992b3030e80bfee2be78d91 /org.eclipse.help.ui
parent44155183f61c1db7eed930a5004f0fe6a9c7a18b (diff)
downloadeclipse.platform.ua-2ed9f979af0085f8e69e192d4edfd79937e1d917.tar.gz
eclipse.platform.ua-2ed9f979af0085f8e69e192d4edfd79937e1d917.tar.xz
eclipse.platform.ua-2ed9f979af0085f8e69e192d4edfd79937e1d917.zip
Bug 317886 - [Help] Duplicate links in F1 help - Fix in Eclipse 3.7
Diffstat (limited to 'org.eclipse.help.ui')
-rw-r--r--org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java27
1 files changed, 23 insertions, 4 deletions
diff --git a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java
index 655ebe3fa..85a92a0a2 100644
--- a/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java
+++ b/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/ContextHelpPart.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 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
@@ -11,7 +11,9 @@
package org.eclipse.help.ui.internal.views;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.runtime.Platform;
import org.eclipse.help.HelpSystem;
@@ -42,7 +44,6 @@ import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.window.Window;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.osgi.util.NLS;
-
import org.eclipse.swt.custom.CTabFolder;
import org.eclipse.swt.custom.CTabItem;
import org.eclipse.swt.graphics.Font;
@@ -396,13 +397,31 @@ public class ContextHelpPart extends SectionPart implements IHelpPart {
}
return buff.length() > 0 ? buff.toString().trim() : null;
}
+
+ private class SearchTerms {
+
+ private List terms = new ArrayList();
+ private Set termSet = new HashSet();
+ public void add(String term) {
+ String lowerCaseTerm = term.toLowerCase();
+ // Do not allow duplicates
+ if (!termSet.contains(lowerCaseTerm)) {
+ termSet.add(lowerCaseTerm);
+ terms.add(term);
+ }
+ }
+
+ public String[] toArray() {
+ return (String[]) terms.toArray(new String[terms.size()]);
+ }
+ }
/*
* Used for both dynamic help and to get a useful title
*/
private String[] computeSearchTerms(Control c) {
Composite parent = c.getParent();
- List searchTerms = new ArrayList();
+ SearchTerms searchTerms = new SearchTerms();
while (parent != null) {
Object data = parent.getData();
if (data instanceof IWizardContainer) {
@@ -451,7 +470,7 @@ public class ContextHelpPart extends SectionPart implements IHelpPart {
}
parent = parent.getParent();
}
- return (String[]) searchTerms.toArray(new String[searchTerms.size()]);
+ return (String[]) searchTerms.toArray();
}
private String getPageName(Control focusControl, Object page) {

Back to the top