1
2
3
4
5
6
7
8
9
10
11
12
13 package com.eviware.soapui.model.tree.nodes.support;
14
15 import java.util.Collections;
16 import java.util.List;
17
18 import javax.swing.ImageIcon;
19
20 import com.eviware.soapui.SoapUI;
21 import com.eviware.soapui.model.ModelItem;
22 import com.eviware.soapui.model.settings.Settings;
23 import com.eviware.soapui.model.support.AbstractModelItem;
24
25 /***
26 * Empty ModelItem used by intermediary TreeNodes
27 *
28 * @author ole.matzura
29 */
30
31 public class EmptyModelItem extends AbstractModelItem
32 {
33 private String name;
34 private ImageIcon icon;
35
36 public EmptyModelItem( String name, ImageIcon icon )
37 {
38 this.name = name;
39 this.icon = icon;
40 }
41
42 public void setName( String name )
43 {
44 String oldName = this.name;
45 this.name = name;
46
47 notifyPropertyChanged( ModelItem.NAME_PROPERTY, oldName, name );
48 }
49
50 public String getName()
51 {
52 return name;
53 }
54
55 public ImageIcon getIcon()
56 {
57 return icon;
58 }
59
60 public String getDescription()
61 {
62 return name;
63 }
64
65 public Settings getSettings()
66 {
67 return SoapUI.getSettings();
68 }
69
70 public void release()
71 {
72 }
73
74 public String getId()
75 {
76 return String.valueOf( hashCode() );
77 }
78
79 @SuppressWarnings( "unchecked" )
80 public List<? extends ModelItem> getChildren()
81 {
82 return Collections.EMPTY_LIST;
83 }
84
85 public ModelItem getParent()
86 {
87 return null;
88 }
89 }