Community
Participate
Working Groups
I20060125 When developping 1.4 code in Eclipse running on a 5.0 SDK the APT UI plug-in gets loaded (activated state) through ContributedProcessorDescriptor#getProcessor(ICompilationUnit).. It should only be loaded when needed. The JDT UI extension point should allow to express the required source level. See also bug 125291.
ContributedProcessorDescriptor is part of the quick fix framework - what is the part jdt-text plays here?
I'll add that to the quickFixProcessor/quickAssistProcessor extension point
added a new property to test on: 'sourceCompliance' <quickFixProcessor name="%exampleQuickFixProcessor.name" class="org.eclipse.jdt.ui.examples.MyQuickFixProcessor" id="org.eclipse.jdt.ui.examples.MyQuickFixProcessor"> <enablement> <with variable="sourceCompliance"> <or> <equals value="'1.5'"/> <equals value="'1.6'"/> </or> </with> </enablement> </quickFixProcessor>
(for the quickFixProcessor and for the quickAssistProcessor). BTW, you can use this mechanism also to test on a project nature. <quickAssistProcessor name="%exampleQuickAssistProcessor.name" class="org.eclipse.jdt.ui.examples.MyQuickAssistProcessor" id="org.eclipse.jdt.ui.examples.MyQuickAssistProcessor"> <enablement> <with variable="projectNatures"> <iterate operator="or"> <equals value="org.eclipse.jdt.core.javanature"/> </iterate> </with> </enablement> </quickAssistProcessor>
I also added a direct attribute 'requiredSourceLevel' to quickFix/AssistProcessors This is similar to what Ferome added for 'compilationParticipant.exsd' and should be preferred as it is more performant. The enablement property is also still there, It can be used for more complex enablement expressions. But I renamed it to 'sourceLevel': <extension point="org.eclipse.jdt.ui.quickFixProcessors"> <quickFixProcessor id="AdvancedQuickFixProcessor" name="Advanced Quick Fix Processor" requiredSourceLevel="1.5" class="com.example.AdvancedQuickFixProcessor"> <handledMarkerTypes> <markerType id="org.eclipse.myplugin.spelling"/> </handledMarkerTypes> <enablement> <with variable="projectNatures"> <iterate operator="or"> <equals value="org.eclipse.jdt.core.javanature"/> </iterate> </with> </enablement> </quickFixProcessor> </extension>