Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
af3
kernel
Commits
3caaa596
Commit
3caaa596
authored
Jul 29, 2013
by
Daniel Ratiu
Browse files
Options
Downloads
Patches
Plain Diff
fixing the model checking of libraries
refs 1529
parent
d75dbe6d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/library/ModelElementLibraryService.java
+51
-46
51 additions, 46 deletions
...tiss/tooling/base/library/ModelElementLibraryService.java
with
51 additions
and
46 deletions
org.fortiss.tooling.base/trunk/src/org/fortiss/tooling/base/library/ModelElementLibraryService.java
+
51
−
46
View file @
3caaa596
...
@@ -111,16 +111,27 @@ public class ModelElementLibraryService implements ILibraryService {
...
@@ -111,16 +111,27 @@ public class ModelElementLibraryService implements ILibraryService {
ILibraryService
.
INSTANCE
.
addElementToLibrary
(
pack
,
obj
);
ILibraryService
.
INSTANCE
.
addElementToLibrary
(
pack
,
obj
);
}
}
/** Converts a {@link ILibraryElementReference} into a {@link IHierarchicElement}. */
/**
* Converts a {@link ILibraryElementReference} into a {@link IHierarchicElement} inside command
* stack.
*/
public
void
convertLibraryElementRefToHierarchicalElement
(
public
void
convertLibraryElementRefToHierarchicalElement
(
final
ILibraryElementReference
elementRef
)
{
final
ILibraryElementReference
elementRef
)
{
final
IHierarchicElement
wrapped
=
(
IHierarchicElement
)
elementRef
.
getLibraryElementShadow
();
final
ITopLevelElement
topLevel
=
final
ITopLevelElement
topLevel
=
IPersistencyService
.
INSTANCE
.
getTopLevelElementFor
(
elementRef
);
IPersistencyService
.
INSTANCE
.
getTopLevelElementFor
(
elementRef
);
topLevel
.
runAsCommand
(
new
Runnable
()
{
topLevel
.
runAsCommand
(
new
Runnable
()
{
@Override
@Override
public
void
run
()
{
public
void
run
()
{
doConvertLibraryElementRefToHierarchicalElement
(
elementRef
);
}
});
}
/** Converts a {@link ILibraryElementReference} into a {@link IHierarchicElement}. */
public
void
doConvertLibraryElementRefToHierarchicalElement
(
final
ILibraryElementReference
elementRef
)
{
IHierarchicElement
wrapped
=
(
IHierarchicElement
)
elementRef
.
getLibraryElementShadow
();
IHierarchicElement
container
=
(
IHierarchicElement
)
elementRef
.
eContainer
();
IHierarchicElement
container
=
(
IHierarchicElement
)
elementRef
.
eContainer
();
container
.
getContainedElementsList
().
remove
(
elementRef
);
container
.
getContainedElementsList
().
remove
(
elementRef
);
...
@@ -129,8 +140,7 @@ public class ModelElementLibraryService implements ILibraryService {
...
@@ -129,8 +140,7 @@ public class ModelElementLibraryService implements ILibraryService {
wrappedConnectorsList
.
addAll
(
wrapped
.
getConnectorsList
());
wrappedConnectorsList
.
addAll
(
wrapped
.
getConnectorsList
());
wrapped
.
getConnectorsList
().
clear
();
wrapped
.
getConnectorsList
().
clear
();
EList
<
IConnector
>
elementRefConnectorsList
=
new
BasicEList
<
IConnector
>();
EList
<
IConnector
>
elementRefConnectorsList
=
new
BasicEList
<
IConnector
>();
elementRefConnectorsList
.
addAll
(((
IHierarchicElement
)
elementRef
)
elementRefConnectorsList
.
addAll
(((
IHierarchicElement
)
elementRef
).
getConnectorsList
());
.
getConnectorsList
());
for
(
IConnector
elemRefConnector
:
elementRefConnectorsList
)
{
for
(
IConnector
elemRefConnector
:
elementRefConnectorsList
)
{
wrapped
.
getConnectorsList
().
add
(
elemRefConnector
);
wrapped
.
getConnectorsList
().
add
(
elemRefConnector
);
String
elementRefConnectorName
=
((
INamedElement
)
elemRefConnector
).
getName
();
String
elementRefConnectorName
=
((
INamedElement
)
elemRefConnector
).
getName
();
...
@@ -138,16 +148,14 @@ public class ModelElementLibraryService implements ILibraryService {
...
@@ -138,16 +148,14 @@ public class ModelElementLibraryService implements ILibraryService {
// for each connector of the element reference add the inner connections from
// for each connector of the element reference add the inner connections from
// the wrapped connector
// the wrapped connector
for
(
IConnector
wrappedConnector
:
wrappedConnectorsList
)
{
for
(
IConnector
wrappedConnector
:
wrappedConnectorsList
)
{
String
currentWrappedConnectorName
=
String
currentWrappedConnectorName
=
((
INamedElement
)
wrappedConnector
).
getName
();
((
INamedElement
)
wrappedConnector
).
getName
();
if
(
currentWrappedConnectorName
.
equals
(
elementRefConnectorName
))
{
if
(
currentWrappedConnectorName
.
equals
(
elementRefConnectorName
))
{
// copy incoming connections
// copy incoming connections
EList
<
IConnection
>
wrappedIncomingConnectionsList
=
EList
<
IConnection
>
wrappedIncomingConnectionsList
=
new
BasicEList
<
IConnection
>();
new
BasicEList
<
IConnection
>();
wrappedIncomingConnectionsList
.
addAll
(
wrappedConnector
wrappedIncomingConnectionsList
.
addAll
(
wrappedConnector
.
getIncomingList
());
.
getIncomingList
());
for
(
IConnection
connection
:
wrappedIncomingConnectionsList
)
{
for
(
IConnection
connection
:
wrappedIncomingConnectionsList
)
{
elemRefConnector
.
getIncomingList
().
add
(
connection
);
elemRefConnector
.
getIncomingList
().
add
(
connection
);
}
}
...
@@ -155,8 +163,7 @@ public class ModelElementLibraryService implements ILibraryService {
...
@@ -155,8 +163,7 @@ public class ModelElementLibraryService implements ILibraryService {
// copy outgoing connections
// copy outgoing connections
EList
<
IConnection
>
wrappedOutgoingConnectionsList
=
EList
<
IConnection
>
wrappedOutgoingConnectionsList
=
new
BasicEList
<
IConnection
>();
new
BasicEList
<
IConnection
>();
wrappedOutgoingConnectionsList
.
addAll
(
wrappedConnector
wrappedOutgoingConnectionsList
.
addAll
(
wrappedConnector
.
getOutgoingList
());
.
getOutgoingList
());
for
(
IConnection
connection
:
wrappedOutgoingConnectionsList
)
{
for
(
IConnection
connection
:
wrappedOutgoingConnectionsList
)
{
elemRefConnector
.
getOutgoingList
().
add
(
connection
);
elemRefConnector
.
getOutgoingList
().
add
(
connection
);
}
}
...
@@ -168,8 +175,6 @@ public class ModelElementLibraryService implements ILibraryService {
...
@@ -168,8 +175,6 @@ public class ModelElementLibraryService implements ILibraryService {
container
.
getContainedElementsList
().
add
(
wrapped
);
container
.
getContainedElementsList
().
add
(
wrapped
);
}
}
});
}
/** Copies the layout data from source to target. */
/** Copies the layout data from source to target. */
private
static
void
private
static
void
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment