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
kernel
Commits
9670f2ce
Commit
9670f2ce
authored
Sep 12, 2018
by
reaboi
Browse files
3293 deleting a component having a test suite
YELLOW Signed-off-by:
reaboi
<
reaboi@fortiss.org
>
parent
028c09c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
org.fortiss.tooling.base/src/org/fortiss/tooling/base/compose/.ratings
View file @
9670f2ce
...
...
@@ -2,7 +2,7 @@ ConnectionCompositorBase.java 692689b535d7136acab2ab67a015f70809e64b6b GREEN
ConnectorConnectionCompositorBase.java 2c710349fe98f09004521fa68586c020499d6275 GREEN
ConnectorHierarchicElementConnectionCompositorBase.java 6a35ca0237ded34169a5b601b5928f1ba58ef6bc GREEN
ConstraintInstanceContainerCompositor.java 85cee7a6e0dfaf087a13b76069d8acfac7589bef GREEN
HierarchicElementCompositorBase.java
e96b8a5a2cdb946f135edb2c2248a476e2f870ef GREEN
HierarchicElementCompositorBase.java
cb429c41d6babd6f285e47144288971338aed159 YELLOW
HierarchicElementConnectionCompositorBase.java 08e315fed95d7c45ad5f00b3258fd13b811dbcfb GREEN
HierarchicElementConnectorConnectionCompositorBase.java eba2318c219f796c73ac0ad0344088298c268eb9 GREEN
LogMessageUserInteractionContext.java b145045589fba08b67a12b5d41c51729aa4ae94e GREEN
...
...
org.fortiss.tooling.base/src/org/fortiss/tooling/base/compose/HierarchicElementCompositorBase.java
View file @
9670f2ce
...
...
@@ -18,6 +18,7 @@ package org.fortiss.tooling.base.compose;
import
static
org
.
eclipse
.
emf
.
ecore
.
util
.
EcoreUtil
.
delete
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.eclipse.emf.common.util.EList
;
import
org.eclipse.emf.ecore.EObject
;
...
...
@@ -35,7 +36,7 @@ import org.fortiss.tooling.kernel.service.IElementCompositorService;
* Base implementation of a compositor for {@link IHierarchicElementContainer}s
* focusing on the remove mechanism.
*
* @author doebber
* @author doebber
, reaboi
*/
public
abstract
class
HierarchicElementCompositorBase
<
HE
extends
IHierarchicElementContainer
>
extends
ModelElementCompositorBase
<
HE
>
{
...
...
@@ -46,14 +47,26 @@ public abstract class HierarchicElementCompositorBase<HE extends IHierarchicElem
@Override
public
final
boolean
decompose
(
EObject
contained
)
{
// Removes first the constraints
List
<
ConstraintInstance
>
ciList
=
new
ArrayList
<
ConstraintInstance
>();
List
<
IConstrained
>
cList
=
new
ArrayList
<
IConstrained
>();
if
(
contained
instanceof
IConstrained
)
{
for
(
ConstraintInstance
ci
:
((
IConstrained
)
contained
).
getConstraintInstances
())
{
for
(
IConstrained
c
:
ci
.
getConstraineds
())
{
if
(
c
!=
contained
)
{
c
.
getConstraintInstances
().
remove
(
ci
);
ciList
.
add
(
ci
);
cList
.
add
(
c
);
}
}
}
// Should be removed outside of an iterator
if
(!
ciList
.
isEmpty
())
{
for
(
int
index
=
0
;
index
<
ciList
.
size
();
index
++)
{
IConstrained
c
=
cList
.
get
(
index
);
ConstraintInstance
ci
=
ciList
.
get
(
index
);
c
.
getConstraintInstances
().
remove
(
ci
);
}
}
((
IConstrained
)
contained
).
getConstraintInstances
().
clear
();
}
return
iterateDecompose
(
contained
)
&&
decomposeSpecific
(
contained
);
...
...
Write
Preview
Supports
Markdown
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