0a21154d723b5acc801872706b7f1013a6678cb4
[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           <Select gridx="7" gridy="1" listener="ActionListener" enable="{@highlight-brackets}">\r
198             <actionPerformed choose="brackets-highlightment">\r
199               <xsl:call-template name="context"/>\r
200             </actionPerformed>\r
201             <option value="_(Filled)" key="Filled"/>\r
202             <option value="_(Framed)" key="Framed"/>\r
203             <option value="_(Underlined)" key="Underlined"/>\r
204           </Select>\r
205         </Grid>\r
206         <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
207           <actionPerformed choose="highlight-keywords">\r
208             <xsl:call-template name="context"/>\r
209           </actionPerformed>\r
210         </Checkbox>\r
211         <Grid gridx="1" gridy="5" gridwidth="3" ipadx="10">\r
212           <Label gridx="1" gridy="1" weightx="0" text="_(Color: )" enable="{@highlight-keywords}"/>\r
213           <Color color="{@keywords-color}" listener="ActionListener" gridx="2" gridy="1" weightx="0" enable="{@highlight-keywords}">\r
214             <actionPerformed choose="keywords-color">\r
215               <xsl:call-template name="context"/>\r
216             </actionPerformed>\r
217           </Color>\r
218           <Panel gridx="3" gridy="1" weightx="1"/>\r
219           <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
220             <actionPerformed choose="keywords-onmouseover">\r
221               <xsl:call-template name="context"/>\r
222             </actionPerformed>\r
223           </Checkbox>\r
224           <Panel gridx="5" gridy="1" weightx="1"/>\r
225           <Label gridx="6" gridy="1" weightx="0" text="_(Style: )" enable="{@highlight-keywords}"/>\r
226           <Select gridx="7" gridy="1" listener="ActionListener" enable="{@highlight-keywords}">\r
227             <actionPerformed choose="keywords-highlightment">\r
228               <xsl:call-template name="context"/>\r
229             </actionPerformed>\r
230             <option value="_(Filled)" key="Filled"/>\r
231             <option value="_(Framed)" key="Framed"/>\r
232           </Select>\r
233         </Grid>\r
234       </Grid>\r
235     </Title>\r
236     <VSpace height="10"/>\r
237     <Title text="_(Tabulation and Indentation)">\r
238       <Grid>\r
239         <Label text="_(Tabulation size: )" gridx="1" gridy="1" weightx="0"/>\r
240         <NumericalSpinner gridx="2"\r
241                           gridy="1"\r
242                           weightx="0"\r
243                           min-value = "1"\r
244                           increment = "1"\r
245                           length = "3"\r
246                           listener = "ActionListener"\r
247                           value = "{@tab-size}">\r
248           <actionPerformed choose="tab-size">\r
249             <xsl:call-template name="context"/>\r
250           </actionPerformed>\r
251         </NumericalSpinner>\r
252         <Panel gridx="3" gridy="1" weightx="1"/>\r
253         <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
254           <actionPerformed choose="use-spaces">\r
255             <xsl:call-template name="context"/>\r
256           </actionPerformed>\r
257         </Checkbox>\r
258 \r
259         <Label text="_(Representation: )" gridx="1" gridy="2" weightx="0"/>\r
260         <Radiobutton value="{@tab-representation}" expected-value="chevrons" listener="ActionListener" text="_(Chevrons)" gridx="2" gridy="2" fill="none" weightx="0" anchor="west" enable="true">\r
261           <actionPerformed choose="tab-representation">\r
262             <xsl:call-template name="context"/>\r
263           </actionPerformed>\r
264         </Radiobutton>\r
265         <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
266           <actionPerformed choose="tab-representation">\r
267             <xsl:call-template name="context"/>\r
268           </actionPerformed>\r
269         </Radiobutton>\r
270         <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
271           <actionPerformed choose="tab-representation">\r
272             <xsl:call-template name="context"/>\r
273           </actionPerformed>\r
274         </Radiobutton>\r
275 \r
276         <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
277           <actionPerformed choose="use-spaces">\r
278             <xsl:call-template name="context"/>\r
279           </actionPerformed>\r
280         </Checkbox>\r
281         <Label gridy="4" text="_(Indent size: )"/>\r
282         <Panel gridy="4" gridx="2" >\r
283           <xsl:call-template name="Select">\r
284             <xsl:with-param name="among">\r
285               <option indent-size="2"/>\r
286               <option indent-size="4"/>\r
287               <option indent-size="8"/>\r
288             </xsl:with-param>\r
289           </xsl:call-template>\r
290         </Panel>\r
291       </Grid>\r
292     </Title>\r
293   </xsl:template>\r
294 \r
295   <xsl:template match="scinotes-autosave">\r
296     <Checkbox checked="{@enable}" selected-value="true" unselected-value="false" listener="ActionListener" text="_(Enable autosave in Scinotes)">\r
297       <actionPerformed choose="enable">\r
298         <xsl:call-template name="context"/>\r
299       </actionPerformed>\r
300     </Checkbox>\r
301     <VSpace height="10"/>\r
302     <Title text="_(Save options)">\r
303       <Grid>\r
304         <Label gridx="1" gridy="1" weightx="0" anchor="west" text="_(Save every )" enable="{@enable}"/>\r
305         <NumericalSpinner gridx="2"\r
306                           gridy="1"\r
307                           weightx="0"\r
308                           min-value = "1"\r
309                           increment = "1"\r
310                           length = "4"\r
311                           listener = "ActionListener"\r
312                           enable = "{@enable}"\r
313                           value = "{@save-every}">\r
314           <actionPerformed choose="save-every">\r
315             <xsl:call-template name="context"/>\r
316           </actionPerformed>\r
317         </NumericalSpinner>\r
318         <Label gridx="3" gridy="1" weightx="0" anchor="west" text="_( minutes )" enable="{@enable}"/>\r
319         <Panel gridx="4" gridy="1" gridheight="1" fill="both"/>\r
320       </Grid>\r
321     </Title>\r
322     <VSpace height="10"/>\r
323     <Title text="_(Close options)">\r
324       <Checkbox checked="{@automatic-delete}" selected-value="true" unselected-value="false" listener="ActionListener" text="_(Delete automatically saved files)" enable="{@enable}">\r
325         <actionPerformed choose="automatic-delete">\r
326           <xsl:call-template name="context"/>\r
327         </actionPerformed>\r
328       </Checkbox>\r
329     </Title>\r
330     <VSpace height="10"/>\r
331     <Title text="_(Filename)">\r
332       <Grid>\r
333         <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
334           <actionPerformed choose="append-filename">\r
335             <xsl:call-template name="context"/>\r
336           </actionPerformed>\r
337         </Radiobutton>\r
338         <Panel gridx="2" gridy="1" gridheight="1" fill="both"/>\r
339         <Entry gridx="3" gridy="1" weightx="1" anchor="above_baseline"\r
340                listener="EntryListener"\r
341                text="{@append-with}">\r
342           <xsl:attribute name="enable">\r
343             <xsl:if test="@enable='true' and @append-filename='true'">\r
344               <xsl:text>true</xsl:text>\r
345             </xsl:if>\r
346           </xsl:attribute>\r
347           <entryChanged choose="append-with">\r
348             <xsl:call-template name="context"/>\r
349           </entryChanged>\r
350         </Entry>\r
351         <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
352           <actionPerformed choose="append-filename">\r
353             <xsl:call-template name="context"/>\r
354           </actionPerformed>\r
355         </Radiobutton>\r
356         <Entry gridx="3" gridy="2" weightx="1" anchor="above_baseline"\r
357                listener="EntryListener"\r
358                text="{@replace-with}">\r
359           <xsl:attribute name="enable">\r
360             <xsl:if test="@enable='true' and @append-filename='false'">\r
361               <xsl:text>true</xsl:text>\r
362             </xsl:if>\r
363           </xsl:attribute>\r
364           <entryChanged choose="replace-with">\r
365             <xsl:call-template name="context"/>\r
366           </entryChanged>\r
367         </Entry>\r
368       </Grid>\r
369     </Title>\r
370     <VSpace height="10"/>\r
371     <Title text="_(Location)">\r
372       <Grid>\r
373         <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
374           <actionPerformed choose="source-flag">\r
375             <xsl:call-template name="context"/>\r
376           </actionPerformed>\r
377         </Radiobutton>\r
378         <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
379           <actionPerformed choose="source-flag">\r
380             <xsl:call-template name="context"/>\r
381           </actionPerformed>\r
382         </Radiobutton>\r
383         <Panel gridx="2" gridy="2" gridheight="1" fill="both"/>\r
384         <FileSelector gridx="3" gridy="2" href="{@single-directory}" mask="*"\r
385                       desc="_(Choose an autosave directory)"\r
386                       dir-selection = "true"\r
387                       listener="EntryListener">\r
388           <xsl:attribute name="enable">\r
389             <xsl:if test="@enable='true' and @source-flag='false'">\r
390               <xsl:text>true</xsl:text>\r
391             </xsl:if>\r
392           </xsl:attribute>\r
393           <entryChanged choose="single-directory">\r
394             <xsl:call-template name="context"/>\r
395           </entryChanged>\r
396         </FileSelector>\r
397       </Grid>\r
398     </Title>\r
399   </xsl:template>\r
400 \r
401   <xsl:template match="scinotes-header">\r
402     <Title text="_(Default header)">\r
403       <Grid>\r
404         <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
405           <actionPerformed choose="enable">\r
406             <xsl:call-template name="context"/>\r
407           </actionPerformed>\r
408         </Checkbox>\r
409         <Panel gridx="2" gridy="1" gridheight="1" fill="both"/>\r
410         <TextArea gridx="1" gridy="2" weightx="1" gridwidth="2" weighty="0" anchor="west"\r
411                   editable="true"\r
412                   rows="15"\r
413                   scroll="true"\r
414                   listener="EntryListener"\r
415                   enable="{@enable}">\r
416           <xsl:attribute name="text">\r
417             <xsl:value-of select="string(child::node()[1])" disable-output-escaping="yes"/>\r
418           </xsl:attribute>\r
419           <entryChanged choose-child="1">\r
420             <xsl:call-template name="context"/>\r
421           </entryChanged>\r
422         </TextArea>\r
423       </Grid>\r
424       </Title>\r
425     </xsl:template> \r
426 </xsl:stylesheet>\r