[Title] fix tab order, process combo
authorjooyoul_lee <jy.exe.lee@samsung.com>
Tue, 17 Dec 2013 08:27:46 +0000 (17:27 +0900)
committerjooyoul_lee <jy.exe.lee@samsung.com>
Tue, 17 Dec 2013 08:27:46 +0000 (17:27 +0900)
[Desc.]
[Issue]

org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/nl/AnalyzerLabels.properties
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/page/BaseView.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/profiling/FunctionUsageProfiler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DAWindowingTableComposite.java

index 793c961..09dbb90 100755 (executable)
@@ -88,24 +88,24 @@ COOLBAR_AREA_KERNEL=Kernel
 COOLBAR_AREA_OPENGLES=OpenGL ES
 
 COOLBAR_AREA_TIMELINE_TOOLTIP=Timeline [Ctrl + 1]
-COOLBAR_AREA_FILE_TOOLTIP=File [Ctrl + 2]
+COOLBAR_AREA_FILE_TOOLTIP=File [Ctrl + 4]
 COOLBAR_AREA_NETWORK_TOOLTIP=Network [Ctrl + 3]
-COOLBAR_AREA_THREAD_TOOLTIP=Thread [Ctrl + 4]
-COOLBAR_AREA_UI_TOOLTIP=UI [Ctrl + 5]
-COOLBAR_AREA_OPENGLES_TOOLTIP=OpenGL ES [Ctrl + 6]
-COOLBAR_AREA_SUMMARY_TOOLTIP=Summary  [Ctrl + 7]
-COOLBAR_AREA_RANGE_TOOLTIP=Range [Ctrl + 8]
-COOLBAR_AREA_KERNEL_TOOLTIP=Kernel [Ctrl + 9]
+COOLBAR_AREA_THREAD_TOOLTIP=Thread [Ctrl + 2]
+COOLBAR_AREA_UI_TOOLTIP=UI [Ctrl + 6]
+COOLBAR_AREA_OPENGLES_TOOLTIP=OpenGL ES [Ctrl + 5]
+COOLBAR_AREA_SUMMARY_TOOLTIP=Summary  [Ctrl + 8]
+COOLBAR_AREA_RANGE_TOOLTIP=Range [Ctrl + 9]
+COOLBAR_AREA_KERNEL_TOOLTIP=Kernel [Ctrl + 7]
 
 COOLBAR_AREA_TIMELINE_TOOLTIP_MAC=Timeline [Command + 1]
-COOLBAR_AREA_FILE_TOOLTIP_MAC=File [Command + 2]
+COOLBAR_AREA_FILE_TOOLTIP_MAC=File [Command + 4]
 COOLBAR_AREA_NETWORK_TOOLTIP_MAC=Network [Command + 3]
-COOLBAR_AREA_THREAD_TOOLTIP_MAC=Thread [Command + 4]
-COOLBAR_AREA_UI_TOOLTIP_MAC=UI [Command + 5]
-COOLBAR_AREA_OPENGLES_TOOLTIP_MAC=OpenGL ES [Command +6]
-COOLBAR_AREA_SUMMARY_TOOLTIP_MAC=Summary  [Command + 7]
-COOLBAR_AREA_RANGE_TOOLTIP_MAC=Range [Command + 8]
-COOLBAR_AREA_KERNEL_TOOLTIP_MAC=Kernel [Command + 9]
+COOLBAR_AREA_THREAD_TOOLTIP_MAC=Thread [Command + 2]
+COOLBAR_AREA_UI_TOOLTIP_MAC=UI [Command + 6]
+COOLBAR_AREA_OPENGLES_TOOLTIP_MAC=OpenGL ES [Command + 5]
+COOLBAR_AREA_SUMMARY_TOOLTIP_MAC=Summary  [Command + 8]
+COOLBAR_AREA_RANGE_TOOLTIP_MAC=Range [Command + 9]
+COOLBAR_AREA_KERNEL_TOOLTIP_MAC=Kernel [Command + 7]
 
 COOLBAR_AREA_CONFIGURATION_FEATURES=Features
 COOLBAR_AREA_CONFIGURATION_SETTING=Configuration
index 553a298..5bb609a 100644 (file)
@@ -34,6 +34,7 @@ import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.ui.file.FilePage;
+import org.tizen.dynamicanalyzer.ui.kernel.KernelPage;
 import org.tizen.dynamicanalyzer.ui.network.NetworkPage;
 import org.tizen.dynamicanalyzer.ui.opengl.ui.GLPage;
 import org.tizen.dynamicanalyzer.ui.range.RangeDataManager;
@@ -65,6 +66,7 @@ public class ShortCutManager {
        private static int KEY_6 = 54;
        private static int KEY_7 = 55;
        private static int KEY_8 = 56;
+       private static int KEY_9 = 57;
 
        public static String START_TRACE = null;
        public static String STOP_TRACE = null;
@@ -168,25 +170,28 @@ public class ShortCutManager {
                else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_1) {
                        System.out.println("timeline page");
                        AnalyzerUtil.changePage(TimelinePage.ID);
-               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_2) {
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_4) {
                        System.out.println("file page");
                        AnalyzerUtil.changePage(FilePage.ID);
                } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_3) {
                        System.out.println("NetworkPage page");
                        AnalyzerUtil.changePage(NetworkPage.ID);
-               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_4) {
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_2) {
                        System.out.println("thread page");
                        AnalyzerUtil.changePage(ThreadPage.ID);
-               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_5) {
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_6) {
                        System.out.println("ui page");
                        AnalyzerUtil.changePage(UIPage.ID);
-               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_6) {
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_5) {
                        System.out.println("Graphics page");
                        AnalyzerUtil.changePage(GLPage.ID);
                } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_7) {
+                       System.out.println("Kernel page");
+                       AnalyzerUtil.changePage(KernelPage.ID);
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_8) {
                        System.out.println("summary page");
                        AnalyzerUtil.changePage(SummaryPage.ID);
-               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_8) {
+               } else if (event.stateMask == CTRL_STATE_MASK && event.keyCode == KEY_9) {
                        System.out.println("range page");
                        AnalyzerUtil.changePage(RangePage.ID);
                }
index 9959762..50bf53f 100755 (executable)
@@ -60,29 +60,29 @@ public class BaseView extends ViewPart {
                                        tabView.getContentComposite(), SWT.NONE);
                        tabView.addView(timelinePage, false);
 
+                       Composite threadPage = new ThreadPage(
+                                       tabView.getContentComposite(), SWT.NONE);
+                       tabView.addView(threadPage, false);
+
+                       Composite networkPage = new NetworkPage(
+                                       tabView.getContentComposite(), SWT.NONE);
+                       tabView.addView(networkPage, false);
+
                        Composite filePage = new FilePage(tabView.getContentComposite(),
                                        SWT.NONE);
                        tabView.addView(filePage, false);
-                       
-                       Composite networkPage = new NetworkPage(tabView.getContentComposite(),
-                                       SWT.NONE);
-                       tabView.addView(networkPage, false);
 
-                       Composite threadPage = new ThreadPage(
-                                       tabView.getContentComposite(), SWT.NONE);
-                       tabView.addView(threadPage, false);
+                       Composite graphicsPage = new GLPage(tabView.getContentComposite(),
+                                       SWT.NONE);
+                       tabView.addView(graphicsPage, false);
 
                        Composite uiPage = new UIPage(tabView.getContentComposite(),
                                        SWT.NONE);
                        tabView.addView(uiPage, false);
-                       
-                       Composite graphicsPage = new GLPage(
-                                       tabView.getContentComposite(), SWT.NONE);
-                       tabView.addView(graphicsPage, false);
-                       
-                       Composite kernelPage = new KernelPage(
-                                       tabView.getContentComposite(), SWT.NONE);
-                       tabView.addView(kernelPage, false);
+
+//                     Composite kernelPage = new KernelPage(
+//                                     tabView.getContentComposite(), SWT.NONE);
+//                     tabView.addView(kernelPage, false);
 
                        Composite summaryPage = new SummaryPage(
                                        tabView.getContentComposite(), SWT.NONE);
index ac1fa1e..fc75a82 100644 (file)
@@ -59,21 +59,24 @@ public class FunctionUsageProfiler implements Runnable {
 
        public List<Integer> getPidsOfProfileDataMakerMap() {
                ArrayList<Integer> pids = new ArrayList<Integer>();
-               pids.addAll(profileDataMakerMap.keySet());
-               
+               pids.addAll(getProfileDataMakerMap().keySet());
                return pids;
        }
-       
-       public ProfileDataMaker getProfileDataMakerByPid(int pid) {
-               if(null == profileDataMakerMap) {
+
+       public synchronized HashMap<Integer, ProfileDataMaker> getProfileDataMakerMap() {
+               if (null == profileDataMakerMap) {
                        profileDataMakerMap = new HashMap<Integer, ProfileDataMaker>();
                }
-               ProfileDataMaker profileDataMaker = profileDataMakerMap.get(pid);
-               if(null == profileDataMaker) {
+               return profileDataMakerMap;
+       }
+
+       public ProfileDataMaker getProfileDataMakerByPid(int pid) {
+               ProfileDataMaker profileDataMaker = getProfileDataMakerMap().get(pid);
+               if (null == profileDataMaker) {
                        profileDataMaker = new ProfileDataMaker(
                                        AnalyzerManager.getCallstackManager());
                        profileDataMaker.setPid(pid);
-                       profileDataMakerMap.put(pid, profileDataMaker);
+                       getProfileDataMakerMap().put(pid, profileDataMaker);
                }
                return profileDataMaker;
        }
@@ -85,7 +88,7 @@ public class FunctionUsageProfiler implements Runnable {
                return instance;
        }
 
-       private List<List<LogData>> getSampleInputs() {
+       private synchronized List<List<LogData>> getSampleInputs() {
                if (null == sampleInputs) {
                        sampleInputs = new ArrayList<List<LogData>>();
                }
@@ -142,7 +145,7 @@ public class FunctionUsageProfiler implements Runnable {
                }
        }
 
-       public static void stopProfiler() {
+       public static synchronized void stopProfiler() {
                if (null != profiler && profiler.isAlive()) {
                        try {
                                sendNotify();
@@ -166,7 +169,8 @@ public class FunctionUsageProfiler implements Runnable {
                        int size = sample.size();
                        for (int i = 0; i < size; i++) {
                                getInstance().getProfileDataMakerByPid(sample.get(i).getPid())
-                                               .makeFunctionUsageProfileData((ProfileData) sample.get(i));
+                                               .makeFunctionUsageProfileData(
+                                                               (ProfileData) sample.get(i));
                        }
                }
 
index f7767aa..9cf0757 100755 (executable)
@@ -91,6 +91,10 @@ public class ToolbarArea {
        public static final int SCREENSHOT_BUTTON = 8;
        public static final int REPLAY_EDIT_BUTTON = 9;
 
+       public static final String ALL_PROCESS = "All Processes";
+       public static final String PROCESS_SPLITER = CommonConstants.SPACE
+                       + CommonConstants.COLON + CommonConstants.SPACE;
+
        String selectedDevice = null;
        AppInfo selectedApp = null;
 
@@ -374,14 +378,23 @@ public class ToolbarArea {
                                        return;
                                }
                                processCombo.initCombo();
-                               processCombo.add("ALL");
+                               processCombo.add(ALL_PROCESS);
 
                                List<ProcessInfoPackage> processInfoPkgList = new ArrayList<ProcessInfoPackage>();
                                processInfoPkgList.addAll(project.getProcessInfoPackHash()
                                                .values());
                                for (ProcessInfoPackage pkg : processInfoPkgList) {
-                                       String pid = Integer.toString(pkg.getPid());
-                                       processCombo.add(pid);
+                                       // String pid = Integer.toString(pkg.getPid());
+                                       String binPath = pkg.getTargetBinaryPath();
+                                       String binName = CommonConstants.EMPTY;
+                                       if (null != binPath && !binPath.isEmpty()) {
+                                               int index = binPath.lastIndexOf(CommonConstants.SLASH);
+                                               binName = binPath.substring(index + 1, binPath.length());
+                                       }
+                                       StringBuffer buffer = new StringBuffer();
+                                       buffer.append(pkg.getPid()).append(PROCESS_SPLITER);
+                                       buffer.append(binName);
+                                       processCombo.add(buffer.toString());
                                }
                        }
                });
@@ -543,7 +556,7 @@ public class ToolbarArea {
                AnalyzerUtil.changePage(TimelinePage.ID);
                AnalyzerManager.setRunningState(true);
                processCombo.initCombo();
-               processCombo.add("ALL");
+               processCombo.add(ALL_PROCESS);
                processCombo.select(0);
                TraceStartStopThread.runStartStopThread();
        }
@@ -821,7 +834,7 @@ public class ToolbarArea {
                processCombo.setLayoutData(data);
 
                processCombo.initCombo();
-               processCombo.add("ALL");
+               processCombo.add(ALL_PROCESS);
                processCombo.select(0);
 
                // Adds toolbar listeners.
@@ -1228,8 +1241,16 @@ public class ToolbarArea {
        public int getSelectedPid() {
                int ret = 0;
                String pid = processCombo.getText();
-               if (!pid.equals("ALL")) {
-                       ret = Integer.parseInt(pid);
+               if (!pid.equals(ALL_PROCESS)) {
+                       int index = pid.indexOf(PROCESS_SPLITER);
+                       String str = pid.substring(0, index);
+                       if (null != str && !str.isEmpty()) {
+                               try {
+                                       ret = Integer.parseInt(str);
+                               } catch (NumberFormatException e) {
+                                       e.printStackTrace();
+                               }
+                       }
                }
                return ret;
        }
index ac1d006..4e518f4 100644 (file)
@@ -43,6 +43,9 @@ import org.eclipse.swt.graphics.Color;
 import org.eclipse.swt.graphics.Point;
 import org.eclipse.swt.graphics.Rectangle;
 import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
@@ -94,7 +97,7 @@ public abstract class DAWindowingTableComposite extends Composite {
        protected long selectionEndTime = -1;
        private int scrollStartSelection = 0;
        private int scrollEndSelection = 0;
-//     private int preDBTableItemsCount = 0;
+       // private int preDBTableItemsCount = 0;
        private List<TableInput> savedTableInputList = null;
 
        private int preLogCount = -1;
@@ -137,7 +140,7 @@ public abstract class DAWindowingTableComposite extends Composite {
 
                scrollComp = new Composite(this, SWT.V_SCROLL);
                scrollComp.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
-               scrollComp.setLayout(new FillLayout());
+               scrollComp.setLayout(new FormLayout());
 
                scrollbar = scrollComp.getVerticalBar();
                scrollbar.setMaximum(0);
@@ -157,6 +160,18 @@ public abstract class DAWindowingTableComposite extends Composite {
                table.setEmptyCellRenderer(new DATableEmptyCellRenderer());
                table.setItemHeight(16);
 
+               FormData data = new FormData();
+               data.top = new FormAttachment(0, 0);
+               data.bottom = new FormAttachment(100, 0);
+               data.left = new FormAttachment(0, 0);
+
+               if (AnalyzerUtil.isLinux()) {
+                       data.right = new FormAttachment(100, -2);
+               } else {
+                       data.right = new FormAttachment(100, 0);
+               }
+               table.setLayoutData(data);
+
                table.addListener(SWT.MouseMove, new Listener() {
 
                        @Override
@@ -256,8 +271,8 @@ public abstract class DAWindowingTableComposite extends Composite {
                selectionStartTime = 0;
                selectionEndTime = 0;
                focusSeq = 0;
-               if(table.getItemCount() <= index){
-                       index = table.getItemCount()-1;
+               if (table.getItemCount() <= index) {
+                       index = table.getItemCount() - 1;
                }
                GridItem focusedItem = table.getItem(index);
                if (null != focusedItem) {
@@ -294,7 +309,7 @@ public abstract class DAWindowingTableComposite extends Composite {
                selectionEndTime = -1;
                scrollStartSelection = 0;
                scrollEndSelection = 0;
-       //      preDBTableItemsCount = 0;
+               // preDBTableItemsCount = 0;
                savedTableInputList = null;
                savedLogDataList = null;
                dbInsetedItemCount = 0;
@@ -323,7 +338,7 @@ public abstract class DAWindowingTableComposite extends Composite {
                if (isSelectDB) {
                        setSavedDBList(makeAddTableInputFromDB());
                }
-       //      preDBTableItemsCount = getItemCount();
+               // preDBTableItemsCount = getItemCount();
 
                return makeTableList(getSavedDBList());
        }