+ public String getDefaultComponentName(GUIComponent component)
+ {
+ Set<String> componentNames = getComponentsByName().keySet();
+ String nameBase = component.getClass().getSimpleName() + '#';
+ for (int i = 0;; i++)
+ {
+ String nameCandidate = nameBase + i;
+ if (!componentNames.contains(nameCandidate))
+ return nameCandidate;
+ }
+ }
+