@@ -15,10 +15,13 @@ class ToM{
1515 // region: properties
1616 // this region has all the properties for the ToM class
1717
18- static final String version = ' 0.0.4'
19- static final c = ScriptUtils . c()
20- static final String tabName = ' Tutorial'
21- static final String idDictStorage = ' ToM_idDictionary'
18+ static final String version = ' 0.0.6'
19+ static final c = ScriptUtils . c()
20+ static final String idDictStorage = ' ToM_idDictionary'
21+ static final String attributeTabLabel = ' ToM_TabLabel'
22+ static final String defaultTabLabel = ' Tutorial'
23+ static final String defaultMapTutorialsTabLabel = ' Tutorials'
24+
2225
2326 static final Map styles = [
2427 tutorial : ' ToM-Tutorial' ,
@@ -199,7 +202,7 @@ class ToM{
199202 def tocToolTip = ' Click to show the Table of Contents of the tutorial'
200203 def tocBttnAction = { e -> showTOC(myP,lastNode) }
201204
202- def nextButtonPanel = tomui. createNextButtonPanel(tabName, closeLabel, closeToolTip, nextLabel, nextToolTip , bttnAction, tocLabel, tocToolTip, tocBttnAction)
205+ def nextButtonPanel = tomui. createNextButtonPanel(closeLabel, closeToolTip, nextLabel, nextToolTip , bttnAction, tocLabel, tocToolTip, tocBttnAction)
203206 myP. add(nextButtonPanel, tomui. GBC )
204207 }
205208
@@ -513,15 +516,17 @@ class ToM{
513516 def bttnAction = { e ->
514517 def tutNodes = getTutNodes(nT)
515518 if (tutNodes) {
516- fillContentPane(myP, tutNodes)
519+ def tutorialTabName = nT[attributeTabLabel] ?: defaultTabLabel
520+ def myP_thisTutorial = tomui. getContentPaneFromMyTab(tutorialTabName. toString(), true )
521+ fillContentPane(myP_thisTutorial, tutNodes)
517522 } else {
518523 ui. informationMessage( " no tutorial components(nodes) found for tutorial '${ nT.text} '" . toString() )
519524 }
520525 }
521526 def button = tomui. createButton(title, bttnAction)
522527 pane. add(button, tomui. GBC )
523528 }
524- def stopButton = tomui. createButton(' Exit tutorial ' , {tomui. closeTab(tabName )})
529+ def stopButton = tomui. createButton(' CLOSE ' , { e -> tomui. closeTab(e . source )})
525530 pane. add(stopButton, tomui. GBC )
526531 myP. add(pane, tomui. GBC )
527532 } else {
@@ -548,7 +553,8 @@ class ToM{
548553 }
549554
550555 def static showTutorials (mapa ){
551- def myP = tomui. getContentPaneFromMyTab(tabName, true )
556+ def tutorialTabName = mapa. root[attributeTabLabel] ?: defaultMapTutorialsTabLabel
557+ def myP = tomui. getContentPaneFromMyTab(tutorialTabName. toString(), true )
552558 myP. removeAll()
553559 tomui. resizeContentPanel(myP,tomui. maxContentPaneHeigth)
554560 addTutorialsPane(myP, mapa)
0 commit comments