Skip to content

Commit f2ba8da

Browse files
committed
goto Pane
1 parent e697f1d commit f2ba8da

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

Tutorial-o-Matic/src/main/groovy/ToM.groovy

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class ToM{
1818
newPage : 'ToM_newPage' ,
1919
showMenu : 'ToM_showMenu' ,
2020
toc : 'ToM_TOC' ,
21+
goto : 'ToM_goto' ,
2122
]
2223

2324
// region: getting tutorial components nodes
@@ -72,6 +73,9 @@ class ToM{
7273
case styles.toc:
7374
addTOCPane(myPanel, tutNode)
7475
break
76+
case styles.goto:
77+
addGotoPane(myPanel, tutNode.children)
78+
break
7579
default:
7680
ui.informationMessage('node style not defined')
7781
break
@@ -107,11 +111,6 @@ class ToM{
107111
def closeToolTip = 'Click to stop the tutorial and close the tutorial tab'
108112
def nextLabel = 'Next page'
109113
def nextToolTip = 'Click to continue to the next page of the tutorial'
110-
def bttnAction = lastNode?{ e ->
111-
def nextNodes = getNextTutNodes(lastNode)
112-
fillContentPane(myP, nextNodes, true)
113-
}:null
114-
def nextButtonPanel = tomui.getNextButtonPanel(tabName, closeLabel, closeToolTip, nextLabel, nextToolTip , bttnAction)
115114
def bttnAction = lastNode? { e -> fillPage(myP, lastNode, included, true) } : null
116115
def tocLabel = 'Table of Contents'
117116
def tocToolTip = 'Click to show the Table of Contents of the tutorial'
@@ -179,6 +178,18 @@ class ToM{
179178
myP.add(pane, tomui.GBC)
180179
}
181180

181+
def static addGotoPane(myP, nodos){
182+
nodos.findAll{n -> n.link.node?true:false}.each{nodo ->
183+
def targetNode = nodo.link.node
184+
def msgHtml = nodo.note?tomui.getHtmlFromNote(nodo):null
185+
def bttnText = nodo.text
186+
def bttnToolTip = "Click to go to '${bttnText}' section"
187+
def bttnAction = { e -> fillPage(myP, targetNode, true, true) }
188+
def buttonPanel = tomui.getButtonPanel(msgHtml,bttnText,bttnToolTip, bttnAction, false)
189+
myP.add(buttonPanel, tomui.GBC)
190+
}
191+
}
192+
182193
// end:
183194

184195
}

0 commit comments

Comments
 (0)