How to make marker annotations in Eclipse extend to the whole width of the editor?









up vote
0
down vote

favorite












I'm writing a plugin for the Eclipse IDE that adds a custom marker annotation to highlight portions of the code. Currently, I use textStylePreferenceValue="BOX" in the org.eclipse.ui.editors.markerAnnotationSpecification and get a changed background color that ends at the line-break for each line. That introduces a lot of visual noise, and I would like to have the color to extend to the whole width of the editor. How can I achieve this?



If this is not possible at the moment, what would be the next steps to add this functionality to the platform?



This is what I have:
Current appearance of the marker



This is what I want:
Intended appearance of the marker










share|improve this question

























    up vote
    0
    down vote

    favorite












    I'm writing a plugin for the Eclipse IDE that adds a custom marker annotation to highlight portions of the code. Currently, I use textStylePreferenceValue="BOX" in the org.eclipse.ui.editors.markerAnnotationSpecification and get a changed background color that ends at the line-break for each line. That introduces a lot of visual noise, and I would like to have the color to extend to the whole width of the editor. How can I achieve this?



    If this is not possible at the moment, what would be the next steps to add this functionality to the platform?



    This is what I have:
    Current appearance of the marker



    This is what I want:
    Intended appearance of the marker










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm writing a plugin for the Eclipse IDE that adds a custom marker annotation to highlight portions of the code. Currently, I use textStylePreferenceValue="BOX" in the org.eclipse.ui.editors.markerAnnotationSpecification and get a changed background color that ends at the line-break for each line. That introduces a lot of visual noise, and I would like to have the color to extend to the whole width of the editor. How can I achieve this?



      If this is not possible at the moment, what would be the next steps to add this functionality to the platform?



      This is what I have:
      Current appearance of the marker



      This is what I want:
      Intended appearance of the marker










      share|improve this question













      I'm writing a plugin for the Eclipse IDE that adds a custom marker annotation to highlight portions of the code. Currently, I use textStylePreferenceValue="BOX" in the org.eclipse.ui.editors.markerAnnotationSpecification and get a changed background color that ends at the line-break for each line. That introduces a lot of visual noise, and I would like to have the color to extend to the whole width of the editor. How can I achieve this?



      If this is not possible at the moment, what would be the next steps to add this functionality to the platform?



      This is what I have:
      Current appearance of the marker



      This is what I want:
      Intended appearance of the marker







      eclipse eclipse-plugin eclipse-rcp






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 4 at 12:08









      Tobias B.

      234




      234






















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          After researching further, it seems that this is not possible at the moment, at least not easily. The relevant Eclipse sub-project seems to be "platform.text" (https://github.com/eclipse/eclipse.platform.text/). The possible textStylePreferenceValues are defined in the class "org.eclipse.ui.texteditor.AnnotationPreference", and how to paint them is defined in the class "org.eclipse.jface.text.source.AnnotationPainter".



          A low level solution could be to use a LineBackgroundListener together with the StyledText object of the editor.






          share|improve this answer






















            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53140659%2fhow-to-make-marker-annotations-in-eclipse-extend-to-the-whole-width-of-the-edito%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            After researching further, it seems that this is not possible at the moment, at least not easily. The relevant Eclipse sub-project seems to be "platform.text" (https://github.com/eclipse/eclipse.platform.text/). The possible textStylePreferenceValues are defined in the class "org.eclipse.ui.texteditor.AnnotationPreference", and how to paint them is defined in the class "org.eclipse.jface.text.source.AnnotationPainter".



            A low level solution could be to use a LineBackgroundListener together with the StyledText object of the editor.






            share|improve this answer


























              up vote
              0
              down vote













              After researching further, it seems that this is not possible at the moment, at least not easily. The relevant Eclipse sub-project seems to be "platform.text" (https://github.com/eclipse/eclipse.platform.text/). The possible textStylePreferenceValues are defined in the class "org.eclipse.ui.texteditor.AnnotationPreference", and how to paint them is defined in the class "org.eclipse.jface.text.source.AnnotationPainter".



              A low level solution could be to use a LineBackgroundListener together with the StyledText object of the editor.






              share|improve this answer
























                up vote
                0
                down vote










                up vote
                0
                down vote









                After researching further, it seems that this is not possible at the moment, at least not easily. The relevant Eclipse sub-project seems to be "platform.text" (https://github.com/eclipse/eclipse.platform.text/). The possible textStylePreferenceValues are defined in the class "org.eclipse.ui.texteditor.AnnotationPreference", and how to paint them is defined in the class "org.eclipse.jface.text.source.AnnotationPainter".



                A low level solution could be to use a LineBackgroundListener together with the StyledText object of the editor.






                share|improve this answer














                After researching further, it seems that this is not possible at the moment, at least not easily. The relevant Eclipse sub-project seems to be "platform.text" (https://github.com/eclipse/eclipse.platform.text/). The possible textStylePreferenceValues are defined in the class "org.eclipse.ui.texteditor.AnnotationPreference", and how to paint them is defined in the class "org.eclipse.jface.text.source.AnnotationPainter".



                A low level solution could be to use a LineBackgroundListener together with the StyledText object of the editor.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 2 days ago

























                answered 2 days ago









                Tobias B.

                234




                234



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53140659%2fhow-to-make-marker-annotations-in-eclipse-extend-to-the-whole-width-of-the-edito%23new-answer', 'question_page');

                    );

                    Post as a guest














































































                    Popular posts from this blog

                    Top Tejano songwriter Luis Silva dead of heart attack at 64

                    政党

                    天津地下鉄3号線