MessageDialog.openInformation(shell, errorTitle, errorMessage);
MessageDialog.openError(shell, errorTitle, errorMessage);
	public void run(IAction action) {				String errorTitle= CompareMessages.getString("ReplaceFromHistory.title"); //$NON-NLS-1$		String errorMessage= CompareMessages.getString("ReplaceFromHistory.internalErrorMessage"); //$NON-NLS-1$				Shell shell= JavaPlugin.getActiveWorkbenchShell();		// shell can be null; as a result error dialogs won't be parented				ISelection selection= getSelection();		IMember input= getEditionElement(selection);		if (input == null) {			// shouldn't happen because Action should not be enabled in the first place			MessageDialog.openInformation(shell, errorTitle, errorMessage);			return;		}				IFile file= getFile(input);		if (file == null) {			MessageDialog.openError(shell, errorTitle, errorMessage);			return;		}												boolean inEditor= beingEdited(file);		if (inEditor)			input= (IMember) getWorkingCopy(input);		// get a TextBuffer where to insert the text		TextBuffer buffer= null;		try {			buffer= TextBuffer.acquire(file);			ResourceBundle bundle= ResourceBundle.getBundle(BUNDLE_NAME);			EditionSelectionDialog d= new EditionSelectionDialog(shell, bundle);						ITypedElement target= new JavaTextBufferNode(buffer, inEditor);			ITypedElement[] editions= buildEditions(target, file);			ITypedElement ti= d.selectEdition(target, editions, input);									if (ti instanceof IStreamContentAccessor) {				IStreamContentAccessor sca= (IStreamContentAccessor) ti;																		// from the edition get the lines (text) to insert				String[] lines= null;				try {					lines= JavaCompareUtilities.readLines(((IStreamContentAccessor) ti).getContents());												} catch (CoreException ex) {					JavaPlugin.log(ex);				}				if (lines == null) {					MessageDialog.openError(shell, errorTitle, "couldn't get text to insert");					return;				}								TextEdit edit= new MemberEdit(input, MemberEdit.REPLACE, lines,										CodeFormatterPreferencePage.getTabSize());				TextBufferEditor editor= new TextBufferEditor(buffer);				editor.add(edit);				editor.performEdits(new NullProgressMonitor());								TextBuffer.commitChanges(buffer, false, new NullProgressMonitor());			}		} catch(CoreException ex) {			JavaPlugin.log(ex);			MessageDialog.openError(shell, errorTitle, "error with TextBuffer");		} finally {			if (buffer != null)				TextBuffer.release(buffer);		}	}