1 /*******************************************************************************
2 * Copyright (c) 2010, 2014 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 * Francois Chouinard - Initial API and implementation
11 * Patrick Tasse - Add support for folder elements
12 *******************************************************************************/
14 package org
.eclipse
.linuxtools
.tmf
.ui
.project
.model
;
16 import java
.util
.ArrayList
;
17 import java
.util
.List
;
19 import org
.eclipse
.jface
.viewers
.IStructuredContentProvider
;
20 import org
.eclipse
.jface
.viewers
.Viewer
;
23 * Content provider implementation for trace folders for tree viewers that display
24 * the content of a trace folder.
28 * @author Francois Chouinard
30 public class TraceFolderContentProvider
implements IStructuredContentProvider
{
33 public Object
[] getElements(Object inputElement
) {
34 if (inputElement
instanceof TmfTraceFolder
) {
35 TmfTraceFolder folder
= (TmfTraceFolder
) inputElement
;
36 List
<ITmfProjectModelElement
> elements
= new ArrayList
<>();
37 for (TmfTraceElement trace
: folder
.getTraces()) {
38 if (trace
.getTraceType() != null) {
42 return elements
.toArray();
48 public void dispose() {
52 public void inputChanged(Viewer viewer
, Object oldInput
, Object newInput
) {