From df6e0f1d0f5c4505ea41bb92a9e157fc3dd50baa Mon Sep 17 00:00:00 2001 From: Alois Zoitl Date: Thu, 25 Apr 2024 18:30:38 +0200 Subject: [PATCH] Interface pins where not correctly added in expanded subapp viewers when going into an expanded subapp we are now showing a non editable viewer of the expanded subapp content. In these viewers the interface pin of the expanded subapp where shown as it was an expanded subapp inside of the subapp. this lead to connection artifacts from the outside to be shown inside. --- .../network/viewer/CompositeViewerEditPartFactory.java | 6 +++--- .../editparts/SubappViewerEditPartFactory.java | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/org.eclipse.fordiac.ide.fbtypeeditor.network/src/org/eclipse/fordiac/ide/fbtypeeditor/network/viewer/CompositeViewerEditPartFactory.java b/plugins/org.eclipse.fordiac.ide.fbtypeeditor.network/src/org/eclipse/fordiac/ide/fbtypeeditor/network/viewer/CompositeViewerEditPartFactory.java index c899db94c4..136296e6aa 100644 --- a/plugins/org.eclipse.fordiac.ide.fbtypeeditor.network/src/org/eclipse/fordiac/ide/fbtypeeditor/network/viewer/CompositeViewerEditPartFactory.java +++ b/plugins/org.eclipse.fordiac.ide.fbtypeeditor.network/src/org/eclipse/fordiac/ide/fbtypeeditor/network/viewer/CompositeViewerEditPartFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013 - 2017 Profactor GmbH, fortiss GmbH + * Copyright (c) 2013, 2024 Profactor GmbH, fortiss GmbH * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -54,7 +54,7 @@ public CompositeViewerEditPartFactory(final GraphicalEditor editor, final FBNetw @Override protected EditPart getPartForElement(final EditPart context, final Object modelElement) { if (modelElement instanceof final IInterfaceElement iElement) { - return getPartForInterfaceElement(iElement); + return getPartForInterfaceElement(context, iElement); } if (modelElement instanceof AdapterFB) { return new AdapterFBEditPart() { @@ -80,7 +80,7 @@ public void performDirectEdit() { return super.getPartForElement(context, modelElement); } - protected EditPart getPartForInterfaceElement(final IInterfaceElement ie) { + protected EditPart getPartForInterfaceElement(final EditPart context, final IInterfaceElement ie) { if (fbInstance == ie.eContainer().eContainer()) { return new CompositeInternalInterfaceEditPartRO(); } diff --git a/plugins/org.eclipse.fordiac.ide.subapptypeeditor/src/org/eclipse/fordiac/ide/subapptypeeditor/editparts/SubappViewerEditPartFactory.java b/plugins/org.eclipse.fordiac.ide.subapptypeeditor/src/org/eclipse/fordiac/ide/subapptypeeditor/editparts/SubappViewerEditPartFactory.java index 2987a2d3d8..e2a1f87ecf 100644 --- a/plugins/org.eclipse.fordiac.ide.subapptypeeditor/src/org/eclipse/fordiac/ide/subapptypeeditor/editparts/SubappViewerEditPartFactory.java +++ b/plugins/org.eclipse.fordiac.ide.subapptypeeditor/src/org/eclipse/fordiac/ide/subapptypeeditor/editparts/SubappViewerEditPartFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021 Primemetals Austria GmbH + * Copyright (c) 2021, 2024 Primemetals Austria GmbH * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -13,6 +13,7 @@ *******************************************************************************/ package org.eclipse.fordiac.ide.subapptypeeditor.editparts; +import org.eclipse.fordiac.ide.application.editparts.SubAppForFBNetworkEditPart; import org.eclipse.fordiac.ide.application.editparts.TargetInterfaceElement; import org.eclipse.fordiac.ide.fbtypeeditor.network.viewer.CompositeViewerEditPartFactory; import org.eclipse.fordiac.ide.model.libraryElement.FBNetwork; @@ -45,11 +46,11 @@ protected EditPart getPartForFBNetwork(final FBNetwork fbNetwork) { } @Override - protected EditPart getPartForInterfaceElement(final IInterfaceElement ie) { - if ((ie.getFBNetworkElement() instanceof UntypedSubApp)) { + protected EditPart getPartForInterfaceElement(final EditPart context, final IInterfaceElement ie) { + if ((ie.getFBNetworkElement() instanceof UntypedSubApp) && (context instanceof SubAppForFBNetworkEditPart)) { return new UntypedSubAppInterfaceElementEditPartRO(); } - return super.getPartForInterfaceElement(ie); + return super.getPartForInterfaceElement(context, ie); } }