import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Composite;
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;
import org.tizen.dynamicanalyzer.common.AnalyzerManager;
import org.tizen.dynamicanalyzer.common.DASelectionData;
import org.tizen.dynamicanalyzer.common.Global;
-import org.tizen.dynamicanalyzer.model.FilterProperty;
import org.tizen.dynamicanalyzer.model.TableInput;
import org.tizen.dynamicanalyzer.project.callstack.RuntimeCallstackManager;
import org.tizen.dynamicanalyzer.swap.model.data.LogData;
seqNum = (Long) calltraceData.get(FunctionEntryDBTable.COLUMN.SEQUENCE_NUMBER.index);
pid = (Integer) calltraceData.get(FunctionEntryDBTable.COLUMN.PID.index);
time = (Long) calltraceData.get(FunctionEntryDBTable.COLUMN.START_TIME.index);
- } else if (tableData.getType() == AnalyzerConstants.TYPE_TABLE_INTERACTIVE) {
+ } else if (tableData.getType() == AnalyzerConstants.TYPE_TABLE_MEM_ALLOCATEDTRACE) {
+ GridItem gridItem = new GridItem(table, SWT.NONE);
+ gridItem.setText(0, "Stub for callstack");
+ return;
+ }else if (tableData.getType() == AnalyzerConstants.TYPE_TABLE_INTERACTIVE) {
return; // TODO
} else { // in case table has LogData
LogData logData = tableData.getLogData();
import org.eclipse.nebula.widgets.grid.GridItem;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
-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.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
import org.tizen.dynamicanalyzer.common.DASelectionData;
-import org.tizen.dynamicanalyzer.constant.CommonConstants;
+import org.tizen.dynamicanalyzer.nl.InformationViewLabels;
import org.tizen.dynamicanalyzer.nl.MemoryPageLabels;
import org.tizen.dynamicanalyzer.resources.ColorResources;
-import org.tizen.dynamicanalyzer.resources.FontResources;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallStackInserter;
+import org.tizen.dynamicanalyzer.ui.info.callstack.CallstackTable;
+import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;
+import org.tizen.dynamicanalyzer.ui.widgets.table.TableColumnSizePackListener;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewComposite;
import org.tizen.dynamicanalyzer.widgets.da.view.DAViewData;
public static final String ID = MemoryCallStackView.class.getName();
- private Composite contents = null;
- private Text detailText = null;
- private Label labelMessage = null;
-
- private void init() {
- detailText.setText(CommonConstants.EMPTY);
- }
+ private DATableComposite callstackTableComp = null;
+ private String[] columnNames = { InformationViewLabels.CALLSTACK_VIEW_FUNCTION,
+ InformationViewLabels.CALLSTACK_VIEW_ADDRESS,
+ InformationViewLabels.CALLSTACK_VIEW_BINARY_PATH };
+ private int[] columnSizes = { 120, 70, 400 };
+ private boolean[] columnVisibility = { true, true, true };
+ Composite contents = null;
+
+ // this definition should be here for creation of instance (register db table)
+ @SuppressWarnings("unused")
+ private static CallStackInserter inserter = CallStackInserter.getInstance();
public MemoryCallStackView(Composite parent, int style) {
super(parent, style, false);
this.setLayout(new FillLayout());
-
setTitle(MemoryPageLabels.MEMORY_CALLSTACK_VIEW_TITLE);
-
- Composite detailCom = getContentArea();
- detailCom.setBackground(ColorResources.VIEW_BG_COLOR);
- detailCom.setLayout(new FormLayout());
- FormData labelData = new FormData();
- labelData.top = new FormAttachment(0, 0);
- labelData.left = new FormAttachment(0, 0);
- labelData.right = new FormAttachment(100, 0);
- labelData.bottom = new FormAttachment(100, 0);
- detailCom.setLayoutData(labelData);
-
- Composite contents = detailCom;
- contents.setBackground(ColorResources.VIEW_BG_COLOR);
- contents.setLayout(new FormLayout());
-
- detailText = new Text(contents, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
- detailText.setBackground(ColorResources.VIEW_BG_COLOR);
- detailText.setForeground(ColorResources.TABLE_CONTENTS_FONT_COLOR);
- detailText.setFont(FontResources.DETAIL_INFO_FONT);
-
- FormData buttonData = new FormData();
- buttonData.top = new FormAttachment(labelMessage, 0);
- buttonData.left = new FormAttachment(0, 0);
- buttonData.right = new FormAttachment(100, 0);
- buttonData.bottom = new FormAttachment(100, 0);
- detailText.setLayoutData(buttonData);
+
+ contents = getContentArea();
+ contents.setBackground(ColorResources.WINDOW_BG_COLOR);
+ contents.setLayout(new FillLayout());
+
+ callstackTableComp = new CallstackTable(contents, SWT.NONE, SWT.SINGLE | SWT.BORDER
+ | SWT.H_SCROLL | SWT.V_SCROLL);
+ callstackTableComp.setTableName("Callstack"); //$NON-NLS-1$
+ callstackTableComp.setColumns(columnNames);
+ callstackTableComp.setColumnSize(columnSizes);
+ callstackTableComp.setColumnVisibility(columnVisibility);
+
+ contents.addControlListener(new TableColumnSizePackListener(callstackTableComp, columnSizes));
}
-
+
@Override
public void updateView() {
-
}
-
+
@Override
public void updateView(DAViewData data) {
- if (data instanceof DASelectionData == false) {
+ if (!(data instanceof DASelectionData))
return;
- }
+
DASelectionData seldata = (DASelectionData) data;
+
if (seldata.getData() instanceof GridItem[]) {
-
+ ((CallstackTable) callstackTableComp).updateCallstackTable(seldata);
} else {
-
+ updateView();
}
}
-
- @Override
- public Control getControl() {
- return contents;
- }
@Override
public void clear() {
- init();
+ callstackTableComp.clear();
}
+ @Override
+ public Control getControl() {
+ return callstackTableComp;
+ }
}
import org.tizen.dynamicanalyzer.resources.ColorResources;
import org.tizen.dynamicanalyzer.setting.SettingDataManager;
import org.tizen.dynamicanalyzer.shortcut.ShortCutManager;
-import org.tizen.dynamicanalyzer.swap.logparser.DataManagerRegistry;
import org.tizen.dynamicanalyzer.ui.memory.data.HeapDataManager;
import org.tizen.dynamicanalyzer.ui.memory.data.MemoryDataManager;
import org.tizen.dynamicanalyzer.ui.page.BaseView;
public static final String chartViewID = MemoryChartView.class.getName();
public static final String detailsViewID = MemoryDetailsTableView.class.getName();
public static final String mapViewID = MemoryMapView.class.getName();
+ public static final String allocationtraceViewID = MemoryAllocationTraceTableView.class.getName();
+
SashForm baseForm;
SashForm topForm;
}
addView(memoryTabView);
- DATabComposite memoryMapCallStackView = new DATabComposite(bottomRightForm, SWT.NONE, false, true);
+ DATabComposite memoryRightTabView = new DATabComposite(bottomRightForm, SWT.NONE, false, true);
{
- memoryMapView = new MemoryMapView(memoryMapCallStackView.getContentComposite(), SWT.NONE);
+ memoryCallStackView = new MemoryCallStackView(memoryRightTabView.getContentComposite(), SWT.NONE);
+ memoryRightTabView.addView(memoryCallStackView, false);
+ addView(memoryCallStackView);
+
+ memoryMapView = new MemoryMapView(memoryRightTabView.getContentComposite(), SWT.NONE);
+ memoryRightTabView.addView(memoryMapView, false);
addView(memoryMapView);
- memoryMapCallStackView.addView(memoryMapView, false);
- // It make ui hang issue. But this tab must be included.
- //memoryCallStackView = new MemoryCallStackView(memoryMapCallStackView.getContentComposite(), SWT.NONE);
- //addView(memoryCallStackView);
- //memoryMapCallStackView.addView(memoryCallStackView, false);
}
- addView(memoryMapCallStackView);
+ addView(memoryRightTabView);
+
baseForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
bottomForm.setSashWidth(AnalyzerConstants.SASH_WIDTH);
import org.eclipse.swt.events.SelectionListener;\r
import org.eclipse.swt.widgets.Composite;\r
import org.tizen.dynamicanalyzer.common.AnalyzerConstants;\r
+import org.tizen.dynamicanalyzer.common.AnalyzerManager;\r
+import org.tizen.dynamicanalyzer.common.DASelectionData;\r
import org.tizen.dynamicanalyzer.common.DAState;\r
import org.tizen.dynamicanalyzer.common.Global;\r
import org.tizen.dynamicanalyzer.model.TableInput;\r
import org.tizen.dynamicanalyzer.nl.MemoryPageLabels;\r
+import org.tizen.dynamicanalyzer.ui.memory.MemoryPage;\r
import org.tizen.dynamicanalyzer.ui.memory.data.HeapDataManager;\r
-import org.tizen.dynamicanalyzer.ui.timeline.calltrace.FunctionEntryDBTable;\r
import org.tizen.dynamicanalyzer.ui.toolbar.Toolbar;\r
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableComposite;\r
import org.tizen.dynamicanalyzer.ui.widgets.table.DATableDataFormat;\r
\r
@Override\r
public void widgetSelected(SelectionEvent e) {\r
-\r
- GridItem[] items = table.getSelection();\r
- if (null == items) {\r
+ GridItem[] items = ((Grid) e.widget).getSelection();\r
+ if (null == items|| items.length == 0) {\r
return;\r
}\r
+ int size = items.length;\r
+ List<Object> startData = ((DATableDataFormat) items[0].getData()).getData();\r
+ List<Object> endData = ((DATableDataFormat) items[size - 1].getData()).getData();\r
+ long startTime = (Long) startData.get(1);//1 is an index of timestamp column in table.\r
+ long endTime = (Long) endData.get(1);\r
+ Toolbar.INSTANCE.setChartDragStartTime(startTime);\r
+ Toolbar.INSTANCE.setChartDragEndTime(endTime);\r
+ Toolbar.INSTANCE.setDlogSelection(false);\r
+ DASelectionData data = new DASelectionData(MemoryPage.allocationtraceViewID, startTime,\r
+ endTime, items, table);\r
+ AnalyzerManager.getCurrentPage().updateView(data);\r
}\r
\r
@Override\r
List<Object> iAllocData = allocDataList.get(j);\r
\r
TableInput alloInput = HeapDataManager.getInstance().makeTreeInputForLeakData(iAllocData, index++);\r
- \r
if (alloInput != null){\r
+ ((DATableDataFormat)alloInput.getData()).setType(AnalyzerConstants.TYPE_TABLE_MEM_ALLOCATEDTRACE);\r
output.add(alloInput);\r
}\r
}\r