[SRADA-709] Add 'source view' function
authordongkyu6 lee <dongkyu6.lee@samsung.com>
Tue, 31 May 2016 00:29:41 +0000 (09:29 +0900)
committerdongkyu6 lee <dongkyu6.lee@samsung.com>
Tue, 31 May 2016 04:20:36 +0000 (13:20 +0900)
Change-Id: I8deae44b952f1a71192497db4b47b4dd8b1fb3c4

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/SummaryMouseDoubleClickListener.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/listeners/TableTooltipListener.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/MenuBar.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/setting/PreferencesDialog.java

index f18784e..5dd0fc4 100644 (file)
@@ -38,8 +38,8 @@ import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.ui.file.FilePage;
 import org.tizen.dynamicanalyzer.ui.network.NetworkPage;
 import org.tizen.dynamicanalyzer.ui.opengl.GLPage;
+import org.tizen.dynamicanalyzer.ui.page.MenuBar;
 import org.tizen.dynamicanalyzer.ui.thread.ThreadPage;
-import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.widgets.da.view.DAPageComposite;
@@ -76,7 +76,7 @@ public class SummaryMouseDoubleClickListener implements MouseListener {
        public void mouseDoubleClick(MouseEvent e) {
                // swt.button1 = left click
                // swt.button3 = right click
-               if (Toolbar.INSTANCE.isSourceViewEnabled()
+               if(MenuBar.getInstance().getSourceView()
                                || !(e.widget instanceof Grid)) {
                        return;
                }
index e27ea71..d8a839b 100644 (file)
@@ -66,6 +66,7 @@ import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
 import org.tizen.dynamicanalyzer.swap.platform.BinarySettingData;
 import org.tizen.dynamicanalyzer.swap.platform.BinarySettingManager;
+import org.tizen.dynamicanalyzer.ui.page.MenuBar;
 import org.tizen.dynamicanalyzer.ui.timeline.calltrace.FunctionEntryDBTable;
 import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;
@@ -106,7 +107,7 @@ public class TableTooltipListener implements Listener {
                        isHeader = true;
                }
 
-               boolean isToggled = Toolbar.INSTANCE.isSourceViewEnabled();
+               boolean isToggled = MenuBar.getInstance().getSourceView();
                if (enabled && !isHeader) {
                        setViewCursor(isToggled);
                }
index dd47a1b..ede26da 100644 (file)
@@ -30,7 +30,6 @@ import java.util.ArrayList;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.FileDialog;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.swt.widgets.MenuItem;
@@ -45,7 +44,6 @@ import org.tizen.dynamicanalyzer.handlers.UIAction;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.nl.MenuBarLabels;
 import org.tizen.dynamicanalyzer.project.Project;
-import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
 import org.tizen.dynamicanalyzer.ui.file.FileChartView;
 import org.tizen.dynamicanalyzer.ui.file.FilePage;
@@ -58,9 +56,7 @@ import org.tizen.dynamicanalyzer.ui.thread.chart.ThreadChartView;
 import org.tizen.dynamicanalyzer.ui.timeline.TimelinePage;
 import org.tizen.dynamicanalyzer.ui.timeline.common.TimelineChartView;
 import org.tizen.dynamicanalyzer.ui.toolbar.AboutDialog;
-import org.tizen.dynamicanalyzer.ui.toolbar.SaveAsDialog;
 import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;
-import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceDialog;
 import org.tizen.dynamicanalyzer.ui.toolbar.opentrace.OpenTraceProgressManager;
 import org.tizen.dynamicanalyzer.ui.toolbar.setting.FlatFeatureDialog;
 import org.tizen.dynamicanalyzer.ui.toolbar.setting.PreferencesDialog;
@@ -77,6 +73,8 @@ public class MenuBar {
        private static MenuBar instance = new MenuBar();
        private Shell currentShell;
        private Menu menubar = null;
+       
+       private boolean sourceView = false;
 
        public MenuBar() {
                currentShell = WorkbenchUtil.getWorkbenchWindow().getShell();
@@ -556,5 +554,11 @@ public class MenuBar {
                return false;
        }
        
-
+       public void setSourceView(boolean setview) {
+               this.sourceView = setview;
+       }
+       
+       public boolean getSourceView() {
+               return this.sourceView;
+       }
 }
\ No newline at end of file
index c0f56f9..9933a48 100644 (file)
@@ -51,6 +51,7 @@ import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.setting.FlatPreferences;
 import org.tizen.dynamicanalyzer.setting.SettingDataManager;
 import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
+import org.tizen.dynamicanalyzer.ui.page.MenuBar;
 import org.tizen.dynamicanalyzer.util.CommonUtil;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
@@ -232,6 +233,13 @@ public class PreferencesDialog extends DAMessageBox {
                generalvalues.setBackground(ColorResources.DIALOG_CONTENT_BACKGROUND);
 
                sourceviewtoggle = createToggleButton(generalvalues);
+               sourceviewtoggle.addClickListener(new DACustomButtonClickEventListener() {
+
+                       @Override
+                       public void handleClickEvent(DACustomButton button) {
+                               MenuBar.getInstance().setSourceView(sourceviewtoggle.isToggled());
+                       }
+               });
 
                systemrateText = createTextBox(generalvalues, "ms");
 
@@ -473,8 +481,10 @@ public class PreferencesDialog extends DAMessageBox {
                
                if (value == 1) {
                        sourceviewtoggle.setToggled(true);
+                       MenuBar.getInstance().setSourceView(true);
                } else {
                        sourceviewtoggle.setToggled(false);
+                       MenuBar.getInstance().setSourceView(false);
                }
 
                value = SettingDataManager.INSTANCE.getOptionsPreferencesValue(FlatPreferences.SYSTEM_SAMPLING_RATE);