1.Unable to open editor, unknown editor ID 错误,你会发现你的Editor的ID和你所调用的ID写得是一模一样,控制台却总是报这个错误,说无法找到该ID。
解决办法:检查一下你在扩展editor的时候有没有添加icon属性,如果没有请加上,即使不显示图片,也要icon设为空,即plugin.xml中显示如下: icon = ""
网上有一段很经典的话来描述这个问题,顺便转来了:
Have you specified the 'icon' attribute in the plugin extension editor for your editor? It may sound strange, but the icon attribute is required if you supply your own class in the 'class' attribute to implement the IEditorPart interface.
Well, the icon itself does not need to exist, but the 'icon' attribute's field must not be empty. Without the icon defined, your editor never gets into the editor registry when the plugin extensions are read, so an attempt later to retrieve this editor by its id fails, even though the editor ID is correct.
2. 在实现IEditorInput时,其中的getToolTipText()方法切记不能返回null,否则也会报错,错误信息如下:Error opening the editor.Reason: null argument: The editor input must have a non-null name