Commit 04ff0c53 authored by Dongyue Mou's avatar Dongyue Mou
Browse files

fixed bug that the functions of minimal guarantee and success guarantee button are mixed

refs 48
parent 99b76131
...@@ -24,8 +24,8 @@ import org.eclipse.swt.events.SelectionEvent; ...@@ -24,8 +24,8 @@ import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.fortiss.af3.micro.model.architecture.component.Component; import org.fortiss.af3.micro.model.architecture.component.Component;
import org.fortiss.af3.micro.model.behavior.state.State; import org.fortiss.af3.micro.model.behavior.state.State;
import org.fortiss.af3.mira.model.usecase.MinimumgaranteeSpecification;
import org.fortiss.af3.mira.model.usecase.ScopeSpecification; import org.fortiss.af3.mira.model.usecase.ScopeSpecification;
import org.fortiss.af3.mira.model.usecase.SuccessgaranteeSpecification;
import org.fortiss.af3.mira.model.usecase.UseCase; import org.fortiss.af3.mira.model.usecase.UseCase;
import org.fortiss.af3.mira.model.usecase.UsecaseFactory; import org.fortiss.af3.mira.model.usecase.UsecaseFactory;
import org.fortiss.af3.mira.ui.dialog.StateSelectionDialog; import org.fortiss.af3.mira.ui.dialog.StateSelectionDialog;
...@@ -82,8 +82,8 @@ public class UseCaseAssignSuccessgaranteeLogic extends SelectionAdapter { ...@@ -82,8 +82,8 @@ public class UseCaseAssignSuccessgaranteeLogic extends SelectionAdapter {
return; return;
for (IModelElementSpecification ref : state.getSpecificationsList()) { for (IModelElementSpecification ref : state.getSpecificationsList()) {
if (ref instanceof MinimumgaranteeSpecification if (ref instanceof SuccessgaranteeSpecification
&& ((MinimumgaranteeSpecification) ref).getReference() == editedObject) { && ((SuccessgaranteeSpecification) ref).getReference() == editedObject) {
return; return;
} }
} }
...@@ -94,14 +94,14 @@ public class UseCaseAssignSuccessgaranteeLogic extends SelectionAdapter { ...@@ -94,14 +94,14 @@ public class UseCaseAssignSuccessgaranteeLogic extends SelectionAdapter {
for (IModelElementReference ref : editedObject for (IModelElementReference ref : editedObject
.getReferencedByList().toArray( .getReferencedByList().toArray(
new IModelElementReference[0])) { new IModelElementReference[0])) {
if (ref instanceof MinimumgaranteeSpecification) { if (ref instanceof SuccessgaranteeSpecification) {
editedObject.getReferencedByList().remove(ref); editedObject.getReferencedByList().remove(ref);
EcoreUtil.delete(ref); EcoreUtil.delete(ref);
} }
} }
MinimumgaranteeSpecification spec = UsecaseFactory.eINSTANCE SuccessgaranteeSpecification spec = UsecaseFactory.eINSTANCE
.createMinimumgaranteeSpecification(); .createSuccessgaranteeSpecification();
spec.setId(editedObject.getId()); spec.setId(editedObject.getId());
spec.setName("Ref: " + editedObject.getId()); spec.setName("Ref: " + editedObject.getId());
state.getSpecificationsList().add(spec); state.getSpecificationsList().add(spec);
......
...@@ -24,8 +24,8 @@ import org.eclipse.swt.events.SelectionEvent; ...@@ -24,8 +24,8 @@ import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
import org.fortiss.af3.micro.model.architecture.component.Component; import org.fortiss.af3.micro.model.architecture.component.Component;
import org.fortiss.af3.micro.model.behavior.state.State; import org.fortiss.af3.micro.model.behavior.state.State;
import org.fortiss.af3.mira.model.usecase.MinimumgaranteeSpecification;
import org.fortiss.af3.mira.model.usecase.ScopeSpecification; import org.fortiss.af3.mira.model.usecase.ScopeSpecification;
import org.fortiss.af3.mira.model.usecase.SuccessgaranteeSpecification;
import org.fortiss.af3.mira.model.usecase.UseCase; import org.fortiss.af3.mira.model.usecase.UseCase;
import org.fortiss.af3.mira.model.usecase.UsecaseFactory; import org.fortiss.af3.mira.model.usecase.UsecaseFactory;
import org.fortiss.af3.mira.ui.dialog.StateSelectionDialog; import org.fortiss.af3.mira.ui.dialog.StateSelectionDialog;
...@@ -82,8 +82,8 @@ public class UseCaseAssignminimalgaranteeLogic extends SelectionAdapter { ...@@ -82,8 +82,8 @@ public class UseCaseAssignminimalgaranteeLogic extends SelectionAdapter {
return; return;
for (IModelElementSpecification ref : state.getSpecificationsList()) { for (IModelElementSpecification ref : state.getSpecificationsList()) {
if (ref instanceof SuccessgaranteeSpecification if (ref instanceof MinimumgaranteeSpecification
&& ((SuccessgaranteeSpecification) ref).getReference() == editedObject) { && ((MinimumgaranteeSpecification) ref).getReference() == editedObject) {
return; return;
} }
} }
...@@ -94,14 +94,14 @@ public class UseCaseAssignminimalgaranteeLogic extends SelectionAdapter { ...@@ -94,14 +94,14 @@ public class UseCaseAssignminimalgaranteeLogic extends SelectionAdapter {
for (IModelElementReference ref : editedObject for (IModelElementReference ref : editedObject
.getReferencedByList().toArray( .getReferencedByList().toArray(
new IModelElementReference[0])) { new IModelElementReference[0])) {
if (ref instanceof SuccessgaranteeSpecification) { if (ref instanceof MinimumgaranteeSpecification) {
editedObject.getReferencedByList().remove(ref); editedObject.getReferencedByList().remove(ref);
EcoreUtil.delete(ref); EcoreUtil.delete(ref);
} }
} }
SuccessgaranteeSpecification spec = UsecaseFactory.eINSTANCE MinimumgaranteeSpecification spec = UsecaseFactory.eINSTANCE
.createSuccessgaranteeSpecification(); .createMinimumgaranteeSpecification();
spec.setId(editedObject.getId()); spec.setId(editedObject.getId());
spec.setName("Ref: " + editedObject.getId()); spec.setName("Ref: " + editedObject.getId());
state.getSpecificationsList().add(spec); state.getSpecificationsList().add(spec);
......
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