Skip to content
GitLab
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
9db414dc
Commit
9db414dc
authored
Jan 29, 2018
by
Simon Barner
Browse files
AllocationTableCollectionCompositorBase: Remove empty AllocationTableCollections
refs 2950
parent
acc63acb
Changes
4
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.allocation/trunk/src/org/fortiss/af3/allocation/compose/.ratings
View file @
9db414dc
AllocationTableCollectionCompositorBase.java
fd0a04a506bcaf57e8dcbec670ff33b7e71e81db
YELLOW
AllocationTableCollectionCompositorBase.java
68485b24f8d8dfe82b4c792fe3b7e49bd5078ada
YELLOW
AllocationTableCollectionFileProjectCompositor.java a762868e5034848735b548cbbbd3661e63452db7 GREEN
org.fortiss.af3.allocation/trunk/src/org/fortiss/af3/allocation/compose/AllocationTableCollectionCompositorBase.java
View file @
9db414dc
...
...
@@ -27,6 +27,7 @@ import org.fortiss.tooling.base.compose.ModelElementCompositorBase;
import
org.fortiss.tooling.kernel.extension.data.IElementCompositionContext
;
import
org.fortiss.tooling.kernel.extension.data.Prototype
;
import
org.fortiss.tooling.kernel.model.IProjectRootElement
;
import
org.fortiss.tooling.kernel.service.IElementCompositorService
;
/**
* Base compositor for adding {@link AllocationTable} specializations to
...
...
@@ -172,4 +173,18 @@ public abstract class AllocationTableCollectionCompositorBase extends
return
true
;
}
/** {@inheritDoc} */
@Override
public
boolean
decompose
(
EObject
contained
)
{
EObject
eContainer
=
contained
.
eContainer
();
// Remove empty AllocationTableCollections
boolean
rval
=
super
.
decompose
(
contained
);
if
(
eContainer
.
eContents
().
isEmpty
())
{
rval
&=
IElementCompositorService
.
getInstance
().
decompose
(
eContainer
);
}
return
rval
;
}
}
org.fortiss.af3.allocation/trunk/src/org/fortiss/af3/allocation/utils/.ratings
View file @
9db414dc
AllocationModelElementFactory.java 0d13ccc9da944dd9a25db262eb1fa47d1a9582e9 YELLOW
AllocationUtils.java
2ab0769710bb0bb0f8c05e2f2b23e9493d75b0cc
YELLOW
AllocationUtils.java
895abb74f059e0bff2d2be8b29851afdc596497a
YELLOW
org.fortiss.af3.allocation/trunk/src/org/fortiss/af3/allocation/utils/AllocationUtils.java
View file @
9db414dc
...
...
@@ -18,6 +18,7 @@ package org.fortiss.af3.allocation.utils;
import
static
org
.
eclipse
.
emf
.
ecore
.
util
.
EcoreUtil
.
create
;
import
static
org
.
fortiss
.
af3
.
allocation
.
utils
.
AllocationModelElementFactory
.
createAllocationEntry
;
import
static
org
.
fortiss
.
af3
.
allocation
.
utils
.
AllocationModelElementFactory
.
createAllocationTableCollection
;
import
static
org
.
fortiss
.
af3
.
project
.
utils
.
ProjectUtils
.
getFileProject
;
import
static
org
.
fortiss
.
tooling
.
common
.
util
.
LambdaUtils
.
asStream
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
EcoreUtils
.
getEClassForClass
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
EcoreUtils
.
pickInstanceOf
;
...
...
@@ -38,7 +39,6 @@ import org.fortiss.af3.allocation.model.OneToOneAllocationEntry;
import
org.fortiss.af3.allocation.model.ParameterEntry
;
import
org.fortiss.af3.allocation.model.ParameterTable
;
import
org.fortiss.af3.project.model.FileProject
;
import
org.fortiss.af3.project.utils.ProjectUtils
;
import
org.fortiss.tooling.base.annotation.AnnotationEntry
;
import
org.fortiss.tooling.base.annotation.IAnnotationValueService
;
import
org.fortiss.tooling.base.model.element.IAnnotatedSpecification
;
...
...
@@ -405,7 +405,7 @@ public class AllocationUtils {
// Create and initialize new one
AllocationTableCollection
atc
=
createAllocationTableCollection
(
"Allocations"
);
FileProject
fileProject
=
ProjectUtils
.
getFileProject
(
modelRef
);
FileProject
fileProject
=
getFileProject
(
modelRef
);
IElementCompositorService
cs
=
IElementCompositorService
.
getInstance
();
cs
.
compose
(
fileProject
,
atc
,
null
);
@SuppressWarnings
(
"unchecked"
)
T
at
=
(
T
)
create
(
getEClassForClass
(
allocationTableType
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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