LTTng: Show the buffer type in the domain property view
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui.tests / stubs / org / eclipse / linuxtools / internal / lttng2 / stubs / dialogs / EnableChannelDialogStub.java
1 /**********************************************************************
2 * Copyright (c) 2012, 2013 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.stubs.dialogs;
13
14 import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo;
15 import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
16 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableChannelDialog;
17 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TargetNodeComponent;
18 import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent;
19
20 /**
21 * Create channel dialog stub implementation.
22 */
23 @SuppressWarnings("javadoc")
24 public class EnableChannelDialogStub implements IEnableChannelDialog {
25
26 // ------------------------------------------------------------------------
27 // Attributes
28 // ------------------------------------------------------------------------
29 private TraceDomainComponent fDomain;
30 private ChannelInfo fChannelInfo;
31 private boolean fIsKernel;
32
33 // ------------------------------------------------------------------------
34 // Constructor
35 // ------------------------------------------------------------------------
36 public EnableChannelDialogStub() {
37 fChannelInfo = new ChannelInfo("mychannel");
38 fChannelInfo.setNumberOfSubBuffers(4);
39 fChannelInfo.setOverwriteMode(true);
40 fChannelInfo.setReadTimer(200);
41 fChannelInfo.setSwitchTimer(100);
42 fChannelInfo.setSubBufferSize(16384);
43 }
44
45 // ------------------------------------------------------------------------
46 // Accessors
47 // ------------------------------------------------------------------------
48 public void setIsKernel(boolean isKernel) {
49 fIsKernel = isKernel;
50 }
51
52 @Override
53 public IChannelInfo getChannelInfo() {
54 return fChannelInfo;
55 }
56
57 @Override
58 public void setDomainComponent(TraceDomainComponent domain) {
59 fDomain = domain;
60 if (fDomain != null) {
61 fIsKernel = fDomain.isKernel();
62 }
63 }
64
65 @Override
66 public int open() {
67 return 0;
68 }
69
70 @Override
71 public boolean isKernel() {
72 return fIsKernel;
73 }
74
75 @Override
76 public void setHasKernel(boolean hasKernel) {
77 // Do nothing
78 }
79
80 public void setChannelInfo(ChannelInfo info) {
81 fChannelInfo = info;
82 }
83
84 @Override
85 public void setTargetNodeComponent(TargetNodeComponent node) {
86 // Do nothing
87 }
88 }
This page took 0.03142 seconds and 5 git commands to generate.