From a49186553c55da67057463c4bb8baba97edc2598 Mon Sep 17 00:00:00 2001 From: "hyeran74.kim" Date: Mon, 2 Jun 2014 11:31:21 +0900 Subject: [PATCH] BaseView : added interface for adding and removing a tab page view Change-Id: I7f0df3f915e0a3ab7f3b545ff7d727ae107304e9 Signed-off-by: hyeran74.kim --- .../widgets/da/view/DATabComposite.java | 5 +- .../tizen/dynamicanalyzer/ui/page/BaseView.java | 62 ++++++++++++++++++++++ 2 files changed, 66 insertions(+), 1 deletion(-) diff --git a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DATabComposite.java b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DATabComposite.java index a7f883e..ae2697e 100644 --- a/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DATabComposite.java +++ b/org.tizen.dynamicanalyzer.appearance/src/org/tizen/dynamicanalyzer/widgets/da/view/DATabComposite.java @@ -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(); } /** diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java index f68f4e8..06648da 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java @@ -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 -- 2.7.4