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