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