[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform] FAQ How do I implement Quick Fixes for my own language? Problem!
|
- From: Frank Becker <Frank@xxxxxxxxxxxxxxx>
- Date: Sun, 3 Dec 2006 13:48:24 +0000 (UTC)
- Newsgroups: eclipse.platform
- Organization: Frank Becker Computertechnik
- User-agent: Xnntp/beta04 (PPC Mac OS 10.3)
Hi,
I try to add Quick Fix to my plugin and followed the instruction given
by http://wiki.eclipse.org/index.php/
FAQ_How_do_I_implement_Quick_Fixes_for_my_own_language%3F
but I never see the Quick Fix. What is wrong?
SironQuickFixer.java:
package de.lrp.editor.sironeditor.siron;
import org.eclipse.core.resources.IMarker;
import org.eclipse.ui.IMarkerResolution;
import org.eclipse.ui.IMarkerResolutionGenerator;
class SironQuickFixer implements IMarkerResolutionGenerator {
public IMarkerResolution[] getResolutions(IMarker mk) {
return new IMarkerResolution[] {
new SironQuickFix("Fix #1 for " /*+problem*/), //$NON-
NLS-1$
new SironQuickFix("Fix #2 for "/*+problem*/), //$NON-
NLS-1$
};
}
}
SironQuickFix.java:
package de.lrp.editor.sironeditor.siron;
import org.eclipse.core.resources.IMarker;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IMarkerResolution;
public class SironQuickFix implements IMarkerResolution{
String label;
SironQuickFix(String label) {
this.label = label;
}
public String getLabel() {
return label;
}
public void run(IMarker marker) {
MessageDialog.openInformation(null, "QuickFix Demo", //$NON-
NLS-1$
"This quick-fix is not yet implemented"); //$NON-NLS-1$
}
}
plugin.xml has
<extension
id="myproblem"
point="org.eclipse.core.resources.markers">
<super type="org.eclipse.core.resources.problemmarker"/>
<super type="de.lrp.editor.siron.mymarker"/>
<attribute name="myAttribute" />
<persistent value="true" />
</extension>
<extension point="org.eclipse.ui.ide.markerResolution">
<markerResolutionGenerator
markerType="de.lrp.editor.siron.myproblem"
class="de.lrp.editor.sironeditor.siron.SironQuickFixer"/>
</extension>
Thanks
Frank