Menu

#30 Free patch for XML editor plugin

v0.x
open
nobody
xml (4)
5
2003-05-17
2003-05-16
No

Hi, I'm building tooling that adds problem markers for the
xml files used by the Tapestry project over at Jakarta.

I noticed that the xml editor (and maybe the others)
don't show the overview ruler or annotations in the
source (squigly lines).

I will attach two files that fix this:

1. A class called PreferenceStoreWrapper that wraps
the XMLPlugin's store and delegates queries for global
Text editor preferences to the EditorsPlugin prefs.

2. A modified copy of XMLEditor that uses the above.

The changes in XMLEditor are miniscule - one line
added to the constructor and a dispose method added.

Works great, the solar eclispe editor now marks the
annotations nicely, shows the overview ruler, and if the
global text editor preferences change, the editor updates
itself automagically.

Cheers,

Geoff

Discussion

  • Geoffrey Longman

     
  • Geoffrey Longman

    Logged In: YES
    user_id=387057

    attaching the wrapper class...

     
  • Geoffrey Longman

     
  • Geoffrey Longman

    Logged In: YES
    user_id=387057

    Oops, there's a goof in PreferenceStoreWrapper...

    The method contains() should return 'result' instead of false.

    Geoff

     
  • Igor Malinin

    Igor Malinin - 2003-05-17

    Logged In: YES
    user_id=346040

    I would ask you a bit more to better understand the problem.

    What preferences in preference store are responsible for
    annotations? overview ruler? (ok, I could find it somewhere
    in documentation...)

    The more important which I don't understand is how squigly
    lines are working... tell in two words with references where
    I could find more info...

    And thanks for patch - I will review it shortly...

     
  • Igor Malinin

    Igor Malinin - 2003-05-17
    • milestone: --> v0.x
     
  • Geoffrey Longman

    Logged In: YES
    user_id=387057

    The preference keys are defined in the file
    org.eclipse.ui.editors.text.TextEditorPreferenceConstants

    The preference pages for the Default text editor are set by
    going to Window->Preferences->Workbench->Editors-
    >TextEditor

    The values are stored in the prefs for the EditorsPlugin.

    Now the solarEclipse editor extends TextEditor, so you get
    all the ruler, overview ruler and annotation support (squigglys)
    for free. But they are not activated unless the preferences
    referred to above are set one way or the other.

    You can design your own preference pages and store the
    values in the XMLPlugin preferences, but why bother when
    they are already set? The only reason to do that is if you
    wanted to give users the ability to override the EditorsPlugin
    prefs.

    My plugin has a builder that parses Tapestry xml files and
    adds various resource markers to the files when problems
    occur (for example, validation). The XMLEditor does display
    the markers in the ruler, but I like to see the annotations too.

    XMLBuddy can't do this
    XMen can't do this

    Now SolarEclipse can

    Geoff

     
  • Geoffrey Longman

    Logged In: YES
    user_id=387057

    Squigglys

    Open Help goto

    Platform Plugin Developer Guide->Programmer's Guide-
    >Editors->Source Viewers and Annotations

     

Log in to post a comment.