return localeString;
}
public Element getAsElement()
{
Element root = new Element("KeyboardConfiguration");
Element li = new Element(Element_LanguageInfo);
root.addContent(li);
li.setAttribute(Attr_Name, name);
li.setAttribute(Attr_NativeName, nativeName);
li.setAttribute(Attr_Font, fontName);
li.setAttribute(Attr_FixedWidthFont, fixedWidthFontName);
li.setAttribute(Attr_LocaleString, localeString.isEmpty() ? "international" : localeString.get(0));
if (localeString.size() > 1)
{
Element countries = new Element(ELEMENT_COUNTRIES);
for (int i = 1; i < localeString.size(); i++)
{
String[] split = localeString.get(i).split("-");
if (split != null && split.length == 2)
{
Element country = new Element(ELEMENT_COUNTRY);
country.setAttribute(ATTR_CODE, split[1]);
countries.addContent(country);
}
}
if (countries.getChildren().isEmpty())
li.addContent(countries);
}
Element keyboard;
// backwards Translation key
if (org.size() > 0)
{
Element et = new Element(Show);
li.setContent(et);
for (int f = 0; f < org.size(); f++)
{
Element ett = new Element(in);
et.addContent(ett);
ett.setAttribute(new org.jdom2.Attribute("org", org.get(f)));
ett.setAttribute(new org.jdom2.Attribute("translate", trans.get(f)));
}
}
if (imeList.size() > 0)
for (int f = 0; f < imeList.size(); f++)
{
Element et = new Element(IME);
et.setAttribute(new org.jdom2.Attribute(IME, imeList.get(f)));
li.addContent(et);
}
for (int i = 0; i < size(); i++)
{
keyboard = new Element(Element_Keyboard);
li.addContent(keyboard);
for (LinkedList<KeyboardKey> list : this.get(i))
{
Element line = new Element(Element_Line);
keyboard.addContent(line);
for (KeyboardKey kk : list)
line.addContent(kk.getAsElement());
}
}
return root;
}