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

After the org.eclipse.ui plugin was introduced into eclipse4 rcp, all the shortcuts defined in Application.e4xmi were disabled. #1783

Closed
TigerGod opened this issue Mar 28, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@TigerGod
Copy link

TigerGod commented Mar 28, 2024

I am using eclipse4 rcp technology. When I add the orgeclipse.ui plugin to the dependency, All the shortcuts defined in Application.e4xmi are not working. such as Ctrl+S. I'm using a simple project generated automatically by pde with no modifications, just adding the “org.eclipse.ui” plugin all over caused the shortcuts to fail. I don't think this is a problem caused by my misuse.
image
image
image

Even if I customize the ctrl+s command as well as the handler it doesn't get triggered

@TigerGod TigerGod added the bug Something isn't working label Mar 28, 2024
@merks
Copy link
Contributor

merks commented Mar 28, 2024

I expect this happens because org.eclipse.ui depends on org.eclipse.ui.workbench which defines the workbench application:

image

When the workbench starts it does this:

image

So probably your application definition is not being used it all.

I'm not sure why you are adding this dependency but probably you need to define things in a fragment if you use the workbench application:

image

@TigerGod
Copy link
Author

Thanks for the explanation. But I don't understand why the shortcut to the E4Application model is disabled after setting this system property during the Workbench creation process in eclipse. My application is a pure eclipse4 rcp with its own Application.e4xmi model, which launches the E4Workbench via E4Application, and doesn't launch the Workbench in org.eclipse.ui.workbench, so the piece of code you're identifying is something I don't think I'm didn't bother to actively execute it. I think it might be the case that the eclipse platform sets that system property ("XMI_URI_ARG") at startup, and then my e4 rcp program introduces the org.eclipse.ui plugin, which also indirectly relies on org.eclipse.ui.workbench, and then during the startup process of my e4 rcp program, somewhere in the where that property ("XMI_URI_ARG") is read again is not the same as it is after a full startup (I don't know if E4Workbench utilizes or modifies that system property when it's created), that's my guess.

@merks
Copy link
Contributor

merks commented Mar 29, 2024

I really don't know all the details of how these things might interact.

I suggest setting a breakpoint in org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(InputStream, Map) and see what resources are all being loaded for in your application. Of course you should see your *.e4xmi being loaded and being the only one used, not this one:

image

For this debug session, I've launched with a brand-new empty workspace.

@laeubi
Copy link
Contributor

laeubi commented Mar 29, 2024

Basically you can't use org.eclipse.ui an a "pure" E4 RCP app as it is all about E3, if you absolutely need that you should consider using the legacy E4 mode what basically is E3 with E4 on top of it.

@TigerGod
Copy link
Author

TigerGod commented Apr 1, 2024

Thank you. I have solved the problem I raised before, now I can add org.eclipse.ui component in pure e4 rcp and the shortcuts already work fine, the solution is to set specific BindingContext in each Part. but it is true that as you said, the api of org.eclipse.ui.* is for e3, for example the methods in PlatformUI only work for e3 Application and Workbench. For example, the methods in PlatformUI are only for e3 Application and Workbench. it seems it is still a problem with my usage, thanks again!

Translated with DeepL.com (free version)

@TigerGod
Copy link
Author

TigerGod commented Apr 1, 2024

Hopefully the platform will come out with a developer tutorial on pure e4 rcp to be placed under the plugin documentation. The content doesn't have to be too involved, but at least it should be able to guide the user step by step on how to implement a complete program and what to consider when using it, and tell us what the programming paradigm is. e4 rcp is really good, but without documentation it's really painful and difficult for users to use.

Translated with DeepL.com (free version)

@TigerGod TigerGod closed this as completed Apr 1, 2024
@TigerGod TigerGod reopened this Apr 1, 2024
@TigerGod
Copy link
Author

TigerGod commented Apr 1, 2024

I'm not sure why only vogella.com's fee-based course covers e4 right now, but if you want to get this technology out there, you can't do it without documentation. I support official e4, but not a monopoly on the technology for a fee.

@TigerGod
Copy link
Author

TigerGod commented Apr 1, 2024

If e4 rcp has detailed documentation, I am even sure that he will grow in China, and even gradually replace QT and other desktop technologies, because you can use eclispe's multiple services and integration of multiple other plug-ins will be a very convenient way of development (OSGi may not be good in the field of the Internet, but will not be taken lightly in the industrial software). Every team in a large enterprise wants to produce a finished product quickly, small enterprises also expect to utilize convenient technology and existing functions to produce results quickly to absorb investment, in the field of industrial software, the rapid integration of functions will undoubtedly greatly improve productivity. In China now is the new energy development time, in the field of many companies are doing their own products, a lot of recruitment is about eclispe rcp and plug-in technology, but it is difficult to find the right person, the reason is that the traditional e3 plug-in development is too cumbersome, high cost of learning and trouble to use. But e4 rcp is different, it is more flexible than e3 rcp, learning cost is not high (provided in the case of rich documentation), if there is no chatgpt I think I will not continue to use e4, because it is too little information. So I really hope that there will be a detailed document about e4 rcp.

@TigerGod TigerGod closed this as completed Apr 1, 2024
@TigerGod TigerGod reopened this Apr 1, 2024
@TigerGod TigerGod closed this as completed Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants