public void setInput(Object input) { if (input instanceof String) setInformation((String)input); else setInformation(null); }
public void setInput(Object input) { if (input instanceof String) setInformation((String)input); else setInformation(null); }
@Override public void setInput(Object input) { String content= null; if (input instanceof String) { content= (String) input; } else if (input instanceof JavaSourceInformationInput) { content= ((JavaSourceInformationInput) input).getHoverInfo(); } setInformation(content); if (fShell != null && !fShell.isDisposed()) { Display display= fShell.getDisplay(); if (!display.isDisposed()) { display.asyncExec(new Runnable() { @Override public void run() { IJavaElement javaElement= null; if (input instanceof JavaSourceInformationInput) { javaElement= ((JavaSourceInformationInput) input).getJavaElement(); } updateViewerConfiguration(javaElement); } }); } } }
public void setInformation(String content) { super.setInformation(content); IDocument doc= getViewer().getDocument(); if (doc == null) return; // ensure that we can scroll enough ensureScrollable(); String start= null; if (IJavaPartitions.JAVA_DOC.equals(fPartition)) { start= "/**" + doc.getLegalLineDelimiters()[0]; //$NON-NLS-1$ } else if (IJavaPartitions.JAVA_MULTI_LINE_COMMENT.equals(fPartition)) { start= "/*" + doc.getLegalLineDelimiters()[0]; //$NON-NLS-1$ } if (start != null) { try { doc.replace(0, 0, start); int startLen= start.length(); getViewer().setDocument(doc, startLen, doc.getLength() - startLen); } catch (BadLocationException e) { // impossible Assert.isTrue(false); } } getViewer().getTextWidget().setHorizontalPixel(fHorizontalScrollPixel); }
@Override public void setInformation(String content) { super.setInformation(content); IDocument doc= getViewer().getDocument(); if (doc == null) return; // ensure that we can scroll enough ensureScrollable(); String start= null; if (IJavaPartitions.JAVA_DOC.equals(fPartition)) { start= "/**" + doc.getLegalLineDelimiters()[0]; //$NON-NLS-1$ } else if (IJavaPartitions.JAVA_MULTI_LINE_COMMENT.equals(fPartition)) { start= "/*" + doc.getLegalLineDelimiters()[0]; //$NON-NLS-1$ } if (start != null) { try { doc.replace(0, 0, start); int startLen= start.length(); getViewer().setDocument(doc, startLen, doc.getLength() - startLen); } catch (BadLocationException e) { // impossible Assert.isTrue(false); } } getViewer().getTextWidget().setHorizontalPixel(fHorizontalScrollPixel); }
@Override public void setInformation(String content) { super.setInformation(content); IDocument doc= getViewer().getDocument(); if (doc == null) return; // ensure that we can scroll enough ensureScrollable(); String start= null; if (IJavaPartitions.JAVA_DOC.equals(fPartition)) { start= "/**" + doc.getLegalLineDelimiters()[0]; //$NON-NLS-1$ } else if (IJavaPartitions.JAVA_MULTI_LINE_COMMENT.equals(fPartition)) { start= "/*" + doc.getLegalLineDelimiters()[0]; //$NON-NLS-1$ } if (start != null) { try { doc.replace(0, 0, start); int startLen= start.length(); getViewer().setDocument(doc, startLen, doc.getLength() - startLen); } catch (BadLocationException e) { // impossible Assert.isTrue(false); } } getViewer().getTextWidget().setHorizontalPixel(fHorizontalScrollPixel); }