Change opening order in TabbedArea
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 2 Jun 2022 08:35:14 +0000 (10:35 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 2 Jun 2022 08:35:14 +0000 (10:35 +0200)
org.argeo.app.ui/src/org/argeo/app/ui/widgets/TabbedArea.java

index c214207d3c4c9873d0a517d2f9bf920da802fc9c..321a1987f120cd08b368d98da85f90b63b3c6abc 100644 (file)
@@ -153,9 +153,10 @@ public class TabbedArea extends Composite {
                Section previousSection = new Section(body, SWT.NONE, context);
                build(previousSection, previousUiProvider, previousNode);
                // previousSection.setLayoutData(CmsUiUtils.coverAll());
-               int index = currentIndex + 1;
-               sections.add(index, previousSection);
-               showTab(index);
+               int newIndex = currentIndex + 1;
+               sections.add(currentIndex, previousSection);
+//             sections.add(newIndex, previousSection);
+               showTab(newIndex);
                refreshTabHeaders();
                layout(true, true);
        }
@@ -200,10 +201,10 @@ public class TabbedArea extends Composite {
                refreshTabHeaders();
                showTab(nextIndex);
        }
-       
+
        public void closeAllTabs() {
-               for(Section section:sections) {
-                       section.dispose();                      
+               for (Section section : sections) {
+                       section.dispose();
                }
                sections.clear();
                emptyState();