Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 521122

Summary: Compare widget V15: Allow the widget users to customize the annotations in the editor.
Product: [ECD] Orion Reporter: libing wang <libingw>
Component: ClientAssignee: libing wang <libingw>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P2 CC: davidlaf, Silenio_Quarti
Version: 15.0   
Target Milestone: 16.0   
Hardware: PC   
OS: Mac OS X   
See Also: https://github.com/eclipse/orion.client/pull/149
Whiteboard:

Description libing wang CLA 2017-08-18 10:14:09 EDT

    
Comment 1 libing wang CLA 2017-08-18 15:14:46 EDT
Hi Rick and David:
Please try the following snippet in your code after you construct the Compare widget.
It should fix all your issues. Please let me if it does not.
*********************
    //var compare = new Compare(options, "compareCmdDiv", "twoWay", true/*, "toggleCmd"*/); //$NON-NLS-1$ //$NON-NLS-0$
    
    //Get the left hand side editor. I believe you already have this line some where.
    var mainEditor = compare.getCompareView().getWidget().getMainEditor();
 
    //The following lines will disable the TODO annotation. But if you find any other noisy annotations please let me know and we will just simply add to the "annoTypes" hash table.
    var annoTypes = {};
    annoTypes["orion.annotation.task"] = false;
    mainEditor.setAnnotationTypesVisible(annoTypes);
 
   //The following API call will disable all the hover/click behaviors on the lineNumberRuler for your left hand side editor.
    mainEditor.getTextView().getRulers()[1].getAnnotationTypePriority = function(type) {
        return 0;
    };
    
*********************
 
Note that the snippet is one-time setup so you only need to do it right after the widget is constructed.
 
I am now doing further investigations to see if you can customize the "fancy action item" on the tooltips, which will be the thing really cool to have.
 
Stay tuned,
Libing
Comment 2 Eclipse Genie CLA 2017-08-22 09:07:44 EDT
GitHub Pull Request 149 created by [libingw]
https://github.com/eclipse/orion.client/pull/149