QuickFix (Marker Resolutions) not available in the Editor, only in Problems-View? [message #779487] |
Sun, 15 January 2012 16:51  |
Eclipse User |
|
|
|
Hello guys,
i am trying to define custom problem markers and custom Quick-Fixes for some specific eclipse editors. In particular, i'm trying with the default Text Editor (org.eclipse.ui.DefaultTextEditor) and the quasi-standard XML Editor (org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart).
I must be missing out something, but i only see my defined marker resolutions (Quick-Fixes) in the "Problems"-View (by the markers context-menu, or by the shortcut Strg+1 on some marker). However i actually expect the marker resolutions to also appear in the editor itself: When pressing Strg+1 on the marked line/characters, or on the left-hand-sided annotation bar. Just like for instance the Java editor, or also the XML editor provides the Quick-Fixes.
My extension looks like this:
<extension point="org.eclipse.ui.ide.markerResolution">
<markerResolutionGenerator
class="com.validator.test.MarkerResolutionGenerator"
markerType="org.eclipse.core.resources.problemmarker">
</markerResolutionGenerator>
</extension>
The resolution works for the basic problem markers "org.eclipse.core.resources.problemmarker", but as mentioned only in the Problems View.
What am i missing? Is there a entirely different concept/extension point responsible for providing Quick-Fixes in the editor?
I'd be glad to read your comments - thank you!
|
|
|
Re: QuickFix (Marker Resolutions) not available in the Editor, only in Problems-View? [message #781965 is a reply to message #779487] |
Sun, 22 January 2012 16:28   |
Eclipse User |
|
|
|
I don't have the problem you describe. When I add markers via below code they appear both on the problems-view and in the editor (lcIFile is an IFile of a particular editor).
IMarker lcMarker = lcIFile.createMarker(IMarker.PROBLEM);
lcMarker.setAttribute(IMarker.LINE_NUMBER, lcErrorLineNumber );
lcMarker.setAttribute(IMarker.CHAR_START, lcOffSet );
lcMarker.setAttribute(IMarker.CHAR_END, lcOffSet + lcWordLen );
lcMarker.setAttribute(IMarker.MESSAGE, lcErrorText);
lcMarker.setAttribute(IMarker.TEXT, lcErrorText);
lcMarker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
if (warning == true) {
lcMarker.setAttribute(IMarker.SEVERITY , IMarker.SEVERITY_WARNING);
} else {
lcMarker.setAttribute(IMarker.SEVERITY , IMarker.SEVERITY_ERROR);
}
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.17468 seconds