BaseView : added interface for adding and removing a tab page view 22/22322/1
authorhyeran74.kim <hyeran74.kim@samsung.com>
Mon, 2 Jun 2014 02:31:21 +0000 (11:31 +0900)
committerhyeran74.kim <hyeran74.kim@samsung.com>
Mon, 2 Jun 2014 02:31:21 +0000 (11:31 +0900)
Change-Id: I7f0df3f915e0a3ab7f3b545ff7d727ae107304e9
Signed-off-by: hyeran74.kim <hyeran74.kim@samsung.com>
org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DATabComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java

index a7f883e..ae2697e 100644 (file)
@@ -444,7 +444,8 @@ public class DATabComposite extends DABaseComposite {
 
                final DATabButton button = buttons.remove(index);
                if (!usingAnimation) {
-                       button.setLayoutData(null);
+                       FormData data = (FormData) button.getLayoutData();
+                       data.width = 0;
                } else {
                        button.setGradationColor(DAButton.STATE_DISABLE,
                                        ColorResources.TAB_NORMAL_COLOR_START,
@@ -457,6 +458,8 @@ public class DATabComposite extends DABaseComposite {
                        contentsStackLayout.topControl = lasttab;
                        contentsComposite.layout();
                }
+               
+               tabComposite.layout();
        }
        
        /**
index f68f4e8..06648da 100755 (executable)
@@ -170,6 +170,68 @@ public class BaseView extends ViewPart {
                }
        }
        
+       /**
+        * add a tab page dynamically
+        * @param tabView
+        */
+       public void addTabViewPage(int tabViewId) {
+               switch (tabViewId) {
+               case CommonConstants.PAGE_FILE:
+                       DABaseComposite filePage = new FilePage(
+                                       tabView.getContentComposite(), SWT.NONE);
+                       tabView.addView(filePage, false);
+                       break;
+               case CommonConstants.PAGE_GRAPHICS:
+                       DABaseComposite graphicsPage = new GLPage(
+                                       tabView.getContentComposite(), SWT.NONE);
+                       tabView.addView(graphicsPage, false);
+                       break;
+               case CommonConstants.PAGE_KERNEL:
+                       DABaseComposite kernelPage = new KernelPage(
+                                       tabView.getContentComposite(), SWT.NONE);
+                       tabView.addView(kernelPage, false);
+                       break;
+               case CommonConstants.PAGE_NETWORK:
+                       DABaseComposite networkPage = new NetworkPage(
+                                       tabView.getContentComposite(), SWT.NONE);
+                       tabView.addView(networkPage, false);
+                       break;
+               case CommonConstants.PAGE_SUMMARY:
+                       DABaseComposite summaryPage = new SummaryPage(
+                                       tabView.getContentComposite(), SWT.NONE);
+                       tabView.addView(summaryPage, false);
+                       break;
+               case CommonConstants.PAGE_THREAD:
+                       DABaseComposite threadPage = new ThreadPage(
+                                       tabView.getContentComposite(), SWT.NONE);
+                       tabView.addView(threadPage, false);
+                       break;
+               case CommonConstants.PAGE_TIME_LINE:
+                       DABaseComposite timelinePage = new TimelinePage(
+                                       tabView.getContentComposite(), SWT.NONE);
+                       tabView.addView(timelinePage, false);
+                       break;
+               case CommonConstants.PAGE_UI:
+                       DABaseComposite uiPage = new UIPage(tabView.getContentComposite(),
+                                       SWT.NONE);
+                       tabView.addView(uiPage, false);
+                       break;
+               default:
+                       DA_LOG.debug("No Selected View Pages");
+                       break;
+               }
+
+       }
+       
+       /**
+        * remove a tab page dynamically
+        * @param tabView
+        */
+       public void removeTabViewPage(String tabViewId) {
+               tabView.removeView(tabViewId, false);
+       }
+       
+       
        public DAPageComposite getTopComposite() {
                Display.getDefault().syncExec(new Runnable() {
                        @Override