View Javadoc

1   /*
2    *  File: ITableNode.java 
3    *  Copyright (c) 2004-2007  Peter Kliem (Peter.Kliem@jaret.de)
4    *  A commercial license is available, see http://www.jaret.de.
5    *
6    * All rights reserved. This program and the accompanying materials
7    * are made available under the terms of the Common Public License v1.0
8    * which accompanies this distribution, and is available at
9    * http://www.eclipse.org/legal/cpl-v10.html
10   */
11  package de.jaret.util.ui.table.model;
12  
13  import java.util.List;
14  
15  /***
16   * Interface describing a table row in a hierarchy of rows.
17   * 
18   * @author Peter Kliem
19   * @version $Id: ITableNode.java 1076 2010-12-05 13:34:42Z kliem $
20   */
21  public interface ITableNode extends IRow {
22  
23      /***
24       * Retrieve all children of the node.
25       * 
26       * @return children of the node
27       */
28      List<ITableNode> getChildren();
29  
30      /***
31       * Retrieve the level in the tree.
32       * 
33       * @return level in the tree.
34       */
35      int getLevel();
36  
37      /***
38       * Tell the node it's level.
39       * 
40       * @TODO remove
41       * @param level level of the node
42       */
43      void setLevel(int level);
44  
45      /***
46       * Add a node as a child.
47       * 
48       * @param node child to be added.
49       */
50      void addNode(ITableNode node);
51  
52      /***
53       * Remove a child node.
54       * 
55       * @param node node to remove.
56       */
57      void remNode(ITableNode node);
58  
59      /***
60       * Add a listener to listen for node changes.
61       * 
62       * @param tnl listener to add
63       */
64      void addTableNodeListener(ITableNodeListener tnl);
65  
66      /***
67       * Remove a listener registered for node changes.
68       * 
69       * @param tnl listener to remove
70       */
71      void removeTableNodeListener(ITableNodeListener tnl);
72  }