1 /**********************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Bernd Hufmann - Initial API and implementation
11 * Marc-Andre Laperle - Add filtering textbox
12 **********************************************************************/
13 package org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.dialogs
;
15 import java
.util
.ArrayList
;
16 import java
.util
.List
;
18 import org
.eclipse
.jface
.dialogs
.MessageDialog
;
19 import org
.eclipse
.jface
.viewers
.CheckStateChangedEvent
;
20 import org
.eclipse
.jface
.viewers
.CheckboxTreeViewer
;
21 import org
.eclipse
.jface
.viewers
.ICheckStateListener
;
22 import org
.eclipse
.jface
.viewers
.TreeViewer
;
23 import org
.eclipse
.swt
.SWT
;
24 import org
.eclipse
.swt
.events
.SelectionAdapter
;
25 import org
.eclipse
.swt
.events
.SelectionEvent
;
26 import org
.eclipse
.swt
.graphics
.Image
;
27 import org
.eclipse
.swt
.layout
.GridData
;
28 import org
.eclipse
.swt
.layout
.GridLayout
;
29 import org
.eclipse
.swt
.widgets
.Button
;
30 import org
.eclipse
.swt
.widgets
.Composite
;
31 import org
.eclipse
.swt
.widgets
.Group
;
32 import org
.eclipse
.swt
.widgets
.Label
;
33 import org
.eclipse
.swt
.widgets
.Text
;
34 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.messages
.Messages
;
35 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.ITraceControlComponent
;
36 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
.BaseEventComponent
;
37 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
.KernelProviderComponent
;
38 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
.TraceControlContentProvider
;
39 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
.TraceControlLabelProvider
;
40 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
.TraceProviderGroup
;
41 import org
.eclipse
.ui
.dialogs
.FilteredTree
;
42 import org
.eclipse
.ui
.dialogs
.PatternFilter
;
46 * A composite for collecting information about kernel events to be enabled.
49 * @author Bernd Hufmann
51 public class EnableKernelEventComposite
extends Composite
implements IEnableKernelEvents
{
53 // ------------------------------------------------------------------------
55 // ------------------------------------------------------------------------
56 private enum KernelGroupEnum
{ ALL
, TRACEPOINTS
, SYSCALLS
, PROBE
, FUNCTION
}
58 // ------------------------------------------------------------------------
60 // ------------------------------------------------------------------------
63 * A button to enable/disable the all tracepoints&sycalls group
65 private Button fAllActivateButton
;
67 * A button to enable/disable the tracepoints group
69 private Button fTracepointsActivateButton
;
71 * A tree viewer for displaying and selection of available tracepoints.
73 private CheckboxTreeViewer fTracepointsViewer
;
75 * A button to enable/disable the syscalls group
77 private Button fSysCallsActivateButton
;
79 * A button to enable or disable the dynamic probe group.
81 private Button fProbeActivateButton
;
83 * The text field for the event name for the dynamic probe.
85 private Text fProbeEventNameText
;
87 * The text field for the dynamic probe.
89 private Text fProbeText
;
91 * A button to enable or disable the dynamic function probe group.
93 private Button fFunctionActivateButton
;
95 * The text field for the event name for the dynamic probe.
97 private Text fFunctionEventNameText
;
99 * The text field for the dynamic function entry/return probe.
101 private Text fFunctionText
;
105 private Text fFilterText
;
107 * The referenced trace provider group containing the kernel provider
108 * component which contains a list of available tracepoints.
110 private final TraceProviderGroup fProviderGroup
;
112 * The flag indicating that all tracepoints/syscalls are selected.
114 private boolean fIsAllTracepointsAndSyscalls
;
116 * The flag indicating that tracepoints are selected.
118 private boolean fIsTracepoints
;
120 * The flag indicating that all tracepoints are selected.
122 private boolean fIsAllTracepoints
;
124 * The flag indicating that syscalls are selected.
126 private boolean fIsSysCalls
;
128 * The list of tracepoints to be enabled.
130 private List
<String
> fSelectedEvents
;
132 * The flag indicating that dynamic probe is selected.
134 private boolean fIsDynamicProbe
;
136 * The event name of the dynamic probe.
138 private String fProbeEventName
;
142 private String fProbeString
;
144 * The flag indicating that the dynamic function probe is selected.
146 private boolean fIsDynamicFunctionProbe
;
148 * The event name of the dynamic function entry/return probe.
150 private String fFunctionEventName
;
152 * The dynamic function entry/return probe.
154 private String fFunctionString
;
156 * The filter expression
158 private String fFilterExpression
;
160 // ------------------------------------------------------------------------
162 // ------------------------------------------------------------------------
168 * The parent composite
170 * The index of the style for this event composite
171 * @param providerGroup
172 * The trace provider group
174 public EnableKernelEventComposite(Composite parent
, int style
, TraceProviderGroup providerGroup
) {
175 super(parent
, style
);
176 fProviderGroup
= providerGroup
;
179 // ------------------------------------------------------------------------
181 // ------------------------------------------------------------------------
183 public boolean isAllEvents() {
184 return fIsAllTracepointsAndSyscalls
;
187 public boolean isTracepoints() {
188 return fIsTracepoints
;
192 public boolean isAllTracePoints() {
193 return fIsAllTracepoints
;
197 public boolean isSysCalls() {
202 public boolean isAllSysCalls() {
207 public List
<String
> getEventNames() {
208 return new ArrayList
<>(fSelectedEvents
);
212 public boolean isDynamicProbe() {
213 return fIsDynamicProbe
;
217 public String
getProbeName() {
222 public String
getProbeEventName() {
223 return fProbeEventName
;
227 public boolean isDynamicFunctionProbe() {
228 return fIsDynamicFunctionProbe
;
232 public String
getFunctionEventName() {
233 return fFunctionEventName
;
237 public String
getFunction() {
238 return fFunctionString
;
242 public String
getFilterExpression() {
243 return fFilterExpression
;
246 // ------------------------------------------------------------------------
248 // ------------------------------------------------------------------------
251 * Creates the composite content
253 public void createContent() {
255 // All Tracepoints/syscalls Group
256 createAllTracepointsSyscallGroup();
259 createTracepointsGroup();
262 createSysCallsGroup();
264 // Dynamic Probe Group
265 createDynamicProbeGroup();
267 // Dynamic Function Probe Group
268 createDynamicFunctionPropeGroup();
273 // Set default enablements
274 setKernelEnablements(KernelGroupEnum
.ALL
);
278 * Validates the kernel composite input data.
279 * @return true if configured data is valid and can be retrieved.
281 public boolean isValid() {
282 fIsAllTracepointsAndSyscalls
= fAllActivateButton
.getSelection();
283 fIsTracepoints
= fTracepointsActivateButton
.getSelection();
284 fIsSysCalls
= fSysCallsActivateButton
.getSelection();
285 fIsDynamicProbe
= fProbeActivateButton
.getSelection();
286 fIsDynamicFunctionProbe
= fFunctionActivateButton
.getSelection();
288 // initialize tracepoint fields
289 fIsAllTracepoints
= false;
290 fSelectedEvents
= new ArrayList
<>();
292 if (fIsTracepoints
) {
293 Object
[] checkedElements
= fTracepointsViewer
.getCheckedElements();
294 for (int i
= 0; i
< checkedElements
.length
; i
++) {
295 ITraceControlComponent component
= (ITraceControlComponent
)checkedElements
[i
];
296 if (component
instanceof BaseEventComponent
) {
297 fSelectedEvents
.add(component
.getName());
300 // verify if all events are selected
302 List
<ITraceControlComponent
> comps
= fProviderGroup
.getChildren(KernelProviderComponent
.class);
303 for (ITraceControlComponent comp
: comps
) {
304 nbEvents
+= comp
.getChildren().length
;
306 fIsAllTracepoints
= (nbEvents
== fSelectedEvents
.size());
309 if (fIsDynamicProbe
) {
310 String temp
= fProbeEventNameText
.getText();
311 if (temp
.trim().isEmpty() ||
312 (!temp
.matches("^[\\s]{0,}$") && !temp
.matches("^[a-zA-Z0-9\\-\\_]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$
313 MessageDialog
.openError(getShell(),
314 Messages
.TraceControl_EnableEventsDialogTitle
,
315 Messages
.TraceControl_InvalidProbeNameError
+ " (" + temp
+ ") \n"); //$NON-NLS-1$ //$NON-NLS-2$
320 fProbeEventName
= temp
;
321 // fProbeString will be validated by lttng-tools
322 fProbeString
= fProbeText
.getText();
325 // initialize function string
326 fFunctionEventName
= null;
327 fFunctionString
= null;
328 if (fIsDynamicFunctionProbe
) {
329 String functionTemp
= fFunctionEventNameText
.getText();
330 if (functionTemp
.trim().isEmpty() ||
331 (!functionTemp
.matches("^[\\s]{0,}$") && !functionTemp
.matches("^[a-zA-Z0-9\\-\\_]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$
332 MessageDialog
.openError(getShell(),
333 Messages
.TraceControl_EnableEventsDialogTitle
,
334 Messages
.TraceControl_InvalidProbeNameError
+ " (" + functionTemp
+ ") \n"); //$NON-NLS-1$ //$NON-NLS-2$
339 fFunctionEventName
= functionTemp
;
340 // fFunctionString will be validated by lttng-tools
341 fFunctionString
= fFunctionText
.getText();
344 // initialize filter with null
345 fFilterExpression
= null;
346 if (fProviderGroup
.isEventFilteringSupported(true)) {
347 String tempFilter
= fFilterText
.getText();
349 if(!tempFilter
.trim().isEmpty()) {
350 fFilterExpression
= tempFilter
;
358 * Creates all tracepoints/syscalls group.
360 private void createAllTracepointsSyscallGroup() {
364 Group tpMainGroup
= new Group(this, SWT
.SHADOW_NONE
);
365 tpMainGroup
.setText(Messages
.TraceControl_EnableEventsAllEventsLabel
);
366 layout
= new GridLayout(2, false);
367 tpMainGroup
.setLayout(layout
);
368 data
= new GridData(GridData
.FILL_HORIZONTAL
);
369 tpMainGroup
.setLayoutData(data
);
371 Composite buttonComposite
= new Composite(tpMainGroup
, SWT
.NONE
);
372 layout
= new GridLayout(1, true);
373 buttonComposite
.setLayout(layout
);
374 data
= new GridData(SWT
.BEGINNING
, SWT
.CENTER
, false, true);
375 buttonComposite
.setLayoutData(data
);
377 fAllActivateButton
= new Button(buttonComposite
, SWT
.RADIO
);
378 fAllActivateButton
.setText(Messages
.TraceControl_EnableGroupSelectionName
);
379 fAllActivateButton
.setToolTipText(Messages
.TraceControl_EnableEventsAllEventsTooltip
);
380 data
= new GridData(GridData
.FILL_HORIZONTAL
);
381 fAllActivateButton
.setLayoutData(data
);
382 fAllActivateButton
.addSelectionListener(new SelectionAdapter() {
384 public void widgetSelected(SelectionEvent e
) {
385 setKernelEnablements(KernelGroupEnum
.ALL
);
391 * Creates tracepoints group.
393 private void createTracepointsGroup() {
397 Group tpMainGroup
= new Group(this, SWT
.SHADOW_NONE
);
398 tpMainGroup
.setText(Messages
.TraceControl_EnableEventsTracepointGroupName
);
399 layout
= new GridLayout(2, false);
400 tpMainGroup
.setLayout(layout
);
401 data
= new GridData(GridData
.FILL_BOTH
);
402 tpMainGroup
.setLayoutData(data
);
404 Composite buttonComposite
= new Composite(tpMainGroup
, SWT
.NONE
);
405 layout
= new GridLayout(1, true);
406 buttonComposite
.setLayout(layout
);
407 data
= new GridData(SWT
.BEGINNING
, SWT
.CENTER
, false, true);
408 buttonComposite
.setLayoutData(data
);
410 fTracepointsActivateButton
= new Button(buttonComposite
, SWT
.RADIO
);
411 fTracepointsActivateButton
.setText(Messages
.TraceControl_EnableGroupSelectionName
);
412 data
= new GridData(GridData
.FILL_HORIZONTAL
);
413 fTracepointsActivateButton
.setLayoutData(data
);
414 fTracepointsActivateButton
.addSelectionListener(new SelectionAdapter() {
416 public void widgetSelected(SelectionEvent e
) {
417 setKernelEnablements(KernelGroupEnum
.TRACEPOINTS
);
421 Group tracepointsGroup
= new Group(tpMainGroup
, SWT
.SHADOW_NONE
);
422 layout
= new GridLayout(1, true);
423 tracepointsGroup
.setLayout(layout
);
424 data
= new GridData(GridData
.FILL_BOTH
);
425 tracepointsGroup
.setLayoutData(data
);
427 new FilteredTree(tracepointsGroup
, SWT
.MULTI
| SWT
.H_SCROLL
| SWT
.V_SCROLL
| SWT
.BORDER
, new PatternFilter(), true) {
429 protected TreeViewer
doCreateTreeViewer(Composite aparent
, int style
) {
430 fTracepointsViewer
= new CheckboxTreeViewer(aparent
, SWT
.MULTI
| SWT
.H_SCROLL
| SWT
.V_SCROLL
);
431 fTracepointsViewer
.getTree().setToolTipText(Messages
.TraceControl_EnableEventsTracepointTreeTooltip
);
433 fTracepointsViewer
.setContentProvider(new KernelContentProvider());
434 fTracepointsViewer
.setLabelProvider(new KernelLabelProvider());
435 fTracepointsViewer
.addCheckStateListener(new KernelCheckListener());
436 fTracepointsViewer
.setInput(fProviderGroup
);
438 fTracepointsViewer
.getTree().setLayoutData(new GridData(GridData
.FILL_BOTH
));
439 return fTracepointsViewer
;
443 protected void updateToolbar(boolean visible
) {
444 super.updateToolbar(visible
);
445 treeViewer
.expandAll();
451 * Creates syscalls group.
453 private void createSysCallsGroup() {
456 Group sysCallsMainGroup
= new Group(this, SWT
.SHADOW_NONE
);
457 sysCallsMainGroup
.setText(Messages
.TraceControl_EnableEventsSyscallName
);
458 sysCallsMainGroup
.setToolTipText(Messages
.TraceControl_EnableEventsSyscallTooltip
);
459 layout
= new GridLayout(2, false);
460 sysCallsMainGroup
.setLayout(layout
);
461 data
= new GridData(GridData
.FILL_HORIZONTAL
);
462 sysCallsMainGroup
.setLayoutData(data
);
464 Composite buttonComposite
= new Composite(sysCallsMainGroup
, SWT
.NONE
);
465 layout
= new GridLayout(1, false);
466 buttonComposite
.setLayout(layout
);
467 data
= new GridData(SWT
.BEGINNING
, SWT
.CENTER
, false, true);
468 buttonComposite
.setLayoutData(data
);
470 fSysCallsActivateButton
= new Button(buttonComposite
, SWT
.RADIO
);
471 fSysCallsActivateButton
.setText(Messages
.TraceControl_EnableGroupSelectionName
);
472 fSysCallsActivateButton
.setToolTipText(Messages
.TraceControl_EnableEventsSyscallTooltip
);
473 fSysCallsActivateButton
.setSelection(false);
474 data
= new GridData(GridData
.FILL_HORIZONTAL
);
475 fSysCallsActivateButton
.setLayoutData(data
);
476 fSysCallsActivateButton
.addSelectionListener(new SelectionAdapter() {
478 public void widgetSelected(SelectionEvent e
) {
479 setKernelEnablements(KernelGroupEnum
.SYSCALLS
);
485 * Creates dynamic probe group.
487 private void createDynamicProbeGroup() {
490 Group probeMainGroup
= new Group(this, SWT
.SHADOW_NONE
);
491 probeMainGroup
.setText(Messages
.TraceControl_EnableEventsProbeGroupName
);
492 layout
= new GridLayout(2, false);
493 probeMainGroup
.setLayout(layout
);
494 data
= new GridData(GridData
.FILL_HORIZONTAL
);
495 probeMainGroup
.setLayoutData(data
);
497 Composite buttonComposite
= new Composite(probeMainGroup
, SWT
.NONE
);
498 layout
= new GridLayout(1, false);
499 buttonComposite
.setLayout(layout
);
500 data
= new GridData(SWT
.BEGINNING
, SWT
.CENTER
, false, true);
501 buttonComposite
.setLayoutData(data
);
503 fProbeActivateButton
= new Button(buttonComposite
, SWT
.RADIO
);
504 fProbeActivateButton
.setText(Messages
.TraceControl_EnableGroupSelectionName
);
505 fProbeActivateButton
.setSelection(false);
506 data
= new GridData(GridData
.FILL_HORIZONTAL
);
507 fProbeActivateButton
.setLayoutData(data
);
508 fProbeActivateButton
.addSelectionListener(new SelectionAdapter() {
510 public void widgetSelected(SelectionEvent e
) {
511 setKernelEnablements(KernelGroupEnum
.PROBE
);
515 Group probeGroup
= new Group(probeMainGroup
, SWT
.SHADOW_NONE
);
516 layout
= new GridLayout(4, true);
517 probeGroup
.setLayout(layout
);
518 probeGroup
.setLayoutData(new GridData(GridData
.FILL_HORIZONTAL
));
520 Label probeNameLabel
= new Label(probeGroup
, SWT
.LEFT
);
521 probeNameLabel
.setText(Messages
.TraceControl_EnableEventsEventNameLabel
);
522 data
= new GridData(GridData
.FILL_BOTH
);
523 data
.horizontalSpan
= 1;
524 probeNameLabel
.setLayoutData(data
);
526 fProbeEventNameText
= new Text(probeGroup
, SWT
.LEFT
);
527 fProbeEventNameText
.setToolTipText(Messages
.TraceControl_EnableEventsProbeEventNameTooltip
);
529 data
= new GridData(GridData
.FILL_BOTH
);
530 data
.horizontalSpan
= 3;
531 fProbeEventNameText
.setLayoutData(data
);
533 Label probeLabel
= new Label(probeGroup
, SWT
.LEFT
);
534 probeLabel
.setText(Messages
.TraceControl_EnableEventsProbeNameLabel
);
535 data
= new GridData(GridData
.FILL_BOTH
);
536 data
.horizontalSpan
= 1;
537 probeLabel
.setLayoutData(data
);
539 fProbeText
= new Text(probeGroup
, SWT
.LEFT
);
540 fProbeText
.setToolTipText(Messages
.TraceControl_EnableEventsProbeNameTooltip
);
541 data
= new GridData(GridData
.FILL_BOTH
);
542 data
.horizontalSpan
= 3;
543 fProbeText
.setLayoutData(data
);
547 * Creates dynamic function entry/return probe group.
549 private void createDynamicFunctionPropeGroup() {
552 Group functionMainGroup
= new Group(this, SWT
.SHADOW_NONE
);
553 functionMainGroup
.setText(Messages
.TraceControl_EnableEventsFucntionGroupName
);
554 layout
= new GridLayout(2, false);
555 functionMainGroup
.setLayout(layout
);
556 data
= new GridData(GridData
.FILL_HORIZONTAL
);
557 functionMainGroup
.setLayoutData(data
);
559 Composite buttonComposite
= new Composite(functionMainGroup
, SWT
.NONE
);
560 layout
= new GridLayout(1, false);
561 buttonComposite
.setLayout(layout
);
562 data
= new GridData(SWT
.BEGINNING
, SWT
.CENTER
, false, true);
563 buttonComposite
.setLayoutData(data
);
565 fFunctionActivateButton
= new Button(buttonComposite
, SWT
.RADIO
);
566 fFunctionActivateButton
.setText(Messages
.TraceControl_EnableGroupSelectionName
);
567 fFunctionActivateButton
.setSelection(false);
568 data
= new GridData(GridData
.FILL_HORIZONTAL
);
569 fFunctionActivateButton
.setLayoutData(data
);
570 fFunctionActivateButton
.addSelectionListener(new SelectionAdapter() {
572 public void widgetSelected(SelectionEvent e
) {
573 setKernelEnablements(KernelGroupEnum
.FUNCTION
);
577 Group functionGroup
= new Group(functionMainGroup
, SWT
.SHADOW_NONE
);
578 layout
= new GridLayout(4, true);
579 functionGroup
.setLayout(layout
);
580 functionGroup
.setLayoutData(new GridData(GridData
.FILL_HORIZONTAL
));
582 Label functionNameLabel
= new Label(functionGroup
, SWT
.LEFT
);
583 functionNameLabel
.setText(Messages
.TraceControl_EnableEventsEventNameLabel
);
584 data
= new GridData(GridData
.FILL_BOTH
);
585 data
.horizontalSpan
= 1;
586 functionNameLabel
.setLayoutData(data
);
588 fFunctionEventNameText
= new Text(functionGroup
, SWT
.LEFT
);
589 fFunctionEventNameText
.setToolTipText(Messages
.TraceControl_EnableEventsFunctionEventNameTooltip
);
590 data
= new GridData(GridData
.FILL_BOTH
);
591 data
.horizontalSpan
= 3;
592 fFunctionEventNameText
.setLayoutData(data
);
594 Label functionLabel
= new Label(functionGroup
, SWT
.LEFT
);
595 functionLabel
.setText(Messages
.TraceControl_EnableEventsFunctionNameLabel
);
596 data
= new GridData(GridData
.FILL_BOTH
);
597 data
.horizontalSpan
= 1;
598 functionLabel
.setLayoutData(data
);
600 fFunctionText
= new Text(functionGroup
, SWT
.LEFT
);
601 fFunctionText
.setToolTipText(Messages
.TraceControl_EnableEventsProbeNameTooltip
);
602 data
= new GridData(GridData
.FILL_BOTH
);
603 data
.horizontalSpan
= 3;
604 fFunctionText
.setLayoutData(data
);
608 * Enable/selects widgets depending on the group specified.
609 * @param group - group to enable.
611 private void setKernelEnablements(KernelGroupEnum group
) {
612 fAllActivateButton
.setSelection(group
== KernelGroupEnum
.ALL
);
613 fTracepointsActivateButton
.setSelection(group
== KernelGroupEnum
.TRACEPOINTS
);
614 fTracepointsViewer
.getTree().setEnabled(group
== KernelGroupEnum
.TRACEPOINTS
);
616 fSysCallsActivateButton
.setSelection(group
== KernelGroupEnum
.SYSCALLS
);
618 fProbeActivateButton
.setSelection(group
== KernelGroupEnum
.PROBE
);
619 fProbeEventNameText
.setEnabled(group
== KernelGroupEnum
.PROBE
);
620 fProbeText
.setEnabled(group
== KernelGroupEnum
.PROBE
);
622 fFunctionActivateButton
.setSelection(group
== KernelGroupEnum
.FUNCTION
);
623 fFunctionEventNameText
.setEnabled(group
== KernelGroupEnum
.FUNCTION
);
624 fFunctionText
.setEnabled(group
== KernelGroupEnum
.FUNCTION
);
627 private void createFilterGroup() {
628 if (fProviderGroup
.isEventFilteringSupported(true)) {
629 Group filterMainGroup
= new Group(this, SWT
.SHADOW_NONE
);
630 filterMainGroup
.setText(Messages
.TraceControl_EnableEventsFilterGroupName
);
631 GridLayout layout
= new GridLayout(3, false);
632 filterMainGroup
.setLayout(layout
);
633 GridData data
= new GridData(GridData
.FILL_HORIZONTAL
);
634 filterMainGroup
.setLayoutData(data
);
636 fFilterText
= new Text(filterMainGroup
, SWT
.LEFT
);
637 fFilterText
.setToolTipText(Messages
.TraceControl_EnableEventsFilterTooltip
);
638 data
= new GridData(GridData
.FILL_HORIZONTAL
);
639 fFilterText
.setLayoutData(data
);
643 // ------------------------------------------------------------------------
645 // ------------------------------------------------------------------------
647 * Content provider for the tracepoints tree.
649 public static final class KernelContentProvider
extends TraceControlContentProvider
{
651 public Object
[] getChildren(Object parentElement
) {
652 if (parentElement
instanceof TraceProviderGroup
) {
653 List
<ITraceControlComponent
> children
= ((ITraceControlComponent
)parentElement
).getChildren(KernelProviderComponent
.class);
654 return children
.toArray(new ITraceControlComponent
[children
.size()]);
656 if (parentElement
instanceof ITraceControlComponent
) {
657 return ((ITraceControlComponent
)parentElement
).getChildren();
659 return new Object
[0];
664 * Content label for the tracepoints tree.
666 public static final class KernelLabelProvider
extends TraceControlLabelProvider
{
668 public Image
getImage(Object element
) {
672 public String
getText(Object element
) {
673 if ((element
!= null) && (element
instanceof KernelProviderComponent
)) {
674 return Messages
.TraceControl_EnableEventsTracepointTreeAllLabel
;
676 return super.getText(element
);
681 * Check state listener for the tracepoints tree.
683 public final class KernelCheckListener
implements ICheckStateListener
{
685 public void checkStateChanged(CheckStateChangedEvent event
) {
686 if (event
.getChecked()) {
687 if (event
.getElement() instanceof KernelProviderComponent
) {
688 fTracepointsViewer
.setSubtreeChecked(event
.getElement(), true);
691 if (event
.getElement() instanceof KernelProviderComponent
) {
692 fTracepointsViewer
.setSubtreeChecked(event
.getElement(), false);
694 ITraceControlComponent component
= (ITraceControlComponent
) event
.getElement();
695 fTracepointsViewer
.setChecked(component
.getParent(), false);