Prefs: split the preference files in each module 56/6356/2
Calixte DENIZET [Tue, 21 Feb 2012 20:57:18 +0000 (21:57 +0100)]
Change-Id: I64e0236713bd71d3fb57fde821015c624ddccac3

24 files changed:
scilab/modules/commons/etc/XConfiguration-general.xsl [moved from scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-general.xsl with 100% similarity]
scilab/modules/console/etc/XConfiguration-console.xml [new file with mode: 0644]
scilab/modules/console/etc/XConfiguration-console.xsl [moved from scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-console.xsl with 100% similarity]
scilab/modules/console/etc/XConfiguration-general.xml [new file with mode: 0644]
scilab/modules/console/etc/XConfiguration-general.xsl [new file with mode: 0644]
scilab/modules/gui/etc/XConfiguration-colors.xml [new file with mode: 0644]
scilab/modules/gui/etc/XConfiguration-colors.xsl [moved from scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-colors.xsl with 100% similarity]
scilab/modules/gui/etc/XConfiguration-font.xml [new file with mode: 0644]
scilab/modules/gui/etc/XConfiguration-font.xsl [moved from scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-font.xsl with 100% similarity]
scilab/modules/gui/etc/XConfiguration-toolbars.xml [new file with mode: 0644]
scilab/modules/gui/etc/XConfiguration-toolbars.xsl [new file with mode: 0644]
scilab/modules/history_manager/etc/XConfiguration-history.xml [new file with mode: 0644]
scilab/modules/history_manager/etc/XConfiguration-history.xsl [moved from scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-history.xsl with 100% similarity]
scilab/modules/preferences/etc/XConfiguration.xml
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XCommonManager.java
scilab/modules/preferences/src/java/org/scilab/modules/preferences/XConfigManager.java
scilab/modules/preferences/src/xslt/XConfiguration.xsl
scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-toolbars.xsl [deleted file]
scilab/modules/scinotes/etc/XConfiguration-scinotes.xml [new file with mode: 0644]
scilab/modules/scinotes/etc/XConfiguration-scinotes.xsl [moved from scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-scinotes.xsl with 100% similarity]
scilab/modules/ui_data/etc/XConfiguration-variables.xml [new file with mode: 0644]
scilab/modules/ui_data/etc/XConfiguration-variables.xsl [moved from scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-variables.xsl with 100% similarity]
scilab/modules/xcos/etc/XConfiguration-xcos.xml [new file with mode: 0644]
scilab/modules/xcos/etc/XConfiguration-xcos.xsl [moved from scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-xcos.xsl with 100% similarity]

diff --git a/scilab/modules/console/etc/XConfiguration-console.xml b/scilab/modules/console/etc/XConfiguration-console.xml
new file mode 100644 (file)
index 0000000..8b2a6eb
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<console>
+  <body>
+    <display wrap-lines="true" lines-to-display="100" columns-to-display="100" tab-size="4" scroll-size="3000"/>
+    <accessibility/>
+  </body>
+</console>
\ No newline at end of file
diff --git a/scilab/modules/console/etc/XConfiguration-general.xml b/scilab/modules/console/etc/XConfiguration-general.xml
new file mode 100644 (file)
index 0000000..a278a82
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<general>
+  <body>
+    <environment floating-point-exception="Produces a warning" printing-format="long" width="10"/>
+    <java-heap-memory heap-size="128"/>
+  </body>
+  <confirmation-dialogs>
+    <body>
+      <tools order="ascending">
+        <tool state="checked" name="Scinotes" description="Prompt"/>
+        <tool state="unchecked" name="Console" description="Warn before clearing the Console"/>
+        <tool state="checked" name="Command History" description="Warn before deleting Command History items"/>
+      </tools>
+    </body>
+  </confirmation-dialogs>
+  <shortcuts>
+    <body>
+      <actions active="scilab" browse="--choose a file --" filter="">
+        <action-folder name="Console" state="open">
+          <action ctrl="E" description="Execute..."/>
+          <action ctrl="N" description="New..."/>
+          <action ctrl="O" description="Open a file"/>
+        </action-folder>
+        <action-folder name="Scinotes" state="close">
+          <action ctrl="A" description="Abort..."/>
+          <action ctrl="B" description="Battle"/>
+          <action ctrl="C" description="Copy"/>
+          <action ctrl="D" description="Delete"/>
+          <action ctrl="E" description="Erase..."/>
+          <action ctrl="F" description="Flush"/>
+          <action ctrl="G" description="Giggle..."/>
+          <action ctrl="H" description="Help"/>
+          <action ctrl="I" description="Ignite"/>
+        </action-folder>
+      </actions>
+    </body>
+  </shortcuts>
+</general>
\ No newline at end of file
diff --git a/scilab/modules/console/etc/XConfiguration-general.xsl b/scilab/modules/console/etc/XConfiguration-general.xsl
new file mode 100644 (file)
index 0000000..8afa52c
--- /dev/null
@@ -0,0 +1,271 @@
+<?xml version='1.0' encoding='utf-8'?>\r
+<xsl:stylesheet version ="1.0"\r
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
+                ><!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\r
+                      ::\r
+                      ::     M A I N   P A N E L :   G E N E R A L\r
+                      ::\r
+                 -->\r
+  <xsl:template match="environment" mode="tooltip">Settings environment</xsl:template>\r
+  <xsl:template match="environment">\r
+    <Title text="Environment">\r
+      <Grid>\r
+        <Label gridx="1" gridy="1" weightx="0" text="Floating point exception: "/>\r
+       <Panel gridx="2" gridy="1" weightx="1"/>\r
+        <Panel gridx="3" gridy="1" weightx="0">\r
+          <xsl:call-template name="Select">\r
+            <xsl:with-param name="among">\r
+              <option floating-point-exception="Produces an error"/>\r
+              <option floating-point-exception="Produces a warning"/>\r
+              <option floating-point-exception="Produces Inf or Nan"/>\r
+            </xsl:with-param>\r
+          </xsl:call-template>\r
+        </Panel>\r
+        <Label gridx="1" gridy="2" weightx="0" text="Printing format: "/>\r
+       <Panel gridx="2" gridy="2" weightx="1"/>\r
+        <Panel gridx="3" gridy="2" weightx="0">\r
+          <xsl:call-template name="Select">\r
+            <xsl:with-param name="among">\r
+              <option printing-format="short"/>\r
+              <option printing-format="long"/>\r
+              <option printing-format="short e"/>\r
+              <option printing-format="long e"/>\r
+              <option printing-format="short g"/>\r
+              <option printing-format="long g"/>\r
+              <option printing-format="variable format"/>\r
+            </xsl:with-param>\r
+          </xsl:call-template>\r
+        </Panel>\r
+        <Label gridx="1" gridy="3" weightx="0" text="Width: "/>\r
+       <Panel gridx="2" gridy="3" weightx="1"/>\r
+        <NumericalSpinner gridx="3"\r
+                          gridy="3"\r
+                         weightx="0"\r
+                          min-value = "1"\r
+                          increment = "1"\r
+                          length = "3"\r
+                          listener = "ActionListener"\r
+                          value = "{@width}">\r
+          <actionPerformed choose="width">\r
+            <xsl:call-template name="context"/>\r
+          </actionPerformed>\r
+        </NumericalSpinner>\r
+      </Grid>\r
+    </Title>\r
+  </xsl:template>\r
+\r
+  <xsl:template match="java-heap-memory" mode="tooltip"> and java heap size.</xsl:template>\r
+  <xsl:template match="java-heap-memory">\r
+    <VSpace height="25"/>\r
+    <Title text="Java Heap Memory">\r
+      <Grid>\r
+        <Label text="Select the memory (in MB) available in Java: " gridx="1" gridy="1" anchor="baseline" weightx="0"/>\r
+       <Panel gridx="2" gridy="1" weightx="1"/>\r
+        <NumericalSpinner min-value = "128"\r
+                          increment = "128"\r
+                          length = "6"\r
+                          listener = "ActionListener"\r
+                          value = "{@heap-size}"\r
+                         gridx="3" gridy="1" anchor="baseline" weightx="0">\r
+          <actionPerformed choose="heap-size">\r
+            <xsl:call-template name="context"/>\r
+          </actionPerformed>\r
+        </NumericalSpinner>\r
+      </Grid>\r
+    </Title>\r
+\r
+  </xsl:template>\r
+\r
+  <xsl:template match="tools">\r
+    <VBox>\r
+      <VSpace height="1"/>\r
+      <HBox>\r
+        <HSpace width="200"/>\r
+        <VBox>\r
+          <HBox>&lt;HTML&gt;&lt;I&gt;The following dialog boxes\r
+          require user confirmation.\r
+          </HBox>\r
+          <HBox>&lt;HTML&gt;&lt;I&gt;Select a check\r
+          box if you want that dialog box to appear.\r
+          </HBox>\r
+        </VBox>\r
+      </HBox>\r
+\r
+      <Title text="Confirmation dialogs">\r
+        <Grid>\r
+          <Label gridy="1" gridx="1" text="&lt;HTML&gt;&lt;B&gt;Dialog box description"/>\r
+          <Label gridy="1" gridx="2" text="&lt;HTML&gt;&lt;B&gt;Tool"/>\r
+          <Icon  gridy="1" gridx="3" listener="MouseListener">\r
+            <xsl:attribute name="src">\r
+              <xsl:choose>\r
+                <xsl:when test="@order='ascending'">\r
+                  <xsl:text>go-up.png</xsl:text>\r
+                </xsl:when>\r
+                <xsl:otherwise>\r
+                  <xsl:text>go-down.png</xsl:text>\r
+                </xsl:otherwise>\r
+              </xsl:choose>\r
+            </xsl:attribute>\r
+            <mouseClicked set="order">\r
+              <xsl:attribute name="value">\r
+                <xsl:choose>\r
+                  <xsl:when test="@order='ascending'">\r
+                    <xsl:text>descending</xsl:text>\r
+                  </xsl:when>\r
+                  <xsl:otherwise>\r
+                    <xsl:text>ascending</xsl:text>\r
+                  </xsl:otherwise>\r
+                </xsl:choose>\r
+              </xsl:attribute>\r
+              <xsl:call-template name="context"/>\r
+            </mouseClicked>\r
+          </Icon>\r
+          <xsl:for-each select="tool">\r
+            <xsl:sort order="{@order}" select="@name"/>\r
+            <Checkbox\r
+                gridy    = "{position() + 1}"\r
+                gridx    = "1"\r
+                listener = "ActionListener"\r
+                checked  = "{@state}"\r
+                text     = "{@description}"\r
+                >\r
+              <actionPerformed choose="state">\r
+                <xsl:call-template name="context"/>\r
+              </actionPerformed>\r
+            </Checkbox>\r
+            <Label\r
+                gridy    = "{position() + 1}"\r
+                gridx    = "2"\r
+                text     = "{@name}"/>\r
+          </xsl:for-each>\r
+        </Grid>\r
+      </Title>\r
+      <Glue/>\r
+      <HBox>\r
+        <Glue/>\r
+        <Button text="Select All" listener="ActionListener">\r
+          <xsl:for-each select="tool">\r
+            <actionPerformed set="state" value="checked">\r
+              <xsl:call-template name="context"/>\r
+            </actionPerformed>\r
+          </xsl:for-each>\r
+        </Button>\r
+        <Glue/>\r
+        <Button text="Clear All" listener="ActionListener">\r
+          <xsl:for-each select="tool">\r
+            <actionPerformed set="state" value="unchecked">\r
+              <xsl:call-template name="context"/>\r
+            </actionPerformed>\r
+          </xsl:for-each>\r
+        </Button>\r
+        <Glue/>\r
+      </HBox>\r
+    </VBox>\r
+  </xsl:template>\r
+\r
+  <xsl:template match="actions">\r
+    <Grid>\r
+      <Label gridy="1" gridx="1" text="Active settings: "/>\r
+      <Panel gridy="1" gridx="2">\r
+        <xsl:call-template name="Select">\r
+          <xsl:with-param name="among">\r
+            <option active="scilab"/>\r
+            <option active="emacs"/>\r
+            <option active="browse..."/>\r
+          </xsl:with-param>\r
+        </xsl:call-template>\r
+      </Panel>\r
+      <File gridy="2" gridx="1" gridwidth="2" href="{@browse}" mask="*.xml" desc="Choose a shortcut description file" listener="ActionListener">\r
+        <xsl:if test="not(@active='browse...')">\r
+          <xsl:attribute name="enable">false</xsl:attribute>\r
+        </xsl:if>\r
+        <actionPerformed choose="browse">\r
+          <xsl:call-template name="context"/>\r
+        </actionPerformed>\r
+      </File>\r
+      <Label gridy="3" gridx="1" gridwidth="2" text="Strike return to search by action name or shortcut:"/>\r
+      <Entry gridy="4" gridx="1" gridwidth="2" text="{@filter}" listener="ActionListener">\r
+        <actionPerformed choose="filter">\r
+          <xsl:call-template name="context"/>\r
+        </actionPerformed>\r
+      </Entry>\r
+    </Grid>\r
+    <Title background="#ffffff" text="General shortcuts preferences">\r
+      <VBox>\r
+        <xsl:variable name="filtered-actions"\r
+                      select="action-folder/action[contains(\r
+                              translate(\r
+                              concat(@description,@ctrl),\r
+                              'abcdefghijklmnopqrstuvwxyz',\r
+                              'ABCDEFGHIJKLMNOPQRSTUVWXYZ'),\r
+                              translate(current()/@filter,\r
+                              'abcdefghijklmnopqrstuvwxyz',\r
+                              'ABCDEFGHIJKLMNOPQRSTUVWXYZ')\r
+                              )]"/>\r
+        <xsl:variable name="filtered-folder"\r
+                      select="action-folder[action [@description=$filtered-actions/@description][@ctrl=$filtered-actions/@ctrl]]"/>\r
+        <HBox>&lt;HTML&gt;&lt;B&gt;Action name\r
+        <Glue/>\r
+        <Label halign="right" text="&lt;HTML&gt;&lt;B&gt;Shortcut"/>\r
+        </HBox>\r
+        <VBox width="200" height="300">\r
+          <Scroll>\r
+            <Grid >\r
+              <VBox anchor="north">\r
+                <xsl:for-each select="$filtered-folder">\r
+                  <HBox>\r
+                    <Icon listener="MouseListener">\r
+                      <xsl:attribute name="src">\r
+                        <xsl:choose>\r
+                          <xsl:when test="@state='close'">\r
+                            <xsl:text>list-add.png</xsl:text>\r
+                          </xsl:when>\r
+                          <xsl:otherwise>\r
+                            <xsl:text>list-remove.png</xsl:text>\r
+                          </xsl:otherwise>\r
+                        </xsl:choose>\r
+                      </xsl:attribute>\r
+                      <mouseClicked set="state">\r
+                        <xsl:attribute name="value">\r
+                          <xsl:choose>\r
+                            <xsl:when test="@state='close'">\r
+                              <xsl:text>open</xsl:text>\r
+                            </xsl:when>\r
+                            <xsl:otherwise>\r
+                              <xsl:text>close</xsl:text>\r
+                            </xsl:otherwise>\r
+                          </xsl:choose>\r
+                        </xsl:attribute>\r
+                        <xsl:call-template name="context"/>\r
+                      </mouseClicked>\r
+                    </Icon>\r
+                    <Label text="  {@name}"/>\r
+                    <Glue/>\r
+                  </HBox>\r
+                  <xsl:if test="@state='open'">\r
+                    <xsl:for-each select="action[@description=$filtered-actions/@description][@ctrl=$filtered-actions/@ctrl]">\r
+                      <HBox>\r
+                        <HSpace width="30"/>\r
+                        <Label text="{@description}"/>\r
+                        <Glue/>\r
+                        <Label font-family="Courier 10 Pitch" text="{concat('CTRL + ', @ctrl)}"/>\r
+                      </HBox>\r
+                    </xsl:for-each>\r
+                  </xsl:if>\r
+                </xsl:for-each>\r
+              </VBox>\r
+            </Grid>\r
+          </Scroll>\r
+        </VBox>\r
+\r
+      </VBox>\r
+    </Title>\r
+    <HBox>\r
+      <Button text="Restore defaults"/>\r
+      <Glue/>\r
+    </HBox>\r
+    <Glue/>\r
+  </xsl:template>\r
+\r
+</xsl:stylesheet>\r
+\r
diff --git a/scilab/modules/gui/etc/XConfiguration-colors.xml b/scilab/modules/gui/etc/XConfiguration-colors.xml
new file mode 100644 (file)
index 0000000..f8732e4
--- /dev/null
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<colors>
+  <body>
+    <desktop-colors use-system-color="true" text="#000000" background="#ffffff" cursor="#000000"/>
+    <syntax-highlighting-colors name="Default">
+      <item name="Default" color="#000000" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="Special" color="#FFAA00" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="Operator" color="#5C5C5C" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="Primitive" color="#32B9B9" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="Macro" color="#AE5CB0" bold="false" italic="false" underline="true" strike-through="false"/>
+      <item name="MacroInFile" color="#000000" bold="false" italic="false" underline="true" strike-through="false"/>
+      <item name="String" color="#BC8F8F" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="ExternalVariable" color="#FF0000" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="InputOutputArgs" color="#834310" bold="true" italic="false" underline="false" strike-through="false"/>
+      <item name="Identifier" color="#000000" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="Comment" color="#64AE64" bold="false" italic="true" underline="false" strike-through="false"/>
+      <item name="Field" color="#AAAAAA" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="FunctionKwd" color="#B01813" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="Url" color="#0000FF" bold="false" italic="false" underline="true" strike-through="false"/>
+      <item name="Mail" color="#0000FF" bold="false" italic="false" underline="true" strike-through="false"/>
+      <item name="Number" color="#BC8F8F" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="Control" color="#5F9EA0" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="Structure" color="#A020F0" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="Constantes" color="#DA70D6" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="White" color="#DCDCDC" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="WhiteInComment" color="#90F790" bold="false" italic="true" underline="false" strike-through="false"/>
+      <item name="WhiteInString" color="#E9B1B1" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="Tabulation" color="#DCDCDC" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="TabulationInComment" color="#90F790" bold="false" italic="true" underline="false" strike-through="false"/>
+      <item name="TabulationInString" color="#E9B1B1" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="LaTeXInComment" color="#8B2252" bold="false" italic="false" underline="false" strike-through="false"/>
+      <item name="OpenClose" color="#4A55DB" bold="false" italic="false" underline="false" strike-through="false"/>
+    </syntax-highlighting-colors>
+  </body>
+</colors>
\ No newline at end of file
diff --git a/scilab/modules/gui/etc/XConfiguration-font.xml b/scilab/modules/gui/etc/XConfiguration-font.xml
new file mode 100644 (file)
index 0000000..94344ec
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<fonts>
+  <body>
+    <fonts item="Console" system="true" font-name="Monospaced" font-face="plain" font-size="10">
+      <item name="Console" desktop="false" font-name="Monospaced" font-face="plain" font-size="10"/>
+      <item name="Command History" desktop="true" font-name="Monospaced" font-face="plain" font-size="10"/>
+      <item name="Variable Browser" desktop="true" font-name="Monospaced" font-face="plain" font-size="10"/>
+      <item name="Help" desktop="true" font-name="Monospaced" font-face="plain" font-size="10"/>
+      <item name="Scinotes" desktop="true" font-name="Monospaced" font-face="plain" font-size="10"/>
+      <item name="Variables Editor" desktop="true" font-name="Monospaced" font-face="plain" font-size="10"/>
+    </fonts>
+  </body>
+</fonts>
\ No newline at end of file
diff --git a/scilab/modules/gui/etc/XConfiguration-toolbars.xml b/scilab/modules/gui/etc/XConfiguration-toolbars.xml
new file mode 100644 (file)
index 0000000..9165748
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<toolbar>
+  <body>
+    <toolbars select="scilab">
+      <toolbar title="scilab" position="1" selection="0">
+        <item title="Cut"/>
+        <separator/>
+        <item title="Paste"/>
+      </toolbar>
+      <toolbar title="scinotes" position="2" selection="2">
+        <item title="Cut"/>
+        <separator/>
+        <item title="Copy"/>
+      </toolbar>
+    </toolbars>
+  </body>
+</toolbar>
\ No newline at end of file
diff --git a/scilab/modules/gui/etc/XConfiguration-toolbars.xsl b/scilab/modules/gui/etc/XConfiguration-toolbars.xsl
new file mode 100644 (file)
index 0000000..ef3a6d7
--- /dev/null
@@ -0,0 +1,155 @@
+<?xml version='1.0' encoding='utf-8'?>
+<xsl:stylesheet version ="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+  <xsl:template match="toolbars">
+    <xsl:variable name="select" select="@select"/>
+    <Title text="Choose toolbar">
+      <Select listener="ActionListener">
+        <actionPerformed choose="select">
+          <xsl:call-template name="context"/>
+        </actionPerformed>
+        <xsl:for-each select="$toolbars/toolbar">
+          <option value="{@title}">
+            <xsl:if test="@title=$select">
+              <xsl:attribute name="selected">selected</xsl:attribute>
+            </xsl:if>
+          </option>
+        </xsl:for-each>
+      </Select>
+    </Title>
+    <xsl:for-each select="toolbar[@title=$select]">
+      <xsl:variable name="context"><xsl:call-template name="here"/></xsl:variable>
+      <xsl:variable name="reference" select="$toolbars/toolbar[ @title=$select]"/>
+      <xsl:variable name="sequence"  select="*"/>
+      <xsl:variable name="count"     select="count(*)"/>
+
+      <!-- reverse position to preserve position vs insertion
+      -->
+      <xsl:variable name="reversed-position">
+        <xsl:choose>
+          <xsl:when test="@position &gt; $count">
+            <xsl:text>1</xsl:text>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="1 + $count - @position"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:variable>
+
+      <!-- Tip to compare position to attribute value
+      -->
+      <xsl:variable name="comparable-position"><xsl:value-of select="$reversed-position"/></xsl:variable>
+      <xsl:variable name="comparable-selection"><xsl:value-of select="@selection"/></xsl:variable>
+      <xsl:variable name="selection" select="$reference/item[ format-number(position(),0)=$comparable-selection]"/>
+      <xsl:variable name="position" select="*[ format-number(position(),0)=$comparable-position]"/>
+      <!--/
+      -->
+
+      <Title refresh="{@title}" text="Proposed layout">
+        <HBox>
+          <Glue/>
+          <xsl:for-each select="*">
+            <VBox>
+              <xsl:choose>
+                <xsl:when test="format-number(position(),0)=$comparable-position">
+                  <xsl:attribute name="background">#aaaaff</xsl:attribute>
+                </xsl:when>
+              </xsl:choose>
+              <Label text=" " listener="MouseListener">
+                <mouseClicked set="position" value="{1 + $count - position()}" context="{$context}"/>
+              </Label>
+              <xsl:apply-templates select="." mode="button">
+                <xsl:with-param name="reference" select="$reference"/>
+                <xsl:with-param name="context"   select="$context"/>
+                <xsl:with-param name="position"  select="1 + $count - position()"/>
+              </xsl:apply-templates>
+            </VBox>
+          </xsl:for-each>
+          <VBox>
+            <xsl:choose>
+              <xsl:when test="format-number($count + 1,0)=$comparable-position">
+                <xsl:attribute name="background">#aaaaff</xsl:attribute>
+              </xsl:when>
+            </xsl:choose>
+            <Label text="    " listener="MouseListener">
+              <mouseClicked set="position" value="0" context="{$context}"/>
+            </Label>
+            <Label text="::::" listener="MouseListener">
+              <mouseClicked set="position" value="0" context="{$context}"/>
+            </Label>
+          </VBox>
+          <Glue/>
+          <Label text=""/> <!-- Workaround for proper deletion of glue -->
+        </HBox>
+      </Title>
+      <Title text="Use these buttons to move, delete or add separator.">
+        <Grid ipadx="5">
+          <Panel  gridx="1" gridheight="1" weightx="10"/>
+          <Button gridx="2" text="&lt;" enable="{@position &lt; $count}" listener="ActionListener">
+            <actionPerformed set="position" value="{@position + 1}" context="{$context}"/>
+          </Button>
+          <Button gridx="3" text="&gt;" enable="{@position &gt; 0}" listener="ActionListener">
+            <actionPerformed set="position" value="{@position - 1}" context="{$context}"/>
+          </Button>
+          <Button gridx="4" text="X" listener="ActionListener">
+            <xsl:if test="format-number($count + 1,0)=$comparable-position">
+              <xsl:attribute name="enable">false</xsl:attribute>
+            </xsl:if>
+            <actionPerformed delete="{$comparable-position}" context="{$context}"/>
+          </Button>
+          <Button gridx="5" text="|+" listener="ActionListener">
+            <actionPerformed insert="{$comparable-position}" context="{$context}">
+              <separator/>
+            </actionPerformed>
+          </Button>
+          <Panel gridx="6" gridheight="3" weightx="10"/>
+        </Grid>
+      </Title>
+      <Title refresh="{@title}" text="Action set for chosen toolbar">
+        <xsl:variable name="item" select="@item"/>
+        <Scroll>
+          <Grid>
+            <xsl:for-each select="$reference/*">
+              <xsl:variable name="checked" select="@title=$sequence/@title"/>
+              <Checkbox gridy="{position() + 1}" text="{@title}" listener="ActionListener">
+                <xsl:choose>
+                  <xsl:when test="$checked">
+                    <xsl:attribute name="checked">checked</xsl:attribute>
+                    <actionPerformed context="{$context}" delete="{1 + count($sequence[@title = current()/@title]/preceding-sibling::*)}"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:attribute name="checked">unchecked</xsl:attribute>
+                    <actionPerformed insert="{$comparable-position}" context="{$context}">
+                      <item title="{@title}"/>
+                    </actionPerformed>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </Checkbox>
+              <Icon gridy="{position() + 1}" gridx="2" src="{@icon}"/>
+            </xsl:for-each>
+          </Grid>
+        </Scroll>
+      </Title>
+    </xsl:for-each>
+  </xsl:template>
+
+  <xsl:template match="item" mode="button">
+    <xsl:param name="reference"/>
+    <xsl:param name="position"/>
+    <xsl:param name="context"/>
+    <Icon src="{$reference/item[@title = current()/@title]/@icon}" listener="MouseListener">
+      <mouseClicked set="position" value="{$position}" context="{$context}"/>
+    </Icon>
+  </xsl:template>
+
+  <xsl:template match="separator" mode="button">
+    <xsl:param name="count"/>
+    <xsl:param name="position"/>
+    <xsl:param name="context"/>
+    <Label text="|" listener="MouseListener">
+      <mouseClicked set="position" value="{$position}" context="{$context}"/>
+    </Label>
+  </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/scilab/modules/history_manager/etc/XConfiguration-history.xml b/scilab/modules/history_manager/etc/XConfiguration-history.xml
new file mode 100644 (file)
index 0000000..25ad2e6
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<command-history>
+  <body>
+    <history-save kind="quit" after="1"/>
+    <history-settings history-file="" history-lines="1000"/>
+  </body>
+</command-history>
index 4ca8419..9182ec5 100644 (file)
 <?xml version="1.0" encoding="utf-8"?>
 <interface path="1/" width="700" height="500">
-  <general>
-    <body>
-      <environment floating-point-exception="Produces a warning" printing-format="long" width="10"/>
-      <java-heap-memory heap-size="128"/>
-    </body>
-    <confirmation-dialogs>
-      <body>
-        <tools order="ascending">
-          <tool state="checked" name="Scinotes" description="Prompt"/>
-          <tool state="unchecked" name="Console" description="Warn before clearing the Console"/>
-          <tool state="checked" name="Command History" description="Warn before deleting Command History items"/>
-        </tools>
-      </body>
-    </confirmation-dialogs>
-    <shortcuts>
-      <body>
-        <actions active="scilab" browse="--choose a file --" filter="">
-          <action-folder name="Console" state="open">
-            <action ctrl="E" description="Execute..."/>
-            <action ctrl="N" description="New..."/>
-            <action ctrl="O" description="Open a file"/>
-          </action-folder>
-          <action-folder name="Scinotes" state="close">
-            <action ctrl="A" description="Abort..."/>
-            <action ctrl="B" description="Battle"/>
-            <action ctrl="C" description="Copy"/>
-            <action ctrl="D" description="Delete"/>
-            <action ctrl="E" description="Erase..."/>
-            <action ctrl="F" description="Flush"/>
-            <action ctrl="G" description="Giggle..."/>
-            <action ctrl="H" description="Help"/>
-            <action ctrl="I" description="Ignite"/>
-          </action-folder>
-        </actions>
-      </body>
-    </shortcuts>
-  </general>
-  <fonts>
-    <body>
-      <fonts item="Console" system="true" font-name="Monospaced" font-face="plain" font-size="10">
-        <item name="Console" desktop="false" font-name="Monospaced" font-face="plain" font-size="10"/>
-        <item name="Command History" desktop="true" font-name="Monospaced" font-face="plain" font-size="10"/>
-        <item name="Variable Browser" desktop="true" font-name="Monospaced" font-face="plain" font-size="10"/>
-        <item name="Help" desktop="true" font-name="Monospaced" font-face="plain" font-size="10"/>
-        <item name="Scinotes" desktop="true" font-name="Monospaced" font-face="plain" font-size="10"/>
-        <item name="Variables Editor" desktop="true" font-name="Monospaced" font-face="plain" font-size="10"/>
-      </fonts>
-    </body>
-  </fonts>
-  <colors>
-    <body>
-      <desktop-colors use-system-color="true" text="#000000" background="#ffffff" cursor="#000000"/>
-      <syntax-highlighting-colors name="Default">
-        <item name="Default" color="#000000" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="Special" color="#FFAA00" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="Operator" color="#5C5C5C" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="Primitive" color="#32B9B9" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="Macro" color="#AE5CB0" bold="false" italic="false" underline="true" strike-through="false"/>
-        <item name="MacroInFile" color="#000000" bold="false" italic="false" underline="true" strike-through="false"/>
-        <item name="String" color="#BC8F8F" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="ExternalVariable" color="#FF0000" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="InputOutputArgs" color="#834310" bold="true" italic="false" underline="false" strike-through="false"/>
-        <item name="Identifier" color="#000000" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="Comment" color="#64AE64" bold="false" italic="true" underline="false" strike-through="false"/>
-        <item name="Field" color="#AAAAAA" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="FunctionKwd" color="#B01813" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="Url" color="#0000FF" bold="false" italic="false" underline="true" strike-through="false"/>
-        <item name="Mail" color="#0000FF" bold="false" italic="false" underline="true" strike-through="false"/>
-        <item name="Number" color="#BC8F8F" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="Control" color="#5F9EA0" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="Structure" color="#A020F0" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="Constantes" color="#DA70D6" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="White" color="#DCDCDC" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="WhiteInComment" color="#90F790" bold="false" italic="true" underline="false" strike-through="false"/>
-        <item name="WhiteInString" color="#E9B1B1" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="Tabulation" color="#DCDCDC" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="TabulationInComment" color="#90F790" bold="false" italic="true" underline="false" strike-through="false"/>
-        <item name="TabulationInString" color="#E9B1B1" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="LaTeXInComment" color="#8B2252" bold="false" italic="false" underline="false" strike-through="false"/>
-        <item name="OpenClose" color="#4A55DB" bold="false" italic="false" underline="false" strike-through="false"/>
-      </syntax-highlighting-colors>
-    </body>
-  </colors>
-  <console>
-    <body>
-      <display wrap-lines="true" lines-to-display="100" columns-to-display="100" tab-size="4" scroll-size="3000"/>
-      <accessibility/>
-    </body>
-  </console>
-  <command-history>
-    <body>
-      <history-save kind="quit" after="1"/>
-      <history-settings history-file="" history-lines="1000"/>
-    </body>
-  </command-history>
-  <scinotes>
-    <body>
-      <scinotes-preferences restart-reopen="true" reload-unedited="true" add-line-termination="true" number-of-entries="5" encoding="utf-8" eol="Unix(LF)"/>
-    </body>
-    <display>
-      <body>
-        <scinotes-display highlight-current-line="true" current-line-color="#facade" show-line-numbers="true" wrap-lines="true"/>
-      </body>
-    </display>
-    <syntax>
-      <body>
-        <scinotes-syntax highlight="true" hightlight-brackets="true" tab-size="4" use-spaces="true" indent-size="4" automatic-indent="true"/>
-      </body>
-    </syntax>
-    <autosave>
-      <body>
-        <scinotes-autosave enable="true" save-every="5" save-untitled="true" automatic-delete="true" append-flag="true" append-with="~" replace-with="tmp" source-flag="true" single-directory=""/>
-      </body>
-    </autosave>
-  </scinotes>
-  <variables>
-    <body>
-      <variable-browser maximum-array-size="500000"/>
-      <variable-editor default-array-format="short" move-selection-after-enter="true" direction="Down" decimal-separator=","/>
-    </body>
-  </variables>
-  <xcos>
-    <body>
-      <xcos/>
-    </body>
-  </xcos>
-  <toolbar>
-    <body>
-      <toolbars select="scilab">
-        <toolbar title="scilab" position="1" selection="0">
-          <item title="Cut"/>
-          <separator/>
-          <item title="Paste"/>
-        </toolbar>
-        <toolbar title="scinotes" position="2" selection="2">
-          <item title="Cut"/>
-          <separator/>
-          <item title="Copy"/>
-        </toolbar>
-      </toolbars>
-    </body>
-  </toolbar>
+  <general/>
+  <fonts/>
+  <colors/>
+  <console/>
+  <command-history/>
+  <scinotes/>
+  <variables/>
+  <xcos/>
+  <toolbar/>
   <toolboxes/>
 </interface>
index a336df6..fe3f34f 100644 (file)
@@ -2,6 +2,7 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2011 - INRIA - Vincent COUVERT
  * Copyright (C) 2011 -         Pierre GRADIT
+ * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
  *
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
@@ -19,10 +20,15 @@ import java.awt.Container;
 import java.awt.Dimension;
 import java.awt.Frame;
 import java.io.File;
+import java.io.FilenameFilter;
+import java.io.FileFilter;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
 
@@ -49,6 +55,7 @@ import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
 import org.scilab.modules.localization.Messages;
@@ -118,6 +125,13 @@ public abstract class XCommonManager {
      */
     protected static Transformer transformer = null;
 
+    private static final String SCI = System.getenv("SCI");
+
+    /** Scilab configuration file.*/
+    private static final String SCILAB_CONFIG_FILE = SCI + "/modules/preferences/etc/XConfiguration.xml";
+
+    private static String XSLCODE;
+
     /**
      * Monitor time between calls.
      */
@@ -218,12 +232,117 @@ public abstract class XCommonManager {
         return swingComposite(topSwing, "");
     }
 
+    private static List<File> getEtcDir() {
+        List<File> list = new ArrayList<File>();
+        File modulesDir = new File(SCI + "/modules/");
+        File[] modules = modulesDir.listFiles(new FileFilter() {
+                public boolean accept(File f) {
+                    return f.isDirectory();
+                }
+            });
+
+        for (File module : modules) {
+            File etc = new File(module, "/etc/");
+            if (etc.exists() && etc.isDirectory()) {
+                list.add(etc);
+            }
+        }
+
+        return list;
+    }
+
+    /**
+     * Create a XSL string in using the XConfiguration-*.xsl found in SCI/modules/MODULE_NAME/etc/
+     * @return the buit XSL string.
+     */
+    protected static String createXSLFile() {
+        if (XSLCODE == null) {
+            List<File> etcs = getEtcDir();
+
+            StringBuilder buffer = new StringBuilder("<?xml version='1.0' encoding='utf-8'?>\n");
+            buffer.append("<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">\n");
+            buffer.append("<xsl:import href=\"").append(SCI).append("/modules/preferences/src/xslt/XConfiguration.xsl").append("\"/>\n");
+
+            for (File etc : etcs) {
+                File[] xsls = etc.listFiles(new FilenameFilter() {
+                        public boolean accept(File dir, String name) {
+                            return name.endsWith(".xsl") && name.startsWith("XConfiguration");
+                        }
+                    });
+                for (File xsl : xsls) {
+                    try {
+                        buffer.append("<xsl:import href=\"").append(xsl.getCanonicalPath()).append("\"/>\n");
+                    } catch (IOException e) {
+                        buffer.append("<xsl:import href=\"").append(xsl.getAbsolutePath()).append("\"/>\n");
+                    }
+                }
+            }
+            buffer.append("</xsl:stylesheet>");
+
+            XSLCODE = buffer.toString();
+        }
+
+        return XSLCODE;
+    }
+
+    /**
+     * Create a document in using the XConfiguration-*.xml found in SCI/modules/MODULE_NAME/etc/
+     * @return the built document
+     */
+    protected static Document createDocument() {
+        DocumentBuilder docBuilder;
+        DocumentBuilderFactory factory;
+        Document mainDoc;
+
+        try {
+            factory = ScilabDocumentBuilderFactory.newInstance();
+            docBuilder = factory.newDocumentBuilder();
+            mainDoc = docBuilder.parse(SCILAB_CONFIG_FILE);
+        } catch (ParserConfigurationException pce) {
+            System.err.println("Cannot create a XML DocumentBuilder:\n" + pce);
+            return null;
+        } catch (SAXException se) {
+            System.err.println("Weird... Cannot parse basic file:\n" + se);
+            return null;
+        } catch (IOException ioe) {
+            System.err.println("Weird... Cannot parse basic file:\n" + ioe);
+            return null;
+        }
+
+        Element root = mainDoc.getDocumentElement();
+
+        List<File> etcs = getEtcDir();
+        for (File etc : etcs) {
+            File[] xmls = etc.listFiles(new FilenameFilter() {
+                    public boolean accept(File dir, String name) {
+                        return name.endsWith(".xml") && name.startsWith("XConfiguration-");
+                    }
+                });
+            for (File xml : xmls) {
+                try {
+                    Document doc = docBuilder.parse(xml);
+                    Node node = mainDoc.importNode(doc.getDocumentElement(), true);
+                    NodeList list = root.getElementsByTagName(node.getNodeName());
+                    if (list.getLength() != 0) {
+                        root.replaceChild(node, list.item(0));
+                    }
+                } catch (SAXException se) {
+                    System.err.println(ERROR_READ + xml.getName());
+                } catch (IOException ioe) {
+                    System.err.println(ERROR_READ + xml.getName());
+                }
+            }
+        }
+
+        return mainDoc;
+    }
+
     /**
      * Load XSL as XSL Transformer.
      */
     protected static void reloadTransformer(String address) {
         try {
-            StreamSource source = new StreamSource(address);
+            StreamSource source = new StreamSource(new StringReader(createXSLFile()));
             transformer = factory.newTransformer(source);
         } catch (TransformerConfigurationException e1) {
             System.err.println(ERROR_READ + address);
@@ -601,15 +720,16 @@ public abstract class XCommonManager {
      * Read the file to modify
      */
     protected static Document readDocument(final String fileName) {
-        File xml = null;
+        File xml = new File(fileName);
+        if (!xml.exists()) {
+            return createDocument();
+        }
+
         DocumentBuilder docBuilder = null;
 
         try {
             DocumentBuilderFactory factory = ScilabDocumentBuilderFactory.newInstance();
             docBuilder = factory.newDocumentBuilder();
-
-            // lecture du contenu d'un fichier XML avec DOM
-            xml = new File(fileName);
             return docBuilder.parse(xml);
         } catch (ParserConfigurationException pce) {
             System.err.println(ERROR_READ + fileName);
@@ -624,7 +744,7 @@ public abstract class XCommonManager {
     /**
      * Save the modifications
      */
-    protected static void writeDocument(String filename,  Node written) {
+    protected static void writeDocument(String filename, Node written) {
         Transformer transformer = null;
         try {
             transformer = ScilabTransformerFactory.newInstance().newTransformer();
index 846d8ea..c3a1ae3 100644 (file)
@@ -108,7 +108,7 @@ public final class XConfigManager extends XCommonManager {
 
         // Let the show begin!
         if (refreshDisplay()) {
-           // Center the dialog on the parent window
+            // Center the dialog on the parent window
             Frame topWindow = XCommonManager.getTopLevel();
             int x = topWindow.getX() + (topWindow.getWidth() - dialog.getWidth()) / 2;
             int y = topWindow.getY() + (topWindow.getHeight() - dialog.getHeight()) / 2;
@@ -131,7 +131,6 @@ public final class XConfigManager extends XCommonManager {
     /** Read files to modify (and possibly create it).
      */
     private static void readUserDocuments() {
-        createUserCopy(SCILAB_CONFIG_FILE, USER_CONFIG_FILE);
         document = readDocument(USER_CONFIG_FILE);
         NodeList toolboxes = document.getElementsByTagName("toolboxes");
         if (toolboxes.getLength() != 1) {
@@ -246,7 +245,8 @@ public final class XConfigManager extends XCommonManager {
         }
         if (callback.equals("Default")) {
             reloadTransformer(SCILAB_CONFIG_XSL);
-            refreshUserCopy(SCILAB_CONFIG_FILE, USER_CONFIG_FILE);
+           document = createDocument();
+           writeDocument(USER_CONFIG_FILE, document);
             List<ToolboxInfos> infos = ScilabPreferences.getToolboxesInfos();
             for (int i=0; i<infos.size(); i++) {
                 ToolboxInfos info = infos.get(i);
index ff73e45..75dba3a 100644 (file)
@@ -1,20 +1,9 @@
 <?xml version='1.0' encoding='utf-8'?>\r
-<xsl:stylesheet\r
-    version ="1.0"\r
-    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\r
-    >\r
+<xsl:stylesheet version ="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">\r
 \r
   <xsl:import href="XCommon.xsl"/>\r
+  <xsl:import href="XCommon-toolbars.xsl"/>\r
   <xsl:import href="XGeneric.xsl"/>\r
-  <xsl:import href="XConfiguration/XConfiguration-general.xsl"/>\r
-  <xsl:import href="XConfiguration/XConfiguration-font.xsl"/>\r
-  <xsl:import href="XConfiguration/XConfiguration-colors.xsl"/>\r
-  <xsl:import href="XConfiguration/XConfiguration-console.xsl"/>\r
-  <xsl:import href="XConfiguration/XConfiguration-history.xsl"/>\r
-  <xsl:import href="XConfiguration/XConfiguration-scinotes.xsl"/>\r
-  <xsl:import href="XConfiguration/XConfiguration-variables.xsl"/>\r
-  <xsl:import href="XConfiguration/XConfiguration-xcos.xsl"/>\r
-  <xsl:import href="XConfiguration/XConfiguration-toolbars.xsl"/>\r
 \r
   <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =\r
        ::\r
diff --git a/scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-toolbars.xsl b/scilab/modules/preferences/src/xslt/XConfiguration/XConfiguration-toolbars.xsl
deleted file mode 100644 (file)
index 0c66e4e..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<xsl:stylesheet version ="1.0"
-       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
->
-
-       <xsl:import href="../XCommon-toolbars.xsl"/>
-
-       <xsl:template match="toolbars">
-               <xsl:variable name="select" select="@select"/>
-               <Title text="Choose toolbar">
-                                       <Select listener="ActionListener">
-                                               <actionPerformed choose="select">
-                                                       <xsl:call-template name="context"/>
-                                               </actionPerformed>
-                                               <xsl:for-each select="$toolbars/toolbar">
-                                                       <option value="{@title}">
-                                                               <xsl:if test="@title=$select">
-                                                                       <xsl:attribute name="selected">selected</xsl:attribute>
-                                                               </xsl:if>
-                                                       </option>                                               
-                                               </xsl:for-each>
-                                       </Select>
-               </Title>
-               <xsl:for-each select="toolbar[@title=$select]">
-                       <xsl:variable name="context"><xsl:call-template name="here"/></xsl:variable>
-                       <xsl:variable name="reference" select="$toolbars/toolbar[ @title=$select]"/>
-                       <xsl:variable name="sequence"  select="*"/>
-                       <xsl:variable name="count"     select="count(*)"/>
-
-                       <!-- reverse position to preserve position vs insertion
-                         -->
-                       <xsl:variable name="reversed-position">
-                               <xsl:choose>
-                                       <xsl:when test="@position &gt; $count">
-                                               <xsl:text>1</xsl:text>
-                                       </xsl:when>
-                                       <xsl:otherwise>
-                                               <xsl:value-of select="1 + $count - @position"/>
-                                       </xsl:otherwise>
-                               </xsl:choose>
-                       </xsl:variable>
-
-                       <!-- Tip to compare position to attribute value
-                         -->
-                       <xsl:variable name="comparable-position"><xsl:value-of select="$reversed-position"/></xsl:variable>
-                       <xsl:variable name="comparable-selection"><xsl:value-of select="@selection"/></xsl:variable>
-                       <xsl:variable name="selection" select="$reference/item[ format-number(position(),0)=$comparable-selection]"/>
-                       <xsl:variable name="position" select="*[ format-number(position(),0)=$comparable-position]"/>
-                       <!--/
-                         -->
-
-                       <Title refresh="{@title}" text="Proposed layout">
-                               <HBox>
-                                       <Glue/>
-                                       <xsl:for-each select="*">
-                                               <VBox>
-                                                       <xsl:choose>
-                                                               <xsl:when test="format-number(position(),0)=$comparable-position">
-                                                                       <xsl:attribute name="background">#aaaaff</xsl:attribute>
-                                                               </xsl:when>
-                                                       </xsl:choose>
-                                                       <Label text=" " listener="MouseListener">
-                                                               <mouseClicked set="position" value="{1 + $count - position()}" context="{$context}"/>
-                                                       </Label>
-                                                       <xsl:apply-templates select="." mode="button">
-                                                               <xsl:with-param name="reference" select="$reference"/>
-                                                               <xsl:with-param name="context"   select="$context"/>
-                                                               <xsl:with-param name="position"  select="1 + $count - position()"/>
-                                                       </xsl:apply-templates>
-                                               </VBox>
-                                       </xsl:for-each>
-                                       <VBox>
-                                               <xsl:choose>
-                                                       <xsl:when test="format-number($count + 1,0)=$comparable-position">
-                                                               <xsl:attribute name="background">#aaaaff</xsl:attribute>
-                                                       </xsl:when>
-                                               </xsl:choose>
-                                               <Label text="    " listener="MouseListener">
-                                                       <mouseClicked set="position" value="0" context="{$context}"/>
-                                               </Label>
-                                               <Label text="::::" listener="MouseListener">
-                                                       <mouseClicked set="position" value="0" context="{$context}"/>
-                                               </Label>
-                                       </VBox>
-                                       <Glue/>
-                                       <Label text=""/> <!-- Workaround for proper deletion of glue -->
-                               </HBox>
-                       </Title>
-                       <Title text="Use these buttons to move, delete or add separator.">
-                               <Grid ipadx="5">
-                                       <Panel  gridx="1" gridheight="1" weightx="10"/>
-                                       <Button gridx="2" text="&lt;" enable="{@position &lt; $count}" listener="ActionListener">
-                                               <actionPerformed set="position" value="{@position + 1}" context="{$context}"/>
-                                       </Button>
-                                       <Button gridx="3" text="&gt;" enable="{@position &gt; 0}" listener="ActionListener">
-                                               <actionPerformed set="position" value="{@position - 1}" context="{$context}"/>
-                                       </Button>
-                                       <Button gridx="4" text="X" listener="ActionListener">
-                                         <xsl:if test="format-number($count + 1,0)=$comparable-position">
-                                                       <xsl:attribute name="enable">false</xsl:attribute>
-                                               </xsl:if>
-                                               <actionPerformed delete="{$comparable-position}" context="{$context}"/>
-                                       </Button>
-                                       <Button gridx="5" text="|+" listener="ActionListener">
-                                               <actionPerformed insert="{$comparable-position}" context="{$context}">
-                                                       <separator/>
-                                               </actionPerformed>
-                                       </Button>
-                                       <Panel gridx="6" gridheight="3" weightx="10"/>
-                               </Grid>
-                       </Title>
-                       <Title refresh="{@title}" text="Action set for chosen toolbar">
-                               <xsl:variable name="item" select="@item"/>
-                               <Scroll>
-                                       <Grid>
-                                               <xsl:for-each select="$reference/*">
-                                                       <xsl:variable name="checked" select="@title=$sequence/@title"/>
-                                                       <Checkbox gridy="{position() + 1}" text="{@title}" listener="ActionListener">
-                                                                       <xsl:choose>
-                                                                               <xsl:when test="$checked">
-                                                                                       <xsl:attribute name="checked">checked</xsl:attribute> 
-                                                                                       <actionPerformed context="{$context}" delete="{1 + count($sequence[@title = current()/@title]/preceding-sibling::*)}"/>
-                                                                               </xsl:when>
-                                                                               <xsl:otherwise>
-                                                                                       <xsl:attribute name="checked">unchecked</xsl:attribute>
-                                                                                       <actionPerformed insert="{$comparable-position}" context="{$context}">
-                                                                                               <item title="{@title}"/>
-                                                                                       </actionPerformed>
-                                                                               </xsl:otherwise>
-                                                                       </xsl:choose>
-                                                       </Checkbox>
-                                                       <Icon gridy="{position() + 1}" gridx="2" src="{@icon}"/>
-                                               </xsl:for-each>
-                                       </Grid>
-                               </Scroll>
-                       </Title>
-               </xsl:for-each>
-       </xsl:template>
-
-       <xsl:template match="item" mode="button">
-               <xsl:param name="reference"/>   
-               <xsl:param name="position"/>    
-               <xsl:param name="context"/>     
-               <Icon src="{$reference/item[@title = current()/@title]/@icon}" listener="MouseListener">
-                       <mouseClicked set="position" value="{$position}" context="{$context}"/>
-               </Icon>
-       </xsl:template>
-
-       <xsl:template match="separator" mode="button">
-               <xsl:param name="count"/>       
-               <xsl:param name="position"/>    
-               <xsl:param name="context"/>     
-               <Label text="|" listener="MouseListener">
-                       <mouseClicked set="position" value="{$position}" context="{$context}"/>
-               </Label>
-       </xsl:template>
-
-</xsl:stylesheet>
-
diff --git a/scilab/modules/scinotes/etc/XConfiguration-scinotes.xml b/scilab/modules/scinotes/etc/XConfiguration-scinotes.xml
new file mode 100644 (file)
index 0000000..c5ef980
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<scinotes>
+  <body>
+    <scinotes-preferences restart-reopen="true" reload-unedited="true" add-line-termination="true" number-of-entries="5" encoding="utf-8" eol="Unix(LF)"/>
+  </body>
+  <display>
+    <body>
+      <scinotes-display highlight-current-line="true" current-line-color="#facade" show-line-numbers="true" wrap-lines="true"/>
+    </body>
+  </display>
+  <syntax>
+    <body>
+      <scinotes-syntax highlight="true" hightlight-brackets="true" tab-size="4" use-spaces="true" indent-size="4" automatic-indent="true"/>
+    </body>
+  </syntax>
+  <autosave>
+    <body>
+      <scinotes-autosave enable="true" save-every="5" save-untitled="true" automatic-delete="true" append-flag="true" append-with="~" replace-with="tmp" source-flag="true" single-directory=""/>
+    </body>
+  </autosave>
+</scinotes>
\ No newline at end of file
diff --git a/scilab/modules/ui_data/etc/XConfiguration-variables.xml b/scilab/modules/ui_data/etc/XConfiguration-variables.xml
new file mode 100644 (file)
index 0000000..c826d9d
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<variables>
+  <body>
+    <variable-browser maximum-array-size="500000"/>
+    <variable-editor default-array-format="short" move-selection-after-enter="true" direction="Down" decimal-separator=","/>
+  </body>
+</variables>
diff --git a/scilab/modules/xcos/etc/XConfiguration-xcos.xml b/scilab/modules/xcos/etc/XConfiguration-xcos.xml
new file mode 100644 (file)
index 0000000..e62dfe0
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<xcos>
+  <body>
+    <xcos/>
+  </body>
+</xcos>
\ No newline at end of file