Bug 81983 [preferences] Disabling and enabling folding on small file takes forever
3.1 M4 Using enable/disable folding on a small CU takes forever. This is caused by the recent change to apply the preference to all Java editors. In another (hidden) window (Debug) I had StyledText open which (understandably) took long to react on the preference change. Non-visible editor's should not react to this change until they become visible.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
synchronized (getLockObject(annotationModel)) {
				if (annotationModel instanceof IAnnotationModelExtension) {
					((IAnnotationModelExtension)annotationModel).replaceAnnotations(fOccurrenceAnnotations, annotationMap);
				} else {
					removeOccurrenceAnnotations();
					Iterator iter= annotationMap.entrySet().iterator();
					while (iter.hasNext()) {
						Map.Entry mapEntry= (Map.Entry)iter.next(); 
						annotationModel.addAnnotation((Annotation)mapEntry.getKey(), (Position)mapEntry.getValue());
					}
				}
				fOccurrenceAnnotations= (Annotation[])annotationMap.keySet().toArray(new Annotation[annotationMap.keySet().size()]);
			}
			return Status.OK_STATUS;
		}
	}	
	
	/**
	 * Updates the occurrences annotations based
	 * on the current selection.
	 * 
	 * @param selection the text selection
	 * @param astRoot the compilation unit AST
	 * @since 3.0
	 */
	protected void updateOccurrenceAnnotations(ITextSelection selection, CompilationUnit astRoot) {
		if (fOccurrencesFinderJob != null)
			fOccurrencesFinderJob.cancel();
		if (!fMarkOccurrenceAnnotations)
			return;