summaryrefslogtreecommitdiff
path: root/modules/preferences/src/xslt
diff options
context:
space:
mode:
authorShashank2017-05-29 12:40:26 +0530
committerShashank2017-05-29 12:40:26 +0530
commit0345245e860375a32c9a437c4a9d9cae807134e9 (patch)
treead51ecbfa7bcd3cc5f09834f1bb8c08feaa526a4 /modules/preferences/src/xslt
downloadscilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.gz
scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.bz2
scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.zip
CMSCOPE changed
Diffstat (limited to 'modules/preferences/src/xslt')
-rwxr-xr-xmodules/preferences/src/xslt/XCommon-toolbars.xsl47
-rwxr-xr-xmodules/preferences/src/xslt/XCommon.xsl212
-rwxr-xr-xmodules/preferences/src/xslt/XConfiguration.xsl137
-rwxr-xr-xmodules/preferences/src/xslt/XGeneric.xsl87
-rwxr-xr-xmodules/preferences/src/xslt/XWizard.xsl194
-rwxr-xr-xmodules/preferences/src/xslt/XWizard/XWizard-any.xsl342
-rwxr-xr-xmodules/preferences/src/xslt/XWizard/XWizard-expression.xsl71
-rwxr-xr-xmodules/preferences/src/xslt/XWizard/XWizard-function.xsl41
-rwxr-xr-xmodules/preferences/src/xslt/XWizard/XWizard-xcos.xsl15
9 files changed, 1146 insertions, 0 deletions
diff --git a/modules/preferences/src/xslt/XCommon-toolbars.xsl b/modules/preferences/src/xslt/XCommon-toolbars.xsl
new file mode 100755
index 000000000..c1bb0468d
--- /dev/null
+++ b/modules/preferences/src/xslt/XCommon-toolbars.xsl
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='utf-8'?>
+<xsl:stylesheet version ="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+ <xsl:variable name="core-toolbars">
+ <toolbar title="scilab">
+ <item title="Cut" icon="edit-cut.png" callScilabBridge='cutConsoleSelection'/>
+ <item title="Copy" icon="edit-copy.png" callScilabBridge='copyConsoleSelection'/>
+ <item title="Paste" icon="edit-paste.png" callScilabBridge='pasteClipboardIntoConsole'/>
+ <item title="Choose Font..." icon="format-text-bold.png" callScilabBridge='changeConsoleFont'/>
+ <item title="Print..." icon="printer.png" callScilabBridge='printConsoleContents'/>
+ <item title="Launch SciNotes" icon="accessories-text-editor.png" script='editor();' />
+ <item title="Help Browser" icon="help-browser.png" script='help();' />
+ <item title="Scilab Demonstrations" icon="applications-system.png" script='demo_gui();' />
+ <item title="Open a file" icon="document-open.png" script='
+ %fileToOpen = uigetfile("*.sc*", pwd(), gettext("Select a file to open with SciNotes"));
+ if ~(%fileToOpen == "") then
+ editor(%fileToOpen);
+ end
+ clear("%fileToOpen");'/>
+ <item title="Change folder" icon="folder.png" script='
+ %newDir = uigetdir(pwd(), gettext("Select a directory"));
+ if ~(%newDir == "") then
+ cd(%newDir);
+ end
+ clear("%newDir");'/>
+ <item title="Module manager - ATOMS" icon="package-x-generic.png" script='
+ if with_module("atoms") then
+ atomsGui();
+ else
+ disp(gettext("Please install atoms module."));
+ end'/>
+ <item title="Xcos" icon="utilities-system-monitor.png" script='
+ if with_module("xcos") then
+ xcos();
+ else
+ disp(gettext("Please install xcos module."));
+ end'/>
+ </toolbar>
+ <toolbar title="scinotes">
+ <item title="Cut" icon="edit-cut.png" callScilabBridge='cutConsoleSelection'/>
+ <item title="Copy" icon="edit-copy.png" callScilabBridge='copyConsoleSelection'/>
+ <item title="Paste" icon="edit-paste.png" callScilabBridge='pasteClipboardIntoConsole'/>
+ </toolbar>
+ </xsl:variable>
+ <xsl:variable name="toolbars" select="nodeset($core-toolbars)"/>
+</xsl:stylesheet>
diff --git a/modules/preferences/src/xslt/XCommon.xsl b/modules/preferences/src/xslt/XCommon.xsl
new file mode 100755
index 000000000..7933c6906
--- /dev/null
+++ b/modules/preferences/src/xslt/XCommon.xsl
@@ -0,0 +1,212 @@
+<?xml version='1.0' encoding='utf-8'?>
+<xsl:stylesheet
+ version ="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ >
+ <!--
+ ::
+ :: Any callback must be equipped with a 'context' attribute
+ :: indicating where the rewriting triggered by the event will
+ :: occur
+ ::
+ ::::> 'here' computes context value at execution point.
+ ::
+ ::::> 'context' is used as an attribute of a callback:
+ ::
+ :: <{event-callback} {action}="{path}">
+ :: <xsl:call-template name="context"/>
+ :: [...]
+ :: </{event-callback}>
+ ::
+ ::::> org.scilab.modules.gui.utils.XCommonManager.getElementByContext
+ ::
+ -->
+
+ <xsl:template name="here">
+ <xsl:for-each select="ancestor-or-self::*">
+ <xsl:if test="not(.=/)">
+ <xsl:value-of select="count(preceding-sibling::*)+1"/>
+ <xsl:text>/</xsl:text>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template name="context">
+ <xsl:attribute name="context">
+ <xsl:call-template name="here"/>
+ </xsl:attribute>
+ </xsl:template>
+
+ <!--
+ ::
+ :: Select template allow to define values of combobox within the XSL.
+ ::
+ :: <xsl:call-template name="Select">
+ :: <xsl:with-param name="among">
+ :: <option <<attr>>="<<value 1>>"/>
+ :: <option <<attr>>="<<value 2>>"/>
+ :: <option <<attr>>="<<value 3>>"/>
+ :: ...
+ :: </xsl:with-param>
+ :: </xsl:call-template>
+ ::
+ -->
+
+ <xsl:template name="Select">
+ <xsl:param name="among"/>
+ <xsl:param name="enable" select="'true'"/>
+ <xsl:variable name="list" select="nodeset($among)/*"/>
+ <xsl:variable name="attr-name">
+ <xsl:for-each select="$list[1]/@*[1]">
+ <xsl:value-of select="local-name()"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="attr-value" select="@*[local-name()=$attr-name]"/>
+ <Select listener="ActionListener" enable="{$enable}">
+ <actionPerformed choose="{$attr-name}">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ <xsl:for-each select="$list">
+ <option value="{@*}">
+ <xsl:if test="@*=$attr-value">
+ <xsl:attribute name="selected">selected</xsl:attribute>
+ </xsl:if>
+ </option>
+ </xsl:for-each>
+ </Select>
+ </xsl:template>
+
+ <xsl:template name="Slider">
+ <xsl:param name="among"/>
+ <xsl:variable name="list" select="nodeset($among)/*"/>
+ <xsl:variable name="attr-name">
+ <xsl:for-each select="$list[1]/@*[1]">
+ <xsl:value-of select="local-name()"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="attr-value" select="@*[local-name()=$attr-name]"/>
+ <Slider listener="ActionListener">
+ <actionPerformed choose="{$attr-name}">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ <xsl:for-each select="$list">
+ <option value="{@*}">
+ <xsl:if test="@*=$attr-value">
+ <xsl:attribute name="selected">selected</xsl:attribute>
+ </xsl:if>
+ </option>
+ </xsl:for-each>
+ </Slider>
+ </xsl:template>
+
+ <!--
+ ::
+ :: BooleanCheckBox template (@attr-name in {true, false})
+ ::
+ :: <xsl:call-template name="SimpleCheckBox">
+ :: <xsl:with-param name="attr-name">...</xsl:with-param>
+ :: </xsl:call-template>
+ ::
+ -->
+ <xsl:template name="BooleanCheckBox">
+ <xsl:param name="attr-name"/>
+ <xsl:param name="text" select="''"/>
+ <xsl:choose>
+ <xsl:when test="@*[local-name()=$attr-name]='true'">
+ <Checkbox checked="checked" listener="ActionListener" text="{$text}">
+ <actionPerformed set="{$attr-name}" value="false">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Checkbox>
+ </xsl:when>
+ <xsl:otherwise>
+ <Checkbox checked="unchecked" listener="ActionListener" text="{$text}">
+ <actionPerformed set="{$attr-name}" value="true">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Checkbox>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="InvertedCheckBox">
+ <xsl:param name="attr-name"/>
+ <xsl:param name="text" select="''"/>
+ <xsl:choose>
+ <xsl:when test="@*[local-name()=$attr-name]='false'">
+ <Checkbox checked="checked" listener="ActionListener" text="{$text}">
+ <actionPerformed set="{$attr-name}" value="true">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Checkbox>
+ </xsl:when>
+ <xsl:otherwise>
+ <Checkbox checked="unchecked" listener="ActionListener" text="{$text}">
+ <actionPerformed set="{$attr-name}" value="false">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Checkbox>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="BooleanRadio">
+ <xsl:param name="attr-name"/>
+ <xsl:param name="text" select="''"/>
+ <xsl:choose>
+ <xsl:when test="@*[local-name()=$attr-name]='true'">
+ <Radiobutton checked="checked" listener="ActionListener" text="{$text}">
+ <actionPerformed set="{$attr-name}" value="false">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Radiobutton>
+ </xsl:when>
+ <xsl:otherwise>
+ <Radiobutton checked="unchecked" listener="ActionListener" text="{$text}">
+ <actionPerformed set="{$attr-name}" value="true">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Radiobutton>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <xsl:template name="InvertedRadio">
+ <xsl:param name="attr-name"/>
+ <xsl:param name="text" select="''"/>
+ <xsl:choose>
+ <xsl:when test="@*[local-name()=$attr-name]='false'">
+ <Radiobutton checked="checked" listener="ActionListener" text="{$text}">
+ <actionPerformed set="{$attr-name}" value="true">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Radiobutton>
+ </xsl:when>
+ <xsl:otherwise>
+ <Radiobutton checked="unchecked" listener="ActionListener" text="{$text}">
+ <actionPerformed set="{$attr-name}" value="false">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Radiobutton>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--
+ ::
+ :: Common vocabulary
+ ::
+ -->
+
+ <xsl:template match="TBD">
+ <Glue/>
+ <HBox>
+ <Glue/>
+ Implemented soon...
+ <Glue/>
+ </HBox>
+ <Glue/>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/modules/preferences/src/xslt/XConfiguration.xsl b/modules/preferences/src/xslt/XConfiguration.xsl
new file mode 100755
index 000000000..e44e25e72
--- /dev/null
+++ b/modules/preferences/src/xslt/XConfiguration.xsl
@@ -0,0 +1,137 @@
+<?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.xsl"/>
+ <xsl:import href="XCommon-toolbars.xsl"/>
+ <xsl:import href="XGeneric.xsl"/>
+
+ <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+ ::
+ :: T O P L E V E L
+ ::
+ -->
+
+ <xsl:template match="interface">
+ <ISML layout="border" height="{@height}" width="{@width}">
+ <VBox border-side="North">
+ <VSpace height="5"/>
+ </VBox>
+ <HBox border-side="West">
+ <Glue/>
+ <Panel>
+ <HSpace width="15"/>
+ </Panel>
+ <Tree listener="ActionListener">
+ <xsl:apply-templates mode="left-tree"/>
+ <actionPerformed choose="path" context="/"/>
+ </Tree>
+ <Panel>
+ <HSpace width="5"/>
+ </Panel>
+ <Glue/>
+ </HBox>
+ <HBox border-side="Center">
+ <Scroll>
+ <Panel border-side="Center">
+ <xsl:apply-templates mode="main-panel">
+ <xsl:with-param name="path" select="@path"/>
+ </xsl:apply-templates>
+ </Panel>
+ </Scroll>
+ </HBox>
+ <HBox border-side="East">
+ <Glue/>
+ <Panel>
+ <HSpace width="15"/>
+ </Panel>
+ </HBox>
+ <HBox border-side="South">
+ <VBox>
+ <Grid>
+ <Panel gridx="1" gridy="1" weightx="1"/>
+ <Button gridx="2" gridy="1" weightx="0" text="_(Default)" listener="ActionListener">
+ <actionPerformed callback="Default"/>
+ </Button>
+ <Panel gridx="3" gridy="1" weightx="0">
+ <HSpace width="10"/>
+ </Panel>
+ <Button gridx="4" gridy="1" weightx="0" text="_(Cancel)" listener="ActionListener">
+ <actionPerformed callback="Cancel"/>
+ </Button>
+ <Panel gridx="5" gridy="1" weightx="0">
+ <HSpace width="10"/>
+ </Panel>
+ <Button gridx="6" gridy="1" weightx="0" text="_(OK)" listener="ActionListener">
+ <actionPerformed callback="Ok"/>
+ </Button>
+ <Panel gridx="7" gridy="1" weightx="0">
+ <HSpace width="10"/>
+ </Panel>
+ <Button gridx="8" gridy="1" weightx="0" text="_(Apply)" listener="ActionListener">
+ <actionPerformed callback="Apply"/>
+ </Button>
+ <Panel gridx="9" gridy="1" weightx="0">
+ <HSpace width="15"/>
+ </Panel>
+ </Grid>
+ <VSpace height="10"/>
+ </VBox>
+ </HBox>
+ </ISML>
+ </xsl:template>
+
+ <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+ ::
+ :: L E F T T R E E
+ ::
+ :: body tag are not displayed in 'left-tree' mode
+ ::
+ -->
+
+
+ <xsl:template match="*" mode="left-tree">
+ <tableNode>
+ <xsl:attribute name="name">
+ <xsl:value-of select="./@title"/>
+ </xsl:attribute>
+ <xsl:apply-templates mode="left-tree"/>
+ </tableNode>
+ </xsl:template>
+
+ <xsl:template match="toolboxes" mode="left-tree">
+ <xsl:if test="*[not(self::body)]">
+ <tableNode name="{local-name()}">
+ <xsl:apply-templates mode="left-tree"/>
+ </tableNode>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="body" mode="left-tree"/>
+
+ <!-- = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
+ ::
+ :: M A I N P A N E L :
+ ::
+ :: body tag are displayed in 'main-panel' mode iff
+ :: interface/@path == $local-path
+ ::
+ -->
+
+ <xsl:template match="body" mode="main-panel">
+ <xsl:param name="path"/>
+ <xsl:variable name="local-path">
+ <xsl:for-each select="..">
+ <xsl:call-template name="here"/>
+ </xsl:for-each>
+ </xsl:variable>
+ <!--xsl:message>
+ <xsl:value-of select="$local-path"/>::::::::<xsl:value-of select="$path"/>
+ </xsl:message-->
+ <xsl:if test="$local-path=$path">
+ <VBox path="{$path}" fill="both">
+ <xsl:apply-templates/>
+ </VBox>
+ </xsl:if>
+ </xsl:template>
+</xsl:stylesheet>
+
diff --git a/modules/preferences/src/xslt/XGeneric.xsl b/modules/preferences/src/xslt/XGeneric.xsl
new file mode 100755
index 000000000..52046e925
--- /dev/null
+++ b/modules/preferences/src/xslt/XGeneric.xsl
@@ -0,0 +1,87 @@
+<?xml version='1.0' encoding='utf-8'?>
+<xsl:stylesheet
+ version ="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+>
+
+<xsl:template match="Form">
+ <Title text="{@text}">
+ <Grid>
+ <xsl:apply-templates mode="form"/>
+ </Grid>
+ </Title>
+</xsl:template>
+
+<xsl:template match="Entry" mode="form">
+ <xsl:variable name="position" select="count(preceding-sibling::*) + 1"/>
+ <Label gridx="1" gridy="{$position}" text="{@text}"/>
+ <Entry gridx="2" gridy="{$position}" text="{@value}" listener="ActionListener">
+ <actionPerformed choose="value">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Entry>
+</xsl:template>
+
+<xsl:template match="Select" mode="form">
+ <xsl:variable name="position" select="count(preceding-sibling::*) + 1"/>
+ <Label gridx="1" gridy="{$position}" text="{@text}"/>
+ <Select gridx="2" gridy="{$position}" listener="ActionListener">
+ <actionPerformed choose="value">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ <xsl:apply-templates/>
+ </Select>
+</xsl:template>
+
+<xsl:template match="Option">
+ <option value="{@value}">
+ <xsl:if test="@value=../@value">
+ <xsl:attribute name="selected">selected</xsl:attribute>
+ </xsl:if>
+ </option>
+</xsl:template>
+
+<xsl:template match="Color" mode="form">
+ <xsl:variable name="position" select="count(preceding-sibling::*) + 1"/>
+ <Label gridx="1" gridy="{$position}" text="{@text}"/>
+ <Color gridx="2" gridy="{$position}" color="{@value}" listener="ActionListener">
+ <actionPerformed choose="value">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Color>
+</xsl:template>
+
+<xsl:template match="Checkbox[ @value='no']" mode="form">
+ <xsl:variable name="position" select="count(preceding-sibling::*) + 1"/>
+ <Checkbox gridx="1" gridy="{$position}" gridwidth="2" checked="unchecked" text="{@text}" listener="ActionListener">
+ <actionPerformed set="value" value="yes">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Checkbox>
+</xsl:template>
+
+<xsl:template match="Checkbox[ @value='yes']" mode="form">
+ <xsl:variable name="position" select="count(preceding-sibling::*) + 1"/>
+ <Checkbox gridx="1" gridy="{$position}" gridwidth="2" checked="checked" text="{@text}" listener="ActionListener">
+ <actionPerformed set="value" value="no">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Checkbox>
+</xsl:template>
+
+<!-- /////////////////////////////////////////////// -->
+<!-- /// // /// /// /// /// /// /// /// /// -->
+<!-- /////////////////////////////////////////////// -->
+
+<xsl:template match="*">
+ <Glue/>
+ <HBox>
+ <Title text="{local-name()}">
+ <Label text="will be implemented soon..." foreground="#0000ff"/>
+ </Title>
+ </HBox>
+ <Glue/>
+</xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/modules/preferences/src/xslt/XWizard.xsl b/modules/preferences/src/xslt/XWizard.xsl
new file mode 100755
index 000000000..af0b24212
--- /dev/null
+++ b/modules/preferences/src/xslt/XWizard.xsl
@@ -0,0 +1,194 @@
+<?xml version='1.0' encoding='utf-8'?>
+<xsl:stylesheet version ="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+> <!--
+ ||
+ || I M P O R T S
+ ||
+ -->
+ <xsl:import href="XCommon.xsl"/>
+ <xsl:import href="XWizard/XWizard-any.xsl"/>
+ <xsl:import href="XWizard/XWizard-function.xsl"/>
+ <xsl:import href="XWizard/XWizard-expression.xsl"/>
+ <xsl:import href="XWizard/XWizard-xcos.xsl"/>
+
+ <!--
+ ||
+ || T E M P O R A R Y T R E E S
+ || | wrox book workaround, p.237
+ ||
+ -->
+ <xsl:variable name="imports"
+ select="document('')/xsl:stylesheet/xsl:import/@import"/>
+ <xsl:variable name="variables"
+ select="document($imports)/xsl:stylesheet/descendant::xsl-variable"/>
+
+ <!--
+ ||
+ || N A V I G A T I O N M A N A G E M E N T
+ ||
+ -->
+ <xsl:variable name="current" select="/*/*[local-name()=/*/@step]"/>
+ <xsl:variable name="next" select="$current/following-sibling::*[1]"/>
+ <xsl:variable name="prev" select="$current/preceding-sibling::*[1]"/>
+
+ <!--
+ ||
+ || T O P - L E V E L
+ ||
+ -->
+ <xsl:template match="/">
+ <ISML layout="border">
+ <VBox background="#ffffff" border-side="West" scroll="vertical">
+ <xsl:apply-templates select="*" mode="left-panel"/>
+ </VBox>
+ <Panel border-side="Center" width="640" height="420">
+ <VBox>
+ <xsl:apply-templates mode="main-panel"/>
+ </VBox>
+ </Panel>
+ <HBox border-side="South">
+ <Button text="Previous" listener="ActionListener">
+ <xsl:choose>
+ <xsl:when test="$prev">
+ <actionPerformed set="step" context="/">
+ <xsl:attribute name="value">
+ <xsl:for-each select="$prev">
+ <xsl:value-of select="local-name()"/>
+ </xsl:for-each>
+ </xsl:attribute>
+ </actionPerformed>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="status">
+ <xsl:text>disabled</xsl:text>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </Button>
+ <HSpace width="5"/>
+ <Button text="Next" listener="ActionListener">
+ <xsl:choose>
+ <xsl:when test="$next">
+ <actionPerformed set="step" context="/">
+ <xsl:attribute name="value">
+ <xsl:for-each select="$next">
+ <xsl:value-of select="local-name()"/>
+ </xsl:for-each>
+ </xsl:attribute>
+ </actionPerformed>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="status">
+ <xsl:text>disabled</xsl:text>
+ </xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </Button>
+ <Glue/>
+ <xsl:choose>
+ <xsl:when test="user-block-wizard">
+ <Button text="Open" listener="ActionListener">
+ <actionPerformed callback="Open"/>
+ </Button>
+ </xsl:when>
+ <xsl:otherwise>
+ <Button text="New" listener="ActionListener">
+ <actionPerformed callback="New"/>
+ </Button>
+ <HSpace width="5"/>
+ <Button text="Save" listener="ActionListener">
+ <actionPerformed callback="Save"/>
+ </Button>
+ <HSpace width="5"/>
+ <Button text="Save as" listener="ActionListener">
+ <actionPerformed callback="SaveAs"/>
+ </Button>
+ <HSpace width="5"/>
+ <Button text="Ok" listener="ActionListener">
+ <actionPerformed callback="Ok"/>
+ </Button>
+ </xsl:otherwise>
+ </xsl:choose>
+ <HSpace width="5"/>
+ <Button text="Quit" listener="ActionListener">
+ <actionPerformed callback="Quit"/>
+ </Button>
+ </HBox>
+ </ISML>
+ </xsl:template>
+
+ <!--
+ ||
+ || L E F T P A N E L M A N A G E M E N T
+ ||
+ -->
+ <xsl:template match="user-block-wizard" mode="left-panel">
+ <xsl:apply-templates mode="inner-left-panel"/>
+ </xsl:template>
+
+ <xsl:template match="kind" mode="inner-left-panel">
+ <HBox>
+ <Icon src="media-playback-start.png"/>
+ <xsl:choose>
+ <xsl:when test="ancestor::user-block-wizard/@select=@name">
+ <Label
+ text="{@title}"
+ background="#0000ff"
+ foreground="#ffffff"
+ listener="MouseListener">
+ <mouseClicked callback="load" name="{@name}"/>
+ </Label>
+ </xsl:when>
+ <xsl:otherwise>
+ <Label text="{@title}">
+ <xsl:choose>
+ <xsl:when test="@name">
+ <xsl:attribute name="listener">MouseListener</xsl:attribute>
+ <mouseClicked set="select" value="{@name}" context="/"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="foreground">#dddddd</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ </Label>
+ </xsl:otherwise>
+ </xsl:choose>
+ <Glue/>
+ <HSpace width="25"/>
+ </HBox>
+ </xsl:template>
+
+ <xsl:template match="folder" mode="inner-left-panel">
+ <HBox>
+ <Icon src="media-playback-start.png"/>&lt;HTML&gt;&lt;B&gt;
+ <xsl:value-of select="@title"/>
+ <Glue/>
+ <HSpace width="25"/>
+ </HBox>
+ <HBox>
+ <HSpace width="25"/>
+ <VBox>
+ <xsl:apply-templates mode="inner-left-panel"/>
+ </VBox>
+ </HBox>
+ </xsl:template>
+
+ <!--
+ ||
+ || M E A N P A N E L M A N A G E M E N T
+ ||
+ -->
+ <xsl:template match="kind" mode="main-panel">
+ <xsl:if test="@name=ancestor::user-block-wizard/@select">
+ <Title text="{@title}">
+ <Label listener="MouseListener">
+ <xsl:attribute name="text"><xsl:apply-templates/></xsl:attribute>
+ <mouseClicked callback="load" name="{@name}"/>
+ </Label>
+ </Title>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/modules/preferences/src/xslt/XWizard/XWizard-any.xsl b/modules/preferences/src/xslt/XWizard/XWizard-any.xsl
new file mode 100755
index 000000000..4bfe3b389
--- /dev/null
+++ b/modules/preferences/src/xslt/XWizard/XWizard-any.xsl
@@ -0,0 +1,342 @@
+<?xml version='1.0' encoding='utf-8'?>
+<xsl:stylesheet version ="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+> <!--
+ ||
+ || L E F T P A N E L M A N A G E M E N T
+ ||
+ -->
+
+ <xsl:template match="*" mode="left-panel">
+ <xsl:apply-templates mode="inner-left-panel"/>
+ <XCosPreview height="200" width="200">
+ <tableBlock>
+ <root>
+ <xsl:apply-templates select="." mode="preview"/>
+ </root>
+ </tableBlock>
+ </XCosPreview>
+ <!-- TODO -->
+ </xsl:template>
+
+ <xsl:template match="*" mode="inner-left-panel">
+ <HBox>
+ <Icon src="media-playback-start.png"/>
+ <xsl:choose>
+ <xsl:when test="local-name()=../@step">
+ <Label text="{local-name()}" background="#0000ff" foreground="#ffffff"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <Label text="{local-name()}" listener="MouseListener">
+ <mouseClicked set="step" value="{local-name()}" context="/"/>
+ </Label>
+ </xsl:otherwise>
+ </xsl:choose>
+ <Glue/>
+ <HSpace width="25"/>
+ </HBox>
+ </xsl:template>
+
+ <!--
+ ||
+ || C O M M O N M A I N P A N E L S
+ ||
+ -->
+
+ <xsl:template match="parameters" mode ="main-panel">
+ <xsl:if test="ancestor::*/@step='parameters'">
+ <xsl:for-each select="item[position()=current()/@item]">
+ <Title text="{concat('User parameter [', @name, ']:')}">
+ <VBox>
+ <HBox>
+ Variable name:
+ <Entry text="{@name}" listener="ActionListener">
+ <actionPerformed choose="name">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Entry>
+ Data-type:
+ <xsl:call-template name="Select">
+ <xsl:with-param name="among">
+ <option type="double"/>
+ <option type="integer"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </HBox>
+ <HBox>
+ Minimum:
+ <Entry text="{@min}" listener="ActionListener">
+ <actionPerformed choose="min">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Entry>
+ Test:
+ <Entry text="{@test}" listener="ActionListener">
+ <actionPerformed choose="test">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Entry>
+ Maximum:
+ <Entry text="{@max}" listener="ActionListener">
+ <actionPerformed choose="max">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Entry>
+ </HBox>
+ <HBox>
+ Description:
+ <Entry text="{@description}" listener="ActionListener">
+ <actionPerformed choose="description">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Entry>
+ </HBox>
+ <HBox>
+ Tooltip:
+ <Entry text="{@tooltip}" listener="ActionListener">
+ <actionPerformed choose="tooltip">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Entry>
+ </HBox>
+ </VBox>
+ </Title>
+ </xsl:for-each>
+ <Title text="Select parameter setup">
+ <Table mode="select" item="{@item}" size="dynamic" listener="TableListener">
+ <tableSelect choose="item">
+ <xsl:call-template name="context"/>
+ </tableSelect>
+ <tableAdd>
+ <xsl:call-template name="context"/>
+ <item name="parameter" type="double" min="0.0" max="999.9"
+ test="0.0" tooltip="tooltip" description="A parameter"/>
+ </tableAdd>
+ <tableCol title="Name" attr="name"/>
+ <tableCol title="Type" attr="type"/>
+ <tableCol title="Minimum" attr="min"/>
+ <tableCol title="Test value" attr="test"/>
+ <tableCol title="Maximum" attr="max"/>
+ <xsl:for-each select="item">
+ <tableRow name="{@name}" type="{@type}" min="{@min}" max="{@max}" test="{@test}"/>
+ </xsl:for-each>
+ </Table>
+ </Title>
+
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="interface" mode ="main-panel">
+ <xsl:if test="ancestor::*/@step='interface'">
+ <Title text="Inputs/Outputs">
+ <VBox>
+ <HBox>&lt;HTML&gt;&lt;B&gt;Regular Inputs<HSpace width="250"/>&lt;HTML&gt;&lt;B&gt;Activation Inputs
+ </HBox>
+ <HBox>
+ <xsl:for-each select="regular-inputs">
+ <Table size="dynamic" mode="cell" listener="TableListener">
+ <tableChanged>
+ <xsl:call-template name="context"/>
+ </tableChanged>
+ <tableAdd>
+ <xsl:call-template name="context"/>
+ <item name="parameter" type="double" rows="" columns=""/>
+ </tableAdd>
+ <tableDel remove="selection">
+ <xsl:call-template name="context"/>
+ </tableDel>
+ <tableCol title="Name" attr="name" editable="true"/>
+ <tableCol title="Data type" attr="type" editable="true"/>
+ <tableCol title="Rows" attr="rows" editable="true"/>
+ <tableCol title="Columns" attr="columns" editable="true"/>
+ <xsl:for-each select="item">
+ <tableRow name="{@name}" type="{@type}" rows="{@rows}" columns="{@columns}"/>
+ </xsl:for-each>
+ </Table>
+ </xsl:for-each>
+ <HSpace width="30"/>
+ <xsl:for-each select="activation-inputs">
+ <Table size="dynamic" mode="cell" listener="TableListener">
+ <tableChanged>
+ <xsl:call-template name="context"/>
+ </tableChanged>
+ <tableAdd>
+ <xsl:call-template name="context"/>
+ <item name="input"/>
+ </tableAdd>
+ <tableCol title="Name" attr="name" editable="true"/>
+ <xsl:for-each select="item">
+ <tableRow name="{@name}"/>
+ </xsl:for-each>
+ </Table>
+ </xsl:for-each>
+ </HBox>
+ <HBox>&lt;HTML&gt;&lt;B&gt;Regular Outputs<HSpace width="250"/>&lt;HTML&gt;&lt;B&gt;Activation Outputs<HSpace width="1"/>
+ </HBox>
+ <HBox>
+ <xsl:for-each select="regular-outputs">
+ <Table size="dynamic" mode="cell" listener="TableListener">
+ <tableChanged>
+ <xsl:call-template name="context"/>
+ </tableChanged>
+ <tableAdd>
+ <xsl:call-template name="context"/>
+ <item name="parameter" type="double" rows="" columns=""/>
+ </tableAdd>
+ <tableCol title="Name" attr="name" editable="true"/>
+ <tableCol title="Data type" attr="type" editable="true"/>
+ <tableCol title="Rows" attr="rows" editable="true"/>
+ <tableCol title="Columns" attr="columns" editable="true"/>
+ <xsl:for-each select="item">
+ <tableRow name="{@name}" type="{@type}" rows="{@rows}" columns="{@columns}"/>
+ </xsl:for-each>
+ </Table>
+ </xsl:for-each>
+ <HSpace width="30"/>
+ <xsl:for-each select="activation-outputs">
+ <Table size="dynamic" mode="cell" listener="TableListener">
+ <tableChanged>
+ <xsl:call-template name="context"/>
+ </tableChanged>
+ <tableAdd>
+ <xsl:call-template name="context"/>
+ <item name="String"/>
+ </tableAdd>
+ <tableCol title="Name" attr="name" editable="true"/>
+ <xsl:for-each select="item">
+ <tableRow name="{@name}"/>
+ </xsl:for-each>
+ </Table>
+ </xsl:for-each>
+ </HBox>
+ </VBox>
+ </Title>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="graphics" mode ="main-panel">
+ <xsl:if test="ancestor::*/@step='graphics'">
+ <xsl:for-each select="item[position()=current()/@item]">
+ <Title text="{concat('Current setup: ', @title)}">
+ <VBox>
+ <HBox>
+ Color:
+ <Glue/>
+ <Color color="{@color}" listener="ActionListener">
+ <actionPerformed choose="color">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Color>
+ <Glue/>
+ </HBox>
+ <xsl:if test="@family">
+ <HBox>
+ Font family:
+ <Glue/>
+ <xsl:call-template name="Select">
+ <xsl:with-param name="among">
+ <option family="Arial"/>
+ <option family="Courier New"/>
+ <option family="System"/>
+ <option family="Times New Roman"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ <Glue/>
+ </HBox>
+ </xsl:if>
+ <xsl:if test="@size">
+ <HBox>
+ Font size:
+ <HSpace width="15"/>
+ <Glue/>
+ <xsl:call-template name="Select">
+ <xsl:with-param name="among">
+ <option size="6"/>
+ <option size="8"/>
+ <option size="9"/>
+ <option size="10"/>
+ <option size="11"/>
+ <option size="12"/>
+ <option size="14"/>
+ <option size="16"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ <Glue/>
+ </HBox>
+ </xsl:if>
+ <xsl:if test="@face">
+ <HBox>
+ Font face:
+ <HSpace width="10"/>
+ <Glue/>
+ <xsl:call-template name="Select">
+ <xsl:with-param name="among">
+ <option face="plain"/>
+ <option face="bold"/>
+ <option face="italic"/>
+ <option face="bold italic"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ <Glue/>
+ </HBox>
+ </xsl:if>
+ <xsl:if test="not(@family)">
+ <VSpace height="85"/>
+ </xsl:if>
+ </VBox>
+ </Title>
+ </xsl:for-each>
+ <VSpace height="50"/>
+ <Title text="Select graphic setup">
+ <Table mode="select" item="{@item}" listener="TableListener">
+ <tableSelect choose="item">
+ <xsl:call-template name="context"/>
+ </tableSelect>
+ <tableCol title="Kind" attr="title"/>
+ <tableCol title="Foreground" attr="color"/>
+ <tableCol title="Font family" attr="family"/>
+ <tableCol title="Font size" attr="size"/>
+ <tableCol title="Font face" attr="face"/>
+ <xsl:for-each select="item">
+ <tableRow title="{@title}" family="{@family}" size="{@size}" face="{@face}" color="{@color}"/>
+ </xsl:for-each>
+ </Table>
+ </Title>
+ <VSpace height="20"/>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="documentation" mode ="main-panel">
+ <xsl:if test="ancestor::*/@step='documentation'">
+ <Title text="Documentation">
+ <VBox>
+ <xsl:for-each select="short-description">
+ <HBox>&lt;HTML&gt;&lt;B&gt;Title
+ <Glue/>
+ </HBox>
+ <HBox>
+ <Entry text="{@text}" listener="ActionListener">
+ <actionPerformed choose="text">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Entry>
+ </HBox>
+ </xsl:for-each>
+ <xsl:for-each select="long-description">
+ <HBox>&lt;HTML&gt;&lt;B&gt;Description
+ <Glue/>
+ </HBox>
+ <Textarea listener="DocumentListener" width="350" height="300">
+ <!--documentUpdate> TODO
+ <xsl:call-template name="context"/>
+ </documentUpdate>
+ <xsl:copy-of select="node()"/ -->
+ </Textarea >
+ </xsl:for-each>
+ </VBox>
+ </Title>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/modules/preferences/src/xslt/XWizard/XWizard-expression.xsl b/modules/preferences/src/xslt/XWizard/XWizard-expression.xsl
new file mode 100755
index 000000000..83f3abd0b
--- /dev/null
+++ b/modules/preferences/src/xslt/XWizard/XWizard-expression.xsl
@@ -0,0 +1,71 @@
+<?xml version='1.0' encoding='utf-8'?>
+<xsl:stylesheet version ="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+> <!--
+ ||
+ || S P E C I F I C M A I N P A N E L S
+ ||
+ -->
+ <xsl:template match="expression" mode="preview">
+ <todo/>
+ </xsl:template>
+ <xsl:template match="expression[parent::expression]" mode ="main-panel">
+ <xsl:if test="ancestor::expression/@step='expression'">
+ <Title text="Scilab expression">
+ <VBox>
+ <HBox>&lt;HTML&gt;&lt;B&gt;Scilab Expressions
+ <Glue/>
+ </HBox>
+ <xsl:for-each select="outputs">
+ <Table mode="cell" location="fixed" size="dynamic" listener="TableListener">
+ <tableChanged>
+ <xsl:call-template name="context"/>
+ </tableChanged>
+ <tableAdd insert="selection">
+ <xsl:call-template name="context"/>
+ <item value="0.0"/>
+ </tableAdd>
+ <tableDel delete="selection">
+ <xsl:call-template name="context"/>
+ </tableDel>
+ <tableCol title="" width="30" attr="label"/>
+ <tableCol title="Values" attr="value" editable="true"/>
+ <xsl:for-each select="item">
+ <tableRow label="{concat('y', format-number(position(), '0'))}" value="{@value}"/>
+ </xsl:for-each>
+ </Table>
+ </xsl:for-each>
+ <HBox>&lt;HTML&gt;&lt;B&gt;Input test values
+ <Glue/>
+ <Button text="Execute"/>
+ </HBox>
+ <xsl:for-each select="inputs">
+ <Table mode="cell" location="fixed" size="dynamic" listener="TableListener">
+ <tableChanged>
+ <xsl:call-template name="context"/>
+ </tableChanged>
+ <tableAdd>
+ <xsl:call-template name="context"/>
+ <item value="0.0"/>
+ </tableAdd>
+ <tableCol title="" width="30" attr="label"/>
+ <tableCol title="Values" attr="value" editable="true" />
+ <xsl:for-each select="item">
+ <tableRow label="{concat('u', format-number(position(), '0'))}" value="{@value}" />
+ </xsl:for-each>
+ </Table>
+ </xsl:for-each>
+ <HBox>
+ <xsl:call-template name="BooleanCheckBox">
+ <xsl:with-param name="attr-name">zero-crossing</xsl:with-param>
+ </xsl:call-template>
+ Use zero-crossing
+ <Glue/>
+ </HBox>
+ </VBox>
+ </Title>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/modules/preferences/src/xslt/XWizard/XWizard-function.xsl b/modules/preferences/src/xslt/XWizard/XWizard-function.xsl
new file mode 100755
index 000000000..00fbbd9d5
--- /dev/null
+++ b/modules/preferences/src/xslt/XWizard/XWizard-function.xsl
@@ -0,0 +1,41 @@
+<?xml version='1.0' encoding='utf-8'?>
+<xsl:stylesheet version ="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+> <!--
+ ||
+ || S P E C I F I C M A I N P A N E L S
+ ||
+ -->
+ <xsl:template match="function[parent::function]" mode ="main-panel">
+ <xsl:if test="ancestor::function/@step='function'">
+ <Title text="Scilab function">
+ <VBox>
+ <HBox>&lt;HTML&gt;&lt;B&gt;Discrete State
+ <Entry text="{@discrete-state}" listener="ActionListener">
+ <actionPerformed choose="context">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Entry>
+ </HBox>
+ <VSpace height="25"/>
+ <HBox>&lt;HTML&gt;&lt;B&gt;Continuous State
+ <Entry text="{@discrete-state}" listener="ActionListener">
+ <actionPerformed choose="discrete-state">
+ <xsl:call-template name="context"/>
+ </actionPerformed>
+ </Entry>
+ </HBox>
+ <VSpace height="25"/>
+ <HBox>
+ <xsl:call-template name="BooleanCheckBox">
+ <xsl:with-param name="attr-name">always-active</xsl:with-param>
+ </xsl:call-template>&lt;HTML&gt;&lt;B&gt;Always active
+ </HBox>
+ </VBox>
+ </Title>
+ <VSpace height="300"/>
+ </xsl:if>
+ </xsl:template>
+
+</xsl:stylesheet>
+
diff --git a/modules/preferences/src/xslt/XWizard/XWizard-xcos.xsl b/modules/preferences/src/xslt/XWizard/XWizard-xcos.xsl
new file mode 100755
index 000000000..eadc8b799
--- /dev/null
+++ b/modules/preferences/src/xslt/XWizard/XWizard-xcos.xsl
@@ -0,0 +1,15 @@
+<?xml version='1.0' encoding='utf-8'?>
+<xsl:stylesheet version ="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+> <!--
+ ||
+ || S P E C I F I C M A I N P A N E L S
+ ||
+ -->
+ <xsl:template match="xcos" mode="preview">
+ <xsl:for-each select="interface/regular-inputs/item">
+ <xsl:value-of select="@columns"/>
+ </xsl:for-each>
+ </xsl:template>
+</xsl:stylesheet>
+