From e4282bead7123776b2e4c6d4d1e5b56f5fdb04ff Mon Sep 17 00:00:00 2001 From: "Hyunjong,park" Date: Tue, 1 Oct 2013 16:42:00 +0900 Subject: [PATCH] [Title] fix sqllite, failed table [Desc.] selection Range, print failed api [Issue] - --- .../dynamicanalyzer/handlers/OpenTraceHandler.java | 6 +- .../logparser/LogCenterConstants.java | 54 +++++----- .../org/tizen/dynamicanalyzer/sql/SqlManager.java | 20 +++- .../swap/model/probe2/LogDataFactory.java | 5 - .../dynamicanalyzer/ui/file/FileApiListView.java | 5 + .../ui/network/NetworkApiListView.java | 58 +++++----- .../ui/network/NetworkDataMaker.java | 51 --------- .../ui/opengl/ui/apiList/GLAPIListTable.java | 2 +- .../ui/thread/ThreadAPIListView.java | 5 + .../ui/widgets/table/DATableComposite.java | 118 +++++++++------------ .../ui/widgets/table/WindowingTable.java | 3 - 11 files changed, 137 insertions(+), 190 deletions(-) diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java index bc13d97..1feedb4 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/handlers/OpenTraceHandler.java @@ -359,7 +359,7 @@ public class OpenTraceHandler extends AbstractHandler { } private boolean loadImageSet() { - List> input = SqlManager.getInstance().getloadImageSet(2); + List> input = SqlManager.getInstance().getloadImageSet(3); if (null == input) { return false; } @@ -373,6 +373,10 @@ public class OpenTraceHandler extends AbstractHandler { ImageInfo imgInfo = new ImageInfo(); imgInfo.setSeq(seq); imgInfo.setTime(time); + + String[] path = imgLog.get(2).split(CommonConstants.SLASH); + imgInfo.setFileName(new String(path[path.length - 1])); + AnalyzerManager.getImageSet().put(seq, imgInfo); } return true; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogCenterConstants.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogCenterConstants.java index 7434118..f7732bb 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogCenterConstants.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/logparser/LogCenterConstants.java @@ -124,31 +124,31 @@ public class LogCenterConstants { public static final int FD_API_TYPE_OTHERS = 8; /* Log Network */ - public static final int SOCKET_API_FD_OPEN = 0; - public static final int SOCKET_API_FD_CLOSE = 1; - public static final int SOCKET_API_RECV_START = 2; - public static final int SOCKET_API_RECV_END = 3; - public static final int SOCKET_API_SEND_START = 4; - public static final int SOCKET_API_SEND_END = 5; - public static final int SOCKET_API_BIND = 6; - public static final int SOCKET_API_LISTEN = 7; - public static final int SOCKET_API_CONNECT = 8; - public static final int SOCKET_API_ACCEPT_START = 9; - public static final int SOCKET_API_ACCEPT_END = 10; - public static final int SOCKET_API_EVENT_START = 11; - public static final int SOCKET_API_EVENT_END = 12; - public static final int SOCKET_API_OTHER = 13; - public static final int HTTP_API_SESSION_CONSTRUCT = 14; - public static final int HTTP_API_SESSION_CLOSE = 15; - public static final int HTTP_API_TRANSACTION_OPEN = 16; - public static final int HTTP_API_TRANSACTION_CLOSE = 17; - public static final int HTTP_API_ALLOCATION = 18; - public static final int HTTP_API_SUBMIT = 19; - public static final int HTTP_API_REQUEST = 20; - public static final int HTTP_API_RESPONSE = 21; - public static final int HTTP_API_OTHER = 22; - public static final int HTTP_API_CLOSE = 23; - + public static final int SOCKET_API_FD_OPEN = 0; + public static final int SOCKET_API_FD_CLOSE = 1; + public static final int SOCKET_API_RECV_START = 2; + public static final int SOCKET_API_RECV_END = 3; + public static final int SOCKET_API_SEND_START = 4; + public static final int SOCKET_API_SEND_END = 5; + public static final int SOCKET_API_BIND = 6; + public static final int SOCKET_API_LISTEN = 7; + public static final int SOCKET_API_CONNECT = 8; + public static final int SOCKET_API_ACCEPT_START = 9; + public static final int SOCKET_API_ACCEPT_END = 10; + public static final int SOCKET_API_EVENT_START = 11; + public static final int SOCKET_API_EVENT_END = 12; + public static final int SOCKET_API_OTHER = 13; + public static final int HTTP_API_SESSION_CONSTRUCT = 14; + public static final int HTTP_API_SESSION_CLOSE = 15; + public static final int HTTP_API_TRANSACTION_OPEN = 16; + public static final int HTTP_API_TRANSACTION_CLOSE = 17; + public static final int HTTP_API_ALLOCATION = 18; + public static final int HTTP_API_SUBMIT = 19; + public static final int HTTP_API_REQUEST = 20; + public static final int HTTP_API_RESPONSE = 21; + public static final int HTTP_API_OTHER = 22; + public static final int HTTP_API_CLOSE = 23; + /* Log snapshot */ public static final int SNAPSHOT_IMAGE_PATH_INDEX = 12; public static final int SNAPSHOT_ROTATE_INDEX = 13; @@ -257,7 +257,7 @@ public class LogCenterConstants { public static final int SYNC_API_TYPE_NOTIFY = 7; public static final int SYNC_API_TYPE_NOTIFY_ALL = 8; public static final int SYNC_API_TYPE_OTHER = 9; - + /* network log : 15 */ public static final int NETWORK_OBJECT_INDEX = 12; public static final int NETWORK_FD_INDEX = 13; @@ -267,7 +267,7 @@ public class LogCenterConstants { public static final int NETWORK_MESSAGE_SIZE_INDEX = 17; public static final int NETWORK_DESTINATION_ADDRESS_INDEX = 18; public static final int NETWORK_RESERVED_INDEX = 19; - + /* gles20 log : 16 */ public static final int GL_API_TYPE_INDEX = 12; public static final int GL_CONTEXT_VALUE_INDEX = 13; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java index d12bdce..78a4957 100755 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/sql/SqlManager.java @@ -36,6 +36,7 @@ import java.sql.Connection; import java.sql.DriverManager; import java.sql.PreparedStatement; import java.sql.ResultSet; +import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.SQLWarning; import java.sql.Statement; @@ -1001,7 +1002,7 @@ public class SqlManager { reObj.loadData(rs); eventObjs.add(reObj); } - + output.setObjectCount(eventObjs.size()); } catch (SQLException e) { System.out.println("SQLException - select : " + query); @@ -1062,10 +1063,21 @@ public class SqlManager { return null; } dbInfo = new ArrayList>(); + ResultSetMetaData rsMetaData = rs.getMetaData(); + int nRsMetaDataCount = rsMetaData.getColumnCount(); while (rs.next()) { List rowData = new ArrayList(); - for (String name : columnName) { - rowData.add(rs.getString(name)); + for (int i = 1; i < nRsMetaDataCount + 1; i++) { + if (rsMetaData.getColumnTypeName(i).contains("INTEGER")) {//$NON-NLS-1$ + rowData.add(Integer.toString(rs.getInt(i))); + } else if (rsMetaData.getColumnTypeName(i).contains( + "VARCHAR")) {//$NON-NLS-1$ + rowData.add(rs.getString(rsMetaData.getColumnName(i))); + } else { + System.out.println("Error undefine Type : " + + rsMetaData.getColumnTypeName(i)); + } + } dbInfo.add(rowData); } @@ -1274,7 +1286,7 @@ public class SqlManager { public List> getloadImageSet(int size) { List> dbInfo = selectQuery(null, new String[] { - "SeqNumber", "Time" }, "screenshot", null); //$NON-NLS-1$ //$NON-NLS-2$ + "SeqNumber", "Time", "ImageFilePath" }, "screenshot", null); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ return dbInfo; } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogDataFactory.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogDataFactory.java index 7adf0c5..70a5711 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogDataFactory.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/swap/model/probe2/LogDataFactory.java @@ -129,7 +129,6 @@ public class LogDataFactory { output = new FileData(); break; case MSG_PROBE_NETWORK: - System.out.println("MSG_PROBE_NETWORK "); output = new NetworkData(); break; case MSG_PROBE_GLES20: @@ -211,7 +210,6 @@ public class LogDataFactory { break; case MSG_PROBE_NETWORK: // network - System.out.println("MSG_PROBE_NETWORK"); output = new NetworkData(); break; case MSG_PROBE_GLES20: @@ -288,7 +286,6 @@ public class LogDataFactory { format = FileLogFormat.getInstance(); break; case MSG_PROBE_NETWORK: - System.out.println("MSG_PROBE_NETWORK"); format = NetworkLogFormat.getInstance(); break; case MSG_PROBE_GLES20: @@ -359,8 +356,6 @@ public class LogDataFactory { break; case MSG_PROBE_FILE: case MSG_PROBE_NETWORK: - // file - System.out.println("MSG_PROBE_NETWORK"); break; case LogCenterConstants.LOG_GLES20: count = 16; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListView.java index 147fd8d..8bfee63 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/file/FileApiListView.java @@ -65,6 +65,9 @@ public class FileApiListView extends DAView { private int[] columnSizes = { 35, 70, 120, 250, 0, 100, 100 }; + private int[] columnAlignment = { SWT.RIGHT, SWT.LEFT, SWT.LEFT, SWT.LEFT, + SWT.LEFT, SWT.LEFT, SWT.LEFT }; + int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_STRING, @@ -96,6 +99,8 @@ public class FileApiListView extends DAView { | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); tableComp.setSortTypes(sortTypes); tableComp.setSourceColumns(sourceColumns); + tableComp.setFailedAPITableIndex(6); + tableComp.setColumnAlignment(columnAlignment); tableComp.setColumns(columnNames); tableComp.setColumnSize(columnSizes); tableComp.setTableName(FilePageLabels.FILE_API_LIST_VIEW_TITLE); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListView.java index 01c6fa1..67c8119 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkApiListView.java @@ -114,7 +114,7 @@ public class NetworkApiListView extends DAView { | SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL); tableComp.setSortTypes(sortTypes); tableComp.setSourceColumns(sourceColumns); - tableComp.setFailedAPIColor(true); + tableComp.setFailedAPITableIndex(10); tableComp.setColumnAlignment(columnAlignment); tableComp.setColumns(columnNames); tableComp.setColumnSize(columnSizes); @@ -200,34 +200,34 @@ public class NetworkApiListView extends DAView { tableComp.getTable().getSelection(), tableComp.getTable()); AnalyzerManager.getCurrentPage().updatePage(selData); } - -// @Override -// public void setSelection(List data) { -// if (null == data || data.isEmpty()) { -// return; -// } -// String seq = data.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX); -// tableComp.updateTable(); -// int nSize = tableComp.getTable().getItemCount(); -// for (int ii = 0; ii < nSize; ii++) { -// if (tableComp.getTable().getItem(ii).getText(0).equals(seq)) { -// tableComp.getTable().setSelection(ii); -// tableComp -// .getTable() -// .getVerticalBar() -// .setSelection( -// getScrollSelectionIndex(tableComp.getTable(), -// ii)); -// tableComp.updateTable(); -// } -// } -// String logTime = data.get(LogCenterConstants.TIME_INDEX); -// long selectedTime = Long.parseLong(logTime); -// DASelectionData selData = new DASelectionData(NetworkApiListView.ID, -// selectedTime, selectedTime, -// tableComp.getTable().getSelection(), tableComp.getTable()); -// AnalyzerManager.getCurrentPage().updatePage(selData); -// } + + // @Override + // public void setSelection(List data) { + // if (null == data || data.isEmpty()) { + // return; + // } + // String seq = data.get(LogCenterConstants.SEQUENCE_NUMBER_INDEX); + // tableComp.updateTable(); + // int nSize = tableComp.getTable().getItemCount(); + // for (int ii = 0; ii < nSize; ii++) { + // if (tableComp.getTable().getItem(ii).getText(0).equals(seq)) { + // tableComp.getTable().setSelection(ii); + // tableComp + // .getTable() + // .getVerticalBar() + // .setSelection( + // getScrollSelectionIndex(tableComp.getTable(), + // ii)); + // tableComp.updateTable(); + // } + // } + // String logTime = data.get(LogCenterConstants.TIME_INDEX); + // long selectedTime = Long.parseLong(logTime); + // DASelectionData selData = new DASelectionData(NetworkApiListView.ID, + // selectedTime, selectedTime, + // tableComp.getTable().getSelection(), tableComp.getTable()); + // AnalyzerManager.getCurrentPage().updatePage(selData); + // } private int getScrollSelectionIndex(Grid table, int selection) { int size = table.getVerticalBar().getThumb() / 2; diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java index 2798020..a1ff4e1 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/network/NetworkDataMaker.java @@ -456,57 +456,6 @@ public class NetworkDataMaker { chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board .getTimeline())); plot.setMarkers(board.getMarkers()); - /* - // plot.setAutoHeightRange(AutoRangeType.MANUAL); - plot.setAxisFont(FontResources.CHART_AXIS_FONT); - plot.setAxisRangeY(0, 101); - plot.setAxisRangeX(board.getVisibleStartTime(), - board.getVisibleEndTime()); - - DAChartPlotTooltip tooltip = new DAChartPlotTooltip(-1); - tooltip.setFont(FontResources.CHART_TOOLTIP_FONT); - plot.setTooltip(tooltip); - plot.setMarkers(board.getMarkers()); - - DAPopupMenu popupMenu = new DAPopupMenu(chart); - popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT); - DAPopupMenuItem startItem = new DAPopupMenuItem(popupMenu, - DAPopupMenuItem.NONE); - startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START); - startItem.addListener(new PopupStartMenuItemClickListener(startItem, - board)); - - DAPopupMenuItem endItem = new DAPopupMenuItem(popupMenu, - DAPopupMenuItem.NONE); - endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END); - endItem.addListener(new PopupEndMenuItemClickListener(endItem, board)); - - DAPopupMenuItem fromSelectionItem = new DAPopupMenuItem(popupMenu, - DAPopupMenuItem.NONE); - fromSelectionItem - .setText(TimelineChartLabels.RANGE_CONTEXT_SET_FROM_SELECTION); - fromSelectionItem - .addListener(new PopupFromSelectionMenuItemClickListener( - fromSelectionItem, board)); - - DAPopupMenuItem analysisItem = new DAPopupMenuItem(popupMenu, - DAPopupMenuItem.NONE); - analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS); - analysisItem.addListener(new PopupAnalysisMenuItemClickListener()); - - DAPopupMenuItem clearItem = new DAPopupMenuItem(popupMenu, - DAPopupMenuItem.NONE); - clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR); - clearItem.addListener(new PopupClearMenuItemClickListener()); - - // TimelineChartMouseEventListener timelineChartMouseEventListener = new - // TimelineChartMouseEventListener( - // popupMenu, board.getTimeline()); - // chart.addMouseListener(timelineChartMouseEventListener); - // chart.addMouseMoveListener(timelineChartMouseEventListener); - // chart.addMouseTrackListener(new TimelineChartMouseTrackAdapter(board - // .getTimeline())); - */ } private boolean createNetworkBoardItem(NetworkChartData parent, diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java index c7cac0e..e3f5976 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/opengl/ui/apiList/GLAPIListTable.java @@ -99,7 +99,7 @@ public class GLAPIListTable extends DAApiListTableComposite { setTableName(GLPageLabels.GL_API_LIST_VIEW_TITLE); setSortTypes(sortTypes); setSourceColumns(sourceColumns); - setFailedAPIColor(true); + setFailedAPITableIndex(5); setColumnAlignment(columnAlignment); setColumns(columnNames); setColumnSize(columnSizes); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadAPIListView.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadAPIListView.java index 088e3d2..42186f1 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadAPIListView.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/thread/ThreadAPIListView.java @@ -62,6 +62,9 @@ public class ThreadAPIListView extends DAView { private int[] columnSizes = { 35, 70, 120, 250, 0, 100, 100 }; + private int[] columnAlignment = { SWT.RIGHT, SWT.LEFT, SWT.LEFT, SWT.LEFT, + SWT.LEFT, SWT.LEFT, SWT.LEFT }; + int[] sortTypes = { AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_NUM, AnalyzerConstants.SORT_TYPE_STRING, @@ -94,6 +97,8 @@ public class ThreadAPIListView extends DAView { tableComp.setTableName("Thread API List"); tableComp.setSortTypes(sortTypes); tableComp.setSourceColumns(sourceColumns); + tableComp.setFailedAPITableIndex(6); + tableComp.setColumnAlignment(columnAlignment); tableComp.setColumns(columnNames); tableComp.setColumnSize(columnSizes); diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableComposite.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableComposite.java index 5cd03de..48bb101 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableComposite.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/DATableComposite.java @@ -35,8 +35,6 @@ 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.ControlEvent; -import org.eclipse.swt.events.ControlListener; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.events.SelectionAdapter; @@ -45,7 +43,6 @@ import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Color; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; @@ -58,15 +55,16 @@ import org.tizen.dynamicanalyzer.model.TableInput; import org.tizen.dynamicanalyzer.nl.TimelineChartLabels; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.resources.FontResources; +import org.tizen.dynamicanalyzer.resources.ImageResources; import org.tizen.dynamicanalyzer.swap.model.probe2.LogData; -import org.tizen.dynamicanalyzer.ui.common.ContextAnalysisMenuItemClickListener; +import org.tizen.dynamicanalyzer.ui.common.PopupAnalysisMenuItemClickListener; import org.tizen.dynamicanalyzer.ui.range.RangeDataManager; -import org.tizen.dynamicanalyzer.ui.widgets.DAContextMenu; import org.tizen.dynamicanalyzer.ui.widgets.DAGrid; import org.tizen.dynamicanalyzer.ui.widgets.FindDialog; import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; -import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuItem; -import org.tizen.dynamicanalyzer.widgets.contextMenu.DAContextMenuListener; +import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenu; +import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuItem; +import org.tizen.dynamicanalyzer.widgets.popupMenu.DAPopupMenuListener; public abstract class DATableComposite extends Composite { @@ -98,11 +96,11 @@ public abstract class DATableComposite extends Composite { protected boolean autoColumnPack = true; - private DAContextMenu popupMenu = null; + protected DAPopupMenu popupMenu = null; protected Point mousePoint = new Point(0, 0); - - private boolean failedAPIColor = false; + + private int failedAPITableColumIndex = -1; protected RangeDataManager rangeDataManager = RangeDataManager .getInstance(); @@ -208,25 +206,6 @@ public abstract class DATableComposite extends Composite { me = this; setTableToolTipListener(new TableTooltipListener(table)); - - table.addControlListener(new ControlListener() { - - @Override - public void controlResized(ControlEvent e) { - - if (null != popupMenu) { - Rectangle rect = table.getClientArea(); - int h = table.getHeaderHeight(); - Rectangle contentsRect = new Rectangle(rect.x, rect.y + h, - rect.width, rect.height - h); - popupMenu.setParentArea(contentsRect); - } - } - - @Override - public void controlMoved(ControlEvent e) { - } - }); } public void setTree(boolean tree) { @@ -279,13 +258,13 @@ public abstract class DATableComposite extends Composite { } column.setCellRenderer(new DATableCellRenderer()); column.setHeaderRenderer(new DATableHeaderRenderer()); - + if (isTree == false && columnAlignment != null) { if (columnAlignment.length > i) { column.setAlignment(columnAlignment[i]); } } - + column.pack(); if (null != comparator && null != sourceColumns @@ -393,16 +372,18 @@ public abstract class DATableComposite extends Composite { gridItem.setBackground(rangeColor); } - if (isTree == false && isFailedAPIColor()) { - -// if (!gridData.getData().get(LogCenterConstants.ERROR_INDEX) -// .equals(CommonConstants.ZERO)) { -// gridItem.setBackground(ColorResources.TABLE_CONTENTS_FAILED_BACGOUND_COLOR); -// gridItem.setForeground(ColorResources.TABLE_CONTENTS_FAILED_FONT_COLOR); -// gridItem.setImage(0, ImageResources.FAILED_API_ICON_TABLE); -// } + if (isTree == false) { + int columIndex = getFailedAPITableIndex(); + if (columIndex > 0 && columIndex < text.size()) { + if (!text.get(columIndex).contains("SUCCESS")) { + gridItem.setBackground(ColorResources.TABLE_CONTENTS_FAILED_BACGOUND_COLOR); + gridItem.setForeground(ColorResources.TABLE_CONTENTS_FAILED_FONT_COLOR); + gridItem.setImage(0, + ImageResources.FAILED_API_ICON_TABLE); + } + } } - + if (gridData != null) { long seqNum = gridData.getSelectionKey(); for (int ii = 0; ii < selSeqs.size(); ii++) { @@ -463,7 +444,7 @@ public abstract class DATableComposite extends Composite { public void setColumnAlignment(int[] columns) { columnAlignment = columns; } - + public void deselectAll() { getSelectionIndex().clear(); getSelections().clear(); @@ -592,73 +573,72 @@ public abstract class DATableComposite extends Composite { } public void setRangePopup() { - popupMenu = new DAContextMenu(table); + popupMenu = new DAPopupMenu(table); popupMenu.setFont(FontResources.CONTEXT_MENU_ITEM_FONT); - DAContextMenuItem startItem = new DAContextMenuItem(popupMenu); + DAPopupMenuItem startItem = new DAPopupMenuItem(popupMenu); startItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_START); - startItem.addClickListener(new DAContextMenuListener() { + startItem.addListener(new DAPopupMenuListener() { @Override - public void widgetSelected(DAContextMenuItem menuItem) { + public void widgetSelected(DAPopupMenuItem menuItem) { actionSetStartEnd(START_TIME); } }); - DAContextMenuItem endItem = new DAContextMenuItem(popupMenu); + DAPopupMenuItem endItem = new DAPopupMenuItem(popupMenu); endItem.setText(TimelineChartLabels.RANGE_CONTEXT_SET_END); - endItem.addClickListener(new DAContextMenuListener() { + endItem.addListener(new DAPopupMenuListener() { @Override - public void widgetSelected(DAContextMenuItem menuItem) { + public void widgetSelected(DAPopupMenuItem menuItem) { actionSetStartEnd(END_TIME); } }); - DAContextMenuItem analysisItem = new DAContextMenuItem(popupMenu); + DAPopupMenuItem analysisItem = new DAPopupMenuItem(popupMenu); analysisItem.setText(TimelineChartLabels.RANGE_CONTEXT_ANALYSIS); - analysisItem - .addClickListener(new ContextAnalysisMenuItemClickListener()); + analysisItem.addListener(new PopupAnalysisMenuItemClickListener()); - DAContextMenuItem clearItem = new DAContextMenuItem(popupMenu); + DAPopupMenuItem clearItem = new DAPopupMenuItem(popupMenu); clearItem.setText(TimelineChartLabels.RANGE_CONTEXT_CLEAR); - clearItem.addClickListener(new DAContextMenuListener() { + clearItem.addListener(new DAPopupMenuListener() { @Override - public void widgetSelected(DAContextMenuItem menuItem) { + public void widgetSelected(DAPopupMenuItem menuItem) { rangeDataManager.initRange(); } }); - table.addListener(SWT.MouseUp, new Listener() { + table.addListener(SWT.MouseDown, new Listener() { @Override public void handleEvent(Event event) { // 3 means mouse right button click if (event.button == 3) { - List menuItems = popupMenu.getItems(); + List menuItems = popupMenu.getItems(); int size = menuItems.size(); GridItem item = table.getItem(mousePoint); for (int i = 0; i < size; i++) { if (i == 0 || i == 1) { if (null != item) { - if (!menuItems.get(i).isButtonEnabled()) { - menuItems.get(i).setButtonEnabled(true); + if (!menuItems.get(i).isEnabled()) { + menuItems.get(i).setEnabled(true); } } else { - if (menuItems.get(i).isButtonEnabled()) { - menuItems.get(i).setButtonEnabled(false); + if (menuItems.get(i).isEnabled()) { + menuItems.get(i).setEnabled(false); } } } else if (i == 2) { if (rangeDataManager.isAnalyzable()) { - menuItems.get(i).setButtonEnabled(true); + menuItems.get(i).setEnabled(true); } else { - menuItems.get(i).setButtonEnabled(false); + menuItems.get(i).setEnabled(false); } } else if (i == 3) { if (rangeDataManager.isBeingAnalyzed()) { - menuItems.get(i).setButtonEnabled(true); + menuItems.get(i).setEnabled(true); } else { - menuItems.get(i).setButtonEnabled(false); + menuItems.get(i).setEnabled(false); } } } @@ -674,12 +654,12 @@ public abstract class DATableComposite extends Composite { public boolean isAutoColumnPackEnabled() { return autoColumnPack; } - - public boolean isFailedAPIColor() { - return failedAPIColor; + + public int getFailedAPITableIndex() { + return failedAPITableColumIndex; } - public void setFailedAPIColor(boolean failedAPIColor) { - this.failedAPIColor = failedAPIColor; + public void setFailedAPITableIndex(int failedTableIndex) { + this.failedAPITableColumIndex = failedTableIndex; } } diff --git a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/WindowingTable.java b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/WindowingTable.java index 6358383..dc9a214 100644 --- a/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/WindowingTable.java +++ b/org.tizen.dynamicanalyzer/src/org/tizen/dynamicanalyzer/ui/widgets/table/WindowingTable.java @@ -41,14 +41,11 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.ScrollBar; -import org.tizen.dynamicanalyzer.common.AnalyzerManager; import org.tizen.dynamicanalyzer.logparser.LogCenterConstants; import org.tizen.dynamicanalyzer.model.LogCenter; import org.tizen.dynamicanalyzer.resources.ColorResources; import org.tizen.dynamicanalyzer.resources.FontResources; -import org.tizen.dynamicanalyzer.sql.SqlManager; import org.tizen.dynamicanalyzer.utils.AnalyzerUtil; -import org.tizen.dynamicanalyzer.utils.Formatter; public class WindowingTable extends Composite { -- 2.7.4