View | Details | Raw Unified | Return to bug 165183 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/templates/PDETemplateMessages.java (+1 lines)
Lines 178-183 Link Here
178
	public static String HelpTemplate_tasks;
178
	public static String HelpTemplate_tasks;
179
	public static String HelpTemplate_reference;
179
	public static String HelpTemplate_reference;
180
	public static String HelpTemplate_samples;
180
	public static String HelpTemplate_samples;
181
	public static String HelpTemplate_index;
181
182
182
	public static String BuilderNewWizard_wtitle;
183
	public static String BuilderNewWizard_wtitle;
183
	public static String BuilderTemplate_title;
184
	public static String BuilderTemplate_title;
(-)src/org/eclipse/pde/internal/ui/templates/pderesources.properties (+1 lines)
Lines 153-158 Link Here
153
HelpTemplate_reference = Generate a '&Reference' category
153
HelpTemplate_reference = Generate a '&Reference' category
154
HelpTemplate_samples = Generate a '&Samples' category
154
HelpTemplate_samples = Generate a '&Samples' category
155
HelpTemplate_sampleText=Sample Table of Contents
155
HelpTemplate_sampleText=Sample Table of Contents
156
HelpTemplate_index = Generate an '&Index'
156
157
157
BuilderNewWizard_wtitle = New plug-in project with a sample project builder and nature
158
BuilderNewWizard_wtitle = New plug-in project with a sample project builder and nature
158
BuilderTemplate_title = Sample Project Builder and Nature
159
BuilderTemplate_title = Sample Project Builder and Nature
(-)src/org/eclipse/pde/internal/ui/templates/ide/HelpTemplate.java (-1 / +33 lines)
Lines 37-42 Link Here
37
	public static final String KEY_TASKS       = "tasks"; //$NON-NLS-1$
37
	public static final String KEY_TASKS       = "tasks"; //$NON-NLS-1$
38
	public static final String KEY_REFERENCE   = "reference"; //$NON-NLS-1$
38
	public static final String KEY_REFERENCE   = "reference"; //$NON-NLS-1$
39
	public static final String KEY_SAMPLES     = "samples"; //$NON-NLS-1$
39
	public static final String KEY_SAMPLES     = "samples"; //$NON-NLS-1$
40
	public static final String KEY_INDEX       = "index"; //$NON-NLS-1$
40
	
41
	
41
	private TemplateOption tocLabelOption;
42
	private TemplateOption tocLabelOption;
42
	private BooleanOption primaryOption;
43
	private BooleanOption primaryOption;
Lines 46-51 Link Here
46
	private BooleanOption tasksOption;
47
	private BooleanOption tasksOption;
47
	private BooleanOption referenceOption;
48
	private BooleanOption referenceOption;
48
	private BooleanOption samplesOption;
49
	private BooleanOption samplesOption;
50
	private BooleanOption indexOption;
49
	
51
	
50
	public HelpTemplate() {
52
	public HelpTemplate() {
51
		setPageCount(1);
53
		setPageCount(1);
Lines 68-75 Link Here
68
		tasksOption.setEnabled(primaryOption.isSelected());
70
		tasksOption.setEnabled(primaryOption.isSelected());
69
		referenceOption.setEnabled(primaryOption.isSelected());
71
		referenceOption.setEnabled(primaryOption.isSelected());
70
		samplesOption.setEnabled(primaryOption.isSelected());
72
		samplesOption.setEnabled(primaryOption.isSelected());
73
		indexOption.setEnabled(primaryOption.isSelected());
71
	}	
74
	}	
72
75
	
73
	private void createOptions() {
76
	private void createOptions() {
74
		tocLabelOption = addOption(
77
		tocLabelOption = addOption(
75
			KEY_TOC_LABEL,
78
			KEY_TOC_LABEL,
Lines 119-124 Link Here
119
			true,
122
			true,
120
			0);
123
			0);
121
124
125
		// Although we'd like to only create the index option if the eclipse
126
		// target version is high enough, unfortunately, at this point the model
127
		// has not been set and so it's just not possible
128
		
129
		indexOption = (BooleanOption)addOption(
130
				KEY_INDEX,
131
				PDETemplateMessages.HelpTemplate_index,
132
				true,
133
				0);
122
	}
134
	}
123
	/**
135
	/**
124
	 * @see OptionTemplateSection#getSectionId()
136
	 * @see OptionTemplateSection#getSectionId()
Lines 172-177 Link Here
172
						&& !tasksOption.isSelected()
184
						&& !tasksOption.isSelected()
173
						&& !referenceOption.isSelected()
185
						&& !referenceOption.isSelected()
174
						&& !samplesOption.isSelected());
186
						&& !samplesOption.isSelected());
187
		} else if ( fileName.equals("index.xml")) { //$NON-NLS-1$
188
			isOk = (indexOption.isEnabled() && indexOption.isSelected());
175
		}
189
		}
176
		return isOk;	
190
		return isOk;	
177
	}
191
	}
Lines 219-226 Link Here
219
		
233
		
220
		if (!extension.isInTheModel())
234
		if (!extension.isInTheModel())
221
			plugin.add(extension);
235
			plugin.add(extension);
236
		
237
		// Add the index?
238
		if (indexOption != null && indexOption.isEnabled()
239
				&& indexOption.isSelected()) {
240
			
241
			final String indexExtPoint = "org.eclipse.help.index";
242
			extension = createExtension(indexExtPoint, true);
243
			
244
			IPluginElement indexElement = factory.createElement(extension);
245
			indexElement.setName("index"); //$NON-NLS-1$
246
			indexElement.setAttribute("file", "index.xml");
247
			extension.add(indexElement);
248
			
249
			if( !extension.isInTheModel() ) 
250
				plugin.add(extension);
251
			
252
		}
222
	}
253
	}
223
	
254
	
255
224
	private void addNonPrimaryTopic(BooleanOption option, String file, IPluginExtension extension) throws CoreException {
256
	private void addNonPrimaryTopic(BooleanOption option, String file, IPluginExtension extension) throws CoreException {
225
		if (option.isEnabled() && option.isSelected()) {
257
		if (option.isEnabled() && option.isSelected()) {
226
			IPluginElement tocElement = extension.getPluginModel().getPluginFactory().createElement(extension);
258
			IPluginElement tocElement = extension.getPluginModel().getPluginFactory().createElement(extension);
(-)templates_3.0/help/index.xml (+72 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<index>
3
   <!-- Index entries for the main topics -->
4
   <entry keyword="Main Topics">
5
%if gettingStarted   
6
	   <entry keyword="Getting Started">
7
	      <topic href="html/gettingStarted/maintopic.html"/>
8
	   </entry>
9
%endif
10
%if concepts   
11
	   <entry keyword="Concepts">
12
	      <topic href="html/concepts/maintopic.html"/>
13
	   </entry>
14
%endif
15
%if tasks   
16
	   <entry keyword="Tasks">
17
	      <topic href="html/tasks/maintopic.html"/>
18
	   </entry>
19
%endif
20
%if reference   
21
	   <entry keyword="Reference">
22
	      <topic href="html/reference/maintopic.html"/>
23
	   </entry>
24
%endif
25
%if samples   
26
	   <entry keyword="Samples">
27
	      <topic href="html/samples/maintopic.html"/>
28
	   </entry>
29
%endif
30
%if gettingStarted || concepts || tasks || reference || samples 
31
%else
32
	   <entry keyword="Only Entry">
33
	      <topic href="html/maintopic.html"/>
34
	   </entry>
35
%endif
36
   </entry>
37
   
38
   <!-- Index entries for the subtopics -->
39
   <entry keyword="Subtopics">
40
%if gettingStarted   
41
	   <entry keyword="Getting Started">
42
	      <topic href="html/gettingStarted/subtopic.html"/>
43
	   </entry>
44
%endif
45
%if concepts   
46
	   <entry keyword="Concepts">
47
	      <topic href="html/concepts/subtopic.html"/>
48
	   </entry>
49
%endif
50
%if tasks   
51
	   <entry keyword="Tasks">
52
	      <topic href="html/tasks/subtopic.html"/>
53
	   </entry>
54
%endif
55
%if reference   
56
	   <entry keyword="Reference">
57
	      <topic href="html/reference/subtopic.html"/>
58
	   </entry>
59
%endif
60
%if samples   
61
	   <entry keyword="Samples">
62
	      <topic href="html/samples/subtopic.html"/>
63
	   </entry>
64
%endif
65
%if gettingStarted || concepts || tasks || reference || samples 
66
%else
67
	   <entry keyword="Only Entry">
68
	      <topic href="html/subtopic.html"/>
69
	   </entry>
70
%endif
71
   </entry>
72
</index>

Return to bug 165183