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

'Switch to Editor' dialog does not include parts contributed via e4 model fragment which represent an Editor #2764

Open
feilimb opened this issue Jan 29, 2025 · 6 comments

Comments

@feilimb
Copy link
Contributor

feilimb commented Jan 29, 2025

Steps to Reproduce

To reproduce you will need to define an editor part which is contributed via an e4 model fragment (eg. via a PartDescriptor), and can be opened eg. via a Menu addition.

It should be marked as closeable and given the magic 'Editor' tag (see screenshot snippet below):

Image

Launch the IDE application and open the newly contributed Part which represents an Editor and was contributed via a model fragment.

Go to the Switch to Editor dialog, via Window/Navigation/Switch to Editor

The dialog does not include the Part contributed via model fragment which represents an Editor, it will contain any other compatibility layer editors which have been opened, eg. the simple Text Editor.

Notes

Looking at platform source code, there appears to multiple places where the 'Editor' tag is checked to perform some handling based on its presence.

Would it be possible to update the Switch to Editor dialog, to also cater for e4 part(s) contributed which represent Editor(s).

@iloveeclipse
Copy link
Member

Could you please attach a simple bundle project that contributes such an editor, so whoever is interesting in the bugfix could quickly debug the problem without wasting time on creating the reproducible example? Thanks.

@feilimb
Copy link
Contributor Author

feilimb commented Jan 30, 2025

Could you please attach a simple bundle project that contributes such an editor, so whoever is interesting in the bugfix could quickly debug the problem without wasting time on creating the reproducible example? Thanks.

Yes of course, apologies for not including in the original post. I will put that together and attach here today.

@feilimb
Copy link
Contributor Author

feilimb commented Jan 30, 2025

Sample plugin is now available on the master branch in the org.eclipse.e4.ui.examples collection.

Instructions

  • Open the Run Configurations in your Platform SDK, select the 'Runtime Workspace' run configuration, and choose the 'Select plug-ins..' - with the following dialog enter the newly added plugin id, ie. 'org.eclipse.e4.ui.examples.e4editor' - and choose OK, it should now be listed in the Plugins list/table, at the bottom, under 'Additional Plugins', ensure the checkbox is checked.
  • Run this Runtime Workspace run configuration, to start up the IDE, close the Welcome to Eclipse screen/view
  • to demonstrate the issue, open eg. a dummy text file, via File / Open and just open any text file
  • now open our E4 Editor (example), note: a menu contribution will be present in the 'Window' menu, see the screenshot below, select this to open the E4 Editor (in screenshot it appears as 'Open Dummy Editor' but on master branch now it appears as 'Open E4 Editor')

Image

  • with the E4 editor, and some random text file open, there are now effectively 2 editors open in the workspace, go to Window /Navigation / Switch to Editor... - see example screenshot below:

Image

Observed
The E4 editor is not listed in the Switch to Editor dialog, only the text editor is present

Notes
The Close Editor menu option under the File menu does close the dummy editor.

@laeubi
Copy link
Contributor

laeubi commented Jan 30, 2025

@feilimb would you mind open a PR and adding it here:

https://github.com/eclipse-platform/eclipse.platform.ui/tree/master/examples

@feilimb
Copy link
Contributor Author

feilimb commented Jan 30, 2025

@feilimb would you mind open a PR and adding it here:

https://github.com/eclipse-platform/eclipse.platform.ui/tree/master/examples

I have created a PR now (#2766), purely for the addition of sample dummy e4 editor addition/contribution via model fragment.

@feilimb
Copy link
Contributor Author

feilimb commented Feb 4, 2025

Update: the PR above, purely for addition of sample E4 Editor was now merged to master.

Therefore to reproduce this Issue, one simply needs to use the run configuration 'Runtime Workspace', but add the 'org.eclipse.e4.ui.examples.e4editor' additional plugin via the 'Select plug-ins..' option on right hand side.

Reproduction steps updated in the post above also, for full details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants