简体   繁体   English

如果两个插件提供相同 class 的不同实现,则 Eclipse 插件加载 class 的顺序

[英]Order of Eclipse plugin to load a class if two plugins provide different implementation of the same class

If two different Eclipse plugins (not two versions of the same plugin) provide different implementation of the same Java class then how does an Eclipse application decides which class from which plugin to use?如果两个不同的 Eclipse 插件(不是同一插件的两个版本)提供相同 Java class 的不同实现,那么 Eclipse 应用程序如何决定使用哪个插件的 class? Is there a search/load order of plugins to search for a class implementation?是否有搜索/加载插件的顺序来搜索 class 实现?

EDIT-1 : This is my use case: EDIT-1 :这是我的用例:

We are using a commercial Eclipse application.我们正在使用商业 Eclipse 应用程序。 This application has a login dialog.这个应用程序有一个登录对话框。 the OOTB login dialog, will get the user id and password from user, and try to login when user clicks OK button on the dialog. OOTB 登录对话框,将从用户那里获取用户 ID 和密码,并在用户单击对话框上的“确定”按钮时尝试登录。

In our environment application user id and password are same as user's OS login id.在我们的环境中,应用程序用户 ID 和密码与用户的操作系统登录 ID 相同。 So, I want users to be automatically logged in using application user id and password same as OS login id.因此,我希望用户使用与操作系统登录 ID 相同的应用程序用户 ID 和密码自动登录。 The OOTB login dialog does not provide any means of doing this. OOTB 登录对话框不提供任何执行此操作的方法。 So, I was thinking if I decompile the OOTB login dialog and add that code to my plugin, in the same package, and change it to auto-login.所以,我在想,如果我反编译 OOTB 登录对话框并将该代码添加到我的插件中,在同一个 package 中,并将其更改为自动登录。

I was wondering which login dialog will be called?我想知道将调用哪个登录对话框?

No you can't override classes in other plug-ins like this.不,您不能像这样覆盖其他插件中的类。

Each plug-in has a separate classpath and won't see your class at all.每个插件都有一个单独的类路径,根本看不到您的 class。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM