[Title] bug patch
authorjooyoul_lee <jy.exe.lee@samsung.com>
Tue, 10 Sep 2013 02:09:21 +0000 (11:09 +0900)
committerjooyoul_lee <jy.exe.lee@samsung.com>
Tue, 10 Sep 2013 02:09:21 +0000 (11:09 +0900)
[Desc.]
[Issue]  -

27 files changed:
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomButton.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/button/DACustomButtonClickEventListener.java
org.tizen.dynamicanalyzer.widgets/src/org/tizen/dynamicanalyzer/widgets/combo/DACustomCombo.java
org.tizen.dynamicanalyzer.workbench/src/org/tizen/dynamicanalyzer/workbench/ApplicationWorkbenchWindowAdvisor.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/AnalyzerManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/DACommunicator.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/MessageProcess.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/shortcut/ShortCutManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/communicator/Communicator30.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/logparser/MessageParser.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/chart/FileChart.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/AddChartMenuComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/common/TimelineEditItemsDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/AboutDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/SaveAsDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/StartProcessManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/StopProcessManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/TraceStartStopThread.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/ConfigurationDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/WelcomeDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/opentrace/OpenTraceDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DAMessageBox.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/ProgressDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/AnalyzerUtil.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/utils/Formatter.java

index 8374a3d..0402ec0 100755 (executable)
@@ -196,6 +196,8 @@ public class DACustomButton extends Canvas {
                this.addListener(SWT.MouseExit, buttonMouseListener);
                this.addListener(SWT.MouseDown, buttonMouseListener);
                this.addListener(SWT.MouseUp, buttonMouseListener);
+               this.addListener(SWT.MouseMove, buttonMouseListener);
+               this.addListener(SWT.MouseHover, buttonMouseListener);
        }
 
        /**
@@ -239,8 +241,7 @@ public class DACustomButton extends Canvas {
         * Sets default state colors
         */
        private void setDefaultColors() {
-               attr.setColor(STATE_DISABLE,
-                               ColorResources.BUTTON_STATE_DISABLE);
+               attr.setColor(STATE_DISABLE, ColorResources.BUTTON_STATE_DISABLE);
                attr.setColor(STATE_PUSH, ColorResources.BUTTON_STATE_PUSH);
                attr.setColor(STATE_HOVER, ColorResources.BUTTON_STATE_HOVER);
                attr.setColor(STATE_NORMAL, ColorResources.BUTTON_STATE_NORMAL);
index c714b12..6471e79 100644 (file)
@@ -46,8 +46,12 @@ public abstract class DACustomButtonClickEventListener implements Listener {
                } else {\r
                        return;\r
                }\r
-\r
+               String tooltip = button.getToolTipText();\r
+               button.setToolTipText(null);\r
                handleClickEvent(button);\r
+               if (!button.isDisposed()) {\r
+                       button.setToolTipText(tooltip);\r
+               }\r
        }\r
 \r
        public abstract void handleClickEvent(DACustomButton button);\r
index ad1ae16..708d24a 100644 (file)
@@ -124,6 +124,9 @@ public class DACustomCombo extends Canvas {
        }
 
        public String getText() {
+               if (selection < 0) {
+                       return text;
+               }
                if (getItems().size() > 0) {
                        return getItems().get(itemIndex + selection);
                }
@@ -192,6 +195,10 @@ public class DACustomCombo extends Canvas {
                                if (event.type == SWT.MouseUp) {
                                        changeComboState(STATE_HOVER);
                                        if (childShell == null || childShell.isDisposed()) {
+                                               if (closeTimer != null) {
+                                                       closeTimer.cancel();
+                                                       closeTimer = null;
+                                               }
                                                openChildShell();
                                        } else {
                                                childShell.close();
@@ -249,7 +256,7 @@ public class DACustomCombo extends Canvas {
        }
 
        private void openChildShell() {
-               childShell = new Shell(parent.getShell(), SWT.ON_TOP);
+               childShell = new Shell(parent.getShell(), SWT.NO_TRIM);
                childShell.setLayout(new FormLayout());
 
                Point p = combo.toDisplay(0, 0);
@@ -293,6 +300,7 @@ public class DACustomCombo extends Canvas {
                popup.addListener(SWT.MouseUp, popupMouseEventListener);
                popup.addListener(SWT.MouseMove, popupMouseEventListener);
                popup.addListener(SWT.FocusOut, popupMouseEventListener);
+               popup.addListener(SWT.FocusIn, popupMouseEventListener);
                popup.addListener(SWT.MouseUp, popupSelectionListener);
                popup.addListener(SWT.MouseWheel, popupMouseEventListener);
                popup.addListener(SWT.MouseExit, popupMouseEventListener);
@@ -314,6 +322,8 @@ public class DACustomCombo extends Canvas {
                        upArrowButton.addListener(SWT.MouseExit, upButtonMouseListener);
                        upArrowButton.addListener(SWT.MouseEnter, upButtonMouseListener);
                        upArrowButton.addListener(SWT.MouseUp, upButtonMouseListener);
+                       upArrowButton.addListener(SWT.FocusIn, upButtonMouseListener);
+                       upArrowButton.addListener(SWT.FocusOut, upButtonMouseListener);
                        shellHeight += height;
                        if (tmpItemIndex > 0) {
                                upArrowButton.setButtonEnabled(true);
@@ -344,6 +354,8 @@ public class DACustomCombo extends Canvas {
                        downArrowButton
                                        .addListener(SWT.MouseEnter, downButtonMouseListener);
                        downArrowButton.addListener(SWT.MouseUp, downButtonMouseListener);
+                       downArrowButton.addListener(SWT.FocusIn, downButtonMouseListener);
+                       downArrowButton.addListener(SWT.FocusOut, downButtonMouseListener);
                        shellHeight += height;
                        if (tmpItemIndex + MAX_SIZE < size - 1) {
                                downArrowButton.setButtonEnabled(true);
@@ -390,6 +402,7 @@ public class DACustomCombo extends Canvas {
        public void setText(String text) {
                if (!setSelect(text)) {
                        this.text = text;
+                       selection = -1;
                        redraw();
                }
        }
@@ -498,12 +511,16 @@ public class DACustomCombo extends Canvas {
                                }
                        }
 
-                       if (event.type == SWT.MouseEnter) {
+                       if (event.type == SWT.MouseEnter || event.type == SWT.FocusIn) {
                                if (null != closeTimer) {
                                        closeTimer.cancel();
                                        closeTimer = null;
                                }
                        }
+
+                       if (event.type == SWT.FocusOut) {
+                               closePopup(CLOSE_WAITING_TIME);
+                       }
                }
        };
 
@@ -565,6 +582,7 @@ public class DACustomCombo extends Canvas {
        public void select(int index) {
                selection = index;
                this.text = items.get(itemIndex + selection);
+               this.setToolTipText(text);
                redraw();
        }
 
@@ -617,13 +635,17 @@ public class DACustomCombo extends Canvas {
                                }
                        }
 
-                       if (event.type == SWT.MouseEnter) {
+                       if (event.type == SWT.MouseEnter || event.type == SWT.FocusIn) {
                                if (null != closeTimer) {
                                        closeTimer.cancel();
                                        closeTimer = null;
                                }
                        }
 
+                       if (event.type == SWT.FocusOut) {
+                               closePopup(CLOSE_WAITING_TIME);
+                       }
+
                        if (event.type == SWT.MouseUp) {
                                if (!upArrowButton.isButtonEnabled()) {
                                        return;
@@ -670,13 +692,17 @@ public class DACustomCombo extends Canvas {
                                }
                        }
 
-                       if (event.type == SWT.MouseEnter) {
+                       if (event.type == SWT.MouseEnter || event.type == SWT.FocusIn) {
                                if (null != closeTimer) {
                                        closeTimer.cancel();
                                        closeTimer = null;
                                }
                        }
 
+                       if (event.type == SWT.FocusOut) {
+                               closePopup(CLOSE_WAITING_TIME);
+                       }
+
                        if (event.type == SWT.MouseUp) {
                                if (!downArrowButton.isButtonEnabled()) {
                                        return;
@@ -811,6 +837,9 @@ public class DACustomCombo extends Canvas {
        }
 
        public void closePopup(int interval) {
+               if (null == childShell || childShell.isDisposed()) {
+                       return;
+               }
                closeTimer = new Timer();
                closeTimer.schedule(new TimerTask() {
                        public void run() {
@@ -820,11 +849,14 @@ public class DACustomCombo extends Canvas {
                                                if (null != childShell && !childShell.isDisposed()) {
                                                        childShell.close();
                                                        childShell = null;
+                                               } else {
+                                                       System.out
+                                                                       .println("combo timer bug : try close child shell ");
                                                }
                                        }
                                });
                        }
-               }, interval, interval);
+               }, interval);
        }
 
        public void setTextAlign(int align) {
index c463118..c6ef4b6 100755 (executable)
@@ -110,7 +110,7 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
                ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
                if (!ConfigurationDialogValues.getInstance().isShowInitia()) {
                        final Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
-                       WelcomeDialog dialog = new WelcomeDialog(shell, SWT.NONE); // FIXME
+                       WelcomeDialog dialog = new WelcomeDialog(shell); // FIXME
                        dialog.open();
                }
                PathManager.setLogPostFix(WorkbenchUtils.getLogPostFix());
index 671d8d3..d0e8318 100755 (executable)
@@ -42,7 +42,6 @@ import org.tizen.dynamicanalyzer.model.LeakCheckList;
 import org.tizen.dynamicanalyzer.model.LogCenter;
 import org.tizen.dynamicanalyzer.project.Project;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.services.RecordStateSourceProvider;
 import org.tizen.dynamicanalyzer.swap.callstack.BaseCallstackManager;
 import org.tizen.dynamicanalyzer.swap.callstack.SWAPCallStackManager;
 import org.tizen.dynamicanalyzer.theme.DATheme;
index 382a710..8a0632a 100644 (file)
@@ -870,8 +870,6 @@ public class DACommunicator {
                                        public void run() {
                                                ToolbarArea.getInstance()
                                                                .setStartButtonEnablement(true);
-                                               ToolbarArea.getInstance()
-                                                               .setStartButtonEnablement(true);
                                        }
                                });
                        }
@@ -894,8 +892,6 @@ public class DACommunicator {
                                                public void run() {
                                                        ToolbarArea.getInstance().setStartButtonEnablement(
                                                                        true);
-                                                       ToolbarArea.getInstance().setStartButtonEnablement(
-                                                                       true);
                                                }
                                        });
                                }
index f156a28..94e7679 100644 (file)
@@ -187,6 +187,7 @@ public class OpenTraceHandler extends AbstractHandler {
                ToolbarArea.getInstance().setTime(p.getLastTime());\r
                ToolbarArea.getInstance().setDeviceComboText(p.getDevice());\r
                ToolbarArea.getInstance().setAppComboText(p.getAppName());\r
+               ToolbarArea.getInstance().checkStartButtonAndAppListEnablement();\r
                ToolbarArea.getInstance().setRepalyButtonEnable(true);\r
                if (AnalyzerManager.getProject().getBinaryPath().isEmpty()) {\r
                        ToolbarArea.getInstance().setSourceViewEnable(false);\r
index 9e9cf58..7ac2ea1 100644 (file)
@@ -74,7 +74,7 @@ public class MessageProcess {
                                count = 0;
                        } else {
                                count++;
-                               if (count >= WAITING_TIME) {
+                               if (count >= WAITING_TIME && DACommunicator.isRunning()) {
                                        ToolbarArea.getInstance().stopTrace();
                                }
                        }
index a595d1f..3ed5754 100644 (file)
@@ -104,13 +104,12 @@ public class ShortCutManager {
                if (event.keyCode == SWT.F1) {
                        System.out.println("about");
                        Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
-                       AboutDialog dialog = new AboutDialog(shell, SWT.NONE); // FIXME
+                       AboutDialog dialog = new AboutDialog(shell); // FIXME
                        dialog.open();
                } else if (event.keyCode == SWT.F2) {
                        System.out.println("configuration");
                        Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
-                       ConfigurationDialog dialog = new ConfigurationDialog(shell,
-                                       SWT.NONE); // FIXME
+                       ConfigurationDialog dialog = new ConfigurationDialog(shell); // FIXME
                        dialog.open();
                } else if (event.keyCode == SWT.F3) {
                        System.out.println("view source toggle");
index 49cf7a1..6c8e642 100755 (executable)
@@ -203,11 +203,11 @@ public class Communicator30 extends BaseCommunicator {
                }
 
                // TODO: app inst , replay info added!!
-               // byte[] rear = ByteUtils.getByte(appInfo.getByteValue(),
-               // rt.getByteValue(), getUserSpaceInst().getByteValue(),
-               // replayEvent);
-               byte[] rear = ByteUtils.getByte(appInfo.getByteValue(),
-                               rt.getByteValue(), 0, 0);
+                byte[] rear = ByteUtils.getByte(appInfo.getByteValue(),
+                rt.getByteValue(), getUserSpaceInst().getByteValue(),
+                replayEvent);
+//             byte[] rear = ByteUtils.getByte(appInfo.getByteValue(),
+//                             rt.getByteValue(), 0, 0);
                int length = rear.length;
 
                byte[] ret = ByteUtils.getByte(AnalyzerConstants.MSG_START_SWAP,
@@ -398,20 +398,44 @@ public class Communicator30 extends BaseCommunicator {
                // FIXME: permission denied problem
 
                if (!targetHashCode.equals(localHashCode)) {
-                       String destFilePath = AnalyzerPaths.TEMP_FOLDER_PATH
-                                       + File.separator + selectedApp.getExecFileName(appInfo.getAppType());
-
-                       SyncResult res = CommunicatorUtils.pull(targetPath, destFilePath);
-                       if (null != res && res.isOk()) {
-                               System.out.println("binary copy success!!");//$NON-NLS-1$ 
-                       } else {
-                               System.out.println("Failed to get " + targetPath + "  step 2"); //$NON-NLS-1$ 
+                       String destFilePath = AnalyzerPaths.TEMP_FOLDER_PATH;
+//                                     + File.separator + selectedApp.getExecFileName(appInfo.getAppType());
+                       try{
+                       Runtime rt = Runtime.getRuntime();
+                       command = "/home/casval/tizen-sdk/tools/sdb root on | /home/casval/tizen-sdk/tools/sdb pull "+ targetPath + "  " + destFilePath;
+                       Process process = rt.exec(new String[] {
+                                       "/home/casval/tizen-sdk/tools/sdb", "root", "on"});
+                       process.waitFor();
+                       BufferedReader reader = new BufferedReader(new InputStreamReader(
+                                       process.getInputStream()));
+                       BufferedReader error = new BufferedReader(new InputStreamReader(
+                                       process.getErrorStream()));
+                       String line = reader.readLine();
+                       String errorStr = error.readLine();
+                       if (null == line) {
+                               System.out.println("host md5sum get failed : " + errorStr);
                                return HostResult.ERR_BIN_INFO_GET_FAIL;
                        }
-                       String[] splitName = binaryPath.split(CommonConstants.SLASH);
-                       binaryPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator
-                                       + new String(splitName[splitName.length - 1]);
-                       binInfo.setPath(binaryPath);
+
+                       }catch(IOException e)
+                       {
+                               e.printStackTrace();
+                       }catch(InterruptedException e)
+                       {
+                               e.printStackTrace();
+                       }
+//
+//                     SyncResult res = CommunicatorUtils.pull(targetPath, destFilePath);
+//                     if (null != res && res.isOk()) {
+//                             System.out.println("binary copy success!!");//$NON-NLS-1$ 
+//                     } else {
+//                             System.out.println("Failed to get " + targetPath + "  step 2"); //$NON-NLS-1$ 
+//                             return HostResult.ERR_BIN_INFO_GET_FAIL;
+//                     }
+//                     String[] splitName = binaryPath.split(CommonConstants.SLASH);
+//                     binaryPath = AnalyzerPaths.TEMP_FOLDER_PATH + File.separator
+//                                     + new String(splitName[splitName.length - 1]);
+//                     binInfo.setPath(binaryPath);
                }
                binInfo.setPath(binaryPath);
 
index 244c275..50b4505 100755 (executable)
@@ -272,6 +272,9 @@ public class MessageParser {
                                        break;
                                }
 
+                               //LOG!
+                               ByteUtils.printByteArray(header);
+                               
                                int id = ByteUtils.toInt(header, 0);
                                int payloadSize = ByteUtils.toInt(header,
                                                MSG_PAYLOAD_SIZE_INDEX);
index 29b4720..ce43598 100644 (file)
@@ -151,23 +151,23 @@ public class FileChart extends TimelineChart {
 
        @Override
        public void parseLogPackage(LogPackage logPack) {
-//             Logs logs = logPack.getLogs(probeType);
-//             List<LogData> logList = logs.getLogs();
-//             for (LogData log : logList) {
-//                     double time = Double.parseDouble(Long.toString(log.getTime()));
-//
-//                     int size = deviceLogTimeList.size();
-//                     int index = (int) (time / TimelineConstants.MEGA);
-//
-//                     if (size <= index) {
-//                             for (int i = size; i <= index; i++) {
-//                                     deviceLogTimeList.add(Double.NaN);
-//                             }
-//                     }
-//                     deviceLogTimeList.set(index, time);
-//
-//                     updateRW(time);
-//             }
+               Logs logs = logPack.getLogs(probeType);
+               List<LogData> logList = logs.getLogs();
+               for (LogData log : logList) {
+                       double time = Double.parseDouble(Long.toString(log.getTime()));
+
+                       int size = deviceLogTimeList.size();
+                       int index = (int) (time / TimelineConstants.MEGA);
+
+                       if (size <= index) {
+                               for (int i = size; i <= index; i++) {
+                                       deviceLogTimeList.add(Double.NaN);
+                               }
+                       }
+                       deviceLogTimeList.set(index, time);
+
+                       updateRW(time);
+               }
        }
 
        private void updateRW(double time) {
index 3922b65..d33dba8 100644 (file)
@@ -53,8 +53,7 @@ public class AddChartMenuComposite extends Composite {
                @Override
                public void handleClickEvent(DACustomButton button) {
                        Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
-                       TimelineEditItemsDialog dialog = new TimelineEditItemsDialog(shell,
-                                       SWT.None);
+                       TimelineEditItemsDialog dialog = new TimelineEditItemsDialog(shell);
                        if (dialog.isRunningDialog() == false) {
                                dialog.open();
                        }
index 10bc3ef..a0ce388 100644 (file)
@@ -28,7 +28,6 @@ package org.tizen.dynamicanalyzer.ui.timeline.common;
 import java.util.ArrayList;
 import java.util.List;
 
-import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.dnd.DND;
@@ -74,14 +73,13 @@ import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.ui.timeline.chart.TimelineChart;
 import org.tizen.dynamicanalyzer.ui.toolbar.ConfigureManager;
 import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.ui.widgets.DAMessageBox;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
 
-public class TimelineEditItemsDialog extends Dialog {
-       
-       private Shell parent = null;
-       private Shell shell = null;
+public class TimelineEditItemsDialog extends DAMessageBox {
+
        private TableViewer chartTableViewer;
        private boolean chartChangeSatus = true;
 
@@ -97,13 +95,12 @@ public class TimelineEditItemsDialog extends Dialog {
        private static final String strDisableChart = "selected disable"; //$NON-NLS-1$
 
        private static boolean RunningDialog = false;
-       
-       public TimelineEditItemsDialog(Shell parent, int style) {
+
+       public TimelineEditItemsDialog(Shell parent) {
                super(parent);
-               this.parent = parent;
-               setShellStyle(getShellStyle() | SWT.MAX | SWT.RESIZE);
        }
-       public boolean isRunningDialog(){
+
+       public boolean isRunningDialog() {
                return RunningDialog;
        }
 
@@ -136,15 +133,16 @@ public class TimelineEditItemsDialog extends Dialog {
                                } else {
                                        showInfo.add(false);
                                }
-                               
+
                                order.add(Integer.parseInt(item.getText(4)));
                        }
-                       
-                       for(int i = tableitems.length; i < chartManager.getChartList().size(); i++) {
+
+                       for (int i = tableitems.length; i < chartManager.getChartList()
+                                       .size(); i++) {
                                chartList.add(chartManager.getChartList().get(i));
                                selectedChartList.add(chartManager.getChartList().get(i));
                        }
-                               
+
                        chartManager.setChartList(chartList);
                        chartManager.setSelectedChartList(selectedChartList);
                        AnalyzerUtil.getTimelineComposite().reArrangeChart(order, showInfo);
@@ -166,9 +164,9 @@ public class TimelineEditItemsDialog extends Dialog {
                public void handleClickEvent(DACustomButton button) {
                        shell.dispose();
                        RunningDialog = false;
-               }       
+               }
        };
-       
+
        private ShellListener shellListener = new ShellListener() {
 
                @Override
@@ -194,9 +192,7 @@ public class TimelineEditItemsDialog extends Dialog {
 
        };
 
-       @Override
-       public int open() {
-               shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM );
+       protected int run() {
                shell.setText(TimelineChartLabels.EDIT_CHART_DLG_TITLE);
                shell.setBackground(ColorResources.WINDOW_BG_COLOR);
                shell.setSize(446, 450);
@@ -422,7 +418,7 @@ public class TimelineEditItemsDialog extends Dialog {
 
                                        chartTableItems[SwapItemIndexB].setText(3, strIndexA);
                                        chartTableItems[SwapItemIndexA].setText(3, strIndexB);
-                                       
+
                                        strIndexA = chartTableItems[SwapItemIndexA].getText(4);
                                        strIndexB = chartTableItems[SwapItemIndexB].getText(4);
 
@@ -490,13 +486,12 @@ public class TimelineEditItemsDialog extends Dialog {
                                                rect.y + 1);
                        }
                });
-       
+
                // Adds listeners.
                RunningDialog = true;
                shell.addShellListener(shellListener);
-               shell.open();
-               
-               return 0;
+
+               return result;
        }
 
        private MouseListener itemZoomMouseListener = new MouseAdapter() {
index 9e07f13..fb193a7 100644 (file)
@@ -32,6 +32,8 @@ import java.io.FileReader;
 import java.io.IOException;
 
 import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
 import org.eclipse.swt.events.PaintEvent;
 import org.eclipse.swt.events.PaintListener;
 import org.eclipse.swt.graphics.Image;
@@ -40,7 +42,6 @@ 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.Display;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Shell;
 import org.tizen.dynamicanalyzer.common.AnalyzerPaths;
@@ -51,22 +52,21 @@ import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.ui.widgets.DAMessageBox;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
 
-public class AboutDialog {
+public class AboutDialog extends DAMessageBox {
        private static boolean opened = false;
-       private Shell parent = null;
-       private Shell shell = null;
        private DACustomButton licenseButton = null;
        private DACustomButton okButton = null;
        private File SDKAboutFile = null;
 
        private final Image iconImage = ImageResources.ABOUT_TIZEN_SDK;
 
-       public AboutDialog(Shell parent, int style) {
-               this.parent = parent;
+       public AboutDialog(Shell parent) {
+               super(parent);
        }
 
        private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
@@ -87,14 +87,21 @@ public class AboutDialog {
                }
        };
 
-       public int open() {
+       protected int run() {
                if (opened) {
                        return -1;
                }
-               shell = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
                shell.setSize(446, 254);
                shell.setLayout(new FormLayout());
                shell.setText(AnalyzerLabels.ABOUT);
+               shell.addDisposeListener(new DisposeListener() {
+                       
+                       @Override
+                       public void widgetDisposed(DisposeEvent e) {
+                               opened = false;
+                               ShortCutManager.getInstance().setEnabled(!opened);
+                       }
+               });
 
                Composite base = new Composite(shell, SWT.NONE);
                base.setLayout(new FormLayout());
@@ -120,9 +127,6 @@ public class AboutDialog {
                titleText.setText(AnalyzerLabels.ABOUT_DIALOG_TITLE);
 
                Label version = new Label(base, SWT.TRANSPARENT);
-               // version.setText(AnalyzerLabels.ABOUT_DIALOG_VERSION_TAB
-               // + ConfigureManager.getInstance().getValue(
-               // AnalyzerLabels.ABOUT_DIALOG_VERSION));
                String versionString = getVersion();// FIXME
                version.setText(AnalyzerLabels.ABOUT_DIALOG_VERSION_TAB + versionString);
                version.setBackground(ColorResources.DIALOG_BG_UPPER);
@@ -131,13 +135,6 @@ public class AboutDialog {
                version.setFont(FontResources.ABOUT_TEXT);
 
                Label buildTime = new Label(base, SWT.TRANSPARENT);
-
-               // buildTime.setText("Build time        : "+new
-               // SimpleDateFormat("MM/dd/yyyy HH:mm").format(new Date())); //FIXME :
-               // time
-               // buildTime.setText(AnalyzerLabels.ABOUT_DIALOG_BUILD_TIME_TAB
-               // + ConfigureManager.getInstance().getValue(
-               //                                              AnalyzerLabels.ABOUT_DIALOG_BUILD_TIME)); //$NON-NLS-1$
                String buildTimeString = getBuildTime();// FIXME
                buildTime.setText(AnalyzerLabels.ABOUT_DIALOG_BUILD_TIME_TAB
                                + buildTimeString);
@@ -197,7 +194,6 @@ public class AboutDialog {
                compData.top = new FormAttachment(base, 0);
                compData.left = new FormAttachment(0, 0);
                compData.right = new FormAttachment(100, 0);
-               // compData.height = 51;
                compData.bottom = new FormAttachment(100, 0);
                buttonComp.setLayoutData(compData);
 
@@ -227,21 +223,8 @@ public class AboutDialog {
 
                opened = true;
                ShortCutManager.getInstance().setEnabled(!opened);
-               shell.open();
-
-               Display display = Display.getDefault();
-
-               while (!shell.isDisposed()) {
-                       if (!display.readAndDispatch()) {
-                               display.sleep();
-                       }
-               }
-
-               shell.dispose();
-               opened = false;
-               ShortCutManager.getInstance().setEnabled(!opened);
 
-               return 0;
+               return result;
        }
 
        private String parseBuildTime(String readData) {
index 156127f..7cdc562 100755 (executable)
@@ -61,6 +61,8 @@ import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener
 
 public class SaveAsDialog extends DAMessageBox {
 
+       private int MAX_SAVE_FILE_NAME_LENGTH = 35;
+
        private Text textBox = null;
        private String saveFileName = null;
        private DAButton okButton = null;
@@ -159,6 +161,12 @@ public class SaveAsDialog extends DAMessageBox {
                @Override
                public void handleClickEvent(DACustomButton button) {
                        saveFileName = textBox.getText();
+                       
+                       if (saveFileName.length() > MAX_SAVE_FILE_NAME_LENGTH) {
+                               String old = saveFileName;
+                               saveFileName = old.substring(0, MAX_SAVE_FILE_NAME_LENGTH -1);
+                       }
+                       
                        if (executeSaveTrace()) {
                                result = AnalyzerConstants.SUCCESS;
                        }
index e503ee9..c83fa2f 100644 (file)
@@ -20,7 +20,7 @@ public class StartProcessManager implements Runnable {
 
        public void startProcessStart(String waitMessage) {
                Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
-               dialog = new ProgressDialog(shell, SWT.APPLICATION_MODAL);
+               dialog = new ProgressDialog(shell, SWT.ON_TOP);
                if (null != dialog) {
                        dialog.open();
                        dialog.setProgressMessage(waitMessage);
index d22099f..5229db1 100644 (file)
@@ -55,10 +55,9 @@ public class StopProcessManager {
                        return;
                }
                state = STOP_PROCESS_START;
-//             AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
                AnalyzerManager.setRunningState(false);
                Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
-               dialog = new ProgressDialog(shell, SWT.APPLICATION_MODAL);
+               dialog = new ProgressDialog(shell, SWT.ON_TOP);
                if (null != dialog) {
                        dialog.open();
                        dialog.setProgressMessage(EndMessage);
index 7ce8eaa..805a968 100755 (executable)
@@ -52,6 +52,7 @@ import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.common.DesignConstants;
 import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.handlers.ReplayTraceHandler;
+import org.tizen.dynamicanalyzer.model.DeviceInfo;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.nl.ConfigureLabels;
 import org.tizen.dynamicanalyzer.project.AppInfo;
@@ -232,7 +233,8 @@ public class ToolbarArea {
                                        replayButton.setButtonEnabled(false);
                                        return;
                                }
-                               String device = deviceCombo.getText();
+                               String device = DACommunicator.getSelectedDevice().getIDevice()
+                                               .getSerialNumber();
                                String deviceName = p.getDevice();
 
                                String appName = p.getAppName();
@@ -384,8 +386,7 @@ public class ToolbarArea {
                        @Override
                        public void handleClickEvent(DACustomButton button) {
                                Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
-                               ConfigurationDialog dialog = new ConfigurationDialog(shell,
-                                               SWT.NONE); // FIXME
+                               ConfigurationDialog dialog = new ConfigurationDialog(shell); // FIXME
                                dialog.open();
                        }
                });
@@ -395,7 +396,7 @@ public class ToolbarArea {
                        @Override
                        public void handleClickEvent(DACustomButton button) {
                                Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
-                               AboutDialog dialog = new AboutDialog(shell, SWT.NONE); // FIXME
+                               AboutDialog dialog = new AboutDialog(shell); // FIXME
                                dialog.open();
                        }
                });
@@ -466,15 +467,6 @@ public class ToolbarArea {
 
        public void startTrace() {
                ShortCutManager.getInstance().setEnabled(false);
-               Display.getDefault().syncExec(new Runnable() {
-
-                       @Override
-                       public void run() {
-                               StartProcessManager.getInstance().startProcessStart(
-                                               "prepare for tracing");
-                       }
-               });
-
                if (!checkValidApplication()) {
                        // fail message box
                        Shell shell = AnalyzerUtil.getWorkbenchWindow().getShell();
@@ -505,8 +497,16 @@ public class ToolbarArea {
                        ShortCutManager.getInstance().setEnabled(true);
                        return;
                }
+               Display.getDefault().syncExec(new Runnable() {
+
+                       @Override
+                       public void run() {
+                               StartProcessManager.getInstance().startProcessStart(
+                                               "prepare for tracing");
+                       }
+               });
+
                AnalyzerUtil.changePage(TimelinePage.ID);
-               // AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_RECORDING);
                AnalyzerManager.setRunningState(true);
                TraceStartStopThread.runStartStopThread();
        }
@@ -514,7 +514,6 @@ public class ToolbarArea {
        public void stopTrace() {
                ShortCutManager.getInstance().setEnabled(false);
                AnalyzerManager.getProject().setStopTime(getTime());
-               // AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
                AnalyzerManager.setRunningState(false);
                TraceStartStopThread.runStartStopThread();
        }
@@ -917,10 +916,48 @@ public class ToolbarArea {
                return viewSourceButton.isToggled();
        }
 
-       public void setStartButtonEnablement(boolean enabled) {
+       public void setStartButtonEnablement(final boolean enabled) {
+               Display.getDefault().syncExec(new Runnable() {
+
+                       @Override
+                       public void run() {
+                               if (!enabled) {
+                                       startButton.setButtonEnabled(false);
+                                       return;
+                               }
+
+                               String text = deviceCombo.getText();
+                               String device = DACommunicator.getSelectedDevice().getIDevice()
+                                               .getSerialNumber();
+                               if (!device.equals(text)) {
+                                       startButton.setButtonEnabled(false);
+                                       return;
+                               }
+                               startButton.setButtonEnabled(true);
+                       }
+               });
                startButton.setButtonEnabled(enabled);
        }
 
+       public void checkStartButtonAndAppListEnablement() {
+               Display.getDefault().syncExec(new Runnable() {
+
+                       @Override
+                       public void run() {
+                               String text = deviceCombo.getText();
+                               String device = DACommunicator.getSelectedDevice().getIDevice()
+                                               .getSerialNumber();
+                               if (!device.equals(text)) {
+                                       startButton.setButtonEnabled(false);
+                                       appCombo.setEnabled(false);
+                                       return;
+                               }
+                               startButton.setButtonEnabled(true);
+                               appCombo.setEnabled(true);
+                       }
+               });
+       }
+
        public void setSettingsButtonEnablement(boolean enabled) {
                settingsButton.setButtonEnabled(enabled);
        }
@@ -1030,17 +1067,35 @@ public class ToolbarArea {
        }
 
        private boolean checkValidApplication() {
+               List<DeviceInfo> devices = DACommunicator.getDevices();
+               if (null == devices || devices.isEmpty()) {
+                       return false;
+               }
+               String selectedDevice = deviceCombo.getText();
+               deviceCombo.initCombo();
+               int size = devices.size();
+               for (int i = 0; i < size; i++) {
+                       deviceCombo.add(devices.get(i).getIDevice().getSerialNumber());
+               }
+               int index = deviceCombo.getItems().indexOf(selectedDevice);
+               if (index >= 0) {
+                       deviceCombo.setText(selectedDevice);
+               } else {
+                       deviceCombo.setText(CommonConstants.EMPTY);
+                       return false;
+               }
+
                List<AppInfo> apps = DACommunicator.getAppListFromTarget();
                if (null == apps || apps.isEmpty()) {
                        return false;
                }
                String selectedApp = appCombo.getText();
                appCombo.initCombo();
-               int size = apps.size();
+               size = apps.size();
                for (int i = 0; i < size; i++) {
                        appCombo.add(apps.get(i).getInfo(AppInfo.LABEL_INDEX));
                }
-               int index = appCombo.getItems().indexOf(selectedApp);
+               index = appCombo.getItems().indexOf(selectedApp);
                if (index >= 0) {
                        appCombo.setText(selectedApp);
                        return true;
@@ -1054,6 +1109,10 @@ public class ToolbarArea {
                return buttons.get(id);
        }
 
+       public void setEnabled(boolean enabled) {
+               baseComposite.setEnabled(enabled);
+       }
+
        public void setToolbarStartStopState(final boolean isStop) {
                Display.getDefault().syncExec(new Runnable() {
                        @Override
index 5d808e0..4d17bfa 100644 (file)
@@ -125,7 +125,6 @@ public class TraceStartStopThread implements Runnable {
        }
 
        private void recordStop() {
-               // AnalyzerUtil.setRecordState(RecordStateSourceProvider.RECORD_READY);
                AnalyzerManager.setRunningState(false);
                Display.getDefault().syncExec(new Runnable() {
                        @Override
index 7cc5d7f..3442a2b 100644 (file)
@@ -44,21 +44,20 @@ import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
 import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.ui.widgets.DAMessageBox;
 import org.tizen.dynamicanalyzer.ui.widgets.DATabComposite;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
 
-public class ConfigurationDialog {
+public class ConfigurationDialog extends DAMessageBox {
        private static boolean opened = false;
-       private Shell parent = null;
-       private Shell window = null;
        private DACustomButton applyButton = null;
        private DACustomButton okButton = null;
        private DACustomButton cancelButton = null;
        DATabComposite tabView = null;
 
-       public ConfigurationDialog(Shell parent, int style) {
-               this.parent = parent;
+       public ConfigurationDialog(Shell parent) {
+               super(parent);
                ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
        }
 
@@ -75,7 +74,7 @@ public class ConfigurationDialog {
                @Override
                public void handleClickEvent(DACustomButton button) {
                        doApply();
-                       window.dispose();
+                       shell.dispose();
                }
        };
        private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
@@ -83,7 +82,7 @@ public class ConfigurationDialog {
                @Override
                public void handleClickEvent(DACustomButton button) {
                        doBack();
-                       window.dispose();
+                       shell.dispose();
                }
        };
 
@@ -100,16 +99,15 @@ public class ConfigurationDialog {
                ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
        }
 
-       public int open() {
+       protected int run() {
                if (opened) {
                        return -1;
                }
-               window = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
-               window.setSize(608, 480);
-               window.setLayout(new FormLayout());
-               window.setText(AnalyzerLabels.CONFIGURATION);
+               shell.setSize(608, 480);
+               shell.setLayout(new FormLayout());
+               shell.setText(AnalyzerLabels.CONFIGURATION);
 
-               window.addDisposeListener(new DisposeListener() {
+               shell.addDisposeListener(new DisposeListener() {
 
                        @Override
                        public void widgetDisposed(DisposeEvent e) {
@@ -120,7 +118,7 @@ public class ConfigurationDialog {
                });
 
                // banner
-               Label banner = new Label(window, SWT.TRANSPARENT);
+               Label banner = new Label(shell, SWT.TRANSPARENT);
                banner.setBackground(ColorResources.WINDOW_BG_COLOR);
                banner.setImage(ImageResources.CONFIGURATION_BANNER_IMAGE);
 
@@ -131,7 +129,7 @@ public class ConfigurationDialog {
                labelData.height = 80;
                banner.setLayoutData(labelData);
 
-               Composite tabContentsComp = new Composite(window, SWT.NONE);
+               Composite tabContentsComp = new Composite(shell, SWT.NONE);
                FormLayout compLayout = new FormLayout();
                tabContentsComp.setLayout(compLayout);
                tabContentsComp
@@ -166,7 +164,7 @@ public class ConfigurationDialog {
                tabView.addView(settingPage, false);
 
                // button
-               Composite buttonContentsComp = new Composite(window, SWT.NONE);
+               Composite buttonContentsComp = new Composite(shell, SWT.NONE);
                buttonContentsComp.addPaintListener(new PaintListener() {
                        @Override
                        public void paintControl(PaintEvent e) {
@@ -223,8 +221,7 @@ public class ConfigurationDialog {
 
                opened = true;
                ShortCutManager.getInstance().setEnabled(!opened);
-               window.open();
-               return 0;
+               return result;
        }
 
 }
index 18ff7e0..4aa64f3 100644 (file)
@@ -44,21 +44,19 @@ import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 import org.tizen.dynamicanalyzer.resources.ImageResources;
 import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.ui.widgets.DAMessageBox;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
 import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
 import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckBox;
 import org.tizen.dynamicanalyzer.widgets.button.checkbox.DACheckboxSelectionListener;
 
-public class WelcomeDialog {
-       private Shell parent = null;
-       private Shell window = null;
+public class WelcomeDialog extends DAMessageBox{
        private DACustomButton okButton = null;
        private DACustomButton cancelButton = null;
        private DACheckBox useAgainCheckButton = null;
-       private boolean returnType = true;
 
-       public WelcomeDialog(Shell parent, int style) {
-               this.parent = parent;
+       public WelcomeDialog(Shell parent) {
+               super(parent);
                ConfigurationDialogValues.getInstance().setSettingValueFromConfigFile();
        }
 
@@ -67,7 +65,7 @@ public class WelcomeDialog {
                @Override
                public void handleClickEvent(DACustomButton button) {
                        doApply();
-                       window.dispose();
+                       shell.dispose();
                }
        };
        private DACustomButtonClickEventListener cancelButtonListener = new DACustomButtonClickEventListener() {
@@ -75,7 +73,7 @@ public class WelcomeDialog {
                @Override
                public void handleClickEvent(DACustomButton button) {
                        doBack();
-                       window.dispose();
+                       shell.dispose();
                }
        };
 
@@ -89,15 +87,14 @@ public class WelcomeDialog {
                notifyAutoRun();
        }
        
-       public boolean open() {
+       protected int run(){
                IDECommunicator.setOpenWelcomeDlg(true);
-               window = new Shell(parent, SWT.APPLICATION_MODAL | SWT.DIALOG_TRIM);
-               window.setSize(608, 460);
-               window.setLayout(new FormLayout());
-               window.setText(AnalyzerLabels.WELCOME);
+               shell.setSize(608, 460);
+               shell.setLayout(new FormLayout());
+               shell.setText(AnalyzerLabels.WELCOME);
 
                // banner
-               Label banner = new Label(window, SWT.TRANSPARENT);
+               Label banner = new Label(shell, SWT.TRANSPARENT);
                banner.setBackground(ColorResources.WINDOW_BG_COLOR);
                banner.setImage(ImageResources.WELCONE_BANNER_IMAGE);
 
@@ -108,7 +105,7 @@ public class WelcomeDialog {
                labelData.height = 80;
                banner.setLayoutData(labelData);
 
-               Composite contentsComp = new Composite(window, SWT.NONE);
+               Composite contentsComp = new Composite(shell, SWT.NONE);
                FormLayout compLayout = new FormLayout();
                contentsComp.setLayout(compLayout);
                contentsComp
@@ -124,7 +121,7 @@ public class WelcomeDialog {
                new ConfigurationDialogFeaturesPage(contentsComp, SWT.NONE);
 
                // button
-               Composite buttonContentsComp = new Composite(window, SWT.NONE);
+               Composite buttonContentsComp = new Composite(shell, SWT.NONE);
                buttonContentsComp.addPaintListener(new PaintListener() {
                        @Override
                        public void paintControl(PaintEvent e) {
@@ -194,9 +191,9 @@ public class WelcomeDialog {
                buttonData.width = 100;
                buttonData.height = 28;
                okButton.setLayoutData(buttonData);
-               window.addShellListener(shellListener);
-               window.open();
-               return returnType;
+               shell.addShellListener(shellListener);
+               shell.open();
+               return result;
        }
 
        private DACheckboxSelectionListener useAgainCheckbuttonListener = new DACheckboxSelectionListener() {
index 5ae431b..cbe6324 100644 (file)
@@ -472,7 +472,7 @@ public class OpenTraceDialog extends DAMessageBox {
                                y += fontHeight;
 
                                inputText = AnalyzerLabels.OPEN_TRACE_DLG_DETAILS_RECORDING_TIME
-                                               + Formatter.toTimeFormat(elapsedTime);
+                                               + Formatter.toOpentraceTimeFormat(elapsedTime);
                                e.gc.drawText(inputText, x, y);
                        }
                }
index 9d57636..09c440a 100644 (file)
@@ -26,6 +26,8 @@
 
 package org.tizen.dynamicanalyzer.ui.widgets;
 
+import javax.swing.plaf.basic.BasicInternalFrameTitlePane.CloseAction;
+
 import org.eclipse.jface.window.Window.IExceptionHandler;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.SWTException;
@@ -34,17 +36,20 @@ import org.eclipse.swt.widgets.Shell;
 
 public class DAMessageBox {
        protected int result = 0;
+       protected Shell parentShell = null;
        protected Shell shell = null;
        protected boolean block = false;
 
        private static IExceptionHandler exceptionHandler = new DefaultExceptionHandler();
 
        public DAMessageBox(Shell parentShell) {
+               this.parentShell = parentShell;
                shell = new Shell(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
        }
 
        public int open() {
                block = true;
+               parentShell.setEnabled(false);
                result = run();
                if (result >= 0) {
                        shell.open();
@@ -53,6 +58,8 @@ public class DAMessageBox {
                        }
                }
                shell.dispose();
+               parentShell.setEnabled(true);
+               closeAction();
                return result;
        }
 
@@ -60,6 +67,10 @@ public class DAMessageBox {
                return result;
        }
 
+       protected int closeAction() {
+               return result;
+       }
+
        private void runEventLoop(Shell loopShell) {
 
                // Use the display provided by the shell if possible
index d25cfca..79f5044 100644 (file)
@@ -29,6 +29,7 @@ package org.tizen.dynamicanalyzer.ui.widgets;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.FillLayout;
 import org.eclipse.swt.widgets.Shell;
+import org.tizen.dynamicanalyzer.ui.toolbar.ToolbarArea;
 import org.tizen.dynamicanalyzer.widgets.helper.ColorResources;
 import org.tizen.dynamicanalyzer.widgets.helper.FontResources;
 import org.tizen.dynamicanalyzer.widgets.helper.WidgetUtils;
@@ -63,6 +64,7 @@ public class ProgressDialog {
 
        public void open() {
                shell.open();
+               ToolbarArea.getInstance().setEnabled(false);
        }
 
        public void close() {
@@ -79,6 +81,7 @@ public class ProgressDialog {
                        }
                        shell = null;
                }
+               ToolbarArea.getInstance().setEnabled(true);
        }
 
        public void setProgressMessage(String message) {
index c4a4e0c..ed3ddb2 100755 (executable)
@@ -485,6 +485,19 @@ public class AnalyzerUtil {
                shell.setLocation(childX, childY);
        }
 
+       public static void setCenter(Shell shell, Shell parent) {
+               Rectangle pRect = parent.getBounds();
+               Rectangle pChild = shell.getBounds();
+
+               int deltaX = pRect.width - pChild.width;
+               int deltaY = pRect.height - pChild.height;
+
+               int childX = pRect.x + deltaX / 2;
+               int childY = pRect.y + deltaY / 2;
+
+               shell.setLocation(childX, childY);
+       }
+       
        /** stop trace -> change page to summary **/
        public static void changePage(final String pageId) {
                final BaseView baseView = (BaseView) AnalyzerUtil
index 4a57ab4..92af11d 100644 (file)
@@ -139,6 +139,52 @@ public class Formatter {
                return output;
        }
 
+       public static String toOpentraceTimeFormat(Object time) {
+               long longTime = -1;
+               if (time instanceof Long || time instanceof Integer) {
+                       longTime = (Long) time;
+               } else if (time instanceof String) {
+                       longTime = Long.parseLong((String) time);
+               } else {
+                       return null;
+               }
+
+               longTime /= 1000;
+               long ms = longTime % 1000;
+               longTime /= 1000;
+               long second = longTime % 60;
+               longTime /= 60;
+               long minute = longTime % 60;
+               longTime /= 60;
+               long hour = longTime % 60;
+
+               String strHour = Long.toString(hour);
+               if (strHour.length() < 2) {
+                       strHour = "0" + strHour; //$NON-NLS-1$
+               }
+
+               String strMinute = Long.toString(minute);
+               if (strMinute.length() < 2) {
+                       strMinute = "0" + strMinute; //$NON-NLS-1$
+               }
+
+               String strSecond = Long.toString(second);
+               if (strSecond.length() < 2) {
+                       strSecond = "0" + strSecond; //$NON-NLS-1$
+               }
+
+               String strMs = Long.toString(ms);
+               if (strMs.length() == 2) {
+                       strMs = "0" + strMs; //$NON-NLS-1$
+               } else if (strMs.length() == 1) {
+                       strMs = "00" + strMs; //$NON-NLS-1$
+               }
+
+               String output = strHour
+                               + ":" + strMinute + ":" + strSecond + "." + strMs; //$NON-NLS-1$ //$NON-NLS-2$
+               return output;
+       }
+
        public static String toTimeFormat2(Object time) {
                long longTime = -1;
                if (time instanceof Long || time instanceof Integer) {