Commit 88282bd5 authored by Sudeep Kanav's avatar Sudeep Kanav
Browse files

RED

refs 2248
parent 2775c3be
...@@ -26,6 +26,7 @@ import java.util.stream.Collectors; ...@@ -26,6 +26,7 @@ import java.util.stream.Collectors;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.eclipse.core.databinding.observable.value.IObservableValue; import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.jface.databinding.swt.ISWTObservableValue;
import org.eclipse.jface.databinding.swt.SWTObservables; import org.eclipse.jface.databinding.swt.SWTObservables;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
...@@ -44,7 +45,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase; ...@@ -44,7 +45,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
* @author eder * @author eder
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: F4E14E576A2B3A5DAE9057BBDB67680C * @ConQAT.Rating RED Hash: BECACA0D25288CB31FD0F0579E0F2E4C
*/ */
public final class EnumerationMemberPropertySection extends PropertySectionBase { public final class EnumerationMemberPropertySection extends PropertySectionBase {
...@@ -57,12 +58,13 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase ...@@ -57,12 +58,13 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase
/** Text section showing the traces */ /** Text section showing the traces */
private Text showTraces; private Text showTraces;
// TODO (SK,4) Please rephrase
/** enumeration member implement the requirement correctly check button. */ /** enumeration member implement the requirement correctly check button. */
private Button enumerationMemberImplReqButton; private Button enumerationMemberImplReqButton;
/** Label for the "enumeration member implement requirement" text. */ /** Label for the "enumeration member implement requirement" text. */
private Label enumerationMemberImplreqLabel; private Label enumerationMemberImplreqLabel;
/** for capturing the external relation specification */ /** For capturing the external relation specification */
ExternalRelationSpecification spec; ExternalRelationSpecification spec;
/** {@inheritDoc} */ /** {@inheritDoc} */
...@@ -82,6 +84,7 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase ...@@ -82,6 +84,7 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase
@Override @Override
protected void setSectionInput(Object input) { protected void setSectionInput(Object input) {
member = (EnumerationMember)input; member = (EnumerationMember)input;
// TODO (SK,19) following expression should be refactored.
traces = traces =
pickInstanceOf(ExternalRelationSpecification.class, member.getSpecifications()) pickInstanceOf(ExternalRelationSpecification.class, member.getSpecifications())
.stream() .stream()
...@@ -98,6 +101,8 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase ...@@ -98,6 +101,8 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase
if(pickInstanceOf(ExternalRelationSpecification.class, member.getSpecifications()).get( if(pickInstanceOf(ExternalRelationSpecification.class, member.getSpecifications()).get(
0) != null) { 0) != null) {
// get(0) is to get the first instance of the externalRelationSpecification // get(0) is to get the first instance of the externalRelationSpecification
// TODO (SK,20) pickInstanceOf(ExternalRelationSpecification.class,
// member.getSpecifications()) is used 3 times. Please make a local variable for it.
spec = spec =
pickInstanceOf(ExternalRelationSpecification.class, pickInstanceOf(ExternalRelationSpecification.class,
member.getSpecifications()).get(0); member.getSpecifications()).get(0);
...@@ -110,11 +115,12 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase ...@@ -110,11 +115,12 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase
public void refresh() { public void refresh() {
super.refresh(); super.refresh();
if(spec != null) { if(spec != null) {
IObservableValue modelObservable1 = IObservableValue modelObservable =
observeValue(spec, observeValue(spec,
EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY); EXTERNAL_RELATION_SPECIFICATION__REQUIREMENT_IMPLEMENTED_CORRECTLY);
dbc.bindValue(SWTObservables.observeSelection(enumerationMemberImplReqButton), ISWTObservableValue swtObservable =
modelObservable1, null, null); SWTObservables.observeSelection(enumerationMemberImplReqButton);
dbc.bindValue(swtObservable, modelObservable, null, null);
} }
} }
} }
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