@Override public void setInput(Object input) { IDocument document= null; if (input instanceof IDocument) document= (IDocument) input; setDocument(document); }
@Override public void setInput(Object input) { IDocument document= null; if (input instanceof IDocument) document= (IDocument) input; setDocument(document); }
public void setDocument(IDocument document) { this.document = document; txtViewer.setDocument(document); }
@Override public void refresh() { setDocument(getDocument()); }
@Override public void refresh() { setDocument(getDocument()); }
public void configure(final TextViewer viewer, Document document, boolean spellCheck) { if (spellCheck && viewer instanceof ISourceViewer) { configureAsEditor((ISourceViewer) viewer, document); } else { viewer.setDocument(document); } install(viewer, spellCheck); }
@Override public Control createControl(Composite parent) { fTextViewer = new TextViewer(parent, SWT.READ_ONLY); fTextViewer.setDocument(new Document()); StyledText styleText = fTextViewer.getTextWidget(); styleText.setText("\r\n\r\n" + DebugUIMessages.EmptyViewTab_Unable_to_create + "\n" + getRenderingName() + "\n\n" + DebugUIMessages.ErrorRendering_0 + fException.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ return fTextViewer.getControl(); }
@Override public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength) { disposeVisualAnnotationModel(); if (annotationModel != null && document != null) { fVisualAnnotationModel= createVisualAnnotationModel(annotationModel); // Make sure the visual model uses the same lock as the underlying model if (annotationModel instanceof ISynchronizable && fVisualAnnotationModel instanceof ISynchronizable) { ISynchronizable sync= (ISynchronizable)fVisualAnnotationModel; sync.setLockObject(((ISynchronizable)annotationModel).getLockObject()); } fVisualAnnotationModel.connect(document); } if (modelRangeOffset == -1 && modelRangeLength == -1) super.setDocument(document); else super.setDocument(document, modelRangeOffset, modelRangeLength); if (fVerticalRuler != null) fVerticalRuler.setModel(fVisualAnnotationModel); if (fOverviewRuler != null) fOverviewRuler.setModel(fVisualAnnotationModel); }
@Override public void setDocument(IDocument document, IAnnotationModel annotationModel, int modelRangeOffset, int modelRangeLength) { disposeVisualAnnotationModel(); if (annotationModel != null && document != null) { fVisualAnnotationModel= createVisualAnnotationModel(annotationModel); // Make sure the visual model uses the same lock as the underlying model if (annotationModel instanceof ISynchronizable && fVisualAnnotationModel instanceof ISynchronizable) { ISynchronizable sync= (ISynchronizable)fVisualAnnotationModel; sync.setLockObject(((ISynchronizable)annotationModel).getLockObject()); } fVisualAnnotationModel.connect(document); } if (modelRangeOffset == -1 && modelRangeLength == -1) super.setDocument(document); else super.setDocument(document, modelRangeOffset, modelRangeLength); if (fVerticalRuler != null) fVerticalRuler.setModel(fVisualAnnotationModel); if (fOverviewRuler != null) fOverviewRuler.setModel(fVisualAnnotationModel); }
/** * Create the error page of this rendering * * @param parent the parent to add the page to */ private void createMessagePage(Composite parent) { if (fTextViewer == null) { fTextViewer = new TextViewer(parent, SWT.WRAP); fTextViewer.setDocument(new Document()); StyledText styleText = fTextViewer.getTextWidget(); styleText.setEditable(false); styleText.setEnabled(false); } }
/** * Create the error page for this rendering. * The error page is used to report any error resulted from * getting memory from a memory block. * @param parent the parent composite */ private void createErrorPage(Composite parent) { if (fTextViewer == null) { fTextViewer = new TextViewer(parent, SWT.WRAP); fTextViewer.setDocument(new Document()); StyledText styleText = fTextViewer.getTextWidget(); styleText.setEditable(false); styleText.setEnabled(false); } }
fTextViewer.setDocument(new Document()); GridData gridData = new GridData(GridData.FILL_BOTH); gridData.widthHint= 300;
titleViewer.setDocument(new Document(text));