QuickFix in XML Editor [message #231027] |
Tue, 05 May 2009 12:05 |
Xavier Coulon Messages: 58 Registered: July 2009 |
Member |
|
|
Hello,
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 ?
Thank you in advance
Regards,
Xavier
|
|
|
Re: QuickFix in XML Editor [message #231210 is a reply to message #231027] |
Tue, 12 May 2009 02:06 |
|
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?
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: QuickFix in XML Editor [message #231473 is a reply to message #231210] |
Mon, 18 May 2009 08:22 |
Xavier Coulon Messages: 58 Registered: July 2009 |
Member |
|
|
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.deprecatedElementQuickFi x "
point="org.eclipse.wst.sse.ui.quickFixProcessor">
<quickFixProcessor
class=" org.log4jconfig.xml.editor.quickfix.DeprecatedElementQuickAs sistProcessor "
problemType="org.log4jconfig.xml.editor.deprecatedElementProblemType ">
</quickFixProcessor>
</extension>
<extension
point="org.eclipse.ui.ide.markerResolution">
<markerResolutionGenerator
class=" org.log4jconfig.xml.editor.quickfix.DeprecatedElementMarkerR esolutionGenerator "
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
|
|
|
|
Re: QuickFix in XML Editor [message #529939 is a reply to message #528965] |
Tue, 27 April 2010 18:44 |
|
Generally I'd expect it to be invoked the same way as Quick Assist and Quick Fix in other editors: through Ctrl+1, not a menu of any sort.
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
Re: QuickFix in XML Editor [message #531032 is a reply to message #530978] |
Mon, 03 May 2010 12:54 |
|
On 5/3/2010 5:18 AM, Yura wrote:
> Here is my plugin.xml code example. Fixes work only from Problem view.
> They are not available from editor context menu and Ctrl+1 accelerator.
>
....
> <extension
> point="org.eclipse.wst.sse.ui.sourcevalidation">
> <validator
> class="org.jboss.tools.jsf.web.validation.jsf2.JSF2SourceValidator "
> id="org.jboss.tools.jsf.jsf2sourcevalidator"
> scope="total">
> <contentTypeIdentifier
> id="org.eclipse.wst.html.core.htmlsource">
> <partitionType id="org.eclipse.wst.html.HTML_DEFAULT"/>
> </contentTypeIdentifier>
> <contentTypeIdentifier
> id="org.eclipse.jst.jsp.core.jspsource">
> <partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP"/>
> </contentTypeIdentifier>
> </validator>
> </extension>
> <extension
> point="org.eclipse.wst.sse.ui.quickFixProcessor">
> <quickFixProcessor
> class="org.jboss.tools.jsf.QuickAssistProcessor1"
> problemType="org.jboss.tools.jsf.jsf2problemmarker">
> </quickFixProcessor>
> </extension>
Do the IMessages your source validator reports have a "problemType"
attribute that equals the value your QuickFixProcessor specifies in its
extension point element?
--
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
Powered by
FUDForum. Page generated in 0.03446 seconds