Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 166640 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/tptp/trace/jvmti/internal/client/views/messages.properties (-1 / +3 lines)
Lines 126-129 Link Here
126
_MONITOR_THREADS_TAB = Threads Statistics
126
_MONITOR_THREADS_TAB = Threads Statistics
127
_MONITOR_CLASSES_TAB = Monitor Classes Statistics
127
_MONITOR_CLASSES_TAB = Monitor Classes Statistics
128
_MONITOR_BLOCKED_TAB = Blocks Statistics
128
_MONITOR_BLOCKED_TAB = Blocks Statistics
129
_MONITOR_WAITING_TAB = Waits Statistics
129
_MONITOR_WAITING_TAB = Waits Statistics
130
131
MEM_ALLOCATION_DETAILS_FOR = Allocation details for
(-)src/org/eclipse/tptp/trace/jvmti/internal/client/views/AllocationDetailsView.java (-5 / +7 lines)
Lines 1-5 Link Here
1
/*****************************************************************************
1
/*****************************************************************************
2
 * Copyright (c) 2007, Intel Corporation.
2
 * Copyright (c) 2008, Intel Corporation.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 28-33 Link Here
28
import org.eclipse.hyades.ui.provisional.context.IContextLabelFormatProvider;
28
import org.eclipse.hyades.ui.provisional.context.IContextLabelFormatProvider;
29
import org.eclipse.hyades.ui.util.GridUtil;
29
import org.eclipse.hyades.ui.util.GridUtil;
30
import org.eclipse.jface.viewers.Viewer;
30
import org.eclipse.jface.viewers.Viewer;
31
import org.eclipse.swt.SWT;
31
import org.eclipse.swt.events.SelectionEvent;
32
import org.eclipse.swt.events.SelectionEvent;
32
import org.eclipse.swt.graphics.Color;
33
import org.eclipse.swt.graphics.Color;
33
import org.eclipse.swt.graphics.Font;
34
import org.eclipse.swt.graphics.Font;
Lines 39-44 Link Here
39
import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextAttributes;
40
import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextAttributes;
40
import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextProvider;
41
import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextProvider;
41
import org.eclipse.tptp.trace.jvmti.internal.client.widgets.Utils;
42
import org.eclipse.tptp.trace.jvmti.internal.client.widgets.Utils;
43
import org.eclipse.ui.forms.IFormColors;
42
44
43
/**
45
/**
44
 * Allocation Details view provides allocation info for objects
46
 * Allocation Details view provides allocation info for objects
Lines 77-83 Link Here
77
		return "org.eclipse.hyades.trace.views.statistic.allocdetails04";
79
		return "org.eclipse.hyades.trace.views.statistic.allocdetails04";
78
	}
80
	}
79
81
80
	protected String getViewTypeStr() {
82
	protected String getViewTypeStr() { 
81
		return "viewoption.allocdetails";
83
		return "viewoption.allocdetails";
82
	}
84
	}
83
	
85
	
Lines 85-94 Link Here
85
		_label = _toolkit.createLabel(viewContainer, null);
87
		_label = _toolkit.createLabel(viewContainer, null);
86
		Font font = _label.getFont();
88
		Font font = _label.getFont();
87
		FontData fd = font.getFontData()[0];
89
		FontData fd = font.getFontData()[0];
88
		font = new Font(null, new FontData(fd.getName(), fd.getHeight() * 3 / 2, fd.getStyle()));
90
		font = new Font(null, new FontData(fd.getName(), fd.getHeight() * 3 / 2, fd.getStyle() | SWT.BOLD));
89
		_label.setFont(font);
91
		_label.setFont(font);
90
		_label.setBackground(viewContainer.getBackground());
92
		_label.setBackground(viewContainer.getBackground());
91
		_label.setForeground(new Color(null, 0, 0, 200));
93
		_label.setForeground(_toolkit.getColors().getColor(IFormColors.TITLE));
92
		_label.setLayoutData(GridUtil.createHorizontalFill());
94
		_label.setLayoutData(GridUtil.createHorizontalFill());
93
	}
95
	}
94
96
Lines 287-293 Link Here
287
			_allocAll.clear();
289
			_allocAll.clear();
288
			String text = Utils.getPackageClassName(_class);
290
			String text = Utils.getPackageClassName(_class);
289
			if (text.length() > 0)
291
			if (text.length() > 0)
290
				text = "Allocation details for '" + text + "'";
292
				text = UIMessages.MEM_ALLOCATION_DETAILS_FOR + " '" + text + "'";
291
			_label.setText(text);
293
			_label.setText(text);
292
		}
294
		}
293
		update();
295
		update();
(-)src/org/eclipse/tptp/trace/jvmti/internal/client/views/BaseMemoryStatisticView.java (-4 / +72 lines)
Lines 1-5 Link Here
1
/*****************************************************************************
1
/*****************************************************************************
2
 * Copyright (c) 2007, Intel Corporation.
2
 * Copyright (c) 2007, 2008 Intel Corporation.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 26-31 Link Here
26
import org.eclipse.hyades.models.trace.impl.TRCPackageImpl;
26
import org.eclipse.hyades.models.trace.impl.TRCPackageImpl;
27
import org.eclipse.hyades.models.trace.impl.TRCClassImpl.TRCClassSnapshot;
27
import org.eclipse.hyades.models.trace.impl.TRCClassImpl.TRCClassSnapshot;
28
import org.eclipse.hyades.models.trace.impl.TRCPackageImpl.TRCPackageSnapshot;
28
import org.eclipse.hyades.models.trace.impl.TRCPackageImpl.TRCPackageSnapshot;
29
import org.eclipse.hyades.trace.ui.FilterTraceViewer;
30
import org.eclipse.hyades.trace.ui.TraceViewer;
29
import org.eclipse.hyades.trace.ui.TraceViewerPage;
31
import org.eclipse.hyades.trace.ui.TraceViewerPage;
30
import org.eclipse.hyades.trace.ui.internal.util.PerftraceUtil;
32
import org.eclipse.hyades.trace.ui.internal.util.PerftraceUtil;
31
import org.eclipse.hyades.trace.views.adapter.internal.DynamicFilter;
33
import org.eclipse.hyades.trace.views.adapter.internal.DynamicFilter;
Lines 33-43 Link Here
33
import org.eclipse.hyades.trace.views.internal.view.columnlabels.ColumnDisplayInfo;
35
import org.eclipse.hyades.trace.views.internal.view.columnlabels.ColumnDisplayInfo;
34
import org.eclipse.hyades.trace.views.internal.view.columnlabels.ColumnLabelAdapter;
36
import org.eclipse.hyades.trace.views.internal.view.columnlabels.ColumnLabelAdapter;
35
import org.eclipse.hyades.trace.views.util.internal.ColumnData;
37
import org.eclipse.hyades.trace.views.util.internal.ColumnData;
38
import org.eclipse.hyades.ui.filters.internal.actions.FiltersEditorAction;
39
import org.eclipse.hyades.ui.filters.internal.util.FilterInformationManager;
40
import org.eclipse.hyades.ui.util.GridUtil;
36
import org.eclipse.jface.viewers.ISelection;
41
import org.eclipse.jface.viewers.ISelection;
37
import org.eclipse.jface.viewers.Viewer;
42
import org.eclipse.jface.viewers.Viewer;
43
import org.eclipse.osgi.util.NLS;
44
import org.eclipse.swt.SWT;
38
import org.eclipse.swt.events.SelectionEvent;
45
import org.eclipse.swt.events.SelectionEvent;
46
import org.eclipse.swt.events.SelectionListener;
47
import org.eclipse.swt.graphics.Font;
48
import org.eclipse.swt.graphics.FontData;
39
import org.eclipse.swt.graphics.Image;
49
import org.eclipse.swt.graphics.Image;
40
import org.eclipse.swt.widgets.Composite;
50
import org.eclipse.swt.widgets.Composite;
51
import org.eclipse.swt.widgets.Label;
52
import org.eclipse.swt.widgets.Link;
53
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceMessages;
41
import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextAttributes;
54
import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextAttributes;
42
import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextUpdaterHelper;
55
import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextUpdaterHelper;
43
import org.eclipse.tptp.trace.jvmti.internal.client.views.columnlabels.LiveSizeLabelAdapter;
56
import org.eclipse.tptp.trace.jvmti.internal.client.views.columnlabels.LiveSizeLabelAdapter;
Lines 48-56 Link Here
48
import org.eclipse.tptp.trace.jvmti.internal.client.views.columnlabels.TotalInstancesLabelAdapter;
61
import org.eclipse.tptp.trace.jvmti.internal.client.views.columnlabels.TotalInstancesLabelAdapter;
49
import org.eclipse.tptp.trace.jvmti.internal.client.views.columnlabels.TotalSizeLabelAdapter;
62
import org.eclipse.tptp.trace.jvmti.internal.client.views.columnlabels.TotalSizeLabelAdapter;
50
import org.eclipse.tptp.trace.jvmti.internal.client.widgets.Utils;
63
import org.eclipse.tptp.trace.jvmti.internal.client.widgets.Utils;
64
import org.eclipse.ui.forms.IFormColors;
51
65
52
public class BaseMemoryStatisticView extends BaseStatisticView {
66
public class BaseMemoryStatisticView extends BaseStatisticView {
53
54
	static public final int CLASS_MODE = 0; // CM
67
	static public final int CLASS_MODE = 0; // CM
55
	static public final int PACKAGE_MODE = 1;// PM
68
	static public final int PACKAGE_MODE = 1;// PM
56
	// class mode
69
	// class mode
Lines 86-91 Link Here
86
	private ColumnLabelAdapter _packageModeCols[] = new ColumnLabelAdapter[PM_COL_NUM];
99
	private ColumnLabelAdapter _packageModeCols[] = new ColumnLabelAdapter[PM_COL_NUM];
87
	private ColumnLabelAdapter _classModeCols[] = new ColumnLabelAdapter[CM_COL_NUM];
100
	private ColumnLabelAdapter _classModeCols[] = new ColumnLabelAdapter[CM_COL_NUM];
88
	private Map _ageMap = new Hashtable();
101
	private Map _ageMap = new Hashtable();
102
	private Link setFilter;
89
103
90
	public BaseMemoryStatisticView(Composite parent, TraceViewerPage page) {
104
	public BaseMemoryStatisticView(Composite parent, TraceViewerPage page) {
91
		super(parent, page);
105
		super(parent, page);
Lines 325-336 Link Here
325
339
326
	public void update() {
340
	public void update() {
327
		super.update();
341
		super.update();
328
		if (_page instanceof MemoryAnalysisPage)
342
		if (_page instanceof MemoryAnalysisPage) {
329
			((MemoryAnalysisPage) _page).updateFilterAppliedDescription();
343
			((MemoryAnalysisPage) _page).updateFilterAppliedDescription();
344
	    	setFilter.setText(NLS.bind(CommonUITraceMessages.CHOOSE_FILTER_MSG, getCurrentFilterName()));
345
		}
330
	}
346
	}
331
347
332
	protected void defaultActionForSelection(ISelection selection) {
348
	protected void defaultActionForSelection(ISelection selection) {
333
		// none
334
	}
349
	}
335
350
336
	public void widgetDefaultSelected(SelectionEvent event) {
351
	public void widgetDefaultSelected(SelectionEvent event) {
Lines 343-346 Link Here
343
			return ((MemoryAnalysisPage) _page).getCurrentFilter();
358
			return ((MemoryAnalysisPage) _page).getCurrentFilter();
344
		return null;
359
		return null;
345
	}
360
	}
361
	
362
	protected void createLabel(Composite viewContainer) {
363
		Label _label = _toolkit.createLabel(viewContainer, null);
364
		
365
		_label.setBackground(viewContainer.getBackground());
366
    	_label.setForeground(_toolkit.getColors().getColor(IFormColors.TITLE));
367
368
    	Font font = _label.getFont();
369
    	FontData fd = font.getFontData()[0];
370
    	font = new Font(null, new FontData(fd.getName(), fd.getHeight()*3/2, fd.getStyle() | SWT.BOLD));
371
    	_label.setFont(font);
372
    	
373
		_label.setLayoutData(GridUtil.createHorizontalFill());
374
		
375
		_label.setText(UIMessages.MEM_STATISTICS_TITLE);
376
377
    	setFilter = new Link(viewContainer, SWT.WRAP | _toolkit.getOrientation());
378
    	setFilter.setBackground(_toolkit.getColors().getBackground());
379
    	setFilter.setForeground(_toolkit.getColors().getColor(IFormColors.TITLE));
380
    	font = setFilter.getFont();
381
    	fd = font.getFontData()[0];
382
    	font = new Font(null, new FontData(fd.getName(), fd.getHeight(), fd.getStyle() | SWT.BOLD));
383
    	setFilter.setFont(font);
384
    	setFilter.addSelectionListener(new SelectionListener() {
385
    		public void widgetDefaultSelected(SelectionEvent e) {}
386
    	
387
    		public void widgetSelected(SelectionEvent e) {
388
    			if (_page != null && _page instanceof MemoryAnalysisPage) {
389
    				TraceViewer viewer = ((MemoryAnalysisPage) _page).getTraceViewer();
390
    				if (viewer != null && viewer instanceof FilterTraceViewer) {
391
    					FilterInformationManager fim = ((FilterTraceViewer) viewer).getFilterInformationManager();
392
        				FiltersEditorAction feAction = new FiltersEditorAction(fim, true);
393
        				feAction.run();
394
    				}
395
    			}
396
    		}
397
    	});
398
    	
399
    	setFilter.setLayoutData(GridUtil.createHorizontalFill());
400
    	setFilter.setText(NLS.bind(CommonUITraceMessages.CHOOSE_FILTER_MSG, getCurrentFilterName()));
401
	}
402
	
403
	public String getCurrentFilterName() {
404
		String filterAppliedName;
405
	
406
		SimpleSearchQuery cf = getCurrentFilter();
407
		if (cf != null)
408
			filterAppliedName = cf.getName();
409
		else
410
			filterAppliedName = CommonUITraceMessages.ST_FLTAPN;
411
		
412
		return filterAppliedName;
413
	}
346
}
414
}
(-)src/org/eclipse/tptp/trace/jvmti/internal/client/views/UIMessages.java (+2 lines)
Lines 129-134 Link Here
129
	public static String _MONITOR_BLOCKED_TAB;
129
	public static String _MONITOR_BLOCKED_TAB;
130
	public static String _MONITOR_WAITING_TAB;	
130
	public static String _MONITOR_WAITING_TAB;	
131
	
131
	
132
	public static String MEM_ALLOCATION_DETAILS_FOR;
133
	
132
	private UIMessages() {
134
	private UIMessages() {
133
		// Do not instantiate
135
		// Do not instantiate
134
	}
136
	}

Return to bug 166640