From 294fc7dbe8f306a2c2cab7c67796c8303166ab3a Mon Sep 17 00:00:00 2001 From: "joon.c.baek" Date: Mon, 27 Jun 2016 17:33:48 +0900 Subject: [PATCH] [SRADA-829] Highlight searched line in calltrace Highlight searched line in calltrace table Known issue: The table data that exist out of screen couldn't search. I guess that table will generated partially when need it. Change-Id: Iecd8a47aeff97bdab697a1386990ddf12f64ff98 Signed-off-by: joon.c.baek --- .../widgets/table/DAWindowingTableComposite.java | 44 ++++++++++------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DAWindowingTableComposite.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DAWindowingTableComposite.java index a6a80e1..0732f1c 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DAWindowingTableComposite.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DAWindowingTableComposite.java @@ -171,6 +171,7 @@ public abstract class DAWindowingTableComposite extends DATableComposite { selectionEndTime = selectionStartTime; focusSeq = td.getSelectionKey(); + //Logger.debug("SelectionListener, focusSeq: " + focusSeq); } } @@ -215,6 +216,7 @@ public abstract class DAWindowingTableComposite extends DATableComposite { } else if (e.keyCode == SWT.ARROW_DOWN) { int nowScrollBar = vScrollbar.getSelection(); int tableSelectionIndex = table.getSelectionIndex(); + //Logger.debug("nowScrollbar: " + nowScrollBar + ", tableSelectionIndex: " + tableSelectionIndex + ", getTableLength(): " + getTableLength()); if (tableSelectionIndex >= getTableLength()) { vScrollbar.setSelection(nowScrollBar + 1); setTableSeqNumber(getTableLength()); @@ -238,6 +240,7 @@ public abstract class DAWindowingTableComposite extends DATableComposite { selectionStartTime = 0; selectionEndTime = 0; focusSeq = 0; + //Logger.debug("Before focusSeq: " + focusSeq); updateTable(); if (table.getItemCount() <= index) { index = table.getItemCount() - 1; @@ -256,6 +259,7 @@ public abstract class DAWindowingTableComposite extends DATableComposite { focusSeq = td.getSelectionKey(); } + //Logger.debug("After focusSeq: " + focusSeq); updateTable(); } @@ -450,10 +454,9 @@ public abstract class DAWindowingTableComposite extends DATableComposite { if (selectedCount != getRecordCount(itemCount) && selectedCount != itemCount - scrollSelection) { // scroll is at bottom-most and the number of records is less than the size of table -// Logger.debug("requestedRecordCount : " + getRecordCount(itemCount) -// + " selectedCount : " + selectedCount); + //Logger.debug("requestedRecordCount : " + getRecordCount(itemCount) + " selectedCount : " + selectedCount); selectSuccess = false; -// Logger.debug("selected record count mismatch with requested record count"); + //Logger.debug("selected record count mismatch with requested record count"); } } else { selectSuccess = false; @@ -587,19 +590,22 @@ public abstract class DAWindowingTableComposite extends DATableComposite { // forward if (next) { for (int i = start; i < size; i++) { + //Logger.debug("start: " + start + ", size: " + size + ", i: " + i); if (checkText(findProperty, items[i])) { - vScrollbar.setSelection(getScrollSelectionIndex(i)); - table.setSelection(i); - updateTable(); - return i; - } - } - // can't find - for (int i = 0; i < start; i++) { - if (checkText(findProperty, items[i])) { - vScrollbar.setSelection(getScrollSelectionIndex(i)); + int nowScrollBar = vScrollbar.getSelection(); table.setSelection(i); - updateTable(); + int tableSelectionIndex = table.getSelectionIndex(); + GridItem focusedItem = table.getFocusItem(); + if (null != focusedItem) { + DATableDataFormat td = (DATableDataFormat) focusedItem.getData(); + focusSeq = td.getSelectionKey(); + //Logger.debug("searchString, focusSeq: " + focusSeq); + } + //Logger.debug("nowScrollbar: " + nowScrollBar + ", tableSelectionIndex: " + tableSelectionIndex + ", getTableLength(): " + getTableLength()); + if (tableSelectionIndex >= getTableLength()) { + vScrollbar.setSelection(nowScrollBar + 1); + setTableSeqNumber(getTableLength()); + } return i; } } @@ -607,16 +613,6 @@ public abstract class DAWindowingTableComposite extends DATableComposite { for (int i = start; i >= 0; i--) { if (checkText(findProperty, items[i])) { vScrollbar.setSelection(getScrollSelectionIndex(i)); - table.setSelection(i); - updateTable(); - return i; - } - } - - for (int i = size - 1; i > start; i--) { - if (checkText(findProperty, items[i])) { - vScrollbar.setSelection(getScrollSelectionIndex(i)); - table.setSelection(i); updateTable(); return i; } -- 2.7.4