Search in sources :

Example 1 with ICEditor

use of org.eclipse.cdt.ui.ICEditor in project linuxtools by eclipse.

the class GcovAnnotationModelTracker method annotateCEditor.

private void annotateCEditor(IWorkbenchPartReference partref) {
    IWorkbenchPart part = partref.getPart(false);
    if (part instanceof ICEditor) {
        ICEditor editor = (ICEditor) part;
        ICElement element = CDTUITools.getEditorInputCElement(editor.getEditorInput());
        IProject project = element.getCProject().getProject();
        // Attach our annotation model to any compatible editor. (ICEditor)
        GcovAnnotationModel.attach((ITextEditor) part);
        // If a user triggers a build we will not render annotations.
        ResourcesPlugin.getWorkspace().addResourceChangeListener(new ProjectBuildListener(project, editor), IResourceChangeEvent.POST_BUILD);
    }
}
Also used : IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) ICElement(org.eclipse.cdt.core.model.ICElement) IProject(org.eclipse.core.resources.IProject) ICEditor(org.eclipse.cdt.ui.ICEditor)

Aggregations

ICElement (org.eclipse.cdt.core.model.ICElement)1 ICEditor (org.eclipse.cdt.ui.ICEditor)1 IProject (org.eclipse.core.resources.IProject)1 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)1