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
if (PRINT_MARGIN.equals(p)) {
					if (isPrintMarginVisible())
						showPrintMargin();
					else
						hidePrintMargin();
					return;
				}
				
				if (PRINT_MARGIN_COLOR.equals(p)) {
					if (fPrintMarginPainter != null)
						fPrintMarginPainter.setMarginRulerColor(getColor(PRINT_MARGIN_COLOR));
					return;
				}
				
				if (PRINT_MARGIN_COLUMN.equals(p)) {
					if (fPrintMarginPainter != null)
						fPrintMarginPainter.setMarginRulerColumn(getPreferenceStore().getInt(PRINT_MARGIN_COLUMN));
					return;
				}
				
				if (OVERVIEW_RULER.equals(p))  {
					if (isOverviewRulerVisible())
						showOverviewRuler();
					else
						hideOverviewRuler();
					return;
				}
				
				AnnotationType type= getAnnotationType(p);
				if (type != null) {