Introduce fixed entry area.
[gpl/argeo-suite.git] / core / org.argeo.suite.ui / src / org / argeo / suite / ui / widgets / TabbedArea.java
index 8ce5fedb736249fd9581c885f6d740bc224641b8..c281904e989d8d4b8b67b47f4c6ce4cb99b0a468 100644 (file)
@@ -45,7 +45,7 @@ public class TabbedArea extends Composite {
        private boolean singleTab = false;
 
        public TabbedArea(Composite parent, int style) {
-               super(parent, style);
+               super(parent, SWT.NONE);
                CmsUiUtils.style(parent, bodyStyle);
 
                setLayout(CmsUiUtils.noSpaceGridLayout());
@@ -200,6 +200,16 @@ public class TabbedArea extends Composite {
                refreshTabHeaders();
                showTab(nextIndex);
        }
+       
+       public void closeAllTabs() {
+               for(Section section:sections) {
+                       section.dispose();                      
+               }
+               sections.clear();
+               emptyState();
+               refreshTabHeaders();
+               layout(true, true);
+       }
 
        protected void emptyState() {
                new Section(body, SWT.NONE, null);
@@ -214,6 +224,15 @@ public class TabbedArea extends Composite {
                return (Section) stackLayout.topControl;
        }
 
+       public Node getCurrentContext() {
+               Section section = getCurrentSection();
+               if (section != null) {
+                       return section.getNode();
+               } else {
+                       return null;
+               }
+       }
+
        public void setTabStyle(String tabStyle) {
                this.tabStyle = tabStyle;
        }