d7f6db270c1bcf977346b518b2b6cf93459747b8
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.control.ui / src / org / eclipse / tracecompass / internal / lttng2 / control / ui / views / dialogs / EnableKernelEventComposite.java
1 /**********************************************************************
2 * Copyright (c) 2012, 2014 Ericsson
3 *
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
8 *
9 * Contributors:
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;
14
15 import java.util.ArrayList;
16 import java.util.List;
17
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;
43
44 /**
45 * <p>
46 * A composite for collecting information about kernel events to be enabled.
47 * </p>
48 *
49 * @author Bernd Hufmann
50 */
51 public class EnableKernelEventComposite extends Composite implements IEnableKernelEvents {
52
53 // ------------------------------------------------------------------------
54 // Constants
55 // ------------------------------------------------------------------------
56 private enum KernelGroupEnum { TRACEPOINTS, SYSCALLS, PROBE, FUNCTION }
57
58 // ------------------------------------------------------------------------
59 // Attributes
60 // ------------------------------------------------------------------------
61
62 /**
63 * A button to enable/disable the tracepoints group
64 */
65 private Button fTracepointsActivateButton;
66 /**
67 * A tree viewer for displaying and selection of available tracepoints.
68 */
69 private CheckboxTreeViewer fTracepointsViewer;
70 /**
71 * A button to enable/disable the syscalls group
72 */
73 private Button fSysCallsActivateButton;
74 /**
75 * A button to enable or disable the dynamic probe group.
76 */
77 private Button fProbeActivateButton;
78 /**
79 * The text field for the event name for the dynamic probe.
80 */
81 private Text fProbeEventNameText;
82 /**
83 * The text field for the dynamic probe.
84 */
85 private Text fProbeText;
86 /**
87 * A button to enable or disable the dynamic function probe group.
88 */
89 private Button fFunctionActivateButton;
90 /**
91 * The text field for the event name for the dynamic probe.
92 */
93 private Text fFunctionEventNameText;
94 /**
95 * The text field for the dynamic function entry/return probe.
96 */
97 private Text fFunctionText;
98 /**
99 * The filter text
100 */
101 private Text fFilterText;
102 /**
103 * The referenced trace provider group containing the kernel provider
104 * component which contains a list of available tracepoints.
105 */
106 private final TraceProviderGroup fProviderGroup;
107 /**
108 * The flag indicating that tracepoints are selected.
109 */
110 private boolean fIsTracepoints;
111 /**
112 * The flag indicating that all tracepoints are selected.
113 */
114 private boolean fIsAllTracepoints;
115 /**
116 * The flag indicating that syscalls are selected.
117 */
118 private boolean fIsSysCalls;
119 /**
120 * The list of tracepoints to be enabled.
121 */
122 private List<String> fSelectedEvents;
123 /**
124 * The flag indicating that dynamic probe is selected.
125 */
126 private boolean fIsDynamicProbe;
127 /**
128 * The event name of the dynamic probe.
129 */
130 private String fProbeEventName;
131 /**
132 * The dynamic probe.
133 */
134 private String fProbeString;
135 /**
136 * The flag indicating that the dynamic function probe is selected.
137 */
138 private boolean fIsDynamicFunctionProbe;
139 /**
140 * The event name of the dynamic function entry/return probe.
141 */
142 private String fFunctionEventName;
143 /**
144 * The dynamic function entry/return probe.
145 */
146 private String fFunctionString;
147 /**
148 * The filter expression
149 */
150 private String fFilterExpression;
151
152 // ------------------------------------------------------------------------
153 // Constructors
154 // ------------------------------------------------------------------------
155
156 /**
157 * Constructor
158 *
159 * @param parent
160 * The parent composite
161 * @param style
162 * The index of the style for this event composite
163 * @param providerGroup
164 * The trace provider group
165 */
166 public EnableKernelEventComposite(Composite parent, int style, TraceProviderGroup providerGroup) {
167 super(parent, style);
168 fProviderGroup = providerGroup;
169 }
170
171 // ------------------------------------------------------------------------
172 // Acessors
173 // ------------------------------------------------------------------------
174
175 @Override
176 public boolean isTracepoints() {
177 return fIsTracepoints;
178 }
179
180 @Override
181 public boolean isAllTracePoints() {
182 return fIsAllTracepoints;
183 }
184
185 @Override
186 public boolean isSysCalls() {
187 return fIsSysCalls;
188 }
189
190 @Override
191 public boolean isAllSysCalls() {
192 return fIsSysCalls;
193 }
194
195 @Override
196 public List<String> getEventNames() {
197 return new ArrayList<>(fSelectedEvents);
198 }
199
200 @Override
201 public boolean isDynamicProbe() {
202 return fIsDynamicProbe;
203 }
204
205 @Override
206 public String getProbeName() {
207 return fProbeString;
208 }
209
210 @Override
211 public String getProbeEventName() {
212 return fProbeEventName;
213 }
214
215 @Override
216 public boolean isDynamicFunctionProbe() {
217 return fIsDynamicFunctionProbe;
218 }
219
220 @Override
221 public String getFunctionEventName() {
222 return fFunctionEventName;
223 }
224
225 @Override
226 public String getFunction() {
227 return fFunctionString;
228 }
229
230 @Override
231 public String getFilterExpression() {
232 return fFilterExpression;
233 }
234
235 // ------------------------------------------------------------------------
236 // Operations
237 // ------------------------------------------------------------------------
238
239 /**
240 * Creates the composite content
241 */
242 public void createContent() {
243
244 // Tracepoints Group
245 createTracepointsGroup();
246
247 // Syscalls Group
248 createSysCallsGroup();
249
250 // Dynamic Probe Group
251 createDynamicProbeGroup();
252
253 // Dynamic Function Probe Group
254 createDynamicFunctionPropeGroup();
255
256 // Filter Group
257 createFilterGroup();
258
259 // Set default enablements
260 setKernelEnablements(KernelGroupEnum.TRACEPOINTS);
261 }
262
263 /**
264 * Validates the kernel composite input data.
265 * @return true if configured data is valid and can be retrieved.
266 */
267 public boolean isValid() {
268 fIsTracepoints = fTracepointsActivateButton.getSelection();
269 fIsSysCalls = fSysCallsActivateButton.getSelection();
270 fIsDynamicProbe = fProbeActivateButton.getSelection();
271 fIsDynamicFunctionProbe = fFunctionActivateButton.getSelection();
272
273 // initialize tracepoint fields
274 fIsAllTracepoints = false;
275 fSelectedEvents = new ArrayList<>();
276
277 if (fIsTracepoints) {
278 Object[] checkedElements = fTracepointsViewer.getCheckedElements();
279 for (int i = 0; i < checkedElements.length; i++) {
280 ITraceControlComponent component = (ITraceControlComponent)checkedElements[i];
281 if (component instanceof BaseEventComponent) {
282 fSelectedEvents.add(component.getName());
283 }
284 }
285 // verify if all events are selected
286 int nbEvents = 0;
287 List<ITraceControlComponent> comps = fProviderGroup.getChildren(KernelProviderComponent.class);
288 for (ITraceControlComponent comp : comps) {
289 nbEvents += comp.getChildren().length;
290 }
291 fIsAllTracepoints = (nbEvents == fSelectedEvents.size());
292 }
293
294 if (fIsDynamicProbe) {
295 String temp = fProbeEventNameText.getText();
296 if (temp.trim().isEmpty() ||
297 (!temp.matches("^[\\s]{0,}$") && !temp.matches("^[a-zA-Z0-9\\-\\_]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$
298 MessageDialog.openError(getShell(),
299 Messages.TraceControl_EnableEventsDialogTitle,
300 Messages.TraceControl_InvalidProbeNameError + " (" + temp + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$
301
302 return false;
303 }
304
305 fProbeEventName = temp;
306 // fProbeString will be validated by lttng-tools
307 fProbeString = fProbeText.getText();
308 }
309
310 // initialize function string
311 fFunctionEventName = null;
312 fFunctionString = null;
313 if (fIsDynamicFunctionProbe) {
314 String functionTemp = fFunctionEventNameText.getText();
315 if (functionTemp.trim().isEmpty() ||
316 (!functionTemp.matches("^[\\s]{0,}$") && !functionTemp.matches("^[a-zA-Z0-9\\-\\_]{1,}$"))) { //$NON-NLS-1$ //$NON-NLS-2$
317 MessageDialog.openError(getShell(),
318 Messages.TraceControl_EnableEventsDialogTitle,
319 Messages.TraceControl_InvalidProbeNameError + " (" + functionTemp + ") \n"); //$NON-NLS-1$ //$NON-NLS-2$
320
321 return false;
322 }
323
324 fFunctionEventName = functionTemp;
325 // fFunctionString will be validated by lttng-tools
326 fFunctionString = fFunctionText.getText();
327 }
328
329 // initialize filter with null
330 fFilterExpression = null;
331 if (fProviderGroup.isEventFilteringSupported(true)) {
332 String tempFilter = fFilterText.getText();
333
334 if(!tempFilter.trim().isEmpty()) {
335 fFilterExpression = tempFilter;
336 }
337 }
338
339 return true;
340 }
341
342 /**
343 * Creates tracepoints group.
344 */
345 private void createTracepointsGroup() {
346
347 GridLayout layout;
348 GridData data;
349 Group tpMainGroup = new Group(this, SWT.SHADOW_NONE);
350 tpMainGroup.setText(Messages.TraceControl_EnableEventsTracepointGroupName);
351 layout = new GridLayout(2, false);
352 tpMainGroup.setLayout(layout);
353 data = new GridData(GridData.FILL_BOTH);
354 tpMainGroup.setLayoutData(data);
355
356 Composite buttonComposite = new Composite(tpMainGroup, SWT.NONE);
357 layout = new GridLayout(1, true);
358 buttonComposite.setLayout(layout);
359 data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true);
360 buttonComposite.setLayoutData(data);
361
362 fTracepointsActivateButton = new Button(buttonComposite, SWT.RADIO);
363 fTracepointsActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName);
364 data = new GridData(GridData.FILL_HORIZONTAL);
365 fTracepointsActivateButton.setLayoutData(data);
366 fTracepointsActivateButton.addSelectionListener(new SelectionAdapter() {
367 @Override
368 public void widgetSelected(SelectionEvent e) {
369 setKernelEnablements(KernelGroupEnum.TRACEPOINTS);
370 }
371 });
372
373 Group tracepointsGroup = new Group(tpMainGroup, SWT.SHADOW_NONE);
374 layout = new GridLayout(1, true);
375 tracepointsGroup.setLayout(layout);
376 data = new GridData(GridData.FILL_BOTH);
377 tracepointsGroup.setLayoutData(data);
378
379 new FilteredTree(tracepointsGroup, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, new PatternFilter(), true) {
380 @Override
381 protected TreeViewer doCreateTreeViewer(Composite aparent, int style) {
382 fTracepointsViewer = new CheckboxTreeViewer(aparent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
383 fTracepointsViewer.getTree().setToolTipText(Messages.TraceControl_EnableEventsTracepointTreeTooltip);
384
385 fTracepointsViewer.setContentProvider(new KernelContentProvider());
386 fTracepointsViewer.setLabelProvider(new KernelLabelProvider());
387 fTracepointsViewer.addCheckStateListener(new KernelCheckListener());
388 fTracepointsViewer.setInput(fProviderGroup);
389
390 fTracepointsViewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
391 return fTracepointsViewer;
392 }
393
394 @Override
395 protected void updateToolbar(boolean visible) {
396 super.updateToolbar(visible);
397 treeViewer.expandAll();
398 }
399 };
400 }
401
402 /**
403 * Creates syscalls group.
404 */
405 private void createSysCallsGroup() {
406 GridLayout layout;
407 GridData data;
408 Group sysCallsMainGroup = new Group(this, SWT.SHADOW_NONE);
409 sysCallsMainGroup.setText(Messages.TraceControl_EnableEventsSyscallName);
410 sysCallsMainGroup.setToolTipText(Messages.TraceControl_EnableEventsSyscallTooltip);
411 layout = new GridLayout(2, false);
412 sysCallsMainGroup.setLayout(layout);
413 data = new GridData(GridData.FILL_HORIZONTAL);
414 sysCallsMainGroup.setLayoutData(data);
415
416 Composite buttonComposite = new Composite(sysCallsMainGroup, SWT.NONE);
417 layout = new GridLayout(1, false);
418 buttonComposite.setLayout(layout);
419 data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true);
420 buttonComposite.setLayoutData(data);
421
422 fSysCallsActivateButton = new Button(buttonComposite, SWT.RADIO);
423 fSysCallsActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName);
424 fSysCallsActivateButton.setToolTipText(Messages.TraceControl_EnableEventsSyscallTooltip);
425 fSysCallsActivateButton.setSelection(false);
426 data = new GridData(GridData.FILL_HORIZONTAL);
427 fSysCallsActivateButton.setLayoutData(data);
428 fSysCallsActivateButton.addSelectionListener(new SelectionAdapter() {
429 @Override
430 public void widgetSelected(SelectionEvent e) {
431 setKernelEnablements(KernelGroupEnum.SYSCALLS);
432 }
433 });
434 }
435
436 /**
437 * Creates dynamic probe group.
438 */
439 private void createDynamicProbeGroup() {
440 GridLayout layout;
441 GridData data;
442 Group probeMainGroup = new Group(this, SWT.SHADOW_NONE);
443 probeMainGroup.setText(Messages.TraceControl_EnableEventsProbeGroupName);
444 layout = new GridLayout(2, false);
445 probeMainGroup.setLayout(layout);
446 data = new GridData(GridData.FILL_HORIZONTAL);
447 probeMainGroup.setLayoutData(data);
448
449 Composite buttonComposite = new Composite(probeMainGroup, SWT.NONE);
450 layout = new GridLayout(1, false);
451 buttonComposite.setLayout(layout);
452 data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true);
453 buttonComposite.setLayoutData(data);
454
455 fProbeActivateButton = new Button(buttonComposite, SWT.RADIO);
456 fProbeActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName);
457 fProbeActivateButton.setSelection(false);
458 data = new GridData(GridData.FILL_HORIZONTAL);
459 fProbeActivateButton.setLayoutData(data);
460 fProbeActivateButton.addSelectionListener(new SelectionAdapter() {
461 @Override
462 public void widgetSelected(SelectionEvent e) {
463 setKernelEnablements(KernelGroupEnum.PROBE);
464 }
465 });
466
467 Group probeGroup = new Group(probeMainGroup, SWT.SHADOW_NONE);
468 layout = new GridLayout(4, true);
469 probeGroup.setLayout(layout);
470 probeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
471
472 Label probeNameLabel = new Label(probeGroup, SWT.LEFT);
473 probeNameLabel.setText(Messages.TraceControl_EnableEventsEventNameLabel);
474 data = new GridData(GridData.FILL_BOTH);
475 data.horizontalSpan = 1;
476 probeNameLabel.setLayoutData(data);
477
478 fProbeEventNameText = new Text(probeGroup, SWT.LEFT);
479 fProbeEventNameText.setToolTipText(Messages.TraceControl_EnableEventsProbeEventNameTooltip);
480
481 data = new GridData(GridData.FILL_BOTH);
482 data.horizontalSpan = 3;
483 fProbeEventNameText.setLayoutData(data);
484
485 Label probeLabel = new Label(probeGroup, SWT.LEFT);
486 probeLabel.setText(Messages.TraceControl_EnableEventsProbeNameLabel);
487 data = new GridData(GridData.FILL_BOTH);
488 data.horizontalSpan = 1;
489 probeLabel.setLayoutData(data);
490
491 fProbeText = new Text(probeGroup, SWT.LEFT);
492 fProbeText.setToolTipText(Messages.TraceControl_EnableEventsProbeNameTooltip);
493 data = new GridData(GridData.FILL_BOTH);
494 data.horizontalSpan = 3;
495 fProbeText.setLayoutData(data);
496 }
497
498 /**
499 * Creates dynamic function entry/return probe group.
500 */
501 private void createDynamicFunctionPropeGroup() {
502 GridLayout layout;
503 GridData data;
504 Group functionMainGroup = new Group(this, SWT.SHADOW_NONE);
505 functionMainGroup.setText(Messages.TraceControl_EnableEventsFucntionGroupName);
506 layout = new GridLayout(2, false);
507 functionMainGroup.setLayout(layout);
508 data = new GridData(GridData.FILL_HORIZONTAL);
509 functionMainGroup.setLayoutData(data);
510
511 Composite buttonComposite = new Composite(functionMainGroup, SWT.NONE);
512 layout = new GridLayout(1, false);
513 buttonComposite.setLayout(layout);
514 data = new GridData(SWT.BEGINNING, SWT.CENTER, false, true);
515 buttonComposite.setLayoutData(data);
516
517 fFunctionActivateButton = new Button(buttonComposite, SWT.RADIO);
518 fFunctionActivateButton.setText(Messages.TraceControl_EnableGroupSelectionName);
519 fFunctionActivateButton.setSelection(false);
520 data = new GridData(GridData.FILL_HORIZONTAL);
521 fFunctionActivateButton.setLayoutData(data);
522 fFunctionActivateButton.addSelectionListener(new SelectionAdapter() {
523 @Override
524 public void widgetSelected(SelectionEvent e) {
525 setKernelEnablements(KernelGroupEnum.FUNCTION);
526 }
527 });
528
529 Group functionGroup = new Group(functionMainGroup, SWT.SHADOW_NONE);
530 layout = new GridLayout(4, true);
531 functionGroup.setLayout(layout);
532 functionGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
533
534 Label functionNameLabel = new Label(functionGroup, SWT.LEFT);
535 functionNameLabel.setText(Messages.TraceControl_EnableEventsEventNameLabel);
536 data = new GridData(GridData.FILL_BOTH);
537 data.horizontalSpan = 1;
538 functionNameLabel.setLayoutData(data);
539
540 fFunctionEventNameText = new Text(functionGroup, SWT.LEFT);
541 fFunctionEventNameText.setToolTipText(Messages.TraceControl_EnableEventsFunctionEventNameTooltip);
542 data = new GridData(GridData.FILL_BOTH);
543 data.horizontalSpan = 3;
544 fFunctionEventNameText.setLayoutData(data);
545
546 Label functionLabel = new Label(functionGroup, SWT.LEFT);
547 functionLabel.setText(Messages.TraceControl_EnableEventsFunctionNameLabel);
548 data = new GridData(GridData.FILL_BOTH);
549 data.horizontalSpan = 1;
550 functionLabel.setLayoutData(data);
551
552 fFunctionText = new Text(functionGroup, SWT.LEFT);
553 fFunctionText.setToolTipText(Messages.TraceControl_EnableEventsProbeNameTooltip);
554 data = new GridData(GridData.FILL_BOTH);
555 data.horizontalSpan = 3;
556 fFunctionText.setLayoutData(data);
557 }
558
559 /**
560 * Enable/selects widgets depending on the group specified.
561 * @param group - group to enable.
562 */
563 private void setKernelEnablements(KernelGroupEnum group) {
564 fTracepointsActivateButton.setSelection(group == KernelGroupEnum.TRACEPOINTS);
565 fTracepointsViewer.getTree().setEnabled(group == KernelGroupEnum.TRACEPOINTS);
566
567 fSysCallsActivateButton.setSelection(group == KernelGroupEnum.SYSCALLS);
568
569 fProbeActivateButton.setSelection(group == KernelGroupEnum.PROBE);
570 fProbeEventNameText.setEnabled(group == KernelGroupEnum.PROBE);
571 fProbeText.setEnabled(group == KernelGroupEnum.PROBE);
572
573 fFunctionActivateButton.setSelection(group == KernelGroupEnum.FUNCTION);
574 fFunctionEventNameText.setEnabled(group == KernelGroupEnum.FUNCTION);
575 fFunctionText.setEnabled(group == KernelGroupEnum.FUNCTION);
576 }
577
578 private void createFilterGroup() {
579 if (fProviderGroup.isEventFilteringSupported(true)) {
580 Group filterMainGroup = new Group(this, SWT.SHADOW_NONE);
581 filterMainGroup.setText(Messages.TraceControl_EnableEventsFilterGroupName);
582 GridLayout layout = new GridLayout(3, false);
583 filterMainGroup.setLayout(layout);
584 GridData data = new GridData(GridData.FILL_HORIZONTAL);
585 filterMainGroup.setLayoutData(data);
586
587 fFilterText = new Text(filterMainGroup, SWT.LEFT);
588 fFilterText.setToolTipText(Messages.TraceControl_EnableEventsFilterTooltip);
589 data = new GridData(GridData.FILL_HORIZONTAL);
590 fFilterText.setLayoutData(data);
591 }
592 }
593
594 // ------------------------------------------------------------------------
595 // Local classes
596 // ------------------------------------------------------------------------
597 /**
598 * Content provider for the tracepoints tree.
599 */
600 public static final class KernelContentProvider extends TraceControlContentProvider {
601 @Override
602 public Object[] getChildren(Object parentElement) {
603 if (parentElement instanceof TraceProviderGroup) {
604 List<ITraceControlComponent> children = ((ITraceControlComponent)parentElement).getChildren(KernelProviderComponent.class);
605 return children.toArray(new ITraceControlComponent[children.size()]);
606 }
607 if (parentElement instanceof ITraceControlComponent) {
608 return ((ITraceControlComponent)parentElement).getChildren();
609 }
610 return new Object[0];
611 }
612 }
613
614 /**
615 * Content label for the tracepoints tree.
616 */
617 public static final class KernelLabelProvider extends TraceControlLabelProvider {
618 @Override
619 public Image getImage(Object element) {
620 return null;
621 }
622 @Override
623 public String getText(Object element) {
624 if ((element != null) && (element instanceof KernelProviderComponent)) {
625 return Messages.TraceControl_EnableEventsTracepointTreeAllLabel;
626 }
627 return super.getText(element);
628 }
629 }
630
631 /**
632 * Check state listener for the tracepoints tree.
633 */
634 public final class KernelCheckListener implements ICheckStateListener {
635 @Override
636 public void checkStateChanged(CheckStateChangedEvent event) {
637 if (event.getChecked()) {
638 if (event.getElement() instanceof KernelProviderComponent) {
639 fTracepointsViewer.setSubtreeChecked(event.getElement(), true);
640 }
641 } else {
642 if (event.getElement() instanceof KernelProviderComponent) {
643 fTracepointsViewer.setSubtreeChecked(event.getElement(), false);
644 } else {
645 ITraceControlComponent component = (ITraceControlComponent) event.getElement();
646 fTracepointsViewer.setChecked(component.getParent(), false);
647 }
648 }
649 }
650 }
651 }
This page took 0.045607 seconds and 4 git commands to generate.