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 // ------------------------------------------------------------------------
46 public ILTTngProjectTreeNode
getParent() {
50 public boolean hasChildren() {
51 return fChildren
.size() > 0;
54 public List
<ILTTngProjectTreeNode
> getChildren() {
58 public abstract void refreshChildren();
60 public void refresh() {
64 public void removeChild(ILTTngProjectTreeNode child
) {
65 for (ILTTngProjectTreeNode node
: fChildren
) {
67 node
.removeChildren();
68 // We can do it since we are returning right away
69 fChildren
.remove(node
);
75 public void removeChildren() {
76 for (ILTTngProjectTreeNode node
: fChildren
) {
77 node
.removeChildren();