From: Maria Guseva Date: Wed, 18 May 2016 14:16:30 +0000 (+0300) Subject: SRADA-407: Use DataManagerRegistry.createDataManagers() in GUI mode. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=264fec4a4ee7a7f9c4f0cf8bbf00bc30c2a70548;p=sdk%2Ftools%2Fdynamic-analyzer.git SRADA-407: Use DataManagerRegistry.createDataManagers() in GUI mode. Now data managers are registered separately from GUI objects creation. * BaseView.compositePages() - register needed data managers for each succesfully created page via DataManagerRegistry.createDataManagers(). * Removed data managers registration from corresponding DAPageComposite constructors. Conflicts: org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FilePage.java org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/memory/MemoryPage.java org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkPage.java org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLPage.java org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/SummaryPage.java org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPage.java org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/TimelinePage.java Updated: org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/PageInfoRegistry.java Change-Id: Ib6d89309279878ff34a988a3fab3302b0ec25e3e --- diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FilePage.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FilePage.java index 2079fbf..6dc3a8a 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FilePage.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FilePage.java @@ -108,8 +108,6 @@ public class FilePage extends DAPageComposite { bottomRightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH); bottomForm.setWeights(new int[] { 65, 35 }); - - DataManagerRegistry.registerPageDataManager(FileDataManager.getInstance()); } @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/HierarchyPage.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/HierarchyPage.java index e4e69c0..2faff70 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/HierarchyPage.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/hierarchy/HierarchyPage.java @@ -32,13 +32,12 @@ import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; import org.tizen.dynamicanalyzer.common.AnalyzerConstants; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; -import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry; +import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.ui.hierarchy.layout.HierarchyLayoutView; import org.tizen.dynamicanalyzer.ui.hierarchy.properties.HierarchyPropertiesView; import org.tizen.dynamicanalyzer.ui.hierarchy.tree.HierarchyTreeView; import org.tizen.dynamicanalyzer.ui.hierarchy.tree.overview.HierarchyTreeOverView; import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite; -import org.tizen.dynamicanalyzer.resources.ColorResources; public class HierarchyPage extends DAPageComposite { public static final String pageID = HierarchyPage.class.getName(); @@ -86,8 +85,6 @@ public class HierarchyPage extends DAPageComposite { baseForm.setSashWidth(AnalyzerConstants.SASH_WIDTH); leftForm.setSashWidth(AnalyzerConstants.SASH_WIDTH); rightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH); - - DataManagerRegistry.registerPageDataManager(HierarchyDataManager.getInstance()); } @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/kernel/KernelPage.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/kernel/KernelPage.java index 905a7ac..dd2eb58 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/kernel/KernelPage.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/kernel/KernelPage.java @@ -31,13 +31,12 @@ import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; import org.tizen.dynamicanalyzer.nl.AnalyzerLabels; +import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.shortcut.ShortCutManager; -import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry; import org.tizen.dynamicanalyzer.ui.kernel.data.KernelDataManager; import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineTableView; import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite; import org.tizen.dynamicanalyzer.widgets.da.view.DATabComposite; -import org.tizen.dynamicanalyzer.resources.ColorResources; public class KernelPage extends DAPageComposite { public static final String pageID = KernelPage.class.getName(); @@ -97,8 +96,6 @@ public class KernelPage extends DAPageComposite { rightForm.setWeights(new int[] { 50, 50 }); baseForm.setWeights(new int[] { 75, 25 }); - - DataManagerRegistry.registerPageDataManager(KernelDataManager.getInstance()); } @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkPage.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkPage.java index 13f383d..0503253 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkPage.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkPage.java @@ -107,8 +107,6 @@ public class NetworkPage extends DAPageComposite { bottomRightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH); bottomForm.setWeights(new int[] { 65, 35 }); - - DataManagerRegistry.registerPageDataManager(NetworkDataManager.getInstance()); } @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLPage.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLPage.java index 6a4131b..7a14ccc 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLPage.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/GLPage.java @@ -135,8 +135,6 @@ public class GLPage extends DAPageComposite { topForm.setSashWidth(AnalyzerConstants.SASH_WIDTH); bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH); - - DataManagerRegistry.registerPageDataManager(GLDataManager.getInstance()); } @Override 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 864e946..aade8ba 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java @@ -37,6 +37,7 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.ui.part.ViewPart; import org.tizen.dynamicanalyzer.annotation.UIMethod; import org.tizen.dynamicanalyzer.resources.ColorResources; +import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry; import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar; import org.tizen.dynamicanalyzer.util.CommonUtil; import org.tizen.dynamicanalyzer.util.Logger; @@ -118,8 +119,10 @@ public class BaseView extends ViewPart { for (String pageName : pageNames) { DABaseComposite newPage = PageInfoRegistry.createPageByName( pageName, tabView.getContentComposite()); - // add tab view if (null != newPage) { + // register data manager for created page + DataManagerRegistry.createDataManagers(pageName); + // add tab view tabView.addView(newPage, false); } else { Logger.warning("Unknown tab ID"); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/PageInfoRegistry.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/PageInfoRegistry.java index 2696612..b167455 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/PageInfoRegistry.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/PageInfoRegistry.java @@ -14,13 +14,16 @@ import java.util.Set; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; +import org.tizen.dynamicanalyzer.common.Global; import org.tizen.dynamicanalyzer.setting.SettingConstants; import org.tizen.dynamicanalyzer.setting.SettingDataManager; +import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry; import org.tizen.dynamicanalyzer.swap.logparser.PageDataManager; import org.tizen.dynamicanalyzer.ui.file.FilePage; import org.tizen.dynamicanalyzer.ui.file.manager.FileDataManager; import org.tizen.dynamicanalyzer.ui.hierarchy.HierarchyDataManager; import org.tizen.dynamicanalyzer.ui.hierarchy.HierarchyPage; +import org.tizen.dynamicanalyzer.ui.info.screenshot.ScreenshotDataManager; import org.tizen.dynamicanalyzer.ui.interactive.InteractivePage; import org.tizen.dynamicanalyzer.ui.interactive.data.InteractiveDataManager; import org.tizen.dynamicanalyzer.ui.kernel.KernelPage; @@ -40,6 +43,7 @@ import org.tizen.dynamicanalyzer.ui.thread.data.ThreadDataManager; import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage; import org.tizen.dynamicanalyzer.ui.timeline.calltrace.CallTraceDataManager; import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartManager; +import org.tizen.dynamicanalyzer.ui.timeline.dlog.DLogDataManager; import org.tizen.dynamicanalyzer.ui.toolbar.replay.data.ReplayDataManager; import org.tizen.dynamicanalyzer.ui.userinterface.UIDataManager; import org.tizen.dynamicanalyzer.ui.userinterface.UIPage; @@ -90,7 +94,16 @@ public class PageInfoRegistry { timelinePageInfo.addDataManager(TimelineChartManager.class); timelinePageInfo.addDataManager(ReplayDataManager.class); timelinePageInfo.addDataManager(CallTraceDataManager.class); - timelinePageInfo.addDataManager(InteractiveDataManager.class); + if (Global.isGUIMode()) { + timelinePageInfo.addDataManager(InteractiveDataManager.class); + // Screenshots are not tested in CLI mode yet + // TODO test and enable + timelinePageInfo.addDataManager(ScreenshotDataManager.class); + } + timelinePageInfo.addDataManager(MemoryDataManager.class); + timelinePageInfo.addDataManager(DLogDataManager.class); + timelinePageInfo.addDataManager(FunctionUsageProfiler.class); + timelinePageInfo.addDataManager(SummaryDataManager.class); PageInfo uiPageInfo = new PageInfo(UIPage.class, SettingConstants.PAGE_NAME_UI); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPage.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPage.java index c3db618..398cfcb 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPage.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadPage.java @@ -112,8 +112,6 @@ public class ThreadPage extends DAPageComposite { bottomRightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH); bottomForm.setWeights(new int[] { 65, 35 }); - - DataManagerRegistry.registerPageDataManager(ThreadDataManager.getInstance()); } @Override diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/TimelinePage.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/TimelinePage.java index 3b3ba36..799c4d2 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/TimelinePage.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/TimelinePage.java @@ -111,16 +111,6 @@ public class TimelinePage extends DAPageComposite { bottomRightForm.setSashWidth(AnalyzerConstants.SASH_WIDTH); bottomForm.setWeights(new int[] { 65, 35 }); - - DataManagerRegistry.registerPageDataManager(TimelineChartManager.getInstance()); - DataManagerRegistry.registerPageDataManager(ReplayDataManager.getInstance()); - DataManagerRegistry.registerPageDataManager(CallTraceDataManager.getInstance()); - DataManagerRegistry.registerPageDataManager(InteractiveDataManager.getInstance()); - DataManagerRegistry.registerPageDataManager(ScreenshotDataManager.getInstance()); - DataManagerRegistry.registerPageDataManager(MemoryDataManager.getInstance()); - DataManagerRegistry.registerPageDataManager(DLogDataManager.getInstance()); - DataManagerRegistry.registerPageDataManager(FunctionUsageProfiler.getInstance()); - DataManagerRegistry.registerPageDataManager(SummaryDataManager.getInstance()); } @Override