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
kernel
Commits
14d7d66e
Commit
14d7d66e
authored
Jul 17, 2017
by
Vincent Aravantinos
Browse files
makes use of isAncestor to compute the right parent
refs 2955
parent
863d9661
Changes
1
Hide whitespace changes
Inline
Side-by-side
org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/editpart/command/ConnectCommand.java
View file @
14d7d66e
...
...
@@ -18,6 +18,7 @@ $Id$
package
org.fortiss.tooling.base.ui.editpart.command
;
import
static
org
.
fortiss
.
tooling
.
base
.
ui
.
utils
.
DragAndDropBaseUtils
.
setConnectionDragContextTarget
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
EcoreUtils
.
isAncestor
;
import
org.eclipse.draw2d.geometry.Point
;
import
org.eclipse.emf.ecore.EObject
;
...
...
@@ -36,7 +37,7 @@ import org.fortiss.tooling.kernel.service.IConnectionCompositorService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating
GREEN
Hash:
F7D3596F1BC65D2B558627125DCB05AA
* @ConQAT.Rating
YELLOW
Hash:
22616D8ACADDDEB341A7C1A4B47C75D3
*/
public
class
ConnectCommand
extends
Command
{
...
...
@@ -89,12 +90,13 @@ public class ConnectCommand extends Command {
if
(
sourceParent
==
targetParent
)
{
return
sourceParent
;
}
if
(
sourceParent
.
eContainer
()
==
targetParent
)
{
if
(
isAncestor
(
sourceParent
,
targetParent
)
)
{
return
targetParent
;
}
if
(
sourceParent
==
targetParent
.
eContainer
())
if
(
isAncestor
(
targetParent
,
sourceParent
))
{
return
sourceParent
;
}
return
sourceParent
.
eContainer
();
}
...
...
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