-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
3,226 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...lla.gen/resources/customizations/classes/CapellaElement.getAppliedPropertyValueByName.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def get_applied_property_value_by_name(self, p_v_name: str) -> PropertyValue: | ||
for property_value in self.get_applied_property_values(): | ||
if property_value.get_name() == p_v_name: | ||
return property_value | ||
return None | ||
|
6 changes: 6 additions & 0 deletions
6
...en/resources/customizations/classes/CapellaElement.getAppliedPropertyValueGroupByName.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def get_applied_property_value_group_by_name(self, p_v_g_name: str) -> PropertyValueGroup: | ||
for property_value_group in self.get_applied_property_value_groups(): | ||
if property_value_group.get_name() == p_v_g_name: | ||
return property_value_group | ||
return None | ||
|
6 changes: 6 additions & 0 deletions
6
...pella.gen/resources/customizations/classes/CapellaElement.getOwnedPropertyValueByName.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def get_owned_property_value_by_name(self, p_v_name: str) -> PropertyValue: | ||
for property_value in self.get_owned_property_values(): | ||
if property_value.get_name() == p_v_name: | ||
return property_value | ||
return None | ||
|
6 changes: 6 additions & 0 deletions
6
....gen/resources/customizations/classes/CapellaElement.getOwnedPropertyValueGroupByName.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def get_owned_property_value_group_by_name(self, p_v_g_name: str) -> PropertyValueGroup: | ||
for property_value_group in self.get_owned_property_value_groups(): | ||
if property_value_group.get_name() == p_v_g_name: | ||
return property_value_group | ||
return None | ||
|
5 changes: 5 additions & 0 deletions
5
...la.gen/resources/customizations/classes/EnumerationPropertyType.getOwnedLiteralByName.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
def get_owned_literal_by_name(self, literalName: str) -> EnumerationPropertyLiteral: | ||
for literal in self.get_owned_literals(): | ||
if literal.get_name() == literalName: | ||
return literal | ||
|
13 changes: 13 additions & 0 deletions
13
plugins/org.eclipse.python4capella.gen/resources/customizations/classes/PVMT.__init__.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
def __init__(self, java_object = None): | ||
JavaObject.__init__(self, java_object) | ||
@staticmethod | ||
def get_system_engineering(capellaElement: CapellaElement) -> SystemEngineering: | ||
""" | ||
""" | ||
container = capellaElement.get_java_object() | ||
if container is None: | ||
return container | ||
else: | ||
system_engineering_e_class = get_e_classifier("http://www.polarsys.org/capella/core/modeller/" + capella_version(), "SystemEngineering") | ||
if system_engineering_e_class.isInstance(container): | ||
return SystemEngineering(container) | ||
else: | ||
return PVMT.get_system_engineering(JavaObject(container.eContainer())) | ||
|
16 changes: 16 additions & 0 deletions
16
...ipse.python4capella.gen/resources/customizations/classes/PVMT.getAppliedPropertyValue.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@staticmethod | ||
def get_applied_property_value(elem: CapellaElement, propertyValuePackageName: str, propertyValueGroupName: str, propertyValueName: str) -> PropertyValue: | ||
""" | ||
Parameters: elem: CapellaElement, propertyValuePackageName: String, propertyValueGroupName: String, propertyValueName: String | ||
Returns: PropertyValue | ||
""" | ||
systemEngineering = PVMT.get_system_engineering(elem) | ||
pv = PVMT.get_property_value(systemEngineering, propertyValuePackageName, propertyValueGroupName, propertyValueName) | ||
pvg = PropertyValueGroup(pv.get_java_object().eContainer()) | ||
if pvg: | ||
for applied_pvg in elem.get_applied_property_value_groups(): | ||
if applied_pvg.get_applied_property_value_groups().contains(pvg): | ||
for owned_pv in applied_pvg.get_owned_property_values(): | ||
if owned_pv.get_applied_property_values().contains(pv): | ||
return owned_pv | ||
|
11 changes: 11 additions & 0 deletions
11
...e.python4capella.gen/resources/customizations/classes/PVMT.getEnumerationPropertyType.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@staticmethod | ||
def get_enumeration_property_type(systemEngineering: SystemEngineering, propertyValuePackageName: str, typeName: str) -> EnumerationPropertyType: | ||
project = systemEngineering.get_java_object().eContainer() | ||
for ext_package in project.getOwnedPropertyValuePkgs(): | ||
if ext_package.getName() == "EXTENSIONS": | ||
for pv_package in ext_package.getOwnedPropertyValuePkgs(): | ||
if pv_package.getName() == propertyValuePackageName: | ||
for type in pv_package.getOwnedEnumerationPropertyTypes(): | ||
if type.getName() == typeName: | ||
return EnumerationPropertyType(type) | ||
|
22 changes: 22 additions & 0 deletions
22
...python4capella.gen/resources/customizations/classes/PVMT.getOrApplyPropertyValueGroup.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@staticmethod | ||
def get_or_apply_property_value_group(elem: CapellaElement, propertyValuePackageName: str, propertyValueGroupName: str) -> PropertyValue: | ||
systemEngineering = PVMT.get_system_engineering(elem) | ||
pvg = PVMT.get_property_value_group(systemEngineering, propertyValuePackageName, propertyValueGroupName) | ||
if pvg: | ||
for applied_pvg in elem.get_applied_property_value_groups(): | ||
if applied_pvg.get_applied_property_value_groups().contains(pvg): | ||
return applied_pvg | ||
pvg_to_apply = PropertyValueGroup() | ||
pvg_to_apply.set_name(propertyValuePackageName + "." + propertyValueGroupName) | ||
pvg_to_apply.get_applied_property_value_groups().add(pvg) | ||
elem.get_applied_property_value_groups().add(pvg_to_apply) | ||
elem.get_owned_property_value_groups().add(pvg_to_apply) | ||
for pv in pvg.get_owned_property_values(): | ||
pv_to_apply = PropertyValue(None, pv.get_java_object().eClass().getName()) | ||
pv_to_apply.set_name(pv.get_name()) | ||
pv_to_apply.get_applied_property_values().add(pv) | ||
pv_to_apply.set_value(pv.get_value()) | ||
if pv.get_java_object().eClass().getName() == "EnumerationPropertyValue": | ||
pv_to_apply.get_java_object().setType(pv.get_java_object().getType()) | ||
pvg_to_apply.get_owned_property_values().add(pv_to_apply) | ||
|
8 changes: 8 additions & 0 deletions
8
...org.eclipse.python4capella.gen/resources/customizations/classes/PVMT.getPropertyValue.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@staticmethod | ||
def get_property_value(systemEngineering: SystemEngineering, propertyValuePackageName: str, propertyValueGroupName: str, propertyValueName: str) -> PropertyValue: | ||
pvg = PVMT.get_property_value_group(systemEngineering, propertyValuePackageName, propertyValueGroupName) | ||
if pvg: | ||
for pv in pvg.get_owned_property_values(): | ||
if pv.get_name() == propertyValueName: | ||
return pv | ||
|
11 changes: 11 additions & 0 deletions
11
...clipse.python4capella.gen/resources/customizations/classes/PVMT.getPropertyValueGroup.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@staticmethod | ||
def get_property_value_group(systemEngineering: SystemEngineering, propertyValuePackageName: str, propertyValueGroupName: str) -> PropertyValueGroup: | ||
project = systemEngineering.get_java_object().eContainer() | ||
for ext_package in project.getOwnedPropertyValuePkgs(): | ||
if ext_package.getName() == "EXTENSIONS": | ||
for pv_package in ext_package.getOwnedPropertyValuePkgs(): | ||
if pv_package.getName() == propertyValuePackageName: | ||
for pv_group in pv_package.getOwnedPropertyValueGroups(): | ||
if pv_group.getName() == propertyValueGroupName: | ||
return PropertyValueGroup(pv_group) | ||
|
12 changes: 12 additions & 0 deletions
12
...hon4capella.gen/resources/customizations/classes/PVMT.removeAppliedPropertyValueGroup.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@staticmethod | ||
def remove_applied_property_value_group(elem: CapellaElement, propertyValuePackageName: str, propertyValueGroupName: str): | ||
systemEngineering = PVMT.get_system_engineering(elem) | ||
pvg = PVMT.get_property_value_group(systemEngineering, propertyValuePackageName, propertyValueGroupName) | ||
if pvg: | ||
for applied_pvg in elem.get_applied_property_value_groups(): | ||
if applied_pvg.get_applied_property_value_groups().contains(pvg): | ||
elem.get_applied_property_value_groups().remove(applied_pvg) | ||
elem.get_owned_property_value_groups().remove(applied_pvg) | ||
EObject.delete_e_object(applied_pvg) | ||
break | ||
|
7 changes: 6 additions & 1 deletion
7
...s/org.eclipse.python4capella.gen/resources/customizations/classes/PropertyValue.value.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,13 @@ | ||
def get_value(self) -> Any: | ||
if self.java_object.eClass().getName() == "BooleanPropertyValue": | ||
return self.get_java_object().isValue() | ||
elif self.java_object.eClass().getName() == "EnumerationPropertyValue": | ||
return EnumerationPropertyLiteral(self.get_java_object().getValue()) | ||
else: | ||
return self.get_java_object().getValue() | ||
def set_value(self, value: Any): | ||
self.get_java_object().setValue(value) | ||
if isinstance(value, JavaObject): | ||
self.get_java_object().setValue(value.get_java_object()) | ||
else: | ||
self.get_java_object().setValue(value) | ||
|
Oops, something went wrong.