Merge branch 'master' into lttng_2_0_control_dev
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui / src / org / eclipse / linuxtools / internal / lttng / ui / views / control / model / ITraceControlComponent.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.lttng.ui.views.control.model;
13
14 import java.util.List;
15
16 import org.eclipse.core.runtime.IAdaptable;
17 import org.eclipse.linuxtools.internal.lttng.ui.views.control.service.ILttngControlService;
18 import org.eclipse.swt.graphics.Image;
19
20 /**
21 * <b><u>ITraceControlComponent</u></b>
22 * <p>
23 * Interface for trace control components that can be displayed in the
24 * trace control tree viewer.
25 * </p>
26 */
27 public interface ITraceControlComponent extends IAdaptable {
28
29 // ------------------------------------------------------------------------
30 // Accessors
31 // ------------------------------------------------------------------------
32
33 /**
34 * @return the name of the component
35 */
36 public String getName();
37 /**
38 * Sets the name of the component to the given value.
39 * @param name - name to set
40 */
41 public void setName(String name);
42
43 /**
44 * @return the image representing the component.
45 */
46 public Image getImage();
47 /**
48 * Sets the image path of the component.
49 * @param path - path to the image location
50 */
51 public void setImage(String path);
52 /**
53 * Sets the image the component.
54 * @param image - image to the image location
55 */
56 public void setImage(Image image);
57
58 /**
59 * @return tool tip with information about the component.
60 */
61 public String getToolTip();
62 /**
63 * Sets the tool tip with information about the component.
64 * @param toolTip - the tool tip to set.
65 */
66 public void setToolTip(String toolTip);
67
68 /**
69 * @return the node's connection state
70 */
71 public TargetNodeState getTargetNodeState();
72 /**
73 * Sets the node's connection state.
74 * @param state - the state to set
75 */
76 public void setTargetNodeState(TargetNodeState state);
77
78 /**
79 * @return returns the parent component.
80 */
81 public ITraceControlComponent getParent();
82 /**
83 * Sets the parent component.
84 * @param parent - the parent to set.
85 */
86 public void setParent(ITraceControlComponent parent);
87
88 /**
89 * @return the children components
90 */
91 public ITraceControlComponent[] getChildren();
92 /**
93 * Sets the children components.
94 * @param children - the children to set.
95 */
96 public void setChildren(List<ITraceControlComponent> children);
97 /**
98 * Returns the child component with given name.
99 * @param name - name of child to find.
100 * @return child component or null.
101 */
102 public ITraceControlComponent getChild(String name);
103 /**
104 * Gets children for given class type.
105 * @param clazz - a class type to get
106 * @return list of trace control components matching given class type.
107 */
108 public List<ITraceControlComponent> getChildren(Class<? extends ITraceControlComponent> clazz);
109
110 /**
111 * @return the LTTng control service implementation.
112 */
113 public ILttngControlService getControlService();
114
115 /**
116 * Sets the LTTng control service implementation.
117 * @param service - the service to set.
118 */
119 public void setControlService(ILttngControlService service);
120
121 // ------------------------------------------------------------------------
122 // Operations
123 // ------------------------------------------------------------------------
124 /**
125 * Dispose any resource.
126 */
127 public void dispose();
128
129 /**
130 * Adds a child component.
131 * @param component - child to add.
132 */
133 public void addChild(ITraceControlComponent component);
134
135 /**
136 * Removes the given child component.
137 * @param component - the child to remove.
138 */
139 public void removeChild(ITraceControlComponent component);
140
141 /**
142 * Removes all children.
143 */
144 public void removeAllChildren();
145
146 /**
147 * Checks if child with given name exists.
148 * @param name - child name to search for.
149 * @return - true if exists else false.
150 */
151 public boolean containsChild(String name);
152
153 /**
154 * Checks for children.
155 * @return true if one or more children exist else false
156 */
157 public boolean hasChildren();
158
159 /**
160 * Adds a component listener for notification of component changes.
161 * @param listener - listener interface implementation to add.
162 */
163 public void addComponentListener(ITraceControlComponentChangedListener listener);
164
165 /**
166 * Removes a component listener for notification of component changes.
167 * @param listener - listener interface implementation to remove.
168 */
169 public void removeComponentListener(ITraceControlComponentChangedListener listener);
170
171 /**
172 * Notifies listeners about the addition of a child.
173 * @param parent - the parent where the child was added.
174 * @param component - the child that was added.
175 */
176 public void fireComponentAdded(ITraceControlComponent parent, ITraceControlComponent component);
177
178 /**
179 * Notifies listeners about the removal of a child.
180 * @param parent - the parent where the child was removed.
181 * @param component - the child that was removed.
182 */
183 public void fireComponentRemoved(ITraceControlComponent parent, ITraceControlComponent component);
184
185 /**
186 * Notifies listeners about the change of a component.
187 * @param component - the component that was changed.
188 */
189 public void fireComponentChanged(ITraceControlComponent component);
190 }
This page took 0.034087 seconds and 5 git commands to generate.