[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.webtools] Re: QuickFix in XML Editor

Nitin Dahyabhai wrote:

Xavier Coulon wrote:
I managed to generate custom Markers (of my own type) in a plugin based on the Eclipse XML Editor. It works fine, and given the content validation result, I get error or warning markers in the left margin that are bound into the 'problems' view.
Now, I'd like to provide some 'quick fix' as we can find in the Java Editor, but for now, I'm a bit stuck.
First, I added an extension based on 'markerResolution' and it appears correctly - yet *ONLY* - in the problems view. I did not find how to get access to the 'Quick Fix' contextual menu in the editor's left column. Secondly,I noticed a 'quick assistant' that provides a 'surround with element' when I press 'Ctrl+1' as item I want to fix is selected in the editor.
Adding a 'org.e.wst.sse.ui.quickFixProcessor' targeting a 'problemType' that matches an attribute of the same name in my custom marker does not seem to work :-( BTW, this custom attribute that was also declared in the plugin.xml


Can you tell me what are the differences between 'quick fix' and 'quick assistant' (or is it just the same) ?
Is it possible to have quickfix in the XML Editor's left margin ?
Otherwise, how can I contribute to the 'quick assist' contextual menu ?

The order should be to present any available Quick Fixes first, and then if there aren't any, to offer Quick Assists. But they're essentially doing the same thing, the former just being tied to a problem annotation of some kind.

If you were using 'org.e.wst.sse.ui.quickFixProcessor' literally, it might just be that that's an incorrect form of "org.eclipse.wst.sse.ui.quickFixProcessor". Could you post the part of your plugin.xml that's meant to contribute your processor?

Hello Nitin,

Thank you for your clarifications. My confusion between quickAssist and QuickFix was that the QuickFixProcessor extension documentation states :
"This extension point is used to associate a quick *ASSIST* processor in Structured Text Editors with a specific "kind" of problem (a marker or annotation of a certain type or having certain attribute values)."


It's a clearer to me now.

In my plugin.xml file, I have the following extensions :

<extension
        id="org.log4jconfig.xml.editor.deprecatedElementMarker"
        name="Log4jconfig warning marker for deprecated elements"
        point="org.eclipse.core.resources.markers">
     <super  type="org.eclipse.core.resources.problemmarker">
     </super>
     <super type="org.eclipse.core.resources.textmarker">
     </super>
     <persistent value="true">
     </persistent>
     <attribute name="problemType">
     </attribute>
     <attribute name="baseElement">
     </attribute>
  </extension>

<extension
id="org.log4jconfig.xml.editor.quickfix.deprecatedElementQuickFix"
point="org.eclipse.wst.sse.ui.quickFixProcessor">
<quickFixProcessor
class="org.log4jconfig.xml.editor.quickfix.DeprecatedElementQuickAssistProcessor"
problemType="org.log4jconfig.xml.editor.deprecatedElementProblemType">
</quickFixProcessor>
</extension>


<extension
point="org.eclipse.ui.ide.markerResolution">
<markerResolutionGenerator
class="org.log4jconfig.xml.editor.quickfix.DeprecatedElementMarkerResolutionGenerator"
markerType="org.log4jconfig.xml.editor.deprecatedElementMarker">
</markerResolutionGenerator>
</extension>
As I mentionned in my initial post, the XML editor provides my problem markers (error or warning) in the left margin when it is necessary, and from the 'Problems' view, the 'Quick Fix' item is available from the contextual menu. What I would like is to have the same menu item from the contextual menu bound to the marker in the xml editor margin. What should I add ?


Thank you in advance
Regards,
Xavier