Updated to new SWTHelper version
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / ViewModelModifiable.java
1 package net.mograsim.logic.ui.model;
2
3 import java.util.Set;
4
5 import net.mograsim.logic.ui.model.components.GUIComponent;
6 import net.mograsim.logic.ui.model.wires.GUIWire;
7
8 public class ViewModelModifiable extends ViewModel
9 {
10         public String getDefaultComponentName(GUIComponent component)
11         {
12                 Set<String> componentNames = getComponentsByName().keySet();
13                 String nameBase = component.getClass().getSimpleName() + '#';
14                 for (int i = 0;; i++)
15                 {
16                         String nameCandidate = nameBase + i;
17                         if (!componentNames.contains(nameCandidate))
18                                 return nameCandidate;
19                 }
20         }
21
22         @Override
23         public void componentCreated(GUIComponent component)
24         {
25                 super.componentCreated(component);
26         }
27
28         @Override
29         public void componentDestroyed(GUIComponent component)
30         {
31                 super.componentDestroyed(component);
32         }
33
34         @Override
35         public void wireCreated(GUIWire wire)
36         {
37                 super.wireCreated(wire);
38         }
39
40         @Override
41         public void wireDestroyed(GUIWire wire)
42         {
43                 super.wireDestroyed(wire);
44         }
45 }