File tree Expand file tree Collapse file tree
Tutorial-o-Matic/src/main/groovy Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ class TabPane{
1212 // eliminar
1313 if (index >= 0 ) {
1414 tabPane. removeTabAt(index)
15+ def previousTab = tabPane. hasProperty(' previousTab' )? tabPane. previousTab : 0
16+ previousTab = previousTab >= tabPane. tabCount? 0 : previousTab
17+ tabPane. setSelectedIndex(previousTab)
1518 if (hideTabPane && tabPane. isShowing()) {
1619 menuUtils. executeMenuItems([' ShowFormatPanel' ])
1720 }
@@ -24,6 +27,13 @@ class TabPane{
2427 if (! tabPane. isShowing()) {
2528 menuUtils. executeMenuItems([' ShowFormatPanel' ])
2629 }
30+ // remembers selected tab number
31+ def previousTab = tabPane. selectedIndex
32+ if (tabPane. hasProperty(' previousTab' )){
33+ tabPane. previousTab = previousTab
34+ } else {
35+ tabPane. metaClass. previousTab = previousTab
36+ }
2737 // look if tab exists
2838 def index = tabPane. indexOfTab(tabName)
2939 if (index>= 0 ) {
You can’t perform that action at this time.
0 commit comments