IWorkbenchPartSite site= editor.getSite();
if (site != null && target.matchesEditorId(site.getId()))
return true;
if (target.matchesClass(editor.getClass()))
return true;
IContentType contentType= getContentType(editor);
return contentType != null && target.matchesContentType(contentType);