### Eclipse Workspace Patch 1.0 #P org.eclipse.pde.ui.templates Index: src/org/eclipse/pde/internal/ui/templates/PDETemplateMessages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/PDETemplateMessages.java,v retrieving revision 1.5 diff -u -r1.5 PDETemplateMessages.java --- src/org/eclipse/pde/internal/ui/templates/PDETemplateMessages.java 21 Jun 2007 14:38:43 -0000 1.5 +++ src/org/eclipse/pde/internal/ui/templates/PDETemplateMessages.java 6 Jan 2008 17:34:03 -0000 @@ -178,6 +178,7 @@ public static String HelpTemplate_tasks; public static String HelpTemplate_reference; public static String HelpTemplate_samples; + public static String HelpTemplate_index; public static String BuilderNewWizard_wtitle; public static String BuilderTemplate_title; Index: src/org/eclipse/pde/internal/ui/templates/pderesources.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/pderesources.properties,v retrieving revision 1.6 diff -u -r1.6 pderesources.properties --- src/org/eclipse/pde/internal/ui/templates/pderesources.properties 21 Jun 2007 14:38:43 -0000 1.6 +++ src/org/eclipse/pde/internal/ui/templates/pderesources.properties 6 Jan 2008 17:34:04 -0000 @@ -153,6 +153,7 @@ HelpTemplate_reference = Generate a '&Reference' category HelpTemplate_samples = Generate a '&Samples' category HelpTemplate_sampleText=Sample Table of Contents +HelpTemplate_index = Generate an '&Index' BuilderNewWizard_wtitle = New plug-in project with a sample project builder and nature BuilderTemplate_title = Sample Project Builder and Nature Index: src/org/eclipse/pde/internal/ui/templates/ide/HelpTemplate.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/HelpTemplate.java,v retrieving revision 1.1 diff -u -r1.1 HelpTemplate.java --- src/org/eclipse/pde/internal/ui/templates/ide/HelpTemplate.java 12 Nov 2006 09:00:46 -0000 1.1 +++ src/org/eclipse/pde/internal/ui/templates/ide/HelpTemplate.java 6 Jan 2008 17:34:04 -0000 @@ -37,6 +37,7 @@ public static final String KEY_TASKS = "tasks"; //$NON-NLS-1$ public static final String KEY_REFERENCE = "reference"; //$NON-NLS-1$ public static final String KEY_SAMPLES = "samples"; //$NON-NLS-1$ + public static final String KEY_INDEX = "index"; //$NON-NLS-1$ private TemplateOption tocLabelOption; private BooleanOption primaryOption; @@ -46,6 +47,7 @@ private BooleanOption tasksOption; private BooleanOption referenceOption; private BooleanOption samplesOption; + private BooleanOption indexOption; public HelpTemplate() { setPageCount(1); @@ -68,6 +70,7 @@ tasksOption.setEnabled(primaryOption.isSelected()); referenceOption.setEnabled(primaryOption.isSelected()); samplesOption.setEnabled(primaryOption.isSelected()); + indexOption.setEnabled(primaryOption.isSelected()); } private void createOptions() { @@ -119,6 +122,12 @@ true, 0); + indexOption = (BooleanOption)addOption( + KEY_INDEX, + PDETemplateMessages.HelpTemplate_index, + true, + 0); + } /** * @see OptionTemplateSection#getSectionId() @@ -172,6 +181,8 @@ && !tasksOption.isSelected() && !referenceOption.isSelected() && !samplesOption.isSelected()); + } else if ( fileName.equals("index.xml")) { //$NON-NLS-1$ + isOk = indexOption.isEnabled() && indexOption.isSelected(); } return isOk; } @@ -219,8 +230,25 @@ if (!extension.isInTheModel()) plugin.add(extension); + + // Add the index? + if( indexOption.isEnabled() && indexOption.isSelected() ) { + + final String indexExtPoint = "org.eclipse.help.index"; + extension = createExtension(indexExtPoint, true); + + IPluginElement indexElement = factory.createElement(extension); + indexElement.setName("index"); //$NON-NLS-1$ + indexElement.setAttribute("file", "index.xml"); + extension.add(indexElement); + + if( !extension.isInTheModel() ) + plugin.add(extension); + + } } + private void addNonPrimaryTopic(BooleanOption option, String file, IPluginExtension extension) throws CoreException { if (option.isEnabled() && option.isSelected()) { IPluginElement tocElement = extension.getPluginModel().getPluginFactory().createElement(extension); Index: templates_3.0/help/bin/index.xml =================================================================== RCS file: templates_3.0/help/bin/index.xml diff -N templates_3.0/help/bin/index.xml --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ templates_3.0/help/bin/index.xml 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + +