public void setUpUMLModelElement() {
if (umlModelElement == null) {
IModelService md = null;
IGroupService parent = getContainerService();
Package parentElement = null;
if (parent instanceof IPackageService) {
IPackageService pk = (IPackageService) parent;
parentElement = pk.getUMLElement();
} else if (parent instanceof IModelService) {
md = (IModelService) parent;
parentElement = md.getUMLElement();
}
// If the parent element is a package,
if (
(parentElement != null)
&& (parent instanceof IPackageService)
&& (umlModelElement == null)
) {
// Then we create a nested package
umlModelElement =
parentElement.createNestedPackage(getSimpleName());
} else if (
(parent instanceof IModelService)
&&(parentElement!=null)
) {
/*
* Else, if the parent is the model,
* If we have the primitive types package or the class path
*/
if(
(getSimpleName().equals("Primitive types"))
||(getSimpleName().equals("classpath"))
) {
// Then we create a dedicated package
umlModelElement =
parentElement.createNestedPackage(getSimpleName());
umlModelElement.setVisibility(
VisibilityKind.PRIVATE_LITERAL
);
}
else {