use of org.eclipse.ui.internal.texteditor.rulers.RulerColumnTarget in project eclipse.platform.text by eclipse.
the class RulerColumnDescriptor method matchesEditor.
/**
* Returns <code>true</code> if this contribution matches the passed editor, <code>false</code> if not.
*
* @param editor the editor to check
* @return <code>true</code> if this contribution targets the passed editor
*/
public boolean matchesEditor(ITextEditor editor) {
Assert.isLegal(editor != null);
RulerColumnTarget target = getTarget();
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);
}
Aggregations