Commit 8ad7bd7a authored by Andreas Bayha's avatar Andreas Bayha
Browse files

MIRA: Minimized

Reduced MIRA to a minimal core.

Issue-Ref: 3886
Issue-Url: https://af3-developer.fortiss.org/issues/3886

Signed-off-by: Andreas Bayha's avatarAndreas Bayha <bayha@fortiss.org>
parent f7cc0239
ComponentSpecificationPropertySection.java 1f757e659828a61ae79f41d33255523019bb518d GREEN
ComponentSpecificationPropertySection.java e6a829a9e4a8be1163ee52daa77b69f678a493af YELLOW
PortDataPropagation.java 9305d9fd7bb52398bdf227ddf7e1b54adac15808 GREEN
PortInitValueSection.java c25ad3fd1998f35c10a541caad3211f1333ae420 GREEN
PortSpecificationPropertySection.java 180ea52f0c50c4fd3d3ee2a7e59d22d0e3e05c75 RED
......
......@@ -16,16 +16,12 @@
package org.fortiss.af3.component.ui.properties;
import static org.fortiss.af3.component.model.AF3ComponentPackage.Literals.CAUSALITY_COMPONENT_SPECIFICATION__STRONGLY_CAUSAL;
import static org.fortiss.af3.mira.model.MiraPackage.Literals.EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.observeSelection;
import static org.fortiss.tooling.kernel.ui.util.ObservableUtils.observeValue;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ComboViewer;
......@@ -46,7 +42,6 @@ import org.fortiss.af3.component.model.ComponentArchitecture;
import org.fortiss.af3.component.model.VerifBehaviourComponentSpecification;
import org.fortiss.af3.component.model.VerificationBehaviour;
import org.fortiss.af3.component.ui.AF3ComponentUIActivator;
import org.fortiss.af3.mira.model.ExternalRelationSpecification;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.service.IPersistencyService;
import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
......@@ -69,9 +64,6 @@ 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. */
private Button stronglyCausalButton;
......@@ -161,25 +153,6 @@ public final class ComponentSpecificationPropertySection extends PropertySection
} else {
component = (Component)input;
}
traces = pickInstanceOf(ExternalRelationSpecification.class, component.getSpecifications())
.stream().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);
// 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());
specification = component.getCausalitySpecification();
......@@ -211,10 +184,5 @@ public final class ComponentSpecificationPropertySection extends PropertySection
IObservableValue<?> modelObservable =
observeValue(specification, CAUSALITY_COMPONENT_SPECIFICATION__STRONGLY_CAUSAL);
dbc.bindValue(observeSelection(stronglyCausalButton), modelObservable, null, null);
if(spec != null) {
IObservableValue<?> modelObservable1 = observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(observeSelection(componentImplReqButton), modelObservable1, null, null);
}
}
}
......@@ -101,7 +101,8 @@ public class DashboardWizard extends Wizard {
addPage(new DashboardWizardSelectProjectSource());
// Add the actual importer wizard pages.
registerConverter(new DashboardWizardSelectDataDictionary());
registerConverter(new DashboardWizardSelectReqirements());
// FIXME (AB) #3892 - Wizzard broken, due to MIRA chainsaw massacre.
// registerConverter(new DashboardWizardSelectReqirements());
registerConverter(new DashboardWizardSelectComponentArchitecture());
registerConverter(new DashboardWizardSelectTaskArchitecture());
registerConverter(new DashboardWizardSelectAllocation());
......
/*-------------------------------------------------------------------------+
| Copyright 2019 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.af3.exploration.ui.perspective.dashboard.projectwizard;
import static org.fortiss.af3.exploration.util.ModelSnapshotExtractUtils.createRequirementModelSnapshot;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstChildWithType;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import java.util.List;
import java.util.function.Function;
import org.eclipse.emf.ecore.EObject;
import org.fortiss.af3.exploration.model.project.ModelSnapshot;
import org.fortiss.af3.mira.model.Analysis;
import org.fortiss.af3.mira.model.Requirement;
import org.fortiss.af3.mira.model.SafetyLevelRequirementSpecification;
import org.fortiss.tooling.kernel.model.IProjectRootElement;
/**
* Wizard page for selecting the {@link Requirement} {@link Analysis}. Currently, only
* safety-relevant Requirements are imported.
*
* @author eder
*/
public class DashboardWizardSelectReqirements
extends DashboardWizardRootElementSelectionBase<Analysis> {
/** Constructor. */
public DashboardWizardSelectReqirements() {
super("Requirements", Analysis.class);
}
/** {@inheritDoc} */
@Override
protected boolean isRelevantElement(EObject element) {
if(element instanceof Requirement) {
Requirement req = (Requirement)element;
return req.getSpecifications().stream()
.anyMatch(s -> s instanceof SafetyLevelRequirementSpecification);
}
return false;
}
/** {@inheritDoc} */
@Override
protected boolean isRelevantRootElement(Analysis requirements) {
return getFirstChildWithType(requirements,
SafetyLevelRequirementSpecification.class) != null;
}
/** {@inheritDoc} */
@Override
public Function<Analysis, ModelSnapshot> getModelToSnapShotConverter() {
return new Function<Analysis, ModelSnapshot>() {
@Override
public ModelSnapshot apply(Analysis t) {
return createRequirementModelSnapshot(t);
}
};
}
/** {@inheritDoc} */
@Override
public boolean inputsAvailable(List<? extends IProjectRootElement> rootElements) {
List<Analysis> reqNodes = pickInstanceOf(Analysis.class, rootElements);
for(Analysis reqNode : reqNodes) {
if(isRelevantRootElement(reqNode)) {
return true;
}
}
return false;
}
/** {@inheritDoc} */
@Override
public boolean isRequired() {
return false;
}
}
/// *-------------------------------------------------------------------------+
// | Copyright 2019 fortiss GmbH |
// | |
// | Licensed under the Apache License, Version 2.0 (the "License"); |
// | you may not use this file except in compliance with the License. |
// | You may obtain a copy of the License at |
// | |
// | http://www.apache.org/licenses/LICENSE-2.0 |
// | |
// | Unless required by applicable law or agreed to in writing, software |
// | distributed under the License is distributed on an "AS IS" BASIS, |
// | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
// | See the License for the specific language governing permissions and |
// | limitations under the License. |
// +--------------------------------------------------------------------------*/
// package org.fortiss.af3.exploration.ui.perspective.dashboard.projectwizard;
//
// import static
/// org.fortiss.af3.exploration.util.ModelSnapshotExtractUtils.createRequirementModelSnapshot;
// import static org.fortiss.tooling.kernel.utils.EcoreUtils.getFirstChildWithType;
// import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
//
// import java.util.List;
// import java.util.function.Function;
//
// import org.eclipse.emf.ecore.EObject;
// import org.fortiss.af3.exploration.model.project.ModelSnapshot;
// import org.fortiss.af3.mira.model.Analysis;
// import org.fortiss.af3.mira.model.Requirement;
// import org.fortiss.af3.mira.model.SafetyLevelRequirementSpecification;
// import org.fortiss.tooling.kernel.model.IProjectRootElement;
//
/// **
// * Wizard page for selecting the {@link Requirement} {@link Analysis}. Currently, only
// * safety-relevant Requirements are imported.
// *
// * @author eder
// */
// public class DashboardWizardSelectReqirements
// extends DashboardWizardRootElementSelectionBase<Analysis> {
//
// /** Constructor. */
// public DashboardWizardSelectReqirements() {
// super("Requirements", Analysis.class);
// }
//
// /** {@inheritDoc} */
// @Override
// protected boolean isRelevantElement(EObject element) {
// if(element instanceof Requirement) {
// Requirement req = (Requirement)element;
// return req.getSpecifications().stream()
// .anyMatch(s -> s instanceof SafetyLevelRequirementSpecification);
// }
// return false;
// }
//
// /** {@inheritDoc} */
// @Override
// protected boolean isRelevantRootElement(Analysis requirements) {
// return getFirstChildWithType(requirements,
// SafetyLevelRequirementSpecification.class) != null;
// }
//
// /** {@inheritDoc} */
// @Override
// public Function<Analysis, ModelSnapshot> getModelToSnapShotConverter() {
// return new Function<Analysis, ModelSnapshot>() {
// @Override
// public ModelSnapshot apply(Analysis t) {
// return createRequirementModelSnapshot(t);
// }
// };
// }
//
// /** {@inheritDoc} */
// @Override
// public boolean inputsAvailable(List<? extends IProjectRootElement> rootElements) {
// List<Analysis> reqNodes = pickInstanceOf(Analysis.class, rootElements);
// for(Analysis reqNode : reqNodes) {
// if(isRelevantRootElement(reqNode)) {
// return true;
// }
// }
// return false;
// }
//
// /** {@inheritDoc} */
// @Override
// public boolean isRequired() {
// return false;
// }
// }
......@@ -5,5 +5,5 @@ DSMLUtils.java c07eeef09787cea9db98533d346e3e384a232593 GREEN
ExplorationModelElementFactory.java bb48b2d09b92efcb1b2d3e382555089bb7ed5db5 GREEN
ExplorationReflectionUtils.java 62731e1cef32fe93f2c2017f93f5ba1f054d5197 GREEN
ExplorationUtils.java 79f8960b63762045008d27def3752d735dad43f0 GREEN
ModelSnapshotExtractUtils.java 940c5f0e2859519522ae8edfda63e05112870776 GREEN
ModelSnapshotExtractUtils.java b8a9483d24b428b8c45f900d424aa4f9084ba1c9 RED
PatternFactoryUtils.java bcb1d325aecfef12d29d4eb53b28fe59dbd20e9a GREEN
......@@ -42,7 +42,6 @@ import org.fortiss.af3.exploration.model.project.ModelSnapshot;
import org.fortiss.af3.expression.model.DataDictionary;
import org.fortiss.af3.mira.model.Analysis;
import org.fortiss.af3.mira.model.Requirement;
import org.fortiss.af3.mira.model.SafetyLevelRequirementSpecification;
import org.fortiss.af3.platform.model.ExecutionUnit;
import org.fortiss.af3.platform.model.GatewayUnit;
import org.fortiss.af3.platform.model.MemoryUnit;
......@@ -225,13 +224,14 @@ public class ModelSnapshotExtractUtils {
/** Creates a {@link ModelSnapshot} of {@link Requirement}s relevant for the DSE. */
public static ModelSnapshot createRequirementModelSnapshot(Analysis requirements) {
Collection<SafetyLevelRequirementSpecification> safetyReqSpecsCol =
getChildrenWithType(requirements, SafetyLevelRequirementSpecification.class);
SuperSet<SafetyLevelRequirementSpecification> safetyReqSpecs = createSuperSet(
safetyReqSpecsCol, "Safety Functions", SafetyLevelRequirementSpecification.class);
// FIXME (AB) #3892 - Broken due to minimalized MIRA.
// Collection<SafetyLevelRequirementSpecification> safetyReqSpecsCol =
// getChildrenWithType(requirements, SafetyLevelRequirementSpecification.class);
// SuperSet<SafetyLevelRequirementSpecification> safetyReqSpecs = createSuperSet(
// safetyReqSpecsCol, "Safety Functions", SafetyLevelRequirementSpecification.class);
SuperSetMap reqSetMap = createSuperSetMap();
reqSetMap.put(SafetyLevelRequirementSpecification.class, safetyReqSpecs);
// reqSetMap.put(SafetyLevelRequirementSpecification.class, safetyReqSpecs);
return createModelSnapshot(requirements, reqSetMap);
}
......
ArrayPropertySection.java 49c7ab946be39d9ba680fc15f45a7ee635923f98 GREEN
EnumPropertySection.java f79ad25c0c0cd34e5234f8e3997787d0ed1f26d7 GREEN
EnumerationMemberPropertySection.java 2254265a406d07c089217c8e3b4993761587c7d7 GREEN
EnumPropertySection.java 9e9367d3a908c529a705e0dd627e04b2cdafc51f YELLOW
EnumerationMemberPropertySection.java 64c12269b9e56c145e0f2087685ccfd4e6ffc345 YELLOW
FunctionDefinitionPropertySection.java 6b132b194a8dc7e9cd5c3645bf644aa529a8ca67 GREEN
StructureMemberPropertySection.java f8a3d0e7f3b26fb0f6484a2598086cd1f5c949c4 GREEN
StructurePropertySection.java b767fc1887cee6580ed3b93e78b4eefd46905af6 GREEN
StructureMemberPropertySection.java a214bb2695b4c815e928ee4d8e0a5da91dcf1031 YELLOW
StructurePropertySection.java bae22d304b66258c37c8382b57366352a38b3b10 YELLOW
......@@ -15,19 +15,11 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.expression.ui.properties;
import static org.apache.commons.lang.StringUtils.join;
import static org.fortiss.af3.mira.model.MiraPackage.Literals.EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY;
import static org.fortiss.af3.mira.utils.MiraUtils.getTracesFromExternalRelSpec;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.observeSelection;
import static org.fortiss.tooling.kernel.ui.util.ObservableUtils.observeValue;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.copy;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import static org.fortiss.tooling.kernel.utils.KernelModelElementUtils.getParentElement;
import java.util.Set;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.emf.common.util.EList;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
......@@ -41,7 +33,6 @@ import org.fortiss.af3.expression.model.definitions.Enumeration;
import org.fortiss.af3.expression.model.definitions.EnumerationMember;
import org.fortiss.af3.expression.model.definitions.library.EnumerationRef;
import org.fortiss.af3.expression.utils.ExpressionModelElementFactory;
import org.fortiss.af3.mira.model.ExternalRelationSpecification;
import org.fortiss.tooling.kernel.extension.data.ITopLevelElement;
import org.fortiss.tooling.kernel.service.IElementCompositorService;
import org.fortiss.tooling.kernel.service.IPersistencyService;
......@@ -73,9 +64,6 @@ public class EnumPropertySection extends PropertySectionBase {
/** Label for the "enumeration implement requirement" text. */
private Label enumerationImplreqLabel;
/** For capturing the external relation specification from the set of specifications */
ExternalRelationSpecification spec;
/** {@inheritDoc} */
@Override
public void createControls(Composite parent, TabbedPropertySheetPage tabbedPropertySheetPage) {
......@@ -126,35 +114,12 @@ public class EnumPropertySection extends PropertySectionBase {
@Override
protected void setSectionInput(Object input) {
enumeration = (Enumeration)input;
EList<ExternalRelationSpecification> specs = pickInstanceOf(
ExternalRelationSpecification.class, enumeration.getSpecifications());
traces = getTracesFromExternalRelSpec(specs);
showTraces.setText(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);
// check if the first instance of externalRelationSpecification is not null using get(0)
if(specs.get(0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification
spec = specs.get(0);
}
}
}
/** {@inheritDoc} */
@Override
public void refresh() {
super.refresh();
if(spec != null) {
IObservableValue<?> modelObservable1 = observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(observeSelection(enumerationImplReqButton), modelObservable1, null, null);
}
if(enumeration instanceof EnumerationRef) {
detachLabel.setVisible(true);
detachButton.setVisible(true);
......
......@@ -15,18 +15,8 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.expression.ui.properties;
import static org.apache.commons.lang.StringUtils.join;
import static org.fortiss.af3.mira.model.MiraPackage.Literals.EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY;
import static org.fortiss.af3.mira.utils.MiraUtils.getTracesFromExternalRelSpec;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.observeSelection;
import static org.fortiss.tooling.kernel.ui.util.ObservableUtils.observeValue;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import java.util.Set;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
......@@ -35,7 +25,6 @@ import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.fortiss.af3.expression.model.definitions.EnumerationMember;
import org.fortiss.af3.expression.model.definitions.StructureMember;
import org.fortiss.af3.mira.model.ExternalRelationSpecification;
import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
/**
......@@ -62,9 +51,6 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase
/** Label for the "enumeration member implement requirement" text. */
private Label enumerationMemberImplreqLabel;
/** For capturing the external relation specification */
ExternalRelationSpecification spec;
/** {@inheritDoc} */
@Override
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
......@@ -81,33 +67,11 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase
@Override
protected void setSectionInput(Object input) {
member = (EnumerationMember)input;
EList<ExternalRelationSpecification> specs =
pickInstanceOf(ExternalRelationSpecification.class, member.getSpecifications());
traces = getTracesFromExternalRelSpec(specs);
showTraces.setText(join(traces, ", "));
if(traces.size() == 0) {
enumerationMemberImplReqButton.setEnabled(false);
enumerationMemberImplreqLabel.setEnabled(false);
} else {
enumerationMemberImplReqButton.setEnabled(true);
enumerationMemberImplreqLabel.setEnabled(true);
// check if the first instance of externalRelationSpecification is not null using get(0)
if(specs.get(0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification
spec = specs.get(0);
}
}
}
/** {@inheritDoc} */
@Override
public void refresh() {
super.refresh();
if(spec != null) {
IObservableValue<?> modelObservable = observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
ISWTObservableValue swtObservable = observeSelection(enumerationMemberImplReqButton);
dbc.bindValue(swtObservable, modelObservable, null, null);
}
}
}
......@@ -15,19 +15,12 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.expression.ui.properties;
import static org.apache.commons.lang.StringUtils.join;
import static org.fortiss.af3.mira.model.MiraPackage.Literals.EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY;
import static org.fortiss.af3.mira.utils.MiraUtils.getTracesFromExternalRelSpec;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.observeSelection;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.performComplexTextBinding;
import static org.fortiss.tooling.kernel.ui.util.ObservableUtils.observeValue;
import static org.fortiss.tooling.kernel.utils.EcoreUtils.pickInstanceOf;
import java.util.Set;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
......@@ -39,7 +32,6 @@ import org.fortiss.af3.expression.model.definitions.StructureMember;
import org.fortiss.af3.expression.ui.databinding.convert.StringToTypeConverter;
import org.fortiss.af3.expression.ui.databinding.convert.TypeToStringConverter;
import org.fortiss.af3.expression.ui.databinding.validate.StringToTypeValidator;
import org.fortiss.af3.mira.model.ExternalRelationSpecification;
import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
/**
......@@ -67,9 +59,6 @@ public final class StructureMemberPropertySection extends PropertySectionBase {
/** Label for the "structure member implement requirement" text. */
private Label structureMemberImplreqLabel;
/** For capturing the External Relation Specification */
ExternalRelationSpecification spec;
/** {@inheritDoc} */
@Override
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
......@@ -87,34 +76,12 @@ public final class StructureMemberPropertySection extends PropertySectionBase {
@Override
protected void setSectionInput(Object input) {
member = (StructureMember)input;
EList<ExternalRelationSpecification> specs =
pickInstanceOf(ExternalRelationSpecification.class, member.getSpecifications());
traces = getTracesFromExternalRelSpec(specs);
showTraces.setText(join(traces, ", "));
if(traces.size() == 0) {
structureMemberImplReqButton.setEnabled(false);
structureMemberImplreqLabel.setEnabled(false);
} else {
structureMemberImplReqButton.setEnabled(true);
structureMemberImplreqLabel.setEnabled(true);
// check if the first instance of externalRelationSpecification is not null using get(0)
if(specs.get(0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification
spec = specs.get(0);
}
}
}
/** {@inheritDoc} */
@Override
public void refresh() {
super.refresh();
if(spec != null) {
IObservableValue<?> modelObservable = observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
ISWTObservableValue swtObservable = observeSelection(structureMemberImplReqButton);
dbc.bindValue(swtObservable, modelObservable, null, null);
}
IObservableValue<?> modelObservable =
observeValue(member, DefinitionsPackage.Literals.STRUCTURE_MEMBER__TYPE);
performComplexTextBinding(dbc, memberTypeText, modelObservable, new TypeToStringConverter(),
......
......@@ -15,20 +15,11 @@
+--------------------------------------------------------------------------*/
package org.fortiss.af3.expression.ui.properties;
import static org.apache.commons.lang.StringUtils.join;
import static org.fortiss.af3.mira.model.MiraPackage.Literals.EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY;
import static org.fortiss.af3.mira.utils.MiraUtils.getTracesFromExternalRelSpec;