Commit de643550 authored by Liana Soima's avatar Liana Soima
Browse files

Ecore default values



AutomaticSetListener cast fixed + ecore default values of undeveloped
entities + bugfix GSNStates.
Signed-off-by: Liana Soima's avatarLiana Soima <soima@fortiss.org>
Issue-Ref: 3979
parent 89b928f7
......@@ -252,7 +252,7 @@ public class GSNStatesPropertySection extends PropertySectionBase {
} else {
isPrivateCheckbox.setVisible(false);
}
isInstantiatedCheckbox.setSelection(currentlySelectedSection.isToBeInstantiated());
isInstantiatedCheckbox.setSelection(!currentlySelectedSection.isToBeInstantiated());
if(getActualMaintainanceStatus(currentlySelectedSection) == CHALLENGED) {
isChallengedCheckbox.setSelection(true);
} else {
......@@ -281,16 +281,11 @@ public class GSNStatesPropertySection extends PropertySectionBase {
isUndevelopedCheckbox.setVisible(true);
if(currentlySelectedSection instanceof Goal) {
isUndevelopedCheckbox
.setSelection(((Goal)currentlySelectedSection).isToBeDeveloped());
.setSelection(!((Goal)currentlySelectedSection).isToBeDeveloped());
}
if(currentlySelectedSection instanceof Strategy) {
if(((Strategy)currentlySelectedSection).isToBeDeveloped() == true) {
isUndevelopedCheckbox.setSelection(false);
} else {
isUndevelopedCheckbox.setSelection(true);
}
isUndevelopedCheckbox
.setSelection(((Strategy)currentlySelectedSection).isToBeDeveloped());
.setSelection(!((Strategy)currentlySelectedSection).isToBeDeveloped());
}
} else {
isUndevelopedCheckbox.setVisible(false);
......
......@@ -99,7 +99,8 @@
</eOperations>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="DecomposableSpinalElement" eSuperTypes="#//SpinalElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="toBeDeveloped" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="toBeDeveloped" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"
defaultValueLiteral="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="scope" eType="ecore:EClass platform:/resource/org.fortiss.af3.component/model/component.ecore#//Component"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="VISIBILITY">
......
......@@ -31,9 +31,8 @@ import org.fortiss.af3.project.model.FileProject;
import org.fortiss.af3.safetyargumentationpackage.model.SafetyArgumentationPackage;
import org.fortiss.af3.safetycases.AF3SafetyCasesActivator;
import org.fortiss.af3.safetycases.model.ArgumentElement;
import org.fortiss.af3.safetycases.model.DecomposableSpinalElement;
import org.fortiss.af3.safetycases.model.ExitConnector;
import org.fortiss.af3.safetycases.model.Goal;
import org.fortiss.af3.safetycases.model.Strategy;
import org.fortiss.tooling.base.model.base.HierarchicElementBase;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
......@@ -112,26 +111,16 @@ public class AutomaticSetListener extends EContentAdapter {
HierarchicElementBase element =
((ExitConnector)notification.getNotifier()).getGSNElement();
if(notification.getEventType() == Notification.ADD) {
if(element instanceof Goal) {
((Goal)element).setToBeDeveloped(false);
}
if(element instanceof Strategy) {
((Strategy)element).setToBeDeveloped(false);
if(element instanceof DecomposableSpinalElement) {
((DecomposableSpinalElement)element).setToBeDeveloped(false);
}
} else if(notification.getEventType() == Notification.REMOVE) {
if(element instanceof Goal) {
List<ExitConnector> connectors = ((Goal)element).getExitConnectors().stream()
.filter(e -> !e.getOutgoing().isEmpty()).collect(Collectors.toList());
if(connectors.isEmpty()) {
((Goal)element).setToBeDeveloped(true);
}
}
if(element instanceof Strategy) {
List<ExitConnector> connectors = ((Strategy)element).getExitConnectors()
.stream().filter(e -> !e.getOutgoing().isEmpty())
if(element instanceof DecomposableSpinalElement) {
List<ExitConnector> connectors = ((DecomposableSpinalElement)element)
.getExitConnectors().stream().filter(e -> !e.getOutgoing().isEmpty())
.collect(Collectors.toList());
if(connectors.isEmpty()) {
((Strategy)element).setToBeDeveloped(true);
((DecomposableSpinalElement)element).setToBeDeveloped(true);
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment