|
Lines 1-5
Link Here
|
| 1 |
/********************************************************************** |
1 |
/********************************************************************** |
| 2 |
* Copyright (c) 2006 Intel Corporation. |
2 |
* Copyright (c) 2006,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 9-18
Link Here
|
| 9 |
**********************************************************************/ |
9 |
**********************************************************************/ |
| 10 |
package org.eclipse.hyades.trace.views.adapter.internal; |
10 |
package org.eclipse.hyades.trace.views.adapter.internal; |
| 11 |
|
11 |
|
|
|
12 |
import org.eclipse.hyades.models.hierarchy.extensions.SimpleSearchQuery; |
| 12 |
import org.eclipse.hyades.trace.views.internal.ExecutionStatisticView; |
13 |
import org.eclipse.hyades.trace.views.internal.ExecutionStatisticView; |
| 13 |
import org.eclipse.hyades.trace.views.internal.MultiLevelStatisticView; |
14 |
import org.eclipse.hyades.trace.views.internal.MultiLevelStatisticView; |
| 14 |
import org.eclipse.hyades.trace.views.internal.TraceUIPlugin; |
15 |
import org.eclipse.hyades.trace.views.internal.TraceUIPlugin; |
|
|
16 |
import org.eclipse.hyades.ui.filters.internal.actions.FiltersEditorAction; |
| 15 |
import org.eclipse.hyades.ui.util.HyadesFormToolkit; |
17 |
import org.eclipse.hyades.ui.util.HyadesFormToolkit; |
|
|
18 |
import org.eclipse.hyades.ui.util.GridUtil; |
| 16 |
import org.eclipse.jface.action.IAction; |
19 |
import org.eclipse.jface.action.IAction; |
| 17 |
import org.eclipse.jface.action.IMenuManager; |
20 |
import org.eclipse.jface.action.IMenuManager; |
| 18 |
import org.eclipse.swt.SWT; |
21 |
import org.eclipse.swt.SWT; |
|
Lines 20-34
Link Here
|
| 20 |
import org.eclipse.swt.layout.GridLayout; |
23 |
import org.eclipse.swt.layout.GridLayout; |
| 21 |
import org.eclipse.swt.widgets.Composite; |
24 |
import org.eclipse.swt.widgets.Composite; |
| 22 |
import org.eclipse.swt.widgets.Control; |
25 |
import org.eclipse.swt.widgets.Control; |
|
|
26 |
import org.eclipse.swt.widgets.Link; |
| 27 |
import org.eclipse.swt.events.SelectionEvent; |
| 28 |
import org.eclipse.swt.events.SelectionListener; |
| 29 |
import org.eclipse.swt.graphics.Font; |
| 30 |
import org.eclipse.swt.graphics.FontData; |
| 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; |
|
|
34 |
import org.eclipse.osgi.util.NLS; |
| 24 |
|
35 |
|
| 25 |
public class ExecutionStatisticTab extends ExecutionStatisticTabItem { |
36 |
public class ExecutionStatisticTab extends ExecutionStatisticTabItem { |
| 26 |
|
|
|
| 27 |
protected static final String _title = TraceUIPlugin.getString("2"); |
37 |
protected static final String _title = TraceUIPlugin.getString("2"); |
| 28 |
|
38 |
|
| 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 45-53
Link Here
|
| 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 |
|
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 |
public void widgetSelected(SelectionEvent e) { |
| 70 |
if (_page != null && _page.getViewer() != null) { |
| 71 |
FiltersEditorAction feAction = new FiltersEditorAction(_page.getViewer().getFilterInformationManager(), true); |
| 72 |
feAction.run(); |
| 73 |
} |
| 74 |
} |
| 75 |
}); |
| 76 |
_info.setLayoutData(GridUtil.createHorizontalFill()); |
| 77 |
|
| 48 |
_view = new ExecutionStatisticView(_form.getBody(), _page); |
78 |
_view = new ExecutionStatisticView(_form.getBody(), _page); |
| 49 |
|
79 |
|
| 50 |
_page.setContextMenu(_view.getTree(), _view.getTreeViewer()); |
80 |
_page.setContextMenu(_view.getTree(), _view.getTreeViewer()); |
|
|
81 |
_view.getControl().setFocus(); |
| 51 |
} |
82 |
} |
| 52 |
|
83 |
|
| 53 |
public Control getControl() { |
84 |
public Control getControl() { |
|
Lines 58-63
Link Here
|
| 58 |
if (_view != null) { |
89 |
if (_view != null) { |
| 59 |
_view.updateButtons(); |
90 |
_view.updateButtons(); |
| 60 |
_view.refresh(); |
91 |
_view.refresh(); |
|
|
92 |
_info.setText(NLS.bind(CommonUITraceMessages.CHOOSE_FILTER_MSG, getCurrentFilterName())); |
| 61 |
} |
93 |
} |
| 62 |
} |
94 |
} |
| 63 |
|
95 |
|
|
Lines 109-117
Link Here
|
| 109 |
public void update(boolean newPage) { |
141 |
public void update(boolean newPage) { |
| 110 |
if (_view != null) { |
142 |
if (_view != null) { |
| 111 |
_view.update(); |
143 |
_view.update(); |
|
|
144 |
_info.setText(NLS.bind(CommonUITraceMessages.CHOOSE_FILTER_MSG, getCurrentFilterName())); |
| 112 |
} |
145 |
} |
| 113 |
} |
146 |
} |
| 114 |
|
147 |
|
|
|
148 |
public String getCurrentFilterName() { |
| 149 |
String filterName; |
| 150 |
|
| 151 |
SimpleSearchQuery filter = _page.getViewer().getCurrentFilter(); |
| 152 |
if (filter != null) |
| 153 |
filterName = filter.getName(); |
| 154 |
else |
| 155 |
filterName = CommonUITraceMessages.ST_FLTAPN; |
| 156 |
|
| 157 |
return filterName; |
| 158 |
} |
| 159 |
|
| 115 |
public String getViewTitle() { |
160 |
public String getViewTitle() { |
| 116 |
return _title; |
161 |
return _title; |
| 117 |
} |
162 |
} |