Source code: ledestin/swing/EditableTreeNode.java
1 /*
2 * Copyright (C) 2000-2001 Dmitry Macsema. All Rights Reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted under the terms of the following
6 * Open Source license:
7 *
8 * The GNU General Public License, version 2, or any later version, as
9 * published by the Free Software Foundation
10 * (http://www.fsf.org/copyleft/gpl.html);
11 */
12
13 package ledestin.swing;
14
15 import javax.swing.tree.*;
16
17 /**
18 Implement the interface only for nodes that can have children.
19 <code>EditableTreeNode</code>s are supposed to have child nodes of one
20 particular type. In an empty {@link JEditableTree JEditableTree}
21 its nodes must be able to create their children.
22 */
23 public interface EditableTreeNode extends MutableTreeNode {
24 /**
25 Creates a new node of the "child node type", of this node.
26 Note that the newly created node isn't added to this node
27 with {@link javax.swing.tree.MutableTreeNode#insert(MutableTreeNode, int) insert}
28 method or in any other way. It is just the way of creating children for node.
29 @return A new node of "child node type"
30 @throws ChildNodeCreationException thrown when for some reason a child node
31 can't be instantiated. InitializationException weren't used to avoid
32 misrepresentation.
33 */
34 public MutableTreeNode createNewChild() throws ChildNodeCreationException;
35 /**
36 Returns the "child node type" for the node.
37 @return "Child node type" (instance of Class)
38 @throws ClassNotFoundException thrown when failed to obtain Class instance
39 */
40 public Class getChildClass() throws ClassNotFoundException;
41 }