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
throw new InvocationTargetException(ex);
					}
				}
			};
			
			if (inEditor) {
				
				r.run(nullProgressMonitor);
			} else {
				ProgressMonitorDialog pd= new ProgressMonitorDialog(shell);
				pd.run(true, false, r);
			}
	 	} catch(InvocationTargetException ex) {
			JavaPlugin.log(ex);
			MessageDialog.openError(shell, errorTitle, errorMessage);
			
		} catch(InterruptedException ex) {
			
			
		} catch(CoreException ex) {
			JavaPlugin.log(ex);
			MessageDialog.openError(shell, errorTitle, errorMessage);
		} finally {
			if (buffer != null)
				TextBuffer.release(buffer);
		}
	}
	
	/**
	 * Creates a TextEdit for inserting the given lines into the container.