Bug 17699 Java Editor: Local Histroy menu entries are enabled for read-only files
F1 - make file read-only - open it - observe: context menu contains Local History actions. Only compare makes sense for read-only files
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaAddElementFromHistory.java
if (container instanceof IJavaElement)
			return new MemberEdit((IJavaElement)container, MemberEdit.ADD_AT_END, lines,
											CodeFormatterPreferencePage.getTabSize());
											
		return null;
	}
	
	protected boolean isEnabled(ISelection selection) {
		
		if (selection.isEmpty()) {
			if (fEditor != null) {
				
				IEditorInput editorInput= fEditor.getEditorInput();
				IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager();
				return manager.getWorkingCopy(editorInput) != null;
			}
			return false;
		}
		
		if (selection instanceof IStructuredSelection) {
			Object o= ((IStructuredSelection)selection).getFirstElement();
			if (o instanceof ICompilationUnit)
				return true;
		}
		
		return super.isEnabled(selection);
	}
}