コード例 #1
0
 public void deleteGroup(LanguageGroup group, LanguageGroup parent, Language language) {
   Element languageElement = this.getLanguageElement(language);
   Element parentElement = getParentElement(parent, language);
   Element groupElement = factory.getGroupElement(languageElement, group);
   if (parentElement != null && groupElement != null) {
     parentElement.removeChild(groupElement);
     writeDocument();
   }
 }
コード例 #2
0
 public boolean editGroup(LanguageGroup group, Language language) {
   Element languageElement = this.getLanguageElement(language);
   Element element = factory.getGroupElement(languageElement, group);
   if (element != null) {
     factory.groupToElement(group, element);
     writeDocument();
     return true;
   }
   return false;
 }
コード例 #3
0
  private Element getParentElement(LanguageGroup parent, Language language) {
    Element languageElement = this.getLanguageElement(language);
    Element parentElement = null;
    if (parent == language) {
      parentElement = languageElement;
    } else {
      parentElement = factory.getGroupElement(languageElement, parent);
    }

    return parentElement;
  }