Bug 9884 fixed: Add in prefs the possibility to add a default header on new files...
[scilab.git] / scilab / modules / scinotes / etc / XConfiguration-scinotes.xsl
1 <?xml version='1.0' encoding='utf-8'?>\r
2 <xsl:stylesheet version ="1.0"\r
3                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\r
4 \r
5   <xsl:template match="scinotes-preferences">\r
6     <Title text="Editor">\r
7       <VBox>\r
8         <HBox>\r
9           <xsl:call-template name="BooleanCheckBox">\r
10             <xsl:with-param name="text" select="'Use SciNotes'"/>\r
11             <xsl:with-param name="attr-name" select="'scinotes'"/>\r
12           </xsl:call-template>\r
13           <Glue/>\r
14         </HBox>\r
15         <xsl:variable name="enable">\r
16           <xsl:choose>\r
17             <xsl:when test="@scinotes='true'">\r
18               <xsl:text>false</xsl:text>\r
19             </xsl:when>\r
20             <xsl:otherwise>\r
21               <xsl:text>true</xsl:text>\r
22             </xsl:otherwise>\r
23           </xsl:choose>\r
24         </xsl:variable>\r
25         <Grid>\r
26           <Radiobutton value="{@external-cmd}" expected-value="true" listener="ActionListener" text="External editor: " gridx="1" gridy="1" fill="none" weightx="0" anchor="west" enable="{$enable}">\r
27             <actionPerformed choose="external-cmd">\r
28               <xsl:call-template name="context"/>\r
29             </actionPerformed>\r
30           </Radiobutton>\r
31           <FileSelector gridx="2" gridy="1" weightx="1" anchor="above_baseline"\r
32                         listener="EntryListener"\r
33                         href="{@cmd}"\r
34                         dir-selection="false"\r
35                         check-entry="false">\r
36             <xsl:attribute name="enable">\r
37               <xsl:if test="@scinotes='false' and @external-cmd='true'">\r
38                 <xsl:text>true</xsl:text>\r
39               </xsl:if>\r
40             </xsl:attribute>\r
41             <entryChanged choose="cmd">\r
42               <xsl:call-template name="context"/>\r
43             </entryChanged>\r
44           </FileSelector>\r
45           <Label gridx="2" gridy="2" text="(Don't forget to quote path containing white spaces)">\r
46             <xsl:attribute name="enable">\r
47               <xsl:if test="@scinotes='false' and @external-cmd='true'">\r
48                 <xsl:text>true</xsl:text>\r
49               </xsl:if>\r
50             </xsl:attribute>\r
51           </Label>\r
52           <Panel height="5" gridx="1" gridy="3">\r
53             <VSpace height="5"/>\r
54           </Panel>\r
55           <Radiobutton value="{@external-cmd}" expected-value="false" listener="ActionListener" text="Scilab command: " gridx="1" gridy="4" fill="none" weightx="0" anchor="west" enable="{$enable}">\r
56             <actionPerformed choose="external-cmd">\r
57               <xsl:call-template name="context"/>\r
58             </actionPerformed>\r
59           </Radiobutton>\r
60           <Entry gridx="2" gridy="4" weightx="1" anchor="above_baseline"\r
61                  listener="EntryListener"\r
62                  text="{@macro}">\r
63             <xsl:attribute name="enable">\r
64               <xsl:if test="@scinotes='false' and @external-cmd='false'">\r
65                 <xsl:text>true</xsl:text>\r
66               </xsl:if>\r
67             </xsl:attribute>\r
68             <entryChanged choose="macro">\r
69               <xsl:call-template name="context"/>\r
70             </entryChanged>\r
71           </Entry>\r
72         </Grid>\r
73       </VBox>\r
74     </Title>\r
75     <VSpace height="10"/>\r
76     <Title text="SciNotes General settings">\r
77       <Grid>\r
78         <Panel gridx="1" gridy="1" gridwidth="3">\r
79           <xsl:call-template name="BooleanCheckBox">\r
80             <xsl:with-param name="attr-name" select="'restart-reopen'"/>\r
81             <xsl:with-param name="text" select="'Restore previous session on start-up'"/>\r
82           </xsl:call-template>\r
83         </Panel>\r
84         <Panel gridx="1" gridy="2" gridwidth="3">\r
85           <xsl:call-template name="BooleanCheckBox">\r
86             <xsl:with-param name="attr-name" select="'add-line-termination'"/>\r
87             <xsl:with-param name="text" select="'Add carriage return at the end of the file.'"/>\r
88           </xsl:call-template>\r
89         </Panel>\r
90         <Label gridx="1" gridy="3" weightx="0" text="Number of recently opened files to display: "/>\r
91         <Panel gridx="2" gridy="3" gridheight="2" fill="both"/>\r
92         <NumericalSpinner gridx="3"\r
93                           gridy="3"\r
94                           weightx="0"\r
95                           min-value = "0"\r
96                           increment = "1"\r
97                           length = "4"\r
98                           listener = "ActionListener"\r
99                           value = "{@number-of-recently-open}">\r
100           <actionPerformed choose="number-of-recently-open">\r
101             <xsl:call-template name="context"/>\r
102           </actionPerformed>\r
103         </NumericalSpinner>\r
104         <Label gridx="1" gridy="4" weightx="0" text="Default file encoding: "/>\r
105         <Panel gridx="3" gridy="4">\r
106           <xsl:call-template name="Select">\r
107             <xsl:with-param name="among">\r
108               <option encoding="utf-8"/>\r
109               <option encoding="iso-8859-1"/>\r
110               <option encoding="windows-1252"/>\r
111             </xsl:with-param>\r
112           </xsl:call-template>\r
113         </Panel>\r
114         <Label gridx="1" gridy="5" weightx="0" text="Default End-Of-Line: "/>\r
115         <Panel gridx="3" gridy="5">\r
116           <xsl:call-template name="Select">\r
117             <xsl:with-param name="among">\r
118               <option eol="Unix (LF)"/>\r
119               <option eol="Windows (CR+LF)"/>\r
120               <option eol="Mac OS (CR)"/>\r
121             </xsl:with-param>\r
122           </xsl:call-template>\r
123         </Panel>\r
124       </Grid>\r
125     </Title>\r
126   </xsl:template>\r
127 \r
128   <xsl:template match="scinotes-display">\r
129     <Title text="General display options">\r
130       <Grid>\r
131         <Checkbox checked="{@highlight-current-line}" selected-value="true" unselected-value="false" listener="ActionListener" text="Highlight current line: " gridx="1" gridy="1" fill="none" weightx="0" anchor="west">\r
132           <actionPerformed choose="highlight-current-line">\r
133             <xsl:call-template name="context"/>\r
134           </actionPerformed>\r
135         </Checkbox>\r
136         <Panel gridx="2" gridy="1" weightx="1"/>\r
137         <Panel gridx="3" gridy="1" weightx="1"/>\r
138         <Color color="{@current-line-color}" listener="ActionListener" gridx="4" gridy="1" weightx="0" enable="{@highlight-current-line}">\r
139           <actionPerformed choose="current-line-color">\r
140             <xsl:call-template name="context"/>\r
141           </actionPerformed>\r
142         </Color>\r
143         <Checkbox checked="{@show-line-numbers}" selected-value="true" unselected-value="false" listener="ActionListener" text="Show line numbers: " gridx="1" gridy="2" fill="none" weightx="0" anchor="west">\r
144           <actionPerformed choose="show-line-numbers">\r
145             <xsl:call-template name="context"/>\r
146           </actionPerformed>\r
147         </Checkbox>\r
148         <Radiobutton value="{@whereami}" expected-value="true" listener="ActionListener" text="Whereami compatible" gridx="2" gridy="2" fill="none" weightx="0" anchor="west" enable="{@show-line-numbers}">\r
149           <actionPerformed choose="whereami">\r
150             <xsl:call-template name="context"/>\r
151           </actionPerformed>\r
152         </Radiobutton>\r
153         <Radiobutton value="{@whereami}" expected-value="false" listener="ActionListener" text="Normal" gridx="3" gridy="2" gridwidth="2" fill="none" weightx="0" anchor="west" enable="{@show-line-numbers}">\r
154           <actionPerformed choose="whereami">\r
155             <xsl:call-template name="context"/>\r
156           </actionPerformed>\r
157         </Radiobutton>\r
158         <Checkbox checked="{@wrap-lines}" selected-value="true" unselected-value="false" listener="ActionListener" text="Wrap lines" gridx="1" gridy="3" fill="none" weightx="0" anchor="west">\r
159           <actionPerformed choose="wrap-lines">\r
160             <xsl:call-template name="context"/>\r
161           </actionPerformed>\r
162         </Checkbox>\r
163       </Grid>\r
164     </Title>\r
165     <VSpace height="10"/>\r
166     <Title text="Keywords">\r
167       <Grid>\r
168         <Checkbox checked="{@keywords-colorization}" selected-value="true" unselected-value="false" listener="ActionListener" text="Enable keywords colorization" gridx="1" gridy="1" fill="none" weightx="0" anchor="west">\r
169           <actionPerformed choose="keywords-colorization">\r
170             <xsl:call-template name="context"/>\r
171           </actionPerformed>\r
172         </Checkbox>\r
173         <Panel gridx="2" gridy="1" weightx="1"/>\r
174         <Link gridx="3" gridy="1" weightx="0" listener="MouseListener" text="Set syntax Colors" enable="{@keywords-colorization}">\r
175           <mouseClicked set="path" value="3/" context="/" enable="{@keywords-colorization}"/>\r
176         </Link>\r
177         <Checkbox checked="{@highlight-brackets}" selected-value="true" unselected-value="false" listener="ActionListener" text="Highlight corresponding brackets" gridx="1" gridy="2" fill="none" weightx="0" anchor="west">\r
178           <actionPerformed choose="highlight-brackets">\r
179             <xsl:call-template name="context"/>\r
180           </actionPerformed>\r
181         </Checkbox>\r
182         <Grid gridx="1" gridy="3" gridwidth="3" ipadx="10">\r
183           <Label gridx="1" gridy="1" weightx="0" text="Color: " enable="{@highlight-brackets}"/>\r
184           <Color color="{@brackets-color}" listener="ActionListener" gridx="2" gridy="1" weightx="0" enable="{@highlight-brackets}">\r
185             <actionPerformed choose="brackets-color">\r
186               <xsl:call-template name="context"/>\r
187             </actionPerformed>\r
188           </Color>\r
189           <Panel gridx="3" gridy="1" weightx="1"/>\r
190           <Checkbox checked="{@brackets-onmouseover}" selected-value="true" unselected-value="false" listener="ActionListener" text="Highlight on mouse over" gridx="4" gridy="1" fill="none" weightx="0" anchor="west" enable="{@highlight-brackets}">\r
191             <actionPerformed choose="brackets-onmouseover">\r
192               <xsl:call-template name="context"/>\r
193             </actionPerformed>\r
194           </Checkbox>\r
195           <Panel gridx="5" gridy="1" weightx="1"/>\r
196           <Label gridx="6" gridy="1" weightx="0" text="Style: " enable="{@highlight-brackets}"/>\r
197           <Panel gridx="7" gridy="1" weightx="0">\r
198             <xsl:call-template name="Select">\r
199               <xsl:with-param name="among">\r
200                 <option brackets-highlightment="Filled"/>\r
201                 <option brackets-highlightment="Framed"/>\r
202                 <option brackets-highlightment="Underlined"/>\r
203               </xsl:with-param>\r
204               <xsl:with-param name="enable" select="@highlight-brackets" />\r
205             </xsl:call-template>\r
206           </Panel>\r
207         </Grid>\r
208         <Checkbox checked="{@highlight-keywords}" selected-value="true" unselected-value="false" listener="ActionListener" text="Highlight corresponding keywords (e.g. if ... end)" gridx="1" gridy="4" fill="none" weightx="0" anchor="west">\r
209           <actionPerformed choose="highlight-keywords">\r
210             <xsl:call-template name="context"/>\r
211           </actionPerformed>\r
212         </Checkbox>\r
213         <Grid gridx="1" gridy="5" gridwidth="3" ipadx="10">\r
214           <Label gridx="1" gridy="1" weightx="0" text="Color: " enable="{@highlight-keywords}"/>\r
215           <Color color="{@keywords-color}" listener="ActionListener" gridx="2" gridy="1" weightx="0" enable="{@highlight-keywords}">\r
216             <actionPerformed choose="keywords-color">\r
217               <xsl:call-template name="context"/>\r
218             </actionPerformed>\r
219           </Color>\r
220           <Panel gridx="3" gridy="1" weightx="1"/>\r
221           <Checkbox checked="{@keywords-onmouseover}" selected-value="true" unselected-value="false" listener="ActionListener" text="Highlight on mouse over" gridx="4" gridy="1" fill="none" weightx="0" anchor="west" enable="{@highlight-keywords}">\r
222             <actionPerformed choose="keywords-onmouseover">\r
223               <xsl:call-template name="context"/>\r
224             </actionPerformed>\r
225           </Checkbox>\r
226           <Panel gridx="5" gridy="1" weightx="1"/>\r
227           <Label gridx="6" gridy="1" weightx="0" text="Style: " enable="{@highlight-keywords}"/>\r
228           <Panel gridx="7" gridy="1" weightx="0">\r
229             <xsl:call-template name="Select">\r
230               <xsl:with-param name="among">\r
231                 <option keywords-highlightment="Filled"/>\r
232                 <option keywords-highlightment="Framed"/>\r
233               </xsl:with-param>\r
234               <xsl:with-param name="enable" select="@highlight-keywords" />\r
235             </xsl:call-template>\r
236           </Panel>\r
237         </Grid>\r
238       </Grid>\r
239     </Title>\r
240     <VSpace height="10"/>\r
241     <Title text="Tabulation &amp; Indentation">\r
242       <Grid>\r
243         <Label text="Tabulation size:" gridx="1" gridy="1" weightx="0"/>\r
244         <NumericalSpinner gridx="2"\r
245                           gridy="1"\r
246                           weightx="0"\r
247                           min-value = "1"\r
248                           increment = "1"\r
249                           length = "3"\r
250                           listener = "ActionListener"\r
251                           value = "{@tab-size}">\r
252           <actionPerformed choose="tab-size">\r
253             <xsl:call-template name="context"/>\r
254           </actionPerformed>\r
255         </NumericalSpinner>\r
256         <Panel gridx="3" gridy="1" weightx="1"/>\r
257         <Checkbox checked="{@use-spaces}" selected-value="true" unselected-value="false" listener="ActionListener" text="Use space" gridx="4" gridy="1" fill="none" weightx="0" anchor="west">\r
258           <actionPerformed choose="use-spaces">\r
259             <xsl:call-template name="context"/>\r
260           </actionPerformed>\r
261         </Checkbox>\r
262 \r
263         <Label text="Representation:" gridx="1" gridy="2" weightx="0"/>\r
264         <Radiobutton value="{@tab-representation}" expected-value="chevrons" listener="ActionListener" text="Chevrons" gridx="2" gridy="2" fill="none" weightx="0" anchor="west" enable="true">\r
265           <actionPerformed choose="tab-representation">\r
266             <xsl:call-template name="context"/>\r
267           </actionPerformed>\r
268         </Radiobutton>\r
269         <Radiobutton value="{@tab-representation}" expected-value="hrule" listener="ActionListener" text="Horizontal rule" gridx="3" gridy="2" fill="none" weightx="0" anchor="west" enable="true">\r
270           <actionPerformed choose="tab-representation">\r
271             <xsl:call-template name="context"/>\r
272           </actionPerformed>\r
273         </Radiobutton>\r
274         <Radiobutton value="{@tab-representation}" expected-value="vrule" listener="ActionListener" text="Vertical rule" gridx="4" gridy="2" fill="none" weightx="0" anchor="west" enable="true">\r
275           <actionPerformed choose="tab-representation">\r
276             <xsl:call-template name="context"/>\r
277           </actionPerformed>\r
278         </Radiobutton>\r
279 \r
280         <Checkbox checked="{@automatic-indent}" selected-value="true" unselected-value="false" listener="ActionListener" text="Enable auto indentation" gridx="1" gridy="3" fill="none" weightx="0" anchor="west">\r
281           <actionPerformed choose="use-spaces">\r
282             <xsl:call-template name="context"/>\r
283           </actionPerformed>\r
284         </Checkbox>\r
285         <Label gridy="4" text="Indent size:"/>\r
286         <Panel gridy="4" gridx="2" >\r
287           <xsl:call-template name="Select">\r
288             <xsl:with-param name="among">\r
289               <option indent-size="2"/>\r
290               <option indent-size="4"/>\r
291               <option indent-size="8"/>\r
292             </xsl:with-param>\r
293           </xsl:call-template>\r
294         </Panel>\r
295       </Grid>\r
296     </Title>\r
297   </xsl:template>\r
298 \r
299   <xsl:template match="scinotes-autosave">\r
300     <Checkbox checked="{@enable}" selected-value="true" unselected-value="false" listener="ActionListener" text="Enable autosave in Scinotes">\r
301       <actionPerformed choose="enable">\r
302         <xsl:call-template name="context"/>\r
303       </actionPerformed>\r
304     </Checkbox>\r
305     <VSpace height="10"/>\r
306     <Title text="Save options">\r
307       <Grid>\r
308         <Label gridx="1" gridy="1" weightx="0" anchor="west" text="Save every " enable="{@enable}"/>\r
309         <NumericalSpinner gridx="2"\r
310                           gridy="1"\r
311                           weightx="0"\r
312                           min-value = "1"\r
313                           increment = "1"\r
314                           length = "4"\r
315                           listener = "ActionListener"\r
316                           enable = "{@enable}"\r
317                           value = "{@save-every}">\r
318           <actionPerformed choose="save-every">\r
319             <xsl:call-template name="context"/>\r
320           </actionPerformed>\r
321         </NumericalSpinner>\r
322         <Label gridx="3" gridy="1" weightx="0" anchor="west" text=" minutes " enable="{@enable}"/>\r
323         <Panel gridx="4" gridy="1" gridheight="1" fill="both"/>\r
324       </Grid>\r
325     </Title>\r
326     <VSpace height="10"/>\r
327     <Title text="Close options">\r
328       <Checkbox checked="{@automatic-delete}" selected-value="true" unselected-value="false" listener="ActionListener" text="Delete automatically saved files" enable="{@enable}">\r
329         <actionPerformed choose="automatic-delete">\r
330           <xsl:call-template name="context"/>\r
331         </actionPerformed>\r
332       </Checkbox>\r
333     </Title>\r
334     <VSpace height="10"/>\r
335     <Title text="Filename">\r
336       <Grid>\r
337         <Radiobutton value="{@append-filename}" expected-value="true" listener="ActionListener" text="Append filename with: " gridx="1" gridy="1" fill="none" weightx="0" anchor="west" enable="{@enable}">\r
338           <actionPerformed choose="append-filename">\r
339             <xsl:call-template name="context"/>\r
340           </actionPerformed>\r
341         </Radiobutton>\r
342         <Panel gridx="2" gridy="1" gridheight="1" fill="both"/>\r
343         <Entry gridx="3" gridy="1" weightx="1" anchor="above_baseline"\r
344                listener="EntryListener"\r
345                text="{@append-with}">\r
346           <xsl:attribute name="enable">\r
347             <xsl:if test="@enable='true' and @append-filename='true'">\r
348               <xsl:text>true</xsl:text>\r
349             </xsl:if>\r
350           </xsl:attribute>\r
351           <entryChanged choose="append-with">\r
352             <xsl:call-template name="context"/>\r
353           </entryChanged>\r
354         </Entry>\r
355         <Radiobutton value="{@append-filename}" expected-value="false" listener="ActionListener" text="Replace extension with: " gridx="1" gridy="2" fill="none" weightx="0" anchor="west" enable="{@enable}">\r
356           <actionPerformed choose="append-filename">\r
357             <xsl:call-template name="context"/>\r
358           </actionPerformed>\r
359         </Radiobutton>\r
360         <Entry gridx="3" gridy="2" weightx="1" anchor="above_baseline"\r
361                listener="EntryListener"\r
362                text="{@replace-with}">\r
363           <xsl:attribute name="enable">\r
364             <xsl:if test="@enable='true' and @append-filename='false'">\r
365               <xsl:text>true</xsl:text>\r
366             </xsl:if>\r
367           </xsl:attribute>\r
368           <entryChanged choose="replace-with">\r
369             <xsl:call-template name="context"/>\r
370           </entryChanged>\r
371         </Entry>\r
372       </Grid>\r
373     </Title>\r
374     <VSpace height="10"/>\r
375     <Title text="Location">\r
376       <Grid>\r
377         <Radiobutton value="{@source-flag}" expected-value="true" listener="ActionListener" text="Source file directory" gridx="1" gridy="1" fill="none" weightx="0" anchor="west" enable="{@enable}">\r
378           <actionPerformed choose="source-flag">\r
379             <xsl:call-template name="context"/>\r
380           </actionPerformed>\r
381         </Radiobutton>\r
382         <Radiobutton value="{@source-flag}" expected-value="false" listener="ActionListener" text="Single directory" gridx="1" gridy="2" fill="none" weightx="0" anchor="west" enable="{@enable}">\r
383           <actionPerformed choose="source-flag">\r
384             <xsl:call-template name="context"/>\r
385           </actionPerformed>\r
386         </Radiobutton>\r
387         <Panel gridx="2" gridy="2" gridheight="1" fill="both"/>\r
388         <FileSelector gridx="3" gridy="2" href="{@single-directory}" mask="*"\r
389                       desc="Choose an autosave directory"\r
390                       dir-selection = "true"\r
391                       listener="EntryListener">\r
392           <xsl:attribute name="enable">\r
393             <xsl:if test="@enable='true' and @source-flag='false'">\r
394               <xsl:text>true</xsl:text>\r
395             </xsl:if>\r
396           </xsl:attribute>\r
397           <entryChanged choose="single-directory">\r
398             <xsl:call-template name="context"/>\r
399           </entryChanged>\r
400         </FileSelector>\r
401       </Grid>\r
402     </Title>\r
403   </xsl:template>\r
404 \r
405   <xsl:template match="scinotes-header">\r
406     <Title text="Default header">\r
407       <Grid>\r
408         <Checkbox checked="{@enable}" selected-value="true" unselected-value="false" listener="ActionListener" text="Add a default header to new file" gridx="1" gridy="1" fill="none" weightx="0" anchor="west">\r
409           <actionPerformed choose="enable">\r
410             <xsl:call-template name="context"/>\r
411           </actionPerformed>\r
412         </Checkbox>\r
413         <Panel gridx="2" gridy="1" gridheight="1" fill="both"/>\r
414         <TextArea gridx="1" gridy="2" weightx="1" gridwidth="2" weighty="0" anchor="west"\r
415                   editable="true"\r
416                   rows="15"\r
417                   scroll="true"\r
418                   listener="EntryListener"\r
419                   enable="{@enable}">\r
420           <xsl:attribute name="text">\r
421             <xsl:value-of select="string(child::node()[1])" disable-output-escaping="yes"/>\r
422           </xsl:attribute>\r
423           <entryChanged choose-child="1">\r
424             <xsl:call-template name="context"/>\r
425           </entryChanged>\r
426         </TextArea>\r
427       </Grid>\r
428       </Title>\r
429     </xsl:template> \r
430 </xsl:stylesheet>\r