[New] Added Activity.addElementAfter|Before(String, IActivityElement)

This commit is contained in:
Robert von Burg 2023-02-27 10:48:43 +01:00
parent 378390d5a1
commit 4cdddd21be
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 27 additions and 1 deletions

View File

@ -176,6 +176,19 @@ public class Activity extends AbstractStrolchRootElement
this.elements.put(activityElement.getId(), activityElement);
}
/**
* add an activity element to the {@code LinkedHashMap} of {@code IActivityElements} before the given element
*
* @param elementId
* the id of the element before which to add the other element
* @param elementToAdd
* the element to add
*/
public void addElementBefore(String elementId, IActivityElement elementToAdd) {
IActivityElement element = getElement(elementId);
addElementBefore(element, elementToAdd);
}
/**
* add an activity element to the {@code LinkedHashMap} of {@code IActivityElements} before the given element
*
@ -208,11 +221,24 @@ public class Activity extends AbstractStrolchRootElement
this.elements = elements;
}
/**
* add an activity element to the {@code LinkedHashMap} of {@code IActivityElements} after the given element
*
* @param elementId
* the id of the element after which to add the other element
* @param elementToAdd
* the element to add
*/
public void addElementAfter(String elementId, IActivityElement elementToAdd) {
IActivityElement element = getElement(elementId);
addElementAfter(element, elementToAdd);
}
/**
* add an activity element to the {@code LinkedHashMap} of {@code IActivityElements} after the given element
*
* @param element
* the element before which to add the other element
* the element after which to add the other element
* @param elementToAdd
* the element to add
*/