简体   繁体   English

org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout.addStandaloneView上的NullPointerException

[英]NullPointerException at org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout.addStandaloneView

I try to add several views to my rcp project. 我尝试将多个视图添加到我的rcp项目。

At first I created plugin project with a view using Plugin Project wizard. 首先,我使用Plugin Project向导创建了一个带有视图的插件项目。 View was added by two extensions: org.eclipse.ui.perspectiveExtensions and org.eclipse.ui.views. 视图由两个扩展名添加:org.eclipse.ui.perspectiveExtensions和org.eclipse.ui.views。 I started the project and see that view was added successfully. 我启动了该项目,并看到该视图已成功添加。

Then I tried to add several views by the exactly same way. 然后,我尝试以完全相同的方式添加多个视图。 The only difference was that "standalone" property was absent. 唯一的区别是缺少“独立”属性。 Views were not added without any errors. 没有添加视图,没有任何错误。

Than I tried to comment the declaration of the initial view and restart the app. 比我尝试注释初始视图的声明并重新启动应用程序。 Result was the same - new views were not displayed. 结果相同-未显示新视图。

Than I add property "standalone=true" to the extensions of other views. 比我在其他视图的扩展中添加属性“ standalone = true”。 Аnd get the error get得到错误

java.lang.NullPointerException
at org.eclipse.ui.internal.e4.compatibility.ModeledPageLayout.addStandaloneView(ModeledPageLayout.java:243)
at org.eclipse.ui.internal.PerspectiveExtensionReader.processView(PerspectiveExtensionReader.java:289)
at org.eclipse.ui.internal.PerspectiveExtensionReader.processExtension(PerspectiveExtensionReader.java:112)
at org.eclipse.ui.internal.PerspectiveExtensionReader.readElement(PerspectiveExtensionReader.java:350)
at org.eclipse.ui.internal.registry.RegistryReader.readElements(RegistryReader.java:145)
at org.eclipse.ui.internal.registry.RegistryReader.readExtension(RegistryReader.java:156)
at org.eclipse.ui.internal.registry.RegistryReader.readRegistry(RegistryReader.java:177)
at org.eclipse.ui.internal.PerspectiveExtensionReader.extendLayout(PerspectiveExtensionReader.java:76)
at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:4038)
at org.eclipse.ui.internal.WorkbenchWindow.setup(WorkbenchWindow.java:733)

I found this bug . 我发现了这个错误 And try to do all the same on Eclipse Mars. 并尝试在Eclipse Mars上执行所有相同的操作。 Result was the same. 结果是一样的。

I uncomment declarations of the initial view with "standalone" property and delete "standalone" property from other views. 我用“ standalone”属性取消注释初始视图的声明,并从其他视图中删除“ standalone”属性。 Error disappeared. 错误消失了。

I check the code in few generated classes and didn't find any other mentions of the creation or configuration of the initial view. 我检查了几个生成的类中的代码,但没有找到其他有关初始视图的创建或配置的提及。

What other difference may be between a view, which was created by the project wizard, and a view, which was added manually? 由项目向导创建的视图和手动添加的视图之间可能还有什么区别?

Workaround: add view via code in perspective class. 解决方法:通过透视图类中的代码添加视图。

layout.addView(View.ID, IPageLayout.TOP, IPageLayout.RATIO_MAX, IPageLayout.ID_EDITOR_AREA);

http://vogella.com/tutorials/Eclipse3RCP/article.html#add-view-to-perspective-via-code http://vogella.com/tutorials/Eclipse3RCP/article.html#add-view-to-perspective-via-code

暂无
暂无

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

相关问题 org.eclipse.ui.internal.WorkbenchPage.showView的NullPointerException - NullPointerException for org.eclipse.ui.internal.WorkbenchPage.showView 日食错误-org / eclipse / ui / internal / util / SWTResourceUtil - eclipse error - org/eclipse/ui/internal/util/SWTResourceUtil Eclipse 迁移和 org.eclipse.ui.internal apis - Eclipse Migration and org.eclipse.ui.internal apis eclipse indigo包org.eclipse.ui.internal中没有的MaximizePartAction类 - MaximizePartAction class in not there in package org.eclipse.ui.internal of eclipse indigo 导入org.eclipse.ui.internal.ShowViewAction无法解析 - The import org.eclipse.ui.internal.ShowViewAction cannot be resolved org.eclipse.jdt.internal.compiler.codegen.CodeStream.newArray中的java.lang.NullPointerException - java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.codegen.CodeStream.newArray 内部编译器错误: org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.Z93F746A07423BF21C) 处的 java.lang.NullPointerException - Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:148) Eclipse RCP。 如何在org.eclipse.ui.internal中更改方法 - Eclipse RCP. How to change method in org.eclipse.ui.internal Eclipse 3.7.2的包org.eclipse.debug.internal.ui.actions.context中缺少TerminateAction.java - TerminateAction.java is missing in the Package org.eclipse.debug.internal.ui.actions.context for Eclipse 3.7.2 在“正在更新Maven项目”期间发生内部错误。 org.eclipse.m2e.wtp.WTPProjectsUtil.isM2eWtpDisabled - An internal error occurred during: “Updating Maven Project”. org.eclipse.m2e.wtp.WTPProjectsUtil.isM2eWtpDisabled
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM