1 /**********************************************************************
2 * Copyright (c) 2012, 2013 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
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.impl
;
14 import org
.eclipse
.jface
.viewers
.ITreeContentProvider
;
15 import org
.eclipse
.jface
.viewers
.Viewer
;
16 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.ui
.views
.model
.ITraceControlComponent
;
20 * Tree content provider implementation for trace control view.
23 * @author Bernd Hufmann
25 public class TraceControlContentProvider
implements ITreeContentProvider
{
27 // ------------------------------------------------------------------------
29 // ------------------------------------------------------------------------
32 public void dispose() {
36 public void inputChanged(Viewer viewer
, Object oldInput
, Object newInput
) {
40 public Object
[] getElements(Object inputElement
) {
41 return getChildren(inputElement
);
45 public Object
[] getChildren(Object parentElement
) {
47 if (parentElement
instanceof ITraceControlComponent
) {
48 return ((ITraceControlComponent
)parentElement
).getChildren();
54 public Object
getParent(Object element
) {
55 if (element
instanceof ITraceControlComponent
) {
56 return ((ITraceControlComponent
)element
).getParent();
62 public boolean hasChildren(Object element
) {
63 if (element
instanceof ITraceControlComponent
) {
64 return ((ITraceControlComponent
)element
).hasChildren();