1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.model.tree;
14
15
16 import javax.swing.JPopupMenu;
17
18 import com.eviware.soapui.model.ModelItem;
19 import com.eviware.soapui.support.action.swing.ActionList;
20 import com.eviware.soapui.support.action.swing.ActionListBuilder;
21 import com.eviware.soapui.support.action.swing.ActionSupport;
22
23 /***
24 * Base implementation of SoapUITreeNode interface
25 *
26 * @author Ole.Matzura
27 */
28
29 public abstract class AbstractTreeNode<T extends ModelItem> implements SoapUITreeNode
30 {
31 private T modelItem;
32
33 public AbstractTreeNode( T modelItem )
34 {
35 this.modelItem = modelItem;
36 }
37
38 public boolean valueChanged(Object newValue)
39 {
40 return false;
41 }
42
43 public boolean isLeaf()
44 {
45 return getChildCount() == 0;
46 }
47
48 public JPopupMenu getPopup()
49 {
50 return ActionSupport.buildPopup( getActions() );
51 }
52
53 public ActionList getActions()
54 {
55 return ActionListBuilder.buildActions( modelItem );
56 }
57
58 public T getModelItem()
59 {
60 return modelItem;
61 }
62
63 public String toString()
64 {
65 return modelItem.getName();
66 }
67
68 public void reorder( boolean notify )
69 {
70 }
71 }