Open up Eclipse Editor in a dialog

两盒软妹~` 提交于 2019-12-25 08:12:22

问题


I have a requirement where I need to open my editor in a dialog.

The things I have are

  1. My Editor Plugin

  2. A button listener in a different plugin where I need to open this editor in a dialog

I tried one way , below is code inside that button listener

//this opens up a new workbench window
PlatformUI.getWorkbench().openWorkbenchWindow("<provide perspective id here>", null);
//this gets active window, which is the above one and opens our editor
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(myEditorInput, "editor.plugin.id");

But using above I have to hide a thousands of things from that newly opened window like Menu Bar, Other Views.

My question is can anyone help me opening the editor in a newly created dialog which comes without those menu bars and views.

Thanks in advance !


回答1:


Eclipse does not support opening editors in a dialog. Editors rely on too many things in the Eclipse framework which are not available in a dialog.

You can use the JFace SourceViewer or TextViewer classes which form the core of many text editor in a dialog.



来源:https://stackoverflow.com/questions/38603527/open-up-eclipse-editor-in-a-dialog

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!