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