code>PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().resetPerspective();此操作无效,因为我使用的是E4。this didn't work because I use E4. -clearPersistedState -persistState false-clearPersistedState -persistState false不是解决方案,因为我需要在不重新启动应用程序的情况下进行重置。is not a solution cause I need to reset without restart my App.推荐答案使用 EModelService 的$ c> resetPerspective 方法:Use the resetPerspective method of EModelService:public void resetPerspectiveModel(MPerspective persp, MWindow window)请注意 PlatformUI 和关联的API不能在纯e4应用程序中使用。Note that PlatformUI and associated APIs can't be used in a pure e4 application. 这篇关于如何在Eclipse RCP E4(而非E3)中以编程方式重置透视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-02 11:27