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/hyades/trace/views/adapter/internal/ExecutionStatisticTab.java (-2 / +45 lines)
Lines 12-25 Link Here
12
import org.eclipse.hyades.trace.views.internal.ExecutionStatisticView;
12
import org.eclipse.hyades.trace.views.internal.ExecutionStatisticView;
13
import org.eclipse.hyades.trace.views.internal.MultiLevelStatisticView;
13
import org.eclipse.hyades.trace.views.internal.MultiLevelStatisticView;
14
import org.eclipse.hyades.trace.views.internal.TraceUIPlugin;
14
import org.eclipse.hyades.trace.views.internal.TraceUIPlugin;
15
import org.eclipse.hyades.ui.filters.internal.actions.FiltersEditorAction;
16
import org.eclipse.hyades.ui.util.GridUtil;
15
import org.eclipse.hyades.ui.util.HyadesFormToolkit;
17
import org.eclipse.hyades.ui.util.HyadesFormToolkit;
16
import org.eclipse.jface.action.IAction;
18
import org.eclipse.jface.action.IAction;
17
import org.eclipse.jface.action.IMenuManager;
19
import org.eclipse.jface.action.IMenuManager;
20
import org.eclipse.osgi.util.NLS;
18
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.SWT;
22
import org.eclipse.swt.events.SelectionEvent;
23
import org.eclipse.swt.events.SelectionListener;
24
import org.eclipse.swt.graphics.Font;
25
import org.eclipse.swt.graphics.FontData;
19
import org.eclipse.swt.layout.GridData;
26
import org.eclipse.swt.layout.GridData;
20
import org.eclipse.swt.layout.GridLayout;
27
import org.eclipse.swt.layout.GridLayout;
21
import org.eclipse.swt.widgets.Composite;
28
import org.eclipse.swt.widgets.Composite;
22
import org.eclipse.swt.widgets.Control;
29
import org.eclipse.swt.widgets.Control;
30
import org.eclipse.swt.widgets.Link;
31
import org.eclipse.tptp.platform.common.ui.trace.internal.CommonUITraceMessages;
32
import org.eclipse.ui.forms.IFormColors;
23
import org.eclipse.ui.forms.widgets.Form;
33
import org.eclipse.ui.forms.widgets.Form;
24
34
25
public class ExecutionStatisticTab extends ExecutionStatisticTabItem {
35
public class ExecutionStatisticTab extends ExecutionStatisticTabItem {
Lines 29-34 Link Here
29
	protected MultiLevelStatisticView _view;
39
	protected MultiLevelStatisticView _view;
30
	protected HyadesFormToolkit _toolkit;
40
	protected HyadesFormToolkit _toolkit;
31
	protected Form _form;
41
	protected Form _form;
42
	protected Link _info;
32
43
33
    public ExecutionStatisticTab(ExecutionStatisticPage2 page) {
44
    public ExecutionStatisticTab(ExecutionStatisticPage2 page) {
34
		super(page);
45
		super(page);
Lines 44-52 Link Here
44
    	_form.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
55
    	_form.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
45
    	_form.getBody().setLayout(gridLayout);
56
    	_form.getBody().setLayout(gridLayout);
46
    	_form.getBody().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
57
    	_form.getBody().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
47
		
48
		_view = new ExecutionStatisticView(_form.getBody(), _page);
49
58
59
    	_info = new Link(_form.getBody(), SWT.WRAP | _toolkit.getOrientation());
60
		_info.setBackground(_toolkit.getColors().getBackground());
61
		_info.setForeground(_toolkit.getColors().getColor(IFormColors.TITLE));
62
		Font font = _info.getFont();
63
		FontData fd = font.getFontData()[0];
64
		font = new Font(null, new FontData(fd.getName(), fd.getHeight(), fd.getStyle() | SWT.BOLD));
65
		_info.setFont(font);
66
		_info.addSelectionListener(new SelectionListener() {
67
			public void widgetDefaultSelected(SelectionEvent e) {
68
			}
69
70
			public void widgetSelected(SelectionEvent e) {
71
				if (_page != null && _page.getViewer() != null) {
72
					FiltersEditorAction feAction = new FiltersEditorAction(_page.getViewer().getFilterInformationManager());
73
					feAction.run();
74
				}
75
			}
76
		});
77
		_info.setLayoutData(GridUtil.createHorizontalFill());
78
79
    	_view = new ExecutionStatisticView(_form.getBody(), _page);
50
		_page.setContextMenu(_view.getTree(), _view.getTreeViewer());
80
		_page.setContextMenu(_view.getTree(), _view.getTreeViewer());
51
	}	
81
	}	
52
82
Lines 58-63 Link Here
58
		if (_view != null) {
88
		if (_view != null) {
59
			_view.updateButtons();
89
			_view.updateButtons();
60
			_view.refresh();
90
			_view.refresh();
91
			_info.setText(NLS.bind(CommonUITraceMessages.CHOOSE_FILTER_MSG, getCurrentFilterName()));
61
		}
92
		}
62
	}	
93
	}	
63
94
Lines 109-117 Link Here
109
	public void update(boolean newPage) {
140
	public void update(boolean newPage) {
110
		if (_view != null) {
141
		if (_view != null) {
111
			_view.update();
142
			_view.update();
143
			_info.setText(NLS.bind(CommonUITraceMessages.CHOOSE_FILTER_MSG, getCurrentFilterName()));
112
		}
144
		}
113
	}
145
	}
114
146
147
	public String getCurrentFilterName() {
148
		ExecutionStatisticViewer2 viewer = _page.getViewer();
149
		viewer.getCurrentFilter().getName();
150
		String filterName;
151
		if (viewer.getCurrentFilter() != null)
152
			filterName = viewer.getCurrentFilter().getName();
153
		else
154
			filterName = CommonUITraceMessages.ST_FLTAPN;
155
		return filterName;
156
	}
157
115
	public String getViewTitle() {
158
	public String getViewTitle() {
116
		return _title;
159
		return _title;
117
	}
160
	}

Return to bug 166640