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); |