Commit | Line | Data |
---|---|---|
abfad0aa FC |
1 | /******************************************************************************* |
2 | * Copyright (c) 2009, 2010 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 | * Francois Chouinard - Initial API and implementation | |
11 | *******************************************************************************/ | |
12 | ||
13 | package org.eclipse.linuxtools.tmf.ui.views.project.model; | |
14 | ||
15 | import org.eclipse.core.resources.IResource; | |
16 | ||
17 | /** | |
18 | * <b><u>TmfTraceNode</u></b> | |
19 | * <p> | |
20 | * TODO: Implement me. Please. | |
21 | */ | |
22 | public class TmfTraceNode extends TmfProjectTreeNode { | |
23 | ||
24 | private final IResource fTrace; | |
25 | ||
26 | // ------------------------------------------------------------------------ | |
27 | // Constructors | |
28 | // ------------------------------------------------------------------------ | |
29 | ||
30 | public TmfTraceNode(IResource trace) { | |
31 | this(null, trace); | |
32 | } | |
33 | ||
34 | public TmfTraceNode(ITmfProjectTreeNode parent, IResource trace) { | |
35 | super(parent); | |
36 | fTrace = trace; | |
37 | } | |
38 | ||
39 | // ------------------------------------------------------------------------ | |
40 | // TmfProjectTreeNode | |
41 | // ------------------------------------------------------------------------ | |
42 | ||
d4011df2 | 43 | @Override |
abfad0aa FC |
44 | public String getName() { |
45 | return fTrace.getName(); | |
46 | } | |
47 | ||
48 | @Override | |
49 | public void refreshChildren() { | |
50 | } | |
51 | ||
52 | // ------------------------------------------------------------------------ | |
53 | // Accessors | |
54 | // ------------------------------------------------------------------------ | |
55 | ||
56 | /** | |
57 | * @return | |
58 | */ | |
59 | public TmfProjectNode getProject() { | |
60 | ITmfProjectTreeNode node = this; | |
61 | while (node != null) { | |
62 | node = node.getParent(); | |
63 | if (node instanceof TmfProjectNode) { | |
64 | return (TmfProjectNode) node; | |
65 | } | |
66 | } | |
67 | return null; | |
68 | } | |
69 | ||
70 | /** | |
71 | * @return | |
72 | */ | |
73 | public IResource getResource() { | |
74 | return fTrace; | |
75 | } | |
76 | ||
77 | } |