Commit 6ef1c2c6 authored by Saad bin Abid's avatar Saad bin Abid
Browse files

fixed the problem with not been able to see the written action and the guard...

fixed the problem with not been able to see the written action and the guard in the property view of the transition Segment Specification of state machine. Issue Identifier: Vincent.
parent dab9e73d
......@@ -75,6 +75,7 @@ public final class ComponentSpecificationPropertySection extends PropertySection
/** The selected {@link CausalityComponentSpecification}. */
private CausalityComponentSpecification specification;
/** for capturing the external relation specification */
ExternalRelationSpecification spec;
/** Stores causality flag button. */
......@@ -82,6 +83,7 @@ public final class ComponentSpecificationPropertySection extends PropertySection
/** Stores component implement the requirement correctly flag button. */
private Button componentImplReqButton;
/** Label for the "component implement requirement" text. */
private Label componentImplreqLabel;
......@@ -172,15 +174,21 @@ public final class ComponentSpecificationPropertySection extends PropertySection
.map(e -> e.getExternalRelation().getSourceRequirement().getReqId())
.collect(Collectors.toSet());
showTraces.setText(StringUtils.join(traces, ", "));
// if traces size is 0 (i.e., Traced To) disable the button
if(traces.size() == 0) {
componentImplReqButton.setEnabled(false);
componentImplreqLabel.setEnabled(false);
} else {
componentImplReqButton.setEnabled(true);
componentImplreqLabel.setEnabled(true);
spec =
pickInstanceOf(ExternalRelationSpecification.class,
component.getSpecifications()).get(0);
// check if the first instance of externalRelationSpecification is not null using get(0)
if(pickInstanceOf(ExternalRelationSpecification.class, component.getSpecifications())
.get(0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification
spec =
pickInstanceOf(ExternalRelationSpecification.class,
component.getSpecifications()).get(0);
}
}
enableStronglyCausal(component.getContainedElements().isEmpty());
......@@ -207,18 +215,19 @@ public final class ComponentSpecificationPropertySection extends PropertySection
@Override
public void refresh() {
super.refresh();
if(specification == null || verifBehaviourSpec == null || spec == null) {
if(specification == null || verifBehaviourSpec == null) {
return;
}
IObservableValue modelObservable =
observeValue(specification, CAUSALITY_COMPONENT_SPECIFICATION__STRONGLY_CAUSAL);
dbc.bindValue(SWTObservables.observeSelection(stronglyCausalButton), modelObservable, null,
null);
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(componentImplReqButton), modelObservable1,
null, null);
if(spec != null) {
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(componentImplReqButton),
modelObservable1, null, null);
}
}
}
......@@ -68,10 +68,12 @@ public class EnumPropertySection extends PropertySectionBase {
private Label detachLabel;
/** The detach button. */
private Button detachButton;
/** Stores state enumeration implement the requirement correctly flag button. */
/** Stores enumeration implement the requirement correctly check button. */
private Button enumerationImplReqButton;
/** Label for the "state automaton implement requirement" text. */
/** Label for the "enumeration implement requirement" text. */
private Label enumerationImplreqLabel;
/** for capturing the external relation specification from the set of specifications */
ExternalRelationSpecification spec;
/** {@inheritDoc} */
......@@ -130,15 +132,21 @@ public class EnumPropertySection extends PropertySectionBase {
.map(e -> e.getExternalRelation().getSourceRequirement().getReqId())
.collect(Collectors.toSet());
showTraces.setText(StringUtils.join(traces, ", "));
// if traces are 0 disable the check button "Correctly Implement Req."
if(traces.size() == 0) {
enumerationImplReqButton.setEnabled(false);
enumerationImplreqLabel.setEnabled(false);
} else {
enumerationImplReqButton.setEnabled(true);
enumerationImplreqLabel.setEnabled(true);
spec =
pickInstanceOf(ExternalRelationSpecification.class,
enumeration.getSpecifications()).get(0);
// check if the first instance of externalRelationSpecification is not null using get(0)
if(pickInstanceOf(ExternalRelationSpecification.class, enumeration.getSpecifications())
.get(0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification
spec =
pickInstanceOf(ExternalRelationSpecification.class,
enumeration.getSpecifications()).get(0);
}
}
}
......@@ -146,14 +154,14 @@ public class EnumPropertySection extends PropertySectionBase {
@Override
public void refresh() {
super.refresh();
if(spec == null) {
return;
if(spec != null) {
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(enumerationImplReqButton),
modelObservable1, null, null);
}
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(enumerationImplReqButton), modelObservable1,
null, null);
if(enumeration instanceof EnumerationRef) {
detachLabel.setVisible(true);
detachButton.setVisible(true);
......
......@@ -57,10 +57,12 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase
/** Text section showing the traces */
private Text showTraces;
/** Stores state enumeration member implement the requirement correctly flag button. */
/** enumeration member implement the requirement correctly check button. */
private Button enumerationMemberImplReqButton;
/** Label for the "state automaton implement requirement" text. */
/** Label for the "enumeration member implement requirement" text. */
private Label enumerationMemberImplreqLabel;
/** for capturing the external relation specification */
ExternalRelationSpecification spec;
/** {@inheritDoc} */
......@@ -92,9 +94,14 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase
} else {
enumerationMemberImplReqButton.setEnabled(true);
enumerationMemberImplreqLabel.setEnabled(true);
spec =
pickInstanceOf(ExternalRelationSpecification.class, member.getSpecifications())
.get(0);
// check if the first instance of externalRelationSpecification is not null using get(0)
if(pickInstanceOf(ExternalRelationSpecification.class, member.getSpecifications()).get(
0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification
spec =
pickInstanceOf(ExternalRelationSpecification.class,
member.getSpecifications()).get(0);
}
}
}
......@@ -102,13 +109,12 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase
@Override
public void refresh() {
super.refresh();
if(spec == null) {
return;
if(spec != null) {
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(enumerationMemberImplReqButton),
modelObservable1, null, null);
}
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(enumerationMemberImplReqButton),
modelObservable1, null, null);
}
}
......@@ -67,6 +67,8 @@ public final class StructureMemberPropertySection extends PropertySectionBase {
private Button structureMemberImplReqButton;
/** Label for the "structure member implement requirement" text. */
private Label structureMemberImplreqLabel;
/** For capturing the External Relation Specification */
ExternalRelationSpecification spec;
/** {@inheritDoc} */
......@@ -99,9 +101,14 @@ public final class StructureMemberPropertySection extends PropertySectionBase {
} else {
structureMemberImplReqButton.setEnabled(true);
structureMemberImplreqLabel.setEnabled(true);
spec =
pickInstanceOf(ExternalRelationSpecification.class, member.getSpecifications())
.get(0);
// check if the first instance of externalRelationSpecification is not null using get(0)
if(pickInstanceOf(ExternalRelationSpecification.class, member.getSpecifications()).get(
0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification
spec =
pickInstanceOf(ExternalRelationSpecification.class,
member.getSpecifications()).get(0);
}
}
}
......@@ -109,15 +116,13 @@ public final class StructureMemberPropertySection extends PropertySectionBase {
@Override
public void refresh() {
super.refresh();
if(spec == null) {
return;
if(spec != null) {
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(structureMemberImplReqButton),
modelObservable1, null, null);
}
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(structureMemberImplReqButton),
modelObservable1, null, null);
IObservableValue modelObservable =
observeValue(member, DefinitionsPackage.Literals.STRUCTURE_MEMBER__TYPE);
performComplexTextBinding(dbc, memberTypeText, modelObservable,
......
......@@ -69,10 +69,11 @@ public class StructurePropertySection extends PropertySectionBase {
/** The detach button. */
private Button detachButton;
/** Stores structure member implement the requirement correctly flag button. */
/** Stores structure implement the requirement correctly flag button. */
private Button structureImplReqButton;
/** Label for the "structure member implement requirement" text. */
/** Label for the "structure implement requirement" text. */
private Label structureImplreqLabel;
/** For capturing the external relation specification */
ExternalRelationSpecification spec;
/** {@inheritDoc} */
......@@ -137,9 +138,14 @@ public class StructurePropertySection extends PropertySectionBase {
} else {
structureImplReqButton.setEnabled(true);
structureImplreqLabel.setEnabled(true);
spec =
pickInstanceOf(ExternalRelationSpecification.class,
structure.getSpecifications()).get(0);
// check if the first instance of externalRelationSpecification is not null using get(0)
if(pickInstanceOf(ExternalRelationSpecification.class, structure.getSpecifications())
.get(0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification
spec =
pickInstanceOf(ExternalRelationSpecification.class,
structure.getSpecifications()).get(0);
}
}
}
......@@ -147,14 +153,13 @@ public class StructurePropertySection extends PropertySectionBase {
@Override
public void refresh() {
super.refresh();
if(spec == null) {
return;
if(spec != null) {
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(structureImplReqButton),
modelObservable1, null, null);
}
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(structureImplReqButton), modelObservable1,
null, null);
if(structure instanceof StructureRef) {
detachLabel.setVisible(true);
detachButton.setVisible(true);
......
......@@ -59,6 +59,8 @@ public class StateAutomatonPropertySection extends PropertySectionBase {
private Button stateautomatonImplReqButton;
/** Label for the "state automaton implement requirement" text. */
private Label stateautomatonImplreqLabel;
/** For capturing the external relation specification */
ExternalRelationSpecification spec;
/** {@inheritDoc} */
......@@ -90,9 +92,14 @@ public class StateAutomatonPropertySection extends PropertySectionBase {
} else {
stateautomatonImplReqButton.setEnabled(true);
stateautomatonImplreqLabel.setEnabled(true);
spec =
pickInstanceOf(ExternalRelationSpecification.class,
stateAutomaton.getSpecifications()).get(0);
// check if the first instance of externalRelationSpecification is not null using get(0)
if(pickInstanceOf(ExternalRelationSpecification.class,
stateAutomaton.getSpecifications()).get(0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification
spec =
pickInstanceOf(ExternalRelationSpecification.class,
stateAutomaton.getSpecifications()).get(0);
}
}
}
......@@ -100,13 +107,12 @@ public class StateAutomatonPropertySection extends PropertySectionBase {
@Override
public void refresh() {
super.refresh();
if(spec == null) {
return;
if(spec != null) {
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(stateautomatonImplReqButton),
modelObservable1, null, null);
}
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(stateautomatonImplReqButton),
modelObservable1, null, null);
}
}
......@@ -90,10 +90,12 @@ public class StateSpecificationPropertySection extends PropertySectionBase {
/** User selection flag */
private boolean userSelection;
/** Stores component implement the requirement correctly flag button. */
/** Stores state implement the requirement correctly check button. */
private Button stateImplReqButton;
/** Label for the "state implement requirement" text. */
private Label stateImplreqLabel;
/** For capturing the External Relation Specification */
ExternalRelationSpecification spec;
/** {@inheritDoc} */
......@@ -185,9 +187,14 @@ public class StateSpecificationPropertySection extends PropertySectionBase {
} else {
stateImplReqButton.setEnabled(true);
stateImplreqLabel.setEnabled(true);
spec =
pickInstanceOf(ExternalRelationSpecification.class, state.getSpecifications())
.get(0);
// check if the first instance of externalRelationSpecification is not null using get(0)
if(pickInstanceOf(ExternalRelationSpecification.class, state.getSpecifications())
.get(0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification
spec =
pickInstanceOf(ExternalRelationSpecification.class,
state.getSpecifications()).get(0);
}
}
idleTransitionSpecification = state.getIdleTransitionSpecification();
if(idleTransitionSpecification == null) {
......@@ -201,7 +208,7 @@ public class StateSpecificationPropertySection extends PropertySectionBase {
public void refresh() {
super.refresh();
if(specification == null || spec == null) {
if(specification == null) {
return;
}
......@@ -211,11 +218,12 @@ public class StateSpecificationPropertySection extends PropertySectionBase {
performComplexTextBinding(dbc, idleActionsText, actionsObservable,
new ActionsToStringConverter(), new StringToActionsConverter(specification),
new StringToActionsValidator(specification), null);
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(stateImplReqButton), modelObservable1, null,
null);
if(spec != null) {
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(stateImplReqButton), modelObservable1,
null, null);
}
}
}
......@@ -107,6 +107,8 @@ public class TransitionSegmentSpecificationPropertySection extends
private Button transitionSegmentImplReqButton;
/** Label for the "state implement requirement" text. */
private Label transitionSegmentImplreqLabel;
/** For capturing the external Relation Specification */
ExternalRelationSpecification spec;
/** {@inheritDoc} */
......@@ -174,15 +176,21 @@ public class TransitionSegmentSpecificationPropertySection extends
.map(e -> e.getExternalRelation().getSourceRequirement().getReqId())
.collect(Collectors.toSet());
showTraces.setText(StringUtils.join(traces, ", "));
// check if the traces are not 0 if yes disable the button
if(traces.size() == 0) {
transitionSegmentImplReqButton.setEnabled(false);
transitionSegmentImplreqLabel.setEnabled(false);
} else {
transitionSegmentImplReqButton.setEnabled(true);
transitionSegmentImplreqLabel.setEnabled(true);
spec =
pickInstanceOf(ExternalRelationSpecification.class,
((TransitionSegment)input).getSpecifications()).get(0);
// check if the first instance of externalRelationSpecification is not null using get(0)
if(pickInstanceOf(ExternalRelationSpecification.class,
((TransitionSegment)input).getSpecifications()).get(0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification
spec =
pickInstanceOf(ExternalRelationSpecification.class,
((TransitionSegment)input).getSpecifications()).get(0);
}
}
}
......@@ -190,9 +198,6 @@ public class TransitionSegmentSpecificationPropertySection extends
@Override
public void refresh() {
super.refresh();
if(spec == null) {
return;
}
// create guard data binding
IObservableValue guardObservable =
observeValue(specification, TRANSITION_SEGMENT_SPECIFICATION__GUARD);
......@@ -207,11 +212,13 @@ public class TransitionSegmentSpecificationPropertySection extends
new ActionsToStringConverter(), new StringToActionsConverter(specification),
new StringToActionsValidator(specification), null);
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(transitionSegmentImplReqButton),
modelObservable1, null, null);
if(spec != null) {
IObservableValue modelObservable1 =
observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(transitionSegmentImplReqButton),
modelObservable1, null, null);
}
}
/** {@inheritDoc} */
......
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