[Title] File/FileEntry explorer added
authorjooyoul_lee <jy.exe.lee@samsung.com>
Sat, 9 Nov 2013 09:34:01 +0000 (18:34 +0900)
committerjooyoul_lee <jy.exe.lee@samsung.com>
Sat, 9 Nov 2013 09:34:01 +0000 (18:34 +0900)
[Desc.]
[Issue]

21 files changed:
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/ElfSymbolExtracter.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/common/PathManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/communicator/CommunicatorUtils.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/resources/FontResources.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/callstack/SWAPCallStackManager.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/BinaryAddDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DAFileExplorer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DeviceExplorer/DeviceExplorer.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DeviceExplorer/DeviceExplorerDilaog.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/ExplorerUtil.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/DAFileExplorerCasval.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/DAFileExplorerEmptyCellRenderer.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/DAFileExplorerTableRenderer.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/FileExplorerCasvalDialog.java [new file with mode: 0644]
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/SaveSettingDialog.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/summary/leaks/LeakDetector.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/ToolbarArea.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/toolbar/configuration/BinarySettingsPage.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/DATabComposite.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableCellRenderer.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableEmptyCellRenderer.java

index bf43310..8fa4678 100755 (executable)
@@ -207,7 +207,7 @@ public class PathManager {
                }
                return settingPath;
        }
-       
+
        public static String getRPMPath() {
                String rpmPath = AnalyzerPaths.TIZEN_SDK_DATA_PATH;
                if (null != rpmPath) {
@@ -217,7 +217,7 @@ public class PathManager {
                }
                return rpmPath;
        }
-       
+
        public static String getLogPath() {
                String logPath = AnalyzerPaths.TIZEN_SDK_DATA_PATH;
                if (null != logPath) {
@@ -326,4 +326,10 @@ public class PathManager {
                        }
                }
        }
+
+       public static String getRootStrapsPath() {
+               return AnalyzerPaths.TIZEN_ROOT_PATH + File.separator + "platforms"
+                               + File.separator + getPlatform() + File.separator
+                               + "rootstraps";
+       }
 }
index 418090a..24289c7 100755 (executable)
@@ -300,7 +300,6 @@ public class CommunicatorUtils {
                int remotePort = -1;
                // add error check
                System.out.print("Getting Port Progress \n ");
-               int ii = 0;
                while (count < PORT_WAIT_TIME) {
                        try {
                                execShellCommand(device,
@@ -322,7 +321,7 @@ public class CommunicatorUtils {
                                                                + remotePort);
                                                break;
                                        } catch (NumberFormatException e) {
-                                                System.out.print("=");
+                                               System.out.print("=");
                                        }
                                }
                                count++;
index 180e5ee..426b3a5 100644 (file)
@@ -101,6 +101,10 @@ public class FontResources {
                        "table_cell_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
        // mac 11\r
 \r
+       public static final Font EXPLORER_CELL_FONT = getFont(\r
+                       "table_cell_font", resizeDefaultFont(15, 3));//$NON-NLS-1$\r
+       \r
+       \r
        public static final Font DETAIL_INFO_FONT = getFont(\r
                        "detail_info_font", resizeDefaultFont(8, 3));//$NON-NLS-1$\r
        // mac 11\r
index 3f6a120..d8752b5 100644 (file)
@@ -38,16 +38,14 @@ import java.util.TreeMap;
 import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
 import org.tizen.dynamicanalyzer.common.AnalyzerManager;
 import org.tizen.dynamicanalyzer.common.SymbolManager;
-import org.tizen.dynamicanalyzer.communicator.DACommunicator;
 import org.tizen.dynamicanalyzer.logparser.LogCenterConstants;
 import org.tizen.dynamicanalyzer.swap.logparser.SWAPLogParser;
-import org.tizen.dynamicanalyzer.swap.channel.control.BinaryInfo;
 import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.swap.model.data.ProbeCommonData;
 import org.tizen.dynamicanalyzer.swap.model.data.ProfileData;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackData;
-import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
 import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackItem;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackUnit;
 import org.tizen.dynamicanalyzer.ui.summary.profiling.ProfileDataMaker;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
 
index e2200cc..161e695 100644 (file)
@@ -1,5 +1,6 @@
 package org.tizen.dynamicanalyzer.swap.platform.ui;
 
+import java.io.File;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -20,6 +21,8 @@ import org.tizen.dynamicanalyzer.common.CommonConstants;
 import org.tizen.dynamicanalyzer.common.DesignConstants;
 import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.swap.platform.ui.DeviceExplorer.DeviceExplorerDilaog;
+import org.tizen.dynamicanalyzer.swap.platform.ui.FileExplorer.FileExplorerCasvalDialog;
 import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
 import org.tizen.dynamicanalyzer.ui.widgets.DAMessageBox;
 import org.tizen.dynamicanalyzer.utils.AnalyzerUtil;
@@ -34,6 +37,7 @@ public class BinaryAddDialog extends DAMessageBox {
        private Text debugPackage = null;
 
        private DAButton findButton = null;
+       private DAButton findPackageButton = null;
        private DAButton okButton = null;
        private DAButton cancelButton = null;
 
@@ -55,7 +59,7 @@ public class BinaryAddDialog extends DAMessageBox {
 
                @Override
                public void handleClickEvent(DACustomButton button) {
-                       FileExplorerDialog dialog = new FileExplorerDialog(shell);
+                       DeviceExplorerDilaog dialog = new DeviceExplorerDilaog(shell);
                        Object result = dialog.open();
                        if (result != null) {
                                FileEntry entry = (FileEntry) result;
@@ -65,6 +69,18 @@ public class BinaryAddDialog extends DAMessageBox {
                }
        };
 
+       private DACustomButtonClickEventListener findDebugButtonListener = new DACustomButtonClickEventListener() {
+
+               @Override
+               public void handleClickEvent(DACustomButton button) {
+                       FileExplorerCasvalDialog dialog = new FileExplorerCasvalDialog(shell);
+                       Object result = dialog.open();
+                       if (result != null) {
+                               File file = (File) result;
+                               debugPackage.setText(file.getAbsolutePath());
+                       }
+               }
+       };
        private DACustomButtonClickEventListener okButtonListener = new DACustomButtonClickEventListener() {
 
                @Override
@@ -125,7 +141,7 @@ public class BinaryAddDialog extends DAMessageBox {
                data.top = new FormAttachment(label, 5);
                data.left = new FormAttachment(0, 12);
                data.height = 24;
-               data.width = 350;
+               data.width = 330;
                binary.setLayoutData(data);
                binary.setBackground(ColorResources.WHITE);
                binary.addKeyListener(binaryKeyListener);
@@ -149,9 +165,9 @@ public class BinaryAddDialog extends DAMessageBox {
                data.top = new FormAttachment(label, 4);
                data.left = new FormAttachment(binary, 5);
                data.height = 30;
-               data.width = 50;
+               data.width = 80;
                findButton.setLayoutData(data);
-               findButton.setText("Find");
+               findButton.setText("Find file");
                findButton.addClickListener(findButtonListener);
 
                // Label sourceLabel = new Label(shell, SWT.TRANSPARENT);
@@ -182,7 +198,7 @@ public class BinaryAddDialog extends DAMessageBox {
                data.width = 150;
                debugLabel.setLayoutData(data);
                debugLabel.setForeground(ColorResources.BLACK);
-               debugLabel.setText("Debug package Path");
+               debugLabel.setText("Debug directory path");
                debugLabel.setBackground(ColorResources.DIALOG_BG_UPPER);
 
                debugPackage = new Text(shell, SWT.SINGLE);
@@ -190,7 +206,7 @@ public class BinaryAddDialog extends DAMessageBox {
                data.top = new FormAttachment(debugLabel, 5);
                data.left = new FormAttachment(0, 12);
                data.height = 26;
-               data.width = 350;
+               data.width = 330;
                debugPackage.setLayoutData(data);
                debugPackage.setBackground(ColorResources.WHITE);
                debugPackage.setText(debutStr);
@@ -209,6 +225,16 @@ public class BinaryAddDialog extends DAMessageBox {
                        }
                });
 
+               findPackageButton = new DAButton(shell, SWT.NONE);
+               data = new FormData();
+               data.top = new FormAttachment(debugLabel, 4);
+               data.left = new FormAttachment(debugPackage, 5);
+               data.height = 30;
+               data.width = 80;
+               findPackageButton.setLayoutData(data);
+               findPackageButton.setText("Find dir");
+               findPackageButton.addClickListener(findDebugButtonListener);
+               
                Composite buttonComp = new Composite(shell, SWT.NONE);
                buttonComp.setLayout(new FormLayout());
                buttonComp.setBackground(ColorResources.DIALOG_BG_LOWER);
index 67b595d..b594a65 100644 (file)
@@ -43,8 +43,10 @@ import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableEmptyCellRenderer;
 import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
 import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.receiver.FileEntryFactory;
 import org.tizen.sdblib.service.FileEntry;
 import org.tizen.sdblib.service.FileEntryType;
+import org.tizen.sdblib.util.FileEntryUtil;
 
 public class DAFileExplorer extends Composite {
        protected Grid table;
@@ -126,7 +128,6 @@ public class DAFileExplorer extends Composite {
                String name = getDeviceSerialWithName(root);
                item.setText(name);
                item.setData(root);
-
                table.update();
        }
 
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DeviceExplorer/DeviceExplorer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DeviceExplorer/DeviceExplorer.java
new file mode 100644 (file)
index 0000000..536b9d7
--- /dev/null
@@ -0,0 +1,271 @@
+package org.tizen.dynamicanalyzer.swap.platform.ui.DeviceExplorer;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+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.Label;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.swap.platform.ui.ExplorerUtil;
+import org.tizen.dynamicanalyzer.swap.platform.ui.FileExplorer.DAFileExplorerEmptyCellRenderer;
+import org.tizen.dynamicanalyzer.swap.platform.ui.FileExplorer.DAFileExplorerTableRenderer;
+import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+import org.tizen.sdblib.IDevice;
+import org.tizen.sdblib.service.FileEntry;
+
+public class DeviceExplorer extends Composite {
+       protected Grid table = null;
+       protected Text inputText = null;
+       protected DACustomButton goButton = null;
+       protected Label info = null;
+
+       private IDevice device = null;
+       private FileEntry root = null;
+       private FileEntry current = null;
+       private FileEntry selected = null;
+
+       private SelectionListener tableSelectionListener = new SelectionListener() {
+
+               @Override
+               public void widgetSelected(SelectionEvent e) {
+                       GridItem[] selections = table.getSelection();
+                       GridItem selection = selections[0];
+                       FileEntry file = (FileEntry) selection
+                                       .getData(ExplorerUtil.DATA_FIEL_KEY);
+                       System.out.println("Selected : " + file.getFullPath());
+                       selected = file;
+                       inputText.setText(selected.getFullPath());
+                       inputText.setBackground(ColorResources.WHITE);
+                       info.setText(CommonConstants.EMPTY);
+               }
+
+               @Override
+               public void widgetDefaultSelected(SelectionEvent e) {
+
+               }
+       };
+
+       private MouseListener tableMouseListener = new MouseListener() {
+
+               @Override
+               public void mouseUp(MouseEvent e) {
+                       // TODO Auto-generated method stub
+
+               }
+
+               @Override
+               public void mouseDown(MouseEvent e) {
+                       // TODO Auto-generated method stub
+
+               }
+
+               @Override
+               public void mouseDoubleClick(MouseEvent e) {
+                       if (selected.isDirectory() || selected.isRoot()) {
+                               current = selected;
+                               updateData();
+                       }
+               }
+       };
+
+       private DACustomButtonClickEventListener goButtonClickListener = new DACustomButtonClickEventListener() {
+
+               @Override
+               public void handleClickEvent(DACustomButton button) {
+                       String path = inputText.getText();
+                       if (null == path || path.isEmpty()) {
+                               System.out.println("path must not empty");
+                               inputText.setBackground(ColorResources.RED);
+                               info.setText("Empty path");
+                               return;
+                       }
+
+                       if (!path.contains(root.getFullPath())) {
+                               System.out.println("Out of root range");
+                               inputText.setBackground(ColorResources.RED);
+                               info.setText("Out of root range");
+                               return;
+                       }
+
+                       FileEntry file = device.getFileEntry(path);
+                       if (null == file || (!file.isDirectory() && !file.isRoot())) {
+                               System.out.println("target path is invalid");
+                               inputText.setBackground(ColorResources.RED);
+                               info.setText("Invalid path");
+                               return;
+                       }
+                       inputText.setBackground(ColorResources.WHITE);
+                       current = file;
+                       updateData();
+               }
+       };
+
+       public DeviceExplorer(Composite parent) {
+               super(parent, SWT.NONE);
+               this.setLayout(new FormLayout());
+               this.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+               inputText = new Text(this, SWT.SINGLE);
+               FormData data = new FormData();
+               data.top = new FormAttachment(0, 5);
+               data.left = new FormAttachment(0, 5);
+               data.right = new FormAttachment(100, -80);
+               data.height = 18;
+               inputText.setLayoutData(data);
+
+               goButton = new DAButton(this, SWT.NONE);
+               data = new FormData();
+               data.top = new FormAttachment(0, 5);
+               data.left = new FormAttachment(inputText, 5);
+               data.right = new FormAttachment(100, -5);
+               data.height = 22;
+               goButton.setLayoutData(data);
+               goButton.setText("Go");
+               goButton.addClickListener(goButtonClickListener);
+
+               // Label label = new Label(this, SWT.TRANSPARENT);
+               // data = new FormData();
+               // data.top = new FormAttachment(inputText, 5);
+               // data.left = new FormAttachment(0, 20);
+               // data.height = 18;
+               // data.width = 70;
+               // label.setLayoutData(data);
+               // label.setText(CommonConstants.EMPTY);
+               // label.setBackground(ColorResources.DIALOG_BG_UPPER);
+               // label.setFont(FontResources.TABLE_CELL_FONT);
+
+               info = new Label(this, SWT.TRANSPARENT);
+               data = new FormData();
+               data.top = new FormAttachment(inputText, 10);
+               data.left = new FormAttachment(75, 0);
+               data.right = new FormAttachment(100, -6);
+               data.height = 18;
+               info.setLayoutData(data);
+               info.setText(CommonConstants.EMPTY);
+               info.setBackground(ColorResources.DIALOG_BG_UPPER);
+               info.setFont(FontResources.TABLE_CELL_FONT);
+
+               table = new DAGrid(this, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
+               table.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
+               table.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+               // table.setFont(FontResources.EXPLORER_CELL_FONT);
+               setColumns();
+               table.setEmptyCellRenderer(new DAFileExplorerEmptyCellRenderer());
+               table.setItemHeight(40);
+
+               data = new FormData();
+               data.top = new FormAttachment(info, 5);
+               data.left = new FormAttachment(0, 0);
+               data.right = new FormAttachment(100, 0);
+               data.bottom = new FormAttachment(100, 0);
+               table.setLayoutData(data);
+
+               table.addSelectionListener(tableSelectionListener);
+               table.addMouseListener(tableMouseListener);
+       }
+
+       public void setColumns() {
+               GridColumn preColumn = new GridColumn(table, SWT.NONE);
+               preColumn.setCellRenderer(new DAFileExplorerTableRenderer());
+               preColumn.setHeaderRenderer(new DATableHeaderRenderer());
+               preColumn.setText("File");
+               preColumn.setWidth(20);
+
+               GridColumn fileColumn = new GridColumn(table, SWT.NONE);
+               fileColumn.setCellRenderer(new DAFileExplorerTableRenderer());
+               fileColumn.setHeaderRenderer(new DATableHeaderRenderer());
+               fileColumn.setText("File");
+               fileColumn.setWidth(395);
+
+               GridColumn postColumn = new GridColumn(table, SWT.NONE);
+               postColumn.setCellRenderer(new DAFileExplorerTableRenderer());
+               postColumn.setHeaderRenderer(new DATableHeaderRenderer());
+               postColumn.setText("File");
+               postColumn.setWidth(20);
+       }
+
+       public void updateData() {
+               if (null == current) {
+                       if (null == root) {
+                               System.out.println("Root is empty");
+                               return;
+                       }
+                       current = root;
+               }
+               table.removeAll();
+               inputText.setText(current.getFullPath());
+
+               if (!current.getFullPath().equals(root.getFullPath())) {
+                       GridItem parentItem = new GridItem(table, SWT.NONE);
+                       parentItem.setText(1, ExplorerUtil.PARENT_STR);
+                       parentItem.setData(ExplorerUtil.DATA_FIEL_KEY, current.getParent());
+               }
+               FileEntry[] children = current.getChildren();
+               if (null != children) {
+                       int size = children.length;
+                       for (int i = 0; i < size; i++) {
+                               FileEntry child = children[i];
+                               GridItem item = new GridItem(table, SWT.NONE);
+                               item.setText(1, child.getName());
+                               item.setData(ExplorerUtil.DATA_FIEL_KEY, child);
+                       }
+               }
+
+               table.update();
+       }
+
+       public void setRoot(String r) {
+               if (null != device && null != r && !r.isEmpty()) {
+                       FileEntry rootDir = device.getFileEntry(r);
+                       if (null == rootDir
+                                       || (!rootDir.isDirectory() && !rootDir.isRoot())) {
+                               System.out.println("root path is invalid");
+                               return;
+                       } else {
+                               root = rootDir;
+                       }
+               }
+       }
+
+       public Grid getTable() {
+               return table;
+       }
+
+       public FileEntry getSelection() {
+               GridItem[] selections = table.getSelection();
+               if (selections.length > 0) {
+                       GridItem selection = selections[0];
+                       if (selection.getText().equals(ExplorerUtil.PARENT_STR)) {
+                               return null;
+                       }
+                       FileEntry entry = (FileEntry) selection
+                                       .getData(ExplorerUtil.DATA_FIEL_KEY);
+                       if (!entry.isDirectory() && !entry.isRoot()) {
+                               return entry;
+                       } else {
+                               return null;
+                       }
+               } else {
+                       return null;
+               }
+       }
+
+       public void setDevice(IDevice dev) {
+               this.device = dev;
+       }
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DeviceExplorer/DeviceExplorerDilaog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/DeviceExplorer/DeviceExplorerDilaog.java
new file mode 100644 (file)
index 0000000..13827e2
--- /dev/null
@@ -0,0 +1,143 @@
+package org.tizen.dynamicanalyzer.swap.platform.ui.DeviceExplorer;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Rectangle;
+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.Shell;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.communicator.DACommunicator;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.swap.platform.ui.ExplorerUtil;
+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.sdblib.service.FileEntry;
+
+public class DeviceExplorerDilaog extends DAMessageBox {
+       private DeviceExplorer explorer = null;
+       private DACustomButton okButton = null;
+       private DACustomButton cancelButton = null;
+
+       public DeviceExplorerDilaog(Shell parentShell) {
+               super(parentShell);
+               shell.setLayout(new FormLayout());
+               shell.setSize(446, 600);
+               shell.setBackground(ColorResources.DIALOG_BG_UPPER);
+               shell.setText("Select binary");
+
+               explorer = new DeviceExplorer(shell);
+               FormData data = new FormData();
+               data.top = new FormAttachment(0, 17);
+               data.left = new FormAttachment(0, 6);
+               data.height = 476;
+               data.width = 434;
+               explorer.setLayoutData(data);
+               explorer.setDevice(DACommunicator.getSelectedDevice().getIDevice());
+               explorer.setRoot(DACommunicator.getSelectedDevice().getIDevice()
+                               .getRoot().getFullPath());
+               explorer.updateData();
+
+               Composite buttonComp = new Composite(shell, SWT.NONE);
+               buttonComp.setLayout(new FormLayout());
+               buttonComp.setBackground(ColorResources.DIALOG_BG_LOWER);
+
+               buttonComp.addPaintListener(new PaintListener() {
+
+                       @Override
+                       public void paintControl(PaintEvent e) {
+                               Composite comp = (Composite) e.widget;
+                               Rectangle rect = comp.getClientArea();
+                               e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1);
+                               e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
+                               e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2);
+                               e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width,
+                                               rect.y + 1);
+                       }
+               });
+
+               FormData compData = new FormData();
+               compData.top = new FormAttachment(explorer, 20);
+               compData.left = new FormAttachment(0, 0);
+               compData.right = new FormAttachment(100, 0);
+               compData.bottom = new FormAttachment(100, 0);
+               buttonComp.setLayoutData(compData);
+
+               okButton = new DAButton(buttonComp, SWT.NONE);
+               data = new FormData();
+               data.top = new FormAttachment(0, 11);
+               data.left = new FormAttachment(50, -DesignConstants.DA_BUTTON_WIDTH - 4);
+               data.height = DesignConstants.DA_BUTTON_HEIGHT;
+               data.width = DesignConstants.DA_BUTTON_WIDTH;
+               okButton.setLayoutData(data);
+               okButton.setText(AnalyzerLabels.OK);
+               okButton.addClickListener(new DACustomButtonClickEventListener() {
+
+                       @Override
+                       public void handleClickEvent(DACustomButton button) {
+                               result = explorer.getSelection();
+                               if (null != result) {
+                                       shell.dispose();
+                               }
+                       }
+               });
+
+               cancelButton = new DAButton(buttonComp, SWT.NONE);
+               data = new FormData();
+               data.top = new FormAttachment(0, 11);
+               data.left = new FormAttachment(50, 4);
+               data.height = DesignConstants.DA_BUTTON_HEIGHT;
+               data.width = DesignConstants.DA_BUTTON_WIDTH;
+               cancelButton.setLayoutData(data);
+               cancelButton.setText(AnalyzerLabels.CANCEL);
+               cancelButton.addClickListener(new DACustomButtonClickEventListener() {
+
+                       @Override
+                       public void handleClickEvent(DACustomButton button) {
+                               shell.dispose();
+                       }
+               });
+
+               explorer.getTable().addMouseListener(new MouseListener() {
+
+                       @Override
+                       public void mouseUp(MouseEvent e) {
+                               // TODO Auto-generated method stub
+
+                       }
+
+                       @Override
+                       public void mouseDown(MouseEvent e) {
+                               // TODO Auto-generated method stub
+
+                       }
+
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               Grid table = (Grid) e.widget;
+                               GridItem[] items = (GridItem[]) table.getSelection();
+                               if (null == items || items.length == 0) {
+                                       return;
+                               }
+                               GridItem item = items[0];
+                               FileEntry entry = (FileEntry) item
+                                               .getData(ExplorerUtil.DATA_FIEL_KEY);
+
+                               if (!entry.isDirectory() && !entry.isRoot()) {
+                                       result = entry;
+                                       shell.dispose();
+                               }
+                       }
+               });
+       }
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/ExplorerUtil.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/ExplorerUtil.java
new file mode 100644 (file)
index 0000000..43957d5
--- /dev/null
@@ -0,0 +1,26 @@
+package org.tizen.dynamicanalyzer.swap.platform.ui;
+
+import java.io.File;
+
+public class ExplorerUtil {
+       public static String PARENT_STR = "..";
+       
+       public static int TYPE_DIR = 0;
+       public static int TYPE_FILE = 1;
+       public static int TYPE_HIDDEN = 2;
+       
+       public static String DATA_FIEL_KEY = "file";
+
+       public static int getType(File file) {
+               if (file.isDirectory()) {
+                       return TYPE_DIR;
+               } else if (file.isFile()) {
+                       return TYPE_FILE;
+               } else if (file.isHidden()) {
+                       return TYPE_HIDDEN;
+               } else {
+                       System.out.println("error : file type error");
+                       return -1;
+               }
+       }
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/DAFileExplorerCasval.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/DAFileExplorerCasval.java
new file mode 100644 (file)
index 0000000..a91f97c
--- /dev/null
@@ -0,0 +1,264 @@
+package org.tizen.dynamicanalyzer.swap.platform.ui.FileExplorer;
+
+import java.io.File;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.nebula.widgets.grid.GridColumn;
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+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.Label;
+import org.eclipse.swt.widgets.Text;
+import org.tizen.dynamicanalyzer.common.CommonConstants;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.swap.platform.ui.ExplorerUtil;
+import org.tizen.dynamicanalyzer.ui.widgets.DAButton;
+import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableHeaderRenderer;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButton;
+import org.tizen.dynamicanalyzer.widgets.button.DACustomButtonClickEventListener;
+
+public class DAFileExplorerCasval extends Composite {
+
+       protected Grid table = null;
+       protected Text inputText = null;
+       protected DACustomButton goButton = null;
+       protected Label info = null;
+
+       private File root = null;
+       private File current = null;
+       private File selected = null;
+
+       private SelectionListener tableSelectionListener = new SelectionListener() {
+
+               @Override
+               public void widgetSelected(SelectionEvent e) {
+                       GridItem[] selections = table.getSelection();
+                       GridItem selection = selections[0];
+                       File file = (File) selection.getData(ExplorerUtil.DATA_FIEL_KEY);
+                       System.out.println("Selected : " + file.getAbsolutePath());
+                       selected = file;
+                       inputText.setText(selected.getAbsolutePath());
+                       inputText.setBackground(ColorResources.WHITE);
+                       info.setText(CommonConstants.EMPTY);
+               }
+
+               @Override
+               public void widgetDefaultSelected(SelectionEvent e) {
+
+               }
+       };
+
+       private MouseListener tableMouseListener = new MouseListener() {
+
+               @Override
+               public void mouseUp(MouseEvent e) {
+                       // TODO Auto-generated method stub
+
+               }
+
+               @Override
+               public void mouseDown(MouseEvent e) {
+                       // TODO Auto-generated method stub
+
+               }
+
+               @Override
+               public void mouseDoubleClick(MouseEvent e) {
+                       if (selected.isDirectory()) {
+                               current = selected;
+                               updateData();
+                       }
+               }
+       };
+
+       private DACustomButtonClickEventListener goButtonClickListener = new DACustomButtonClickEventListener() {
+
+               @Override
+               public void handleClickEvent(DACustomButton button) {
+                       String path = inputText.getText();
+                       if (null == path || path.isEmpty()) {
+                               System.out.println("path must not empty");
+                               inputText.setBackground(ColorResources.RED);
+                               info.setText("Empty path");
+                               return;
+                       }
+
+                       if (!path.contains(root.getAbsolutePath())) {
+                               System.out.println("Out of root range");
+                               inputText.setBackground(ColorResources.RED);
+                               info.setText("Out of root range");
+                               return;
+                       }
+
+                       File file = new File(path);
+                       if (!file.exists() || !file.isDirectory()) {
+                               System.out.println("target path is invalid");
+                               inputText.setBackground(ColorResources.RED);
+                               info.setText("Invalid path");
+                               return;
+                       }
+                       inputText.setBackground(ColorResources.WHITE);
+                       current = file;
+                       updateData();
+               }
+       };
+
+       public DAFileExplorerCasval(Composite parent) {
+               super(parent, SWT.NONE);
+               this.setLayout(new FormLayout());
+               this.setBackground(ColorResources.DIALOG_BG_UPPER);
+
+               inputText = new Text(this, SWT.SINGLE);
+               FormData data = new FormData();
+               data.top = new FormAttachment(0, 5);
+               data.left = new FormAttachment(0, 5);
+               data.right = new FormAttachment(100, -80);
+               data.height = 18;
+               inputText.setLayoutData(data);
+
+               goButton = new DAButton(this, SWT.NONE);
+               data = new FormData();
+               data.top = new FormAttachment(0, 5);
+               data.left = new FormAttachment(inputText, 5);
+               data.right = new FormAttachment(100, -5);
+               data.height = 22;
+               goButton.setLayoutData(data);
+               goButton.setText("Go");
+               goButton.addClickListener(goButtonClickListener);
+
+//             Label label = new Label(this, SWT.TRANSPARENT);
+//             data = new FormData();
+//             data.top = new FormAttachment(inputText, 5);
+//             data.left = new FormAttachment(0, 20);
+//             data.height = 18;
+//             data.width = 70;
+//             label.setLayoutData(data);
+//             label.setText(CommonConstants.EMPTY);
+//             label.setBackground(ColorResources.DIALOG_BG_UPPER);
+//             label.setFont(FontResources.TABLE_CELL_FONT);
+
+               info = new Label(this, SWT.TRANSPARENT);
+               data = new FormData();
+               data.top = new FormAttachment(inputText, 10);
+               data.left = new FormAttachment(75, 0);
+               data.right = new FormAttachment(100, -6);
+               data.height = 18;
+               info.setLayoutData(data);
+               info.setText(CommonConstants.EMPTY);
+               info.setBackground(ColorResources.DIALOG_BG_UPPER);
+               info.setFont(FontResources.TABLE_CELL_FONT);
+
+               table = new DAGrid(this, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
+               table.setBackground(ColorResources.TABLE_CONTENTS_NORMAL);
+               table.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+               // table.setFont(FontResources.EXPLORER_CELL_FONT);
+               setColumns();
+               table.setEmptyCellRenderer(new DAFileExplorerEmptyCellRenderer());
+               table.setItemHeight(40);
+
+               data = new FormData();
+               data.top = new FormAttachment(info, 5);
+               data.left = new FormAttachment(0, 0);
+               data.right = new FormAttachment(100, 0);
+               data.bottom = new FormAttachment(100, 0);
+               table.setLayoutData(data);
+
+               table.addSelectionListener(tableSelectionListener);
+               table.addMouseListener(tableMouseListener);
+       }
+
+       public void setColumns() {
+               GridColumn preColumn = new GridColumn(table, SWT.NONE);
+               preColumn.setCellRenderer(new DAFileExplorerTableRenderer());
+               preColumn.setHeaderRenderer(new DATableHeaderRenderer());
+               preColumn.setText("File");
+               preColumn.setWidth(20);
+
+               GridColumn fileColumn = new GridColumn(table, SWT.NONE);
+               fileColumn.setCellRenderer(new DAFileExplorerTableRenderer());
+               fileColumn.setHeaderRenderer(new DATableHeaderRenderer());
+               fileColumn.setText("File");
+               fileColumn.setWidth(395);
+
+               GridColumn postColumn = new GridColumn(table, SWT.NONE);
+               postColumn.setCellRenderer(new DAFileExplorerTableRenderer());
+               postColumn.setHeaderRenderer(new DATableHeaderRenderer());
+               postColumn.setText("File");
+               postColumn.setWidth(20);
+       }
+
+       public void updateData() {
+               if (null == current) {
+                       if (null == root) {
+                               System.out.println("Root is empty");
+                               return;
+                       }
+                       current = root;
+               }
+               table.removeAll();
+               inputText.setText(current.getAbsolutePath());
+
+               if (!current.getAbsolutePath().equals(root.getAbsolutePath())) {
+                       GridItem parentItem = new GridItem(table, SWT.NONE);
+                       parentItem.setText(1, ExplorerUtil.PARENT_STR);
+                       parentItem.setData(ExplorerUtil.DATA_FIEL_KEY,
+                                       current.getParentFile());
+               }
+               File[] children = current.listFiles();
+               if (null != children) {
+                       int size = children.length;
+                       for (int i = 0; i < size; i++) {
+                               File child = children[i];
+                               GridItem item = new GridItem(table, SWT.NONE);
+                               item.setText(1, child.getName());
+                               item.setData(ExplorerUtil.DATA_FIEL_KEY, child);
+                       }
+               }
+
+               table.update();
+       }
+
+       public void setRoot(String r) {
+               if (null != r && !r.isEmpty()) {
+                       File rootDir = new File(r);
+                       if (!rootDir.exists() || !rootDir.isDirectory()) {
+                               System.out.println("root path is invalid");
+                               return;
+                       } else {
+                               root = rootDir;
+                       }
+               }
+       }
+
+       public Grid getTable() {
+               return table;
+       }
+
+       public File getSelection() {
+               GridItem[] selections = table.getSelection();
+               if (selections.length > 0) {
+                       GridItem selection = selections[0];
+                       if (selection.getText().equals(ExplorerUtil.PARENT_STR)) {
+                               return null;
+                       }
+                       File entry = (File) selection.getData(ExplorerUtil.DATA_FIEL_KEY);
+                       if (entry.isDirectory()) {
+                               return entry;
+                       } else {
+                               return entry.getParentFile();
+                       }
+               } else {
+                       return null;
+               }
+       }
+
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/DAFileExplorerEmptyCellRenderer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/DAFileExplorerEmptyCellRenderer.java
new file mode 100644 (file)
index 0000000..cd14c4d
--- /dev/null
@@ -0,0 +1,59 @@
+package org.tizen.dynamicanalyzer.swap.platform.ui.FileExplorer;
+
+import org.eclipse.nebula.widgets.grid.Grid;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableEmptyCellRenderer;
+
+public class DAFileExplorerEmptyCellRenderer extends DATableEmptyCellRenderer {
+       @Override
+       public void paint(GC gc, Object value) {
+
+               Grid table = null;
+               if (value instanceof Grid) {
+                       table = (Grid) value;
+               } else {
+                       return;
+               }
+
+               boolean drawBackground = true;
+
+               if (isSelected()) {
+                       gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START);
+                       gc.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END);
+               } else {
+                       if (table.isEnabled()) {
+                               drawBackground = false;
+                       } else {
+                               gc.setBackground(getDisplay().getSystemColor(
+                                               SWT.COLOR_WIDGET_BACKGROUND));
+                       }
+                       gc.setForeground(table.getForeground());
+               }
+
+               if (drawBackground && isSelected()) {
+                       gc.fillGradientRectangle(getBounds().x, getBounds().y + 1,
+                                       getBounds().width, getBounds().height, true);
+               } else if (drawBackground) {
+                       gc.fillRectangle(getBounds().x, getBounds().y + 1,
+                                       getBounds().width, getBounds().height);
+               }
+
+//             if (table.getLinesVisible()) {
+//                     if (isCellSelected()) {
+//                             gc.setForeground(ColorResources.TABLE_LINE);
+//                     } else {
+//                             gc.setForeground(ColorResources.TABLE_LINE);
+//                     }
+//                     gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
+//                                     getBounds().x + getBounds().width - 1, getBounds().y
+//                                                     + getBounds().height);
+//                     gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y,
+//                                     getBounds().x + getBounds().width - 1, getBounds().y
+//                                                     + getBounds().height);
+//             }
+
+       }
+
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/DAFileExplorerTableRenderer.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/DAFileExplorerTableRenderer.java
new file mode 100644 (file)
index 0000000..9e9dce7
--- /dev/null
@@ -0,0 +1,212 @@
+package org.tizen.dynamicanalyzer.swap.platform.ui.FileExplorer;
+
+import java.io.File;
+
+import org.eclipse.nebula.widgets.grid.GridItem;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.resources.ImageResources;
+import org.tizen.dynamicanalyzer.swap.platform.ui.ExplorerUtil;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableCellRenderer;
+import org.tizen.sdblib.service.FileEntry;
+
+public class DAFileExplorerTableRenderer extends DATableCellRenderer {
+       @Override
+       public void paint(GC gc, Object value) {
+               if (getColumn() != 1) {
+                       return;
+               }
+               GridItem item = (GridItem) value;
+
+               gc.setFont(item.getFont(getColumn()));
+
+               boolean drawAsSelected = isSelected();
+
+               boolean drawBackground = true;
+
+               if (isCellSelected()) {
+                       drawAsSelected = true;// (!isCellFocus());
+               }
+
+               if (drawAsSelected) {
+                       gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_START);
+                       gc.setBackground(ColorResources.TABLE_CONTENTS_SELECTED_END);
+               } else {
+                       if (item.getParent().isEnabled()) {
+                               Color bg = item.getBackground();
+                               if (bg != null) {
+                                       gc.setBackground(bg);
+                               } else {
+                                       drawBackground = false;
+                               }
+                       } else {
+                               gc.setBackground(getDisplay().getSystemColor(
+                                               SWT.COLOR_WIDGET_BACKGROUND));
+                       }
+               }
+
+               if (drawBackground && drawAsSelected) {
+                       gc.fillGradientRectangle(getBounds().x, getBounds().y,
+                                       getBounds().width, getBounds().height, true);
+               } else if (drawBackground) {
+                       gc.fillRectangle(getBounds().x, getBounds().y + 1,
+                                       getBounds().width, getBounds().height);
+               }
+
+               int x = leftMargin;
+
+               if (isTree()) {
+                       x += getToggleIndent(item);
+
+                       if (drawAsSelected) {
+                               toggleRenderer.setSelected(true);
+                       } else {
+                               toggleRenderer.setSelected(false);
+                       }
+                       toggleRenderer.setExpanded(item.isExpanded());
+
+                       toggleRenderer.setHover(getHoverDetail().equals("toggle")); //$NON-NLS-1$
+
+                       toggleRenderer.setLocation(getBounds().x + x,
+                                       (getBounds().height - toggleRenderer.getBounds().height)
+                                                       / 2 + getBounds().y);
+                       toggleRenderer.paint(gc, item);
+
+                       x += toggleRenderer.getBounds().width + insideMargin;
+               }
+
+               if (isCheck()) {
+
+                       checkRenderer.setChecked(item.getChecked(getColumn()));
+                       checkRenderer.setGrayed(item.getGrayed(getColumn()));
+                       if (!item.getParent().isEnabled()) {
+                               checkRenderer.setGrayed(true);
+                       }
+                       checkRenderer.setHover(getHoverDetail().equals("check")); //$NON-NLS-1$
+
+                       checkRenderer.setBounds(getBounds().x + x,
+                                       (getBounds().height - checkRenderer.getBounds().height) / 2
+                                                       + getBounds().y, checkRenderer.getBounds().width,
+                                       checkRenderer.getBounds().height);
+                       checkRenderer.paint(gc, null);
+
+                       x += checkRenderer.getBounds().width + insideMargin;
+               }
+
+               // Image image = item.getImage(getColumn());
+               // if (image != null) {
+               // int y = getBounds().y;
+               // y += (getBounds().height - image.getBounds().height) / 2;
+               // gc.drawImage(image, getBounds().x + x, y);
+               // x += image.getBounds().width + insideMargin;
+               // }
+
+               int width = getBounds().width - x - rightMargin;
+
+               String text = item.getText(getColumn());
+
+               if (getAlignment() == SWT.RIGHT) {
+                       int len = gc.stringExtent(text).x;
+                       if (len < width) {
+                               x += width - len;
+                       }
+               } else if (getAlignment() == SWT.CENTER) {
+                       int len = gc.stringExtent(text).x;
+                       if (len < width) {
+                               x += (width - len) / 2;
+                       }
+               }
+
+               if (drawAsSelected) {
+                       gc.setForeground(ColorResources.TABLE_CONTENTS_SELECTED_FONT_COLOR);
+               } else {
+                       Color fontColor = item.getForeground();
+                       if (null != fontColor) {
+                               gc.setForeground(item.getForeground());
+                       } else {
+                               gc.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
+                       }
+               }
+
+               Image image = null;
+               Object object = item.getData(ExplorerUtil.DATA_FIEL_KEY);
+               if (object instanceof File) {
+                       File file = (File) object;
+                       if (file.isDirectory()) {
+                               image = ImageResources.ICON_DIR;
+                       } else if (file.isFile()) {
+                               image = ImageResources.ICON_FILE;
+                       } else {
+                               image = ImageResources.ICON_OTHER;
+                       }
+               } else if (object instanceof FileEntry) {
+                       FileEntry entry = (FileEntry) object;
+                       switch (entry.getType()) {
+                       case File:
+                               image = ImageResources.ICON_FILE;
+                               break;
+                       case Link:
+                               image = ImageResources.ICON_FILE_LINK;
+                               break;
+                       case Directory:
+                               image = ImageResources.ICON_DIR;
+                               break;
+                       case DirectoryLink:
+                               image = ImageResources.ICON_DIR_LINK;
+                               break;
+                       case RootEmulator:
+                               image = ImageResources.ICON_EMULATOR;
+                               break;
+                       case RootDevice:
+                               image = ImageResources.ICON_DEVICE;
+                               break;
+                       default:
+                               image = ImageResources.ICON_OTHER;
+                               break;
+                       }
+               }
+
+               gc.drawImage(image, getBounds().x + x, getBounds().y + textTopMargin
+                               - 3);
+               gc.setFont(FontResources.EXPLORER_CELL_FONT);
+               gc.drawText(text, getBounds().x + x + 20,
+                               getBounds().y + textTopMargin, true);
+
+               if (item.getParent().getLinesVisible()) {
+                       if (isCellSelected()) {
+                               gc.setForeground(ColorResources.TABLE_LINE);
+                       } else {
+                               gc.setForeground(ColorResources.TABLE_LINE);
+                       }
+                       gc.drawLine(getBounds().x, getBounds().y + getBounds().height,
+                                       getBounds().x + getBounds().width - 1, getBounds().y
+                                                       + getBounds().height);
+                       // gc.drawLine(getBounds().x + getBounds().width - 1, getBounds().y,
+                       // getBounds().x + getBounds().width - 1, getBounds().y
+                       // + getBounds().height);
+               }
+
+               if (isCellFocus()) {
+                       Rectangle focusRect = new Rectangle(getBounds().x - 1,
+                                       getBounds().y - 1, getBounds().width,
+                                       getBounds().height + 1);
+
+                       gc.setForeground(ColorResources.RED);
+                       gc.drawRectangle(focusRect);
+
+                       if (isFocus()) {
+                               focusRect.x++;
+                               focusRect.width -= 2;
+                               focusRect.y++;
+                               focusRect.height -= 2;
+
+                               gc.drawRectangle(focusRect);
+                       }
+               }
+       }
+}
diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/FileExplorerCasvalDialog.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/platform/ui/FileExplorer/FileExplorerCasvalDialog.java
new file mode 100644 (file)
index 0000000..63d2456
--- /dev/null
@@ -0,0 +1,134 @@
+package org.tizen.dynamicanalyzer.swap.platform.ui.FileExplorer;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Rectangle;
+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.Shell;
+import org.tizen.dynamicanalyzer.common.DesignConstants;
+import org.tizen.dynamicanalyzer.common.PathManager;
+import org.tizen.dynamicanalyzer.nl.AnalyzerLabels;
+import org.tizen.dynamicanalyzer.resources.ColorResources;
+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;
+
+public class FileExplorerCasvalDialog extends DAMessageBox {
+       private DAFileExplorerCasval explorer = null;
+       private DACustomButton okButton = null;
+       private DACustomButton cancelButton = null;
+
+       public FileExplorerCasvalDialog(Shell parentShell) {
+               super(parentShell);
+               shell.setLayout(new FormLayout());
+               shell.setSize(446, 600);
+               shell.setBackground(ColorResources.DIALOG_BG_UPPER);
+               shell.setText("Select binary");
+
+               explorer = new DAFileExplorerCasval(shell);
+               FormData data = new FormData();
+               data.top = new FormAttachment(0, 17);
+               data.left = new FormAttachment(0, 6);
+               data.height = 476;
+               data.width = 434;
+               explorer.setLayoutData(data);
+               explorer.setRoot(PathManager.getRootStrapsPath());
+               explorer.updateData();
+
+               Composite buttonComp = new Composite(shell, SWT.NONE);
+               buttonComp.setLayout(new FormLayout());
+               buttonComp.setBackground(ColorResources.DIALOG_BG_LOWER);
+
+               buttonComp.addPaintListener(new PaintListener() {
+
+                       @Override
+                       public void paintControl(PaintEvent e) {
+                               Composite comp = (Composite) e.widget;
+                               Rectangle rect = comp.getClientArea();
+                               e.gc.setForeground(ColorResources.DIALOG_SUNKEN_1);
+                               e.gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y);
+                               e.gc.setForeground(ColorResources.DIALOG_SUNKEN_2);
+                               e.gc.drawLine(rect.x, rect.y + 1, rect.x + rect.width,
+                                               rect.y + 1);
+                       }
+               });
+
+               FormData compData = new FormData();
+               compData.top = new FormAttachment(explorer, 20);
+               compData.left = new FormAttachment(0, 0);
+               compData.right = new FormAttachment(100, 0);
+               compData.bottom = new FormAttachment(100, 0);
+               buttonComp.setLayoutData(compData);
+
+               okButton = new DAButton(buttonComp, SWT.NONE);
+               data = new FormData();
+               data.top = new FormAttachment(0, 11);
+               data.left = new FormAttachment(50, -DesignConstants.DA_BUTTON_WIDTH - 4);
+               data.height = DesignConstants.DA_BUTTON_HEIGHT;
+               data.width = DesignConstants.DA_BUTTON_WIDTH;
+               okButton.setLayoutData(data);
+               okButton.setText(AnalyzerLabels.OK);
+               okButton.addClickListener(new DACustomButtonClickEventListener() {
+
+                       @Override
+                       public void handleClickEvent(DACustomButton button) {
+                               result = explorer.getSelection();
+                               if (null != result) {
+                                       shell.dispose();
+                               }
+                       }
+               });
+
+               cancelButton = new DAButton(buttonComp, SWT.NONE);
+               data = new FormData();
+               data.top = new FormAttachment(0, 11);
+               data.left = new FormAttachment(50, 4);
+               data.height = DesignConstants.DA_BUTTON_HEIGHT;
+               data.width = DesignConstants.DA_BUTTON_WIDTH;
+               cancelButton.setLayoutData(data);
+               cancelButton.setText(AnalyzerLabels.CANCEL);
+               cancelButton.addClickListener(new DACustomButtonClickEventListener() {
+
+                       @Override
+                       public void handleClickEvent(DACustomButton button) {
+                               shell.dispose();
+                       }
+               });
+
+               // explorer.getTable().addMouseListener(new MouseListener() {
+               //
+               // @Override
+               // public void mouseUp(MouseEvent e) {
+               // // TODO Auto-generated method stub
+               //
+               // }
+               //
+               // @Override
+               // public void mouseDown(MouseEvent e) {
+               // // TODO Auto-generated method stub
+               //
+               // }
+               //
+               // @Override
+               // public void mouseDoubleClick(MouseEvent e) {
+               // Grid table = (Grid) e.widget;
+               // GridItem[] items = (GridItem[]) table.getSelection();
+               // if (null == items || items.length == 0) {
+               // return;
+               // }
+               // GridItem item = items[0];
+               // File entry = (File) item.getData(ExplorerUtil.DATA_FIEL_KEY);
+               //
+               // if (!entry.isDirectory()) {
+               // result = entry;
+               // shell.dispose();
+               // }
+               // }
+               // });
+       }
+}
index b367525..9ed7e1b 100644 (file)
@@ -144,6 +144,7 @@ public class SaveSettingDialog extends DAMessageBox {
                // List<BinarySettingData> binaryData =
                // BinarySettingManager.getInstance()
                // .getTempBinarySettings();
+               
                boolean success = false;
                try {
                        fileWriter = new FileWriter(saveFile);
index a256a72..596c28f 100644 (file)
@@ -142,18 +142,24 @@ public class LeakDetector {
                        // String inputParam = input[LogCenterConstants.INPUTPARM_INDEX];
                        String inputParam = ((ProbeCommonData) log).getArgs();
                        String[] splitInputParam = inputParam.split("\\,"); //$NON-NLS-1$
-                       int rmKey = Integer.parseInt(splitInputParam[0]);
+                       String param = new String(splitInputParam[0]);
+                       int rmKey = -1;
+                       if (param.contains("0x")) {
+                               rmKey = Integer.decode(param);
+                       } else {
+                               rmKey = Integer.parseInt(splitInputParam[0]);
+                       }
                        leaks.remove(rmKey);
 
                        // internal check
-//                     if (chk.isCheckUserCall()) {
-//                             checkUserFuncLeakData(log, chk);
-//                     } else {
-                               // String key = input[chk.getKeyIndex()];
-                               // leaks.put(key, new LeakData(key, input, this));
-                               int key = log.getKey();
-                               leaks.put(key, new LeakData(log, this));
-//                     }
+                       // if (chk.isCheckUserCall()) {
+                       // checkUserFuncLeakData(log, chk);
+                       // } else {
+                       // String key = input[chk.getKeyIndex()];
+                       // leaks.put(key, new LeakData(key, input, this));
+                       int key = log.getKey();
+                       leaks.put(key, new LeakData(log, this));
+                       // }
                }
        }
 
index 8b92496..1abec76 100755 (executable)
@@ -414,17 +414,6 @@ public class ToolbarArea {
                        }
                });
 
-//             binarySettingsButton
-//                             .addClickListener(new DACustomButtonClickEventListener() {
-//
-//                                     @Override
-//                                     public void handleClickEvent(DACustomButton button) {
-//                                             BinaryAnalyzingConfigDialog dialog = new BinaryAnalyzingConfigDialog(
-//                                                             shell);
-//                                             dialog.open();
-//                                     }
-//                             });
-
                aboutButton.addClickListener(new DACustomButtonClickEventListener() {
 
                        @Override
index 76ce1ef..a07d620 100644 (file)
@@ -469,7 +469,7 @@ public class BinarySettingsPage extends DAPageComposite {
                for (int i = 0; i < binData.size(); i++) {
                        InputRow inputRow = new InputRow(inputComposite);
                        inputRow.setBinaryText(binData.get(i).getBinaryPath());
-                       String source = binData.get(i).getSourcePath();
+                       String source = binData.get(i).getDebugPath();
                        if (null != source && !source.isEmpty()) {
                                inputRow.setSourceText(source);
                                // String[] splitSource =
index 613c179..7cd900a 100644 (file)
@@ -270,7 +270,7 @@ public class DATabComposite extends DAView {
                }
        }
 
-       private List<Composite> getTabChildren() {
+       private synchronized List<Composite> getTabChildren() {
                if (null == children) {
                        children = new ArrayList<Composite>();
                }
index fffa9d8..58a1dbf 100644 (file)
@@ -40,12 +40,12 @@ import org.tizen.dynamicanalyzer.resources.ColorResources;
 import org.tizen.dynamicanalyzer.resources.FontResources;
 
 public class DATableCellRenderer extends DefaultCellRenderer {
-       int leftMargin = 4;
-       int rightMargin = 4;
-       int topMargin = 0;
-       int bottomMargin = 0;
-       int textTopMargin = 1;
-       int insideMargin = 3;
+       protected int leftMargin = 4;
+       protected int rightMargin = 4;
+       protected int topMargin = 0;
+       protected int bottomMargin = 0;
+       protected int textTopMargin = 15;
+       protected int insideMargin = 3;
 
        protected DATableToggleRenderer toggleRenderer;
        protected CheckBoxRenderer checkRenderer;
index e5dd077..21bad2b 100644 (file)
@@ -59,13 +59,13 @@ public class DATableEmptyCellRenderer extends GridCellRenderer {
                        gc.setForeground(table.getForeground());
                }
 
-               if (drawBackground && isSelected()) {
-                       gc.fillGradientRectangle(getBounds().x, getBounds().y + 1,
-                                       getBounds().width, getBounds().height, true);
-               } else if (drawBackground) {
-                       gc.fillRectangle(getBounds().x, getBounds().y + 1,
-                                       getBounds().width, getBounds().height);
-               }
+//             if (drawBackground && isSelected()) {
+//                     gc.fillGradientRectangle(getBounds().x, getBounds().y + 1,
+//                                     getBounds().width, getBounds().height, true);
+//             } else if (drawBackground) {
+//                     gc.fillRectangle(getBounds().x, getBounds().y + 1,
+//                                     getBounds().width, getBounds().height);
+//             }
 
                if (table.getLinesVisible()) {
                        if (isCellSelected()) {