/* * Copyright (c) 2012 Data Harmonisation Panel * * All rights reserved. This program and the accompanying materials are made * available under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of the License, * or (at your option) any later version. * * You should have received a copy of the GNU Lesser General Public License * along with this distribution. If not, see <http://www.gnu.org/licenses/>. * * Contributors: * HUMBOLDT EU Integrated Project #030962 * Data Harmonisation Panel <http://www.dhpanel.eu> */ package eu.esdihumboldt.cst.doc.functions.internal.toc; import org.eclipse.help.AbstractTocProvider; import org.eclipse.help.IToc; import org.eclipse.help.ITocContribution; import org.eclipse.help.internal.toc.HrefUtil; import eu.esdihumboldt.cst.doc.functions.FunctionReferenceConstants; import eu.esdihumboldt.hale.doc.util.toc.OneTopicToc; /** * Function reference table of contents provider. * * @author Simon Templer */ @SuppressWarnings("restriction") public class FunctionReferenceToc extends AbstractTocProvider implements FunctionReferenceConstants { /** * TOC contribution for the function reference. */ public static class FunctionTocContribution implements ITocContribution { private static final String[] NO_DOCS = new String[] {}; private final String locale; /** * @param locale the locale */ public FunctionTocContribution(String locale) { super(); this.locale = locale; } /** * @see ITocContribution#getCategoryId() */ @Override public String getCategoryId() { // no category return null; } /** * @see ITocContribution#getContributorId() */ @Override public String getContributorId() { return PLUGIN_ID; } /** * @see ITocContribution#getExtraDocuments() */ @Override public String[] getExtraDocuments() { // none return NO_DOCS; } /** * @see ITocContribution#getId() */ @Override public String getId() { return HrefUtil.normalizeHref(PLUGIN_ID, "functions.xml"); } /** * @see ITocContribution#getLinkTo() */ @Override public String getLinkTo() { return PLUGINS_ROOT + "/eu.esdihumboldt.hale.doc.user/toc.xml#reference"; } /** * @see ITocContribution#getLocale() */ @Override public String getLocale() { return locale; } /** * @see ITocContribution#getToc() */ @Override public IToc getToc() { return new OneTopicToc(new FunctionReferenceTopic()); } /** * @see ITocContribution#isPrimary() */ @Override public boolean isPrimary() { return false; } } /** * Default constructor */ public FunctionReferenceToc() { super(); } /** * @see AbstractTocProvider#getTocContributions(java.lang.String) */ @Override public ITocContribution[] getTocContributions(String locale) { return new ITocContribution[] { new FunctionTocContribution(locale) }; } }