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