fOldValue = ""; //$NON-NLS-1$
fViewer = new SourceViewer(parent, null, SWT.BORDER | SWT.V_SCROLL
| SWT.H_SCROLL | SWT.LEFT_TO_RIGHT);
fViewer.setInput(parent);
final IDocument document = new Document();
fViewer.setDocumentPartitioning(IErlangPartitions.ERLANG_PARTITIONING);
// setDocumentPartitioning
// JDIDebugUIPlugin.getDefault().getJavaTextTools()
// .setupJavaDocumentPartitioner(document,
// IJavaPartitions.JAVA_PARTITIONING);
// we can only do code assist if there is an associated type
// final IResource r = fBreakpoint.getMarker().getResource();
// if (r != null) {
// final IErlModel model = ErlangCore.getModel();
// final IErlElement element = model.findElement(r);
// if (element!= null && element.getKind() ==
// IErlElement.Kind.MODULE) {
// final int lineNumber = fBreakpoint.getMarker()
// .getAttribute(IMarker.LINE_NUMBER, -1);
// IJavaDebugContentAssistContext context = null;
// final IType type = BreakpointUtils.getType(fBreakpoint);
// if (type == null) {
// context = new TypeContext(null, -1);
// } else {
// try {
// String source = null;
// final ICompilationUnit compilationUnit = type
// .getCompilationUnit();
// if (compilationUnit != null
// && compilationUnit.getJavaProject().getProject()
// .exists()) {
// source = compilationUnit.getSource();
// } else {
// final IClassFile classFile = type.getClassFile();
// if (classFile != null) {
// source = classFile.getSource();
// }
// }
// final int lineNumber = fBreakpoint.getMarker()
// .getAttribute(IMarker.LINE_NUMBER, -1);
// int position = -1;
// if (source != null && lineNumber != -1) {
// try {
// position = new Document(source)
// .getLineOffset(lineNumber - 1);
// } catch (final BadLocationException e) {
// JDIDebugUIPlugin.log(e);
// }
// }
// context = new TypeContext(type, position);
// } catch (final CoreException e) {
// JDIDebugUIPlugin.log(e);
// }
// }
// fCompletionProcessor = new
// JavaDebugContentAssistProcessor(context);
// fViewer.configure(new DisplayViewerConfiguration() {
// public IContentAssistProcessor getContentAssistantProcessor() {
// return fCompletionProcessor;
// }
// });
fViewer.setEditable(true);
// if we don't check upstream tracing can throw assertion exceptions
// see bug 181914
document.set(condition == null ? "" : condition); //$NON-NLS-1$
fViewer.setDocument(document);
fViewer.setUndoManager(new TextViewerUndoManager(10));
fViewer.getUndoManager().connect(fViewer);
fDocumentListener = new IDocumentListener() {
@Override