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-73
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() { |
Lines 119-124
Link Here
|
119 |
true, |
122 |
true, |
120 |
0); |
123 |
0); |
121 |
|
124 |
|
|
|
125 |
indexOption = (BooleanOption)addOption( |
126 |
KEY_INDEX, |
127 |
PDETemplateMessages.HelpTemplate_index, |
128 |
true, |
129 |
0); |
130 |
|
122 |
} |
131 |
} |
123 |
/** |
132 |
/** |
124 |
* @see OptionTemplateSection#getSectionId() |
133 |
* @see OptionTemplateSection#getSectionId() |
Lines 172-177
Link Here
|
172 |
&& !tasksOption.isSelected() |
181 |
&& !tasksOption.isSelected() |
173 |
&& !referenceOption.isSelected() |
182 |
&& !referenceOption.isSelected() |
174 |
&& !samplesOption.isSelected()); |
183 |
&& !samplesOption.isSelected()); |
|
|
184 |
} else if ( fileName.equals("index.xml")) { //$NON-NLS-1$ |
185 |
isOk = indexOption.isEnabled() && indexOption.isSelected(); |
175 |
} |
186 |
} |
176 |
return isOk; |
187 |
return isOk; |
177 |
} |
188 |
} |
Lines 219-226
Link Here
|
219 |
|
230 |
|
220 |
if (!extension.isInTheModel()) |
231 |
if (!extension.isInTheModel()) |
221 |
plugin.add(extension); |
232 |
plugin.add(extension); |
|
|
233 |
|
234 |
// Add the index? |
235 |
if( indexOption.isEnabled() && indexOption.isSelected() ) { |
236 |
|
237 |
final String indexExtPoint = "org.eclipse.help.index"; |
238 |
extension = createExtension(indexExtPoint, true); |
239 |
|
240 |
IPluginElement indexElement = factory.createElement(extension); |
241 |
indexElement.setName("index"); //$NON-NLS-1$ |
242 |
indexElement.setAttribute("file", "index.xml"); |
243 |
extension.add(indexElement); |
244 |
|
245 |
if( !extension.isInTheModel() ) |
246 |
plugin.add(extension); |
247 |
|
248 |
} |
222 |
} |
249 |
} |
223 |
|
250 |
|
|
|
251 |
|
224 |
private void addNonPrimaryTopic(BooleanOption option, String file, IPluginExtension extension) throws CoreException { |
252 |
private void addNonPrimaryTopic(BooleanOption option, String file, IPluginExtension extension) throws CoreException { |
225 |
if (option.isEnabled() && option.isSelected()) { |
253 |
if (option.isEnabled() && option.isSelected()) { |
226 |
IPluginElement tocElement = extension.getPluginModel().getPluginFactory().createElement(extension); |
254 |
IPluginElement tocElement = extension.getPluginModel().getPluginFactory().createElement(extension); |