1 /* 2 * The contents of this file are subject to the terms of the Common Development 3 * and Distribution License (the License). You may not use this file except in 4 * compliance with the License. 5 * 6 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html 7 * or http://www.netbeans.org/cddl.txt. 8 * 9 * When distributing Covered Code, include this CDDL Header Notice in each file 10 * and include the License file at http://www.netbeans.org/cddl.txt. 11 * If applicable, add the following below the CDDL Header, with the fields 12 * enclosed by brackets [] replaced by your own identifying information: 13 * "Portions Copyrighted [year] [name of copyright owner]" 14 * 15 * The Original Software is NetBeans. The Initial Developer of the Original 16 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun 17 * Microsystems, Inc. All Rights Reserved. 18 */ 19 20 package org.netbeans.modules.ant.freeform.spi; 21 22 /** 23 * This interface is used to compute the help context for a freeform project. 24 * Each {@link ProjectNature} should register an implementation in its lookup. 25 * See {@link #getHelpIDFragment} to find out what are the requirements on the help 26 * id fragments. 27 * 28 * If it is necessary to compute a help context for a freeform project, all 29 * {@link HelpIDFragmentProvider}s registered in the project's lookup are asked to 30 * provide the fragments. The fragments are then lexicographically sorted and 31 * concatenated (separated by dots) into one string, used as a base for the help id. 32 * 33 * @author Jan Lahoda 34 * @since 1.11.1 35 */ 36 public interface HelpIDFragmentProvider { 37 38 /** 39 * Returns a help id fragment defined by the implementor. The method should return 40 * the same string each time it is called (more preciselly, it is required that 41 * <code>getHelpIDFragment().equals(getHelpIDFragment())</code>, but is allowed to 42 * <code>getHelpIDFragment() != getHelpIDFragment()</code>). The string should be unique 43 * among all the freeform project natures. The string is required to match this 44 * regular expression: <code>([A-Za-z0-9])+</code>. 45 * 46 * Please note that the returned fragment is part of the contract between the 47 * code and documentation, so be carefull when you need to change it. 48 * 49 * @return a non-null help id fragment, fullfilling the above conditions. 50 */ 51 public String getHelpIDFragment(); 52 53 } 54