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

Changed MetaModel



Change impact was added to metamodel.
Signed-off-by: Liana Soima's avatarLiana Soima <soima@fortiss.org>
Issue-Ref: 3986
parent b47c281c
......@@ -18,16 +18,13 @@ package org.fortiss.af3.safetycases.ui.commands;
import static java.util.Collections.emptyList;
import static org.eclipse.jface.dialogs.MessageDialog.openConfirm;
import static org.eclipse.swt.widgets.Display.getCurrent;
import static org.fortiss.af3.safetycases.model.ChangeAffectionType.NONE;
import static org.fortiss.tooling.kernel.service.IPersistencyService.getInstance;
import static org.fortiss.tooling.kernel.ui.service.IContextMenuService.AFTER_GLOBAL_MENU_SECTION_ID;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IContributionItem;
import org.fortiss.af3.safetycases.model.ArgumentElement;
import org.fortiss.af3.safetycases.ui.AF3SafetyCasesUIActivator;
......@@ -47,14 +44,16 @@ public class ChangeAffectionSolved implements IContextMenuContributor {
@Override
public List<IContributionItem> getContributedItems(EObject selection,
ContextMenuContextProvider contextProvider) {
if(selection instanceof ArgumentElement &&
(!(((ArgumentElement)selection).getAffectedByChange() != null) ||
!((ArgumentElement)selection).getAffectedByChange().equals(NONE))) {
List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
contributionItems.add(new ActionContributionItem(
new ChangeAffectionSolvedAction((ArgumentElement)selection)));
return contributionItems;
}
/*
* if(selection instanceof ArgumentElement &&
* (!(((ArgumentElement)selection).getAffectedByChange() != null) ||
* !((ArgumentElement)selection).getAffectedByChange().equals(NONE))) {
* List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
* contributionItems.add(new ActionContributionItem(
* new ChangeAffectionSolvedAction((ArgumentElement)selection)));
* return contributionItems;
* }
*/
return emptyList();
}
......@@ -88,7 +87,7 @@ public class ChangeAffectionSolved implements IContextMenuContributor {
boolean go = openConfirm(getCurrent().getActiveShell(), "",
"Are you sure you want to set the effect to this element to solved?");
if(go) {
selectedArgumentElement.setAffectedByChange(NONE);
// selectedArgumentElement.setAffectedByChange(NONE);
}
// code for changing to affection solved for all elements at once
/*
......
......@@ -311,22 +311,35 @@
<eLiterals name="UNCERTAIN"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Maintainable" abstract="true" interface="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="affectedByChange" eType="#//ChangeAffectionType"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="systemModelChangeImmune"
eType="#//ModelChangeEffect"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="affectedByCurrentChanges"
upperBound="-1" eType="#//Change"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ModelChangeEffect">
<eStructuralFeatures xsi:type="ecore:EReference" name="modelElement" eType="ecore:EClass platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElement"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="hasImpact" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="ChangeAffectionType">
<eLiterals name="None"/>
<eLiterals name="ActuallyImpacted"/>
<eLiterals name="Challenged"/>
<eLiterals name="PotentialyImpacted"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="ArgumentModuleInterface" abstract="true"
interface="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="visibility" eType="#//VISIBILITY"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="maintenanceStatus">
<eLiterals name="Challenged"/>
<eLiterals name="ActuallyImpacted"/>
<eLiterals name="PotentiallyImpacted"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EEnum" name="TypeOfChange">
<eLiterals name="Add"/>
<eLiterals name="Modified"/>
<eLiterals name="Delete"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Change" eSuperTypes="platform:/resource/org.fortiss.tooling.base/model/base.ecore#//base/HierarchicElementBase">
<eStructuralFeatures xsi:type="ecore:EReference" name="modelElement" eType="ecore:EClass platform:/resource/org.fortiss.tooling.base/model/base.ecore#//element/IModelElement"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="personalizedTypeOfChange"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="predefinedTypeOfChange"
eType="#//TypeOfChange"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="maintainanceCause" eType="#//maintenanceStatus"/>
</eClassifiers>
</ecore:EPackage>
......@@ -33,11 +33,15 @@
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//EvidenceStatus/OUTDATED"/>
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//EvidenceStatus/UNCERTAIN"/>
</genEnums>
<genEnums typeSafeEnumCompatible="false" ecoreEnum="safetycases.ecore#//ChangeAffectionType">
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//ChangeAffectionType/None"/>
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//ChangeAffectionType/ActuallyImpacted"/>
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//ChangeAffectionType/Challenged"/>
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//ChangeAffectionType/PotentialyImpacted"/>
<genEnums typeSafeEnumCompatible="false" ecoreEnum="safetycases.ecore#//maintenanceStatus">
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//maintenanceStatus/Challenged"/>
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//maintenanceStatus/ActuallyImpacted"/>
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//maintenanceStatus/PotentiallyImpacted"/>
</genEnums>
<genEnums typeSafeEnumCompatible="false" ecoreEnum="safetycases.ecore#//TypeOfChange">
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//TypeOfChange/Add"/>
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//TypeOfChange/Modified"/>
<genEnumLiterals ecoreEnumLiteral="safetycases.ecore#//TypeOfChange/Delete"/>
</genEnums>
<genClasses ecoreClass="safetycases.ecore#//Goal">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference safetycases.ecore#//Goal/safetyRequirement"/>
......@@ -207,8 +211,8 @@
</genClasses>
<genClasses ecoreClass="safetycases.ecore#//AwayContractModule"/>
<genClasses image="false" ecoreClass="safetycases.ecore#//Maintainable">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute safetycases.ecore#//Maintainable/affectedByChange"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference safetycases.ecore#//Maintainable/systemModelChangeImmune"/>
<genFeatures createChild="false" ecoreFeature="ecore:EReference safetycases.ecore#//Maintainable/affectedByCurrentChanges"/>
</genClasses>
<genClasses ecoreClass="safetycases.ecore#//ModelChangeEffect">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference safetycases.ecore#//ModelChangeEffect/modelElement"/>
......@@ -217,5 +221,11 @@
<genClasses image="false" ecoreClass="safetycases.ecore#//ArgumentModuleInterface">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute safetycases.ecore#//ArgumentModuleInterface/visibility"/>
</genClasses>
<genClasses ecoreClass="safetycases.ecore#//Change">
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference safetycases.ecore#//Change/modelElement"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute safetycases.ecore#//Change/personalizedTypeOfChange"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute safetycases.ecore#//Change/predefinedTypeOfChange"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute safetycases.ecore#//Change/maintainanceCause"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
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