Commit | Line | Data |
---|---|---|
a26d90be BH |
1 | /********************************************************************** |
2 | * Copyright (c) 2012 Ericsson | |
cfdb727a | 3 | * |
a26d90be BH |
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 | |
cfdb727a AM |
8 | * |
9 | * Contributors: | |
a26d90be BH |
10 | * Bernd Hufmann - Initial API and implementation |
11 | **********************************************************************/ | |
12 | package org.eclipse.linuxtools.internal.lttng2.stubs.dialogs; | |
13 | ||
9315aeee BH |
14 | import org.eclipse.linuxtools.internal.lttng2.core.control.model.IChannelInfo; |
15 | import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo; | |
d62bfa55 | 16 | import org.eclipse.linuxtools.internal.lttng2.ui.views.control.dialogs.IEnableChannelDialog; |
a26d90be BH |
17 | import org.eclipse.linuxtools.internal.lttng2.ui.views.control.model.impl.TraceDomainComponent; |
18 | ||
19 | /** | |
cfdb727a | 20 | * Create channel dialog stub implementation. |
a26d90be | 21 | */ |
cfdb727a | 22 | @SuppressWarnings("javadoc") |
d62bfa55 | 23 | public class EnableChannelDialogStub implements IEnableChannelDialog { |
cfdb727a | 24 | |
a26d90be BH |
25 | // ------------------------------------------------------------------------ |
26 | // Attributes | |
27 | // ------------------------------------------------------------------------ | |
28 | private TraceDomainComponent fDomain; | |
29 | private ChannelInfo fChannelInfo; | |
30 | private boolean fIsKernel; | |
cfdb727a | 31 | |
a26d90be BH |
32 | // ------------------------------------------------------------------------ |
33 | // Constructor | |
34 | // ------------------------------------------------------------------------ | |
d62bfa55 | 35 | public EnableChannelDialogStub() { |
a26d90be BH |
36 | fChannelInfo = new ChannelInfo("mychannel"); //$NON-NLS-1$ |
37 | fChannelInfo.setNumberOfSubBuffers(4); | |
38 | fChannelInfo.setOverwriteMode(true); | |
39 | fChannelInfo.setReadTimer(200); | |
40 | fChannelInfo.setSwitchTimer(100); | |
41 | fChannelInfo.setSubBufferSize(16384); | |
42 | } | |
cfdb727a | 43 | |
a26d90be BH |
44 | // ------------------------------------------------------------------------ |
45 | // Accessors | |
46 | // ------------------------------------------------------------------------ | |
47 | public void setIsKernel(boolean isKernel) { | |
48 | fIsKernel = isKernel; | |
49 | } | |
cfdb727a | 50 | |
a26d90be BH |
51 | @Override |
52 | public IChannelInfo getChannelInfo() { | |
53 | return fChannelInfo; | |
54 | } | |
55 | ||
56 | @Override | |
57 | public void setDomainComponent(TraceDomainComponent domain) { | |
58 | fDomain = domain; | |
59 | if (fDomain != null) { | |
60 | fIsKernel = fDomain.isKernel(); | |
61 | } | |
62 | } | |
63 | ||
64 | @Override | |
65 | public int open() { | |
66 | return 0; | |
67 | } | |
68 | ||
69 | @Override | |
70 | public boolean isKernel() { | |
71 | return fIsKernel; | |
72 | } | |
cfdb727a | 73 | |
a07c7629 BH |
74 | @Override |
75 | public void setHasKernel(boolean hasKernel) { | |
76 | // Do nothing | |
77 | } | |
78 | ||
a26d90be BH |
79 | public void setChannelInfo(ChannelInfo info) { |
80 | fChannelInfo = info; | |
81 | } | |
82 | } |