Skip to content

Commit

Permalink
Interface pins where not correctly added in expanded subapp viewers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
azoitl committed Apr 25, 2024
1 parent f71fc7a commit df6e0f1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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() {
Expand All @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}

}

0 comments on commit df6e0f1

Please sign in to comment.