1 /**********************************************************************
2 * Copyright (c) 2012 Ericsson
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
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
12 package org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.model
;
14 import java
.util
.List
;
16 import org
.eclipse
.core
.runtime
.IAdaptable
;
17 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.service
.ILttngControlService
;
18 import org
.eclipse
.swt
.graphics
.Image
;
21 * <b><u>ITraceControlComponent</u></b>
23 * Interface for trace control components that can be displayed in the
24 * trace control tree viewer.
27 public interface ITraceControlComponent
extends IAdaptable
{
29 // ------------------------------------------------------------------------
31 // ------------------------------------------------------------------------
34 * @return the name of the component
36 public String
getName();
38 * Sets the name of the component to the given value.
39 * @param name - name to set
41 public void setName(String name
);
44 * @return the image representing the component.
46 public Image
getImage();
48 * Sets the image path of the component.
49 * @param path - path to the image location
51 public void setImage(String path
);
53 * Sets the image the component.
54 * @param image - image to the image location
56 public void setImage(Image image
);
59 * @return tool tip with information about the component.
61 public String
getToolTip();
63 * Sets the tool tip with information about the component.
64 * @param toolTip - the tool tip to set.
66 public void setToolTip(String toolTip
);
69 * @return the node's connection state
71 public TargetNodeState
getTargetNodeState();
73 * Sets the node's connection state.
74 * @param state - the state to set
76 public void setTargetNodeState(TargetNodeState state
);
79 * @return returns the parent component.
81 public ITraceControlComponent
getParent();
83 * Sets the parent component.
84 * @param parent - the parent to set.
86 public void setParent(ITraceControlComponent parent
);
89 * @return the children components
91 public ITraceControlComponent
[] getChildren();
93 * Sets the children components.
94 * @param children - the children to set.
96 public void setChildren(List
<ITraceControlComponent
> children
);
98 * Returns the child component with given name.
99 * @param name - name of child to find.
100 * @return child component or null.
102 public ITraceControlComponent
getChild(String name
);
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.
108 public List
<ITraceControlComponent
> getChildren(Class
<?
extends ITraceControlComponent
> clazz
);
111 * @return the LTTng control service implementation.
113 public ILttngControlService
getControlService();
116 * Sets the LTTng control service implementation.
117 * @param service - the service to set.
119 public void setControlService(ILttngControlService service
);
121 // ------------------------------------------------------------------------
123 // ------------------------------------------------------------------------
125 * Dispose any resource.
127 public void dispose();
130 * Adds a child component.
131 * @param component - child to add.
133 public void addChild(ITraceControlComponent component
);
136 * Removes the given child component.
137 * @param component - the child to remove.
139 public void removeChild(ITraceControlComponent component
);
142 * Removes all children.
144 public void removeAllChildren();
147 * Checks if child with given name exists.
148 * @param name - child name to search for.
149 * @return - true if exists else false.
151 public boolean containsChild(String name
);
154 * Checks for children.
155 * @return true if one or more children exist else false
157 public boolean hasChildren();
160 * Adds a component listener for notification of component changes.
161 * @param listener - listener interface implementation to add.
163 public void addComponentListener(ITraceControlComponentChangedListener listener
);
166 * Removes a component listener for notification of component changes.
167 * @param listener - listener interface implementation to remove.
169 public void removeComponentListener(ITraceControlComponentChangedListener listener
);
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.
176 public void fireComponentAdded(ITraceControlComponent parent
, ITraceControlComponent component
);
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.
183 public void fireComponentRemoved(ITraceControlComponent parent
, ITraceControlComponent component
);
186 * Notifies listeners about the change of a component.
187 * @param component - the component that was changed.
189 public void fireComponentChanged(ITraceControlComponent component
);