Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added open type in editor on instance viewer screen #846

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
5df7d18
Added open type in editor on instance viewer screen
alliuqemal Nov 20, 2024
410e2d3
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 7, 2025
d79512b
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 7, 2025
ad7de81
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 8, 2025
f55b51f
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 8, 2025
210b0e4
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 9, 2025
3f18755
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 13, 2025
fc9482d
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 14, 2025
1b28d98
Merge branch 'eclipse-4diac:develop' into develop
alliuqemal Jan 17, 2025
26450d6
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 17, 2025
52b702b
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 17, 2025
523ddd6
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 20, 2025
36df2d4
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 20, 2025
f34924a
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 20, 2025
077c419
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 21, 2025
03e6cc5
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 21, 2025
b575ce0
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 22, 2025
6c34808
Merge branch 'eclipse-4diac:develop' into develop
github-actions[bot] Jan 22, 2025
bd4b15b
Added open type in editor on instance viewer screen
alliuqemal Jan 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 42 additions & 17 deletions plugins/org.eclipse.fordiac.ide.application/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,26 @@

<extension point="org.eclipse.ui.menus">
<menuContribution locationURI="menu:navigate?after=goTo">
<command commandId="org.eclipse.fordiac.ide.application.commands.openType">
<visibleWhen checkEnabled="true">
<or>
<with variable="selection" >
<count value="1" />
<iterate ifEmpty="false">
<or>
<instanceof value="org.eclipse.fordiac.ide.model.libraryElement.FBNetworkElement" />
<reference definitionId="org.eclipse.fordiac.ide.application.FBNelementEditPartSelection" />
<instanceof value="org.eclipse.fordiac.ide.model.libraryElement.IInterfaceElement" />
<instanceof value="org.eclipse.fordiac.ide.gef.editparts.InterfaceEditPart"/>
</or>
</iterate>
</with>
<with variable="activeEditor">
<adapt type="org.eclipse.fordiac.ide.model.libraryElement.FBNetworkElement" />
</with>
</or>
</visibleWhen>
</command>
<command commandId="org.eclipse.fordiac.ide.application.commands.gotoparent"
icon="platform:/plugin/org.eclipse.search/icons/full/elcl16/search_prev.png"/>
<command commandId="org.eclipse.fordiac.ide.application.commands.gotochild"
Expand Down Expand Up @@ -1253,7 +1273,7 @@
<with variable="activeEditor">
<adapt type="org.eclipse.fordiac.ide.model.libraryElement.FBNetwork" />
</with>
<with variable="selection">
<with variable="selection">
<iterate ifEmpty="true">
<or>
<instanceof value="org.eclipse.fordiac.ide.application.editparts.AbstractFBNElementEditPart" />
Expand Down Expand Up @@ -1475,15 +1495,14 @@
</command>
<command commandId="org.eclipse.fordiac.ide.application.commands.openType"
style="push">
<!-- Menu on System Explorer -->
<visibleWhen checkEnabled="true">
<with variable="selection" >
<count value="1" />
<iterate ifEmpty="false">
<or>
<instanceof value="org.eclipse.fordiac.ide.model.libraryElement.FBNetworkElement" />
<reference definitionId="org.eclipse.fordiac.ide.application.FBNelementEditPartSelection" />
<instanceof value="org.eclipse.fordiac.ide.model.libraryElement.IInterfaceElement" />
<instanceof value="org.eclipse.fordiac.ide.gef.editparts.InterfaceEditPart"/>
<instanceof value="org.eclipse.fordiac.ide.model.libraryElement.TypedSubApp" />
<instanceof value="org.eclipse.fordiac.ide.model.libraryElement.CFBInstance" />
</or>
</iterate>
</with>
Expand All @@ -1499,19 +1518,25 @@
</command>
<command commandId="org.eclipse.fordiac.ide.application.commands.openType">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is now twice in the pop-up menu

<visibleWhen checkEnabled="true">
<with variable="selection" >
<count value="1" />
<iterate ifEmpty="false">
<or>
<instanceof value="org.eclipse.fordiac.ide.model.libraryElement.FBNetworkElement" />
<reference definitionId="org.eclipse.fordiac.ide.application.FBNelementEditPartSelection" />
<instanceof value="org.eclipse.fordiac.ide.model.libraryElement.IInterfaceElement" />
<instanceof value="org.eclipse.fordiac.ide.gef.editparts.InterfaceEditPart"/>
</or>
</iterate>
</with>
<or>
<with variable="selection" >
<count value="1" />
<iterate ifEmpty="false">
<or>
<instanceof value="org.eclipse.fordiac.ide.model.libraryElement.FBNetworkElement" />
<reference definitionId="org.eclipse.fordiac.ide.application.FBNelementEditPartSelection" />
<instanceof value="org.eclipse.fordiac.ide.model.libraryElement.IInterfaceElement" />
<instanceof value="org.eclipse.fordiac.ide.gef.editparts.InterfaceEditPart"/>
</or>
</iterate>
</with>
<with variable="activeEditor">
<adapt type="org.eclipse.fordiac.ide.model.libraryElement.FBNetworkElement" />
</with>
</or>
</visibleWhen>
</command>
</command>

<command commandId="org.eclipse.fordiac.ide.application.commands.saveAsSubappType">
<visibleWhen checkEnabled="true">
<and>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.Status;
import org.eclipse.fordiac.ide.model.libraryElement.FBNetwork;
import org.eclipse.fordiac.ide.model.libraryElement.FBNetworkElement;
import org.eclipse.fordiac.ide.model.libraryElement.IInterfaceElement;
import org.eclipse.fordiac.ide.model.libraryElement.LibraryElement;
Expand Down Expand Up @@ -77,6 +78,7 @@ private static IFile getSelectedTypeFile(final ISelection sel) {
}

final LibraryElement type = switch (obj) {
case final FBNetwork fbn -> getTypeFromFbn(fbn);
case final FBNetworkElement fbnEl -> fbnEl.getType();
case final IInterfaceElement ie -> ie.getType();
default -> null;
Expand All @@ -86,6 +88,15 @@ private static IFile getSelectedTypeFile(final ISelection sel) {
return type.getTypeEntry().getFile();
}
}

return null;
}

private static LibraryElement getTypeFromFbn(final FBNetwork fbn) {
if (fbn.eContainer() instanceof final FBNetworkElement fbne) {
return fbne.getType();
}

return null;
}

Expand Down
Loading