DataBase : remove old database api using in WindowingTable 96/27396/1
authorjungwook.ryu <jungwook.ryu@samsung.com>
Fri, 12 Sep 2014 08:19:16 +0000 (17:19 +0900)
committerjungwook.ryu <jungwook.ryu@samsung.com>
Fri, 12 Sep 2014 08:20:58 +0000 (17:20 +0900)
Change-Id: I49b2307e43dfae625bd15994ca250a1bbc2fb8ab
Signed-off-by: jungwook.ryu <jungwook.ryu@samsung.com>
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/kernel/KernelListTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/timeline/calltrace/CallTraceTable.java
org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DAWindowingTableComposite.java

index 346cfb0..621423c 100644 (file)
@@ -56,7 +56,7 @@ public class KernelListTable extends DAWindowingTableComposite {
 
        public KernelListTable(Composite parent, int compStyle, int tableStyle) {
                super(parent, compStyle, tableStyle);
-               setDataType(false, 0); // timeColumnIdex
+               setDataType(0); // timeColumnIdex
                setContextMenu(AnalyzerConstants.CONTEXT_TABLE_RANGE);
 
                table.addSelectionListener(new SelectionListener() {
index 51e616d..b76a5b8 100644 (file)
@@ -52,7 +52,7 @@ public class CallTraceTable extends DAWindowingTableComposite {
 
        public CallTraceTable(Composite parent, int compStyle, int tableStyle) {
                super(parent, compStyle, tableStyle);
-               setDataType(false, FunctionEntryDBTable.COLUMN.STARTTIME.index); // use new DB
+               setDataType(FunctionEntryDBTable.COLUMN.STARTTIME.index); // use new DB
                setContextMenu(AnalyzerConstants.CONTEXT_TABLE_SOURCE
                                | AnalyzerConstants.CONTEXT_TABLE_RANGE);
 
index abfb069..c13a46d 100644 (file)
@@ -50,8 +50,6 @@ import org.tizen.dynamicanalyzer.database.SqlConnectionManager;
 import org.tizen.dynamicanalyzer.model.FindProperty;
 import org.tizen.dynamicanalyzer.model.TableInput;
 import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.sql.SqlManager;
-import org.tizen.dynamicanalyzer.swap.model.data.LogData;
 import org.tizen.dynamicanalyzer.ui.widgets.DAGrid;
 import org.tizen.dynamicanalyzer.ui.widgets.FindDialog;
 import org.tizen.dynamicanalyzer.util.CommonUtil;
@@ -68,7 +66,6 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
 
        protected long selectionStartTime = -1;
        protected long selectionEndTime = -1;
-       protected boolean isLogData = true;
        protected int timeColumnIndex = 0;
 
        private int totalItemCount = 0;
@@ -77,7 +74,6 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
        private int previousTableLength = 0;
        private int tableAreaHeigth = 0;
 
-       private List<LogData> queriedLogData = null;
        private List<List<Object>> queriedObjectData = null;
 
        public DAWindowingTableComposite(Composite parent, int compStyle, int tableStyle) {
@@ -167,14 +163,8 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
                                        if (null == td) {
                                                return;
                                        }
-
-                                       if (isLogData) {
-                                               selectionStartTime = td.getLogData().getTime();
-                                               selectionEndTime = td.getLogData().getTime();
-                                       } else {
-                                               selectionStartTime = (Long) td.getData().get(timeColumnIndex);
-                                               selectionEndTime = selectionStartTime;
-                                       }
+                                       selectionStartTime = (Long) td.getData().get(timeColumnIndex);
+                                       selectionEndTime = selectionStartTime;
 
                                        focusSeq = td.getSelectionKey();
                                }
@@ -257,15 +247,8 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
                        if (null == td) {
                                return;
                        }
-
-                       if (isLogData) {
-                               selectionStartTime = td.getLogData().getTime();
-                               selectionEndTime = td.getLogData().getTime();
-                       } else {
-                               selectionStartTime = (Long) td.getData().get(timeColumnIndex);
-                               selectionEndTime = selectionStartTime;
-                       }
-
+                       selectionStartTime = (Long) td.getData().get(timeColumnIndex);
+                       selectionEndTime = selectionStartTime;
                        focusSeq = td.getSelectionKey();
                }
 
@@ -338,20 +321,11 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
 
                        if (gridData != null) {
                                long seqNum = gridData.getSelectionKey();
-                               if (isLogData) {
-                                       long time = gridData.getLogData().getTime();
-                                       if (selectionStartTime <= time && time <= selectionEndTime) {
-                                               isSelectionItem = true;
-                                               focusIndex = i;
-                                               selectionList.add(i);
-                                       }
-                               } else {
-                                       long time = (Long) gridData.getData().get(timeColumnIndex);
-                                       if (selectionStartTime <= time && time <= selectionEndTime) {
-                                               isSelectionItem = true;
-                                               focusIndex = i;
-                                               selectionList.add(i);
-                                       }
+                               long time = (Long) gridData.getData().get(timeColumnIndex);
+                               if (selectionStartTime <= time && time <= selectionEndTime) {
+                                       isSelectionItem = true;
+                                       focusIndex = i;
+                                       selectionList.add(i);
                                }
 
                                if (-1 != focusSeq && seqNum == focusSeq) {
@@ -426,14 +400,10 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
                }
 
                if (isQueryDB) {
-                       if (isLogData) {
-                               queriedLogData = getLogDataFromDB(itemCount);
-                       } else {
-                               queriedObjectData = getObjectDataFromDB(itemCount);
-                       }
+                       queriedObjectData = getObjectDataFromDB(itemCount);
                }
 
-               if ((isLogData && queriedLogData == null) || (!isLogData && queriedObjectData == null)) {
+               if (queriedObjectData == null) {
                        return null;
                }
 
@@ -470,26 +440,6 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
                return SqlConnectionManager.executeQuery(query);
        }
 
-       private List<LogData> getLogDataFromDB(int itemCount) {
-               String tableName = getDBTableName();
-               if (tableName == null || tableName.isEmpty()) {
-                       return null;
-               }
-
-               int scrollSelection = vScrollbar.getSelection();
-               if (scrollSelection > itemCount) { // change PID
-                       scrollSelection = 0;
-               }
-               int selectedEndIndex = getTableLength() + 1;
-               if (itemCount <= selectedEndIndex) {
-                       selectedEndIndex = itemCount;
-               }
-               List<LogData> outputList = SqlManager.getInstance().selectTableData(tableName,
-                               getDBTableColumnNames(), scrollSelection, selectedEndIndex + 1,
-                               getSelectQueryOption());
-               return outputList;
-       }
-
        @Override
        public void clear() {
                super.clear();
@@ -498,7 +448,6 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
                vScrollbar.setVisible(false);
                selectionStartTime = -1;
                selectionEndTime = -1;
-               queriedLogData = null;
                queriedObjectData = null;
                totalItemCount = 0;
                previousItemCount = -1;
@@ -508,14 +457,8 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
        protected void actionSetStartEnd(int type) {
                GridItem item = table.getItem(mousePoint);
                if (null != item) {
-                       long inputTime;
-                       if (isLogData) {
-                               LogData data = ((DATableDataFormat) item.getData()).getLogData();
-                               inputTime = data.getTime();
-                       } else {
-                               inputTime = (Long) ((DATableDataFormat) item.getData()).getData().get(
+                       long inputTime = (Long) ((DATableDataFormat) item.getData()).getData().get(
                                                timeColumnIndex);
-                       }
 
                        if (type == START_TIME) {
                                rangeDataManager.setMarkerStartTime(inputTime);
@@ -525,10 +468,6 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
                }
        }
 
-       protected List<LogData> getQueriedLogData() {
-               return queriedLogData;
-       }
-
        protected List<List<Object>> getQueriedObjectData() {
                return queriedObjectData;
        }
@@ -560,8 +499,7 @@ public abstract class DAWindowingTableComposite extends DATableComposite {
                }
        }
 
-       public void setDataType(boolean isLogData, int timeColumnIndex) {
-               this.isLogData = isLogData;
+       public void setDataType(int timeColumnIndex) {
                this.timeColumnIndex = timeColumnIndex;
        }