Commit | Line | Data |
---|---|---|
eb1bab5b BH |
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.lttng.ui.views.control.model; | |
13 | ||
14 | import java.util.List; | |
15 | ||
16 | import org.eclipse.core.runtime.IAdaptable; | |
17 | import org.eclipse.linuxtools.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 | /** | |
39 | * Sets the name of the component to the given value. | |
40 | * @param name - name to set | |
41 | */ | |
42 | public void setName(String name); | |
43 | ||
44 | /** | |
45 | * @return the image representing the component. | |
46 | */ | |
47 | public Image getImage(); | |
48 | /** | |
49 | * Sets the image path of the component. | |
50 | * @param path - path to the image location | |
51 | */ | |
52 | public void setImage(String path); | |
53 | /** | |
54 | * Sets the image the component. | |
55 | * @param image - image to the image location | |
56 | */ | |
57 | public void setImage(Image image); | |
58 | /** | |
59 | * @return tool tip with information about the component. | |
60 | */ | |
61 | public String getToolTip(); | |
62 | ||
63 | /** | |
64 | * Sets the tool tip with information about the component. | |
65 | * @param toolTip - the tool tip to set. | |
66 | */ | |
67 | public void setToolTip(String toolTip); | |
68 | ||
69 | /** | |
70 | * @return the node's connection state | |
71 | */ | |
72 | public TargetNodeState getTargetNodeState(); | |
73 | /** | |
74 | * Sets the node's connection state. | |
75 | * @param state - the state to set | |
76 | */ | |
77 | public void setTargetNodeState(TargetNodeState state); | |
78 | ||
79 | /** | |
80 | * @return returns the parent component. | |
81 | */ | |
82 | public ITraceControlComponent getParent(); | |
83 | ||
84 | /** | |
85 | * Sets the parent component. | |
86 | * @param parent - the parent to set. | |
87 | */ | |
88 | public void setParent(ITraceControlComponent parent); | |
89 | ||
90 | /** | |
91 | * @return the children components | |
92 | */ | |
93 | public ITraceControlComponent[] getChildren(); | |
94 | ||
95 | /** | |
96 | * Sets the children components. | |
97 | * @param children - the children to set. | |
98 | */ | |
99 | public void setChildren(List<ITraceControlComponent> children); | |
100 | ||
101 | /** | |
102 | * Returns the child component with given name. | |
103 | * @param name - name of child to find. | |
104 | * @return child component or null. | |
105 | */ | |
106 | public ITraceControlComponent getChild(String name); | |
107 | ||
108 | /** | |
109 | * @return the LTTng control service implementation. | |
110 | */ | |
111 | public ILttngControlService getControlService(); | |
112 | ||
113 | /** | |
114 | * Sets the LTTng control service implementation. | |
115 | * @param service - the service to set. | |
116 | */ | |
117 | public void setControlService(ILttngControlService service); | |
118 | ||
119 | // ------------------------------------------------------------------------ | |
120 | // Operations | |
121 | // ------------------------------------------------------------------------ | |
122 | /** | |
123 | * Dispose any resource. | |
124 | */ | |
125 | public void dispose(); | |
126 | ||
127 | /** | |
128 | * Adds a child component. | |
129 | * @param component - child to add. | |
130 | */ | |
131 | public void addChild(ITraceControlComponent component); | |
132 | ||
133 | /** | |
134 | * Removes the given child component. | |
135 | * @param component - the child to remove. | |
136 | */ | |
137 | public void removeChild(ITraceControlComponent component); | |
138 | ||
139 | /** | |
140 | * Removes all children. | |
141 | */ | |
142 | public void removeAllChildren(); | |
143 | ||
144 | /** | |
145 | * Checks if child with given name exists. | |
146 | * @param name - child name to search for. | |
147 | * @return - true if exists else false. | |
148 | */ | |
149 | public boolean containsChild(String name); | |
150 | ||
151 | /** | |
152 | * Checks for children. | |
153 | * @return true if one or more children exist else false | |
154 | */ | |
155 | public boolean hasChildren(); | |
156 | ||
157 | /** | |
158 | * Adds a component listener for notification of component changes. | |
159 | * @param listener - listener interface implementation to add. | |
160 | */ | |
161 | public void addComponentListener(ITraceControlComponentChangedListener listener); | |
162 | ||
163 | /** | |
164 | * Removes a component listener for notification of component changes. | |
165 | * @param listener - listener interface implementation to remove. | |
166 | */ | |
167 | public void removeComponentListener(ITraceControlComponentChangedListener listener); | |
168 | ||
169 | /** | |
170 | * Notifies listeners about the addition of a child. | |
171 | * @param parent - the parent where the child was added. | |
172 | * @param component - the child that was added. | |
173 | */ | |
174 | public void fireCompenentAdded(ITraceControlComponent parent, ITraceControlComponent component); | |
175 | ||
176 | /** | |
177 | * Notifies listeners about the removal of a child. | |
178 | * @param parent - the parent where the child was removed. | |
179 | * @param component - the child that was removed. | |
180 | */ | |
181 | public void fireCompenentRemoved(ITraceControlComponent parent, ITraceControlComponent component); | |
182 | ||
183 | /** | |
184 | * Notifies listeners about the change of a component. | |
185 | * @param component - the component that was changed. | |
186 | */ | |
187 | public void fireCompenentChanged(ITraceControlComponent component); | |
188 | } |