2010-10-26 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug309042
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / project / model / TmfTraceNode.java
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
43 @Override
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 }
This page took 0.031396 seconds and 5 git commands to generate.