1 /*******************************************************************************
2 * Copyright (c) 2009, 2010 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 *******************************************************************************/
13 package org
.eclipse
.linuxtools
.lttng
.ui
.views
.project
.model
;
15 import java
.util
.ArrayList
;
16 import java
.util
.List
;
19 * <b><u>LTTngProjectTreeNode</u></b>
21 * TODO: Implement me. Please.
23 public abstract class LTTngProjectTreeNode
implements ILTTngProjectTreeNode
{
25 protected ILTTngProjectTreeNode fParent
= null;
26 protected List
<ILTTngProjectTreeNode
> fChildren
= null;
28 // ------------------------------------------------------------------------
30 // ------------------------------------------------------------------------
32 public LTTngProjectTreeNode(ILTTngProjectTreeNode parent
) {
34 fChildren
= new ArrayList
<ILTTngProjectTreeNode
>();
38 public String
toString() {
42 // ------------------------------------------------------------------------
43 // ILTTngProjectTreeNode
44 // ------------------------------------------------------------------------
47 public ILTTngProjectTreeNode
getParent() {
52 public boolean hasChildren() {
53 return fChildren
.size() > 0;
57 public List
<ILTTngProjectTreeNode
> getChildren() {
62 public abstract void refreshChildren();
65 public void refresh() {
70 public void removeChild(ILTTngProjectTreeNode child
) {
71 for (ILTTngProjectTreeNode node
: fChildren
) {
73 node
.removeChildren();
74 // We can do it since we are returning right away
75 fChildren
.remove(node
);
82 public void removeChildren() {
83 for (ILTTngProjectTreeNode node
: fChildren
) {
84 node
.removeChildren();