Bug 21047 code formatter availability inconsistent
Sometimes the hotkey (ctrl-shift-f) and the menu entry for formatting the source code are disabled, while the entry in the context menu is enabled and works as expected. I didn't find any patterns on when this occurs till now.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
IPreferenceStore store= getPreferenceStore();
		return store.getBoolean(OVERVIEW_RULER);
	}
	
	private Color getColor(String key) {
		RGB rgb= PreferenceConverter.getColor(getPreferenceStore(), key);
		return getColor(rgb);
	}
	
	private Color getColor(RGB rgb) {
		JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
		return textTools.getColorManager().getColor(rgb);
	}
	
	private Color getColor(AnnotationType annotationType) {
		AnnotationInfo info= (AnnotationInfo) ANNOTATION_MAP.get(annotationType);
		if (info != null)
			return getColor(info.fColorPreference);
		return null;
	}
	
	/*
	 * @see AbstractTextEditor#dispose()
	 */
	public void dispose() {
		ISourceViewer sourceViewer= getSourceViewer();
		if (sourceViewer instanceof ITextViewerExtension)
			((ITextViewerExtension) sourceViewer).removeVerifyKeyListener(fBracketInserter);
		if (fPropertyChangeListener != null) {
			Preferences preferences= JavaCore.getPlugin().getPluginPreferences();