Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
3c6508f1
Commit
3c6508f1
authored
Oct 27, 2017
by
Hernan Ponce de Leon
Browse files
YELLOW
parent
d0e2cbac
Changes
4
Show whitespace changes
Inline
Side-by-side
org.fortiss.af3.expression.ui/trunk/src/org/fortiss/af3/expression/ui/properties/EnumPropertySection.java
View file @
3c6508f1
...
...
@@ -18,12 +18,12 @@ $Id$
package
org.fortiss.af3.expression.ui.properties
;
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
.
ObservableUtils
.
observeValue
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
EcoreUtils
.
pickInstanceOf
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
KernelModelElementUtils
.
getParentElement
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang.StringUtils
;
import
org.eclipse.core.databinding.observable.value.IObservableValue
;
...
...
@@ -55,7 +55,7 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils;
* @author eder
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash:
EA36FC4CB351DCB4EBFF141540E16ABC
* @ConQAT.Rating YELLOW Hash:
9CC194F0FE92AB343BA25DC70F11906E
*/
public
class
EnumPropertySection
extends
PropertySectionBase
{
...
...
@@ -131,13 +131,9 @@ public class EnumPropertySection extends PropertySectionBase {
@Override
protected
void
setSectionInput
(
Object
input
)
{
enumeration
=
(
Enumeration
)
input
;
EList
<
ExternalRelationSpecification
>
externalRelationS
pecs
=
EList
<
ExternalRelationSpecification
>
s
pecs
=
pickInstanceOf
(
ExternalRelationSpecification
.
class
,
enumeration
.
getSpecifications
());
// TODO (SK,19) following expression should be refactored.
traces
=
externalRelationSpecs
.
stream
()
.
map
(
e
->
e
.
getExternalRelation
().
getSourceRequirement
().
getReqId
())
.
collect
(
Collectors
.
toSet
());
traces
=
getTracesFromExternalRelSpec
(
specs
);
showTraces
.
setText
(
StringUtils
.
join
(
traces
,
", "
));
// if traces are 0 disable the check button "Correctly Implement Req."
if
(
traces
.
size
()
==
0
)
{
...
...
@@ -147,9 +143,9 @@ public class EnumPropertySection extends PropertySectionBase {
enumerationImplReqButton
.
setEnabled
(
true
);
enumerationImplreqLabel
.
setEnabled
(
true
);
// check if the first instance of externalRelationSpecification is not null using get(0)
if
(
externalRelationS
pecs
.
get
(
0
)
!=
null
)
{
if
(
s
pecs
.
get
(
0
)
!=
null
)
{
// get(0) is to get the first instance of the externalRelationSpecification
spec
=
externalRelationS
pecs
.
get
(
0
);
spec
=
s
pecs
.
get
(
0
);
}
}
}
...
...
org.fortiss.af3.expression.ui/trunk/src/org/fortiss/af3/expression/ui/properties/EnumerationMemberPropertySection.java
View file @
3c6508f1
...
...
@@ -18,11 +18,11 @@ $Id$
package
org.fortiss.af3.expression.ui.properties
;
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
.
ObservableUtils
.
observeValue
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
EcoreUtils
.
pickInstanceOf
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang.StringUtils
;
import
org.eclipse.core.databinding.observable.value.IObservableValue
;
...
...
@@ -46,7 +46,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
* @author eder
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
RED
Hash:
9444A44C52E7C4489547EF55EBF0EC9E
* @ConQAT.Rating
YELLOW
Hash:
63915C69A940DBA458CA43AD62ACCA72
*/
public
final
class
EnumerationMemberPropertySection
extends
PropertySectionBase
{
...
...
@@ -87,13 +87,9 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase
@Override
protected
void
setSectionInput
(
Object
input
)
{
member
=
(
EnumerationMember
)
input
;
EList
<
ExternalRelationSpecification
>
externalRelationS
pecs
=
EList
<
ExternalRelationSpecification
>
s
pecs
=
pickInstanceOf
(
ExternalRelationSpecification
.
class
,
member
.
getSpecifications
());
// TODO (SK,19) following expression should be refactored.
traces
=
externalRelationSpecs
.
stream
()
.
map
(
e
->
e
.
getExternalRelation
().
getSourceRequirement
().
getReqId
())
.
collect
(
Collectors
.
toSet
());
traces
=
getTracesFromExternalRelSpec
(
specs
);
showTraces
.
setText
(
StringUtils
.
join
(
traces
,
", "
));
if
(
traces
.
size
()
==
0
)
{
enumerationMemberImplReqButton
.
setEnabled
(
false
);
...
...
@@ -102,9 +98,9 @@ public final class EnumerationMemberPropertySection extends PropertySectionBase
enumerationMemberImplReqButton
.
setEnabled
(
true
);
enumerationMemberImplreqLabel
.
setEnabled
(
true
);
// check if the first instance of externalRelationSpecification is not null using get(0)
if
(
externalRelationS
pecs
.
get
(
0
)
!=
null
)
{
if
(
s
pecs
.
get
(
0
)
!=
null
)
{
// get(0) is to get the first instance of the externalRelationSpecification
spec
=
externalRelationS
pecs
.
get
(
0
);
spec
=
s
pecs
.
get
(
0
);
}
}
}
...
...
org.fortiss.af3.expression.ui/trunk/src/org/fortiss/af3/expression/ui/properties/StructureMemberPropertySection.java
View file @
3c6508f1
...
...
@@ -18,12 +18,12 @@ $Id$
package
org.fortiss.af3.expression.ui.properties
;
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
.
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
java.util.stream.Collectors
;
import
org.apache.commons.lang.StringUtils
;
import
org.eclipse.core.databinding.observable.value.IObservableValue
;
...
...
@@ -50,7 +50,7 @@ import org.fortiss.tooling.kernel.ui.extension.base.PropertySectionBase;
* @author eder
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash:
C68EBE0AE9BD875A54E3A9617C321DEA
* @ConQAT.Rating YELLOW Hash:
820D12B1B9D908ED1A96C96ADEEA1583
*/
public
final
class
StructureMemberPropertySection
extends
PropertySectionBase
{
...
...
@@ -95,9 +95,7 @@ public final class StructureMemberPropertySection extends PropertySectionBase {
member
=
(
StructureMember
)
input
;
EList
<
ExternalRelationSpecification
>
specs
=
pickInstanceOf
(
ExternalRelationSpecification
.
class
,
member
.
getSpecifications
());
traces
=
specs
.
stream
().
map
(
e
->
e
.
getExternalRelation
().
getSourceRequirement
().
getReqId
())
.
collect
(
Collectors
.
toSet
());
traces
=
getTracesFromExternalRelSpec
(
specs
);
showTraces
.
setText
(
StringUtils
.
join
(
traces
,
", "
));
if
(
traces
.
size
()
==
0
)
{
structureMemberImplReqButton
.
setEnabled
(
false
);
...
...
org.fortiss.af3.expression.ui/trunk/src/org/fortiss/af3/expression/ui/properties/StructurePropertySection.java
View file @
3c6508f1
...
...
@@ -18,12 +18,12 @@ $Id$
package
org.fortiss.af3.expression.ui.properties
;
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
.
ObservableUtils
.
observeValue
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
EcoreUtils
.
pickInstanceOf
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
KernelModelElementUtils
.
getParentElement
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.lang.StringUtils
;
import
org.eclipse.core.databinding.observable.value.IObservableValue
;
...
...
@@ -56,7 +56,7 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils;
* @author eder
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash:
D42E8A8F7B27FE78206E4D9705CCC80C
* @ConQAT.Rating YELLOW Hash:
CF07F8335F42AC5023C6D8951894F31A
*/
public
class
StructurePropertySection
extends
PropertySectionBase
{
...
...
@@ -130,9 +130,7 @@ public class StructurePropertySection extends PropertySectionBase {
structure
=
(
Structure
)
input
;
EList
<
ExternalRelationSpecification
>
specs
=
pickInstanceOf
(
ExternalRelationSpecification
.
class
,
structure
.
getSpecifications
());
traces
=
specs
.
stream
().
map
(
e
->
e
.
getExternalRelation
().
getSourceRequirement
().
getReqId
())
.
collect
(
Collectors
.
toSet
());
traces
=
getTracesFromExternalRelSpec
(
specs
);
showTraces
.
setText
(
StringUtils
.
join
(
traces
,
", "
));
if
(
traces
.
size
()
==
0
)
{
structureImplReqButton
.
setEnabled
(
false
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment