[571221] Show instance tab inside untyped subapps
When the background (i.e., nothing) is selected inside of untyped
subapps in edition to the interface editing tabs then instance tab is
shown.
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=571221
Change-Id: I03ef2fe18194e0e3547c745f67da204877d6687d
Signed-off-by: Alois Zoitl <alois.zoitl@gmx.at>
diff --git a/plugins/org.eclipse.fordiac.ide.application/plugin.xml b/plugins/org.eclipse.fordiac.ide.application/plugin.xml
index c657162..d4bb31c 100644
--- a/plugins/org.eclipse.fordiac.ide.application/plugin.xml
+++ b/plugins/org.eclipse.fordiac.ide.application/plugin.xml
@@ -181,6 +181,9 @@
<input
type="org.eclipse.fordiac.ide.model.libraryElement.FBNetworkElement">
</input>
+ <input
+ type="org.eclipse.fordiac.ide.application.editparts.UISubAppNetworkEditPart">
+ </input>
</propertySection>
<propertySection
class="org.eclipse.fordiac.ide.application.properties.DemultiplexerSection"
diff --git a/plugins/org.eclipse.fordiac.ide.application/src/org/eclipse/fordiac/ide/application/properties/InterfaceSection.java b/plugins/org.eclipse.fordiac.ide.application/src/org/eclipse/fordiac/ide/application/properties/InterfaceSection.java
index 5820d0a..cce56b3 100644
--- a/plugins/org.eclipse.fordiac.ide.application/src/org/eclipse/fordiac/ide/application/properties/InterfaceSection.java
+++ b/plugins/org.eclipse.fordiac.ide.application/src/org/eclipse/fordiac/ide/application/properties/InterfaceSection.java
@@ -16,17 +16,24 @@
*******************************************************************************/
package org.eclipse.fordiac.ide.application.properties;
-import org.eclipse.fordiac.ide.application.editparts.AbstractFBNElementEditPart;
import org.eclipse.fordiac.ide.gef.properties.AbstractInterfaceSection;
+import org.eclipse.fordiac.ide.model.libraryElement.FBNetwork;
import org.eclipse.fordiac.ide.model.libraryElement.FBNetworkElement;
+import org.eclipse.gef.EditPart;
public class InterfaceSection extends AbstractInterfaceSection {
@Override
protected FBNetworkElement getInputType(Object input) {
- if (input instanceof AbstractFBNElementEditPart) {
- return ((AbstractFBNElementEditPart) input).getModel();
- } else if (input instanceof FBNetworkElement) {
+ if (input instanceof EditPart) {
+ input = ((EditPart) input).getModel();
+ }
+
+ if (input instanceof FBNetwork) {
+ input = ((FBNetwork) input).eContainer();
+ }
+
+ if (input instanceof FBNetworkElement) {
return (FBNetworkElement) input;
}
return null;