@Override protected void doSetInput(Object input) { if (input instanceof IDocument) fViewer.setInput(input); else if (input == null) fViewer.setInput(new Document("")); //$NON-NLS-1$ else { IDocument document= new Document(input.toString()); JavaPlugin.getDefault().getJavaTextTools().setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING); fViewer.setInput(document); } }
@Override protected void doSetInput(Object input) { if (input instanceof IDocument) fViewer.setInput(input); else if (input == null) fViewer.setInput(new Document("")); //$NON-NLS-1$ else { IDocument document= new Document(input.toString()); JavaPlugin.getDefault().getJavaTextTools().setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING); fViewer.setInput(document); } }
protected void setInput(Object input) { if (input instanceof IDocument) fViewer.setInput(input); else if (input == null) fViewer.setInput(new Document("")); //$NON-NLS-1$ else { IDocument document= new Document(input.toString()); JavaPlugin.getDefault().getJavaTextTools().setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING); fViewer.setInput(document); } }
@Override public void setInformation(String content) { if (content == null) { fViewer.setInput(null); return; } IDocument document = new Document(content); new AntDocumentSetupParticipant().setup(document); fViewer.setDocument(document); }
/** * Sets the input of the source viewer to the given document and reveals the * region determined by the given parameter region. * * @param document the document to present * @param region the region to reveal. */ protected void setInput(IDocument document, IRegion region) { Control ctrl= getControl(); if (ctrl != null && ctrl.isDisposed()) ctrl= null; try { if (ctrl != null) ctrl.setRedraw(false); fSourceViewer.setInput(document); if (region != null && document != null) { int offset= region.getOffset(); int length= region.getLength(); if (offset >= 0 && length >= 0) { fSourceViewer.setSelectedRange(offset, length); fSourceViewer.revealRange(offset, length); } } } finally { if (ctrl != null) ctrl.setRedraw(true); } }
fSnippetViewer.setInput(this);