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

Collapse All | Expand All

(-)src/org/eclipse/pde/ui/templates/AbstractTemplateSection.java (-6 / +9 lines)
Lines 739-751 Link Here
739
	}
739
	}
740
	
740
	
741
	protected double getTargetVersion() {
741
	protected double getTargetVersion() {
742
        try {
742
		if (model != null) {
743
    		IPluginBase plugin = model.getPluginBase();
743
			try {
744
			if (plugin instanceof IBundlePluginBase)
744
				IPluginBase plugin = model.getPluginBase();
745
			    return Double.parseDouble(((IBundlePluginBase)plugin).getTargetVersion());
745
				if (plugin instanceof IBundlePluginBase)
746
		} catch (NumberFormatException e) {
746
					return Double.parseDouble(((IBundlePluginBase) plugin)
747
							.getTargetVersion());
748
			} catch (NumberFormatException e) {
749
			}
747
		}
750
		}
748
       return TargetPlatformHelper.getTargetVersion();
751
		return TargetPlatformHelper.getTargetVersion();
749
	}
752
	}
750
753
751
	/**
754
	/**
(-)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 / +51 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
		
74
		indexOption.setEnabled(isIncludeIndex() && primaryOption.isSelected());
75
		
71
	}	
76
	}	
72
77
	
73
	private void createOptions() {
78
	private void createOptions() {
74
		tocLabelOption = addOption(
79
		tocLabelOption = addOption(
75
			KEY_TOC_LABEL,
80
			KEY_TOC_LABEL,
Lines 119-124 Link Here
119
			true,
124
			true,
120
			0);
125
			0);
121
126
127
		// Although we'd like to only create the index option if the eclipse
128
		// target version is high enough, unfortunately, at this point the model
129
		// has not been set and so it's just not possible
130
		
131
		indexOption = (BooleanOption)addOption(
132
				KEY_INDEX,
133
				PDETemplateMessages.HelpTemplate_index,
134
				true,
135
				0);
122
	}
136
	}
123
	/**
137
	/**
124
	 * @see OptionTemplateSection#getSectionId()
138
	 * @see OptionTemplateSection#getSectionId()
Lines 172-177 Link Here
172
						&& !tasksOption.isSelected()
186
						&& !tasksOption.isSelected()
173
						&& !referenceOption.isSelected()
187
						&& !referenceOption.isSelected()
174
						&& !samplesOption.isSelected());
188
						&& !samplesOption.isSelected());
189
		} else if ( fileName.equals("index.xml")) { //$NON-NLS-1$
190
			if (isIncludeIndex())
191
				isOk = (indexOption.isEnabled() && indexOption.isSelected());
192
			else 
193
				isOk = false;
175
		}
194
		}
176
		return isOk;	
195
		return isOk;	
177
	}
196
	}
Lines 219-226 Link Here
219
		
238
		
220
		if (!extension.isInTheModel())
239
		if (!extension.isInTheModel())
221
			plugin.add(extension);
240
			plugin.add(extension);
241
		
242
		// Add the index?
243
		if (indexOption != null && indexOption.isEnabled()
244
				&& indexOption.isSelected()) {
245
			
246
			final String indexExtPoint = "org.eclipse.help.index";
247
			extension = createExtension(indexExtPoint, true);
248
			
249
			IPluginElement indexElement = factory.createElement(extension);
250
			indexElement.setName("index"); //$NON-NLS-1$
251
			indexElement.setAttribute("file", "index.xml");
252
			extension.add(indexElement);
253
			
254
			if( !extension.isInTheModel() ) 
255
				plugin.add(extension);
256
			
257
		}
222
	}
258
	}
223
	
259
	
260
224
	private void addNonPrimaryTopic(BooleanOption option, String file, IPluginExtension extension) throws CoreException {
261
	private void addNonPrimaryTopic(BooleanOption option, String file, IPluginExtension extension) throws CoreException {
225
		if (option.isEnabled() && option.isSelected()) {
262
		if (option.isEnabled() && option.isSelected()) {
226
			IPluginElement tocElement = extension.getPluginModel().getPluginFactory().createElement(extension);
263
			IPluginElement tocElement = extension.getPluginModel().getPluginFactory().createElement(extension);
Lines 251-254 Link Here
251
		return new String[] {"html/", "*.xml"}; //$NON-NLS-1$ //$NON-NLS-2$
288
		return new String[] {"html/", "*.xml"}; //$NON-NLS-1$ //$NON-NLS-2$
252
	}
289
	}
253
290
291
	/**
292
	 * Determines whether the index option should be available. This is
293
	 * dependent upon the Eclipse version being targeted by the plugin. Indexes
294
	 * were introduced in Eclipse 3.2. This must only be called once the model
295
	 * has been set on the template - i.e. it CANNOT be called in createOptions.
296
	 * 
297
	 * @return true if the index option should be included, false otherwise.
298
	 */
299
	private boolean isIncludeIndex() {
300
301
		double targetVersion = getTargetVersion();
302
		return (targetVersion >= 3.2);
303
	}
254
}
304
}
(-)templates_3.2/help/bin/html/concepts/subtopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Sub Topic</title>
7
</head>
8
9
<body>
10
<h1>Sub Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/html/tasks/subtopic2.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Sub Topic 2</title>
7
</head>
8
9
<body>
10
<h1>Sub Topic 2</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/html/toc.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Table of Contents</title>
7
</head>
8
9
<body>
10
<h1>Table of Contents</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/testToc.xml (+6 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?NLS TYPE="org.eclipse.help.toc"?>
3
4
<toc label="Test TOC" topic="html/toc.html">
5
	<link toc="toc.xml" />
6
</toc>
(-)templates_3.2/help/bin/html/reference/subtopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Sub Topic</title>
7
</head>
8
9
<body>
10
<h1>Sub Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/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>
(-)templates_3.2/help/bin/html/reference/maintopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Main Topic</title>
7
</head>
8
9
<body>
10
<h1>Main Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/tocgettingstarted.xml (+11 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?NLS TYPE="org.eclipse.help.toc"?>
3
4
<toc label="Getting Started" link_to="toc.xml#gettingstarted"> 
5
	<topic label="Main Topic"  href="html/gettingstarted/maintopic.html"> 
6
		<topic label="Sub Topic" href="html/gettingstarted/subtopic.html" /> 
7
	</topic>
8
	<topic label="Main Topic 2">
9
		<topic label="Sub Topic 2" href="html/gettingstarted/subtopic2.html" />
10
	</topic> 
11
</toc>
(-)templates_3.2/help/bin/html/gettingstarted/subtopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Sub Topic</title>
7
</head>
8
9
<body>
10
<h1>Sub Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/tocconcepts.xml (+11 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?NLS TYPE="org.eclipse.help.toc"?>
3
4
<toc label="Concepts" link_to="toc.xml#concepts"> 
5
	<topic label="Main Topic"  href="html/concepts/maintopic.html"> 
6
		<topic label="Sub Topic" href="html/concepts/subtopic.html" /> 
7
	</topic>
8
	<topic label="Main Topic 2">
9
		<topic label="Sub Topic 2" href="html/concepts/subtopic2.html" /> 
10
	</topic> 
11
</toc>
(-)templates_3.2/help/bin/html/tasks/maintopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Main Topic</title>
7
</head>
8
9
<body>
10
<h1>Main Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/html/maintopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Main Topic</title>
7
</head>
8
9
<body>
10
<h1>Main Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/html/subtopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Sub Topic</title>
7
</head>
8
9
<body>
10
<h1>Sub Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/html/tasks/subtopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Sub Topic</title>
7
</head>
8
9
<body>
10
<h1>Sub Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/toc.xml (+41 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?NLS TYPE="org.eclipse.help.toc"?>
3
4
%if isPrimary
5
<toc label="$tocLabel$" topic="html/toc.html">
6
%else
7
<toc label="$tocLabel$">
8
%endif
9
%if isPrimary && gettingStarted
10
   <topic label="Getting Started">
11
      <anchor id="gettingstarted"/>
12
   </topic>
13
%endif
14
%if isPrimary && concepts
15
   <topic label="Concepts">
16
      <anchor id="concepts"/>
17
   </topic>
18
%endif
19
%if isPrimary && tasks
20
   <topic label="Tasks">
21
      <anchor id="tasks"/>
22
   </topic>
23
%endif
24
%if isPrimary && reference
25
   <topic label="Reference">
26
      <anchor id="reference"/>
27
   </topic>
28
%endif
29
%if isPrimary && samples
30
   <topic label="Samples">
31
      <anchor id="samples"/>
32
   </topic>
33
%endif
34
%if isPrimary && (gettingStarted || concepts || tasks || reference || samples) 
35
%else
36
	<topic label="Main Topic"  href="html/maintopic.html"> 
37
		<topic label="Sub Topic" href="html/subtopic.html"/> 
38
	</topic>
39
	<topic label="Main Topic 2"/>
40
%endif
41
</toc>
(-)templates_3.2/help/bin/html/gettingstarted/subtopic2.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Sub Topic 2</title>
7
</head>
8
9
<body>
10
<h1>Sub Topic 2</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/tocsamples.xml (+11 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?NLS TYPE="org.eclipse.help.toc"?>
3
4
<toc label="Samples" link_to="toc.xml#samples"> 
5
	<topic label="Main Topic"  href="html/samples/maintopic.html"> 
6
		<topic label="Sub Topic" href="html/samples/subtopic.html" /> 
7
	</topic>
8
	<topic label="Main Topic 2">
9
		<topic label="Sub Topic 2" href="html/samples/subtopic2.html" /> 
10
	</topic> 
11
</toc>
(-)templates_3.2/help/bin/toctasks.xml (+11 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?NLS TYPE="org.eclipse.help.toc"?>
3
4
<toc label="Tasks" link_to="toc.xml#tasks"> 
5
	<topic label="Main Topic"  href="html/tasks/maintopic.html"> 
6
		<topic label="Sub Topic" href="html/tasks/subtopic.html" /> 
7
	</topic>
8
	<topic label="Main Topic 2">
9
		<topic label="Sub Topic 2" href="html/tasks/subtopic2.html" /> 
10
	</topic> 
11
</toc>
(-)templates_3.2/help/bin/html/concepts/subtopic2.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Sub Topic 2</title>
7
</head>
8
9
<body>
10
<h1>Sub Topic 2</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/html/concepts/maintopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Main Topic</title>
7
</head>
8
9
<body>
10
<h1>Main Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/html/samples/subtopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Sub Topic</title>
7
</head>
8
9
<body>
10
<h1>Sub Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/html/samples/subtopic2.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Sub Topic 2</title>
7
</head>
8
9
<body>
10
<h1>Sub Topic 2</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/html/reference/subtopic2.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Sub Topic 2</title>
7
</head>
8
9
<body>
10
<h1>Sub Topic 2</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/html/gettingstarted/maintopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Main Topic</title>
7
</head>
8
9
<body>
10
<h1>Main Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>
(-)templates_3.2/help/bin/tocreference.xml (+11 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<?NLS TYPE="org.eclipse.help.toc"?>
3
4
<toc label="Reference" link_to="toc.xml#reference"> 
5
	<topic label="Main Topic"  href="html/reference/maintopic.html"> 
6
		<topic label="Sub Topic" href="html/reference/subtopic.html" /> 
7
	</topic>
8
	<topic label="Main Topic 2">
9
		<topic label="Sub Topic 2" href="html/reference/subtopic2.html" /> 
10
	</topic> 
11
</toc>
(-)templates_3.2/help/bin/html/samples/maintopic.html (+13 lines)
Added Link Here
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
3
<html>
4
<head>
5
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6
	<title>Main Topic</title>
7
</head>
8
9
<body>
10
<h1>Main Topic</h1>
11
Please enter your text here.
12
</body>
13
</html>

Return to bug 165183