public IInformationControl createInformationControl(Shell parent) { fControl= new SourceViewerInformationControl(parent, SWT.TOOL | fOrientation, SWT.NONE); fControl.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) { fControl= null; } }); return fControl; }
@Override public Point computeSizeHint() { Point size= super.computeSizeHint(); size.x= Math.min(size.x, fMaxWidth); size.y= Math.min(size.y, fMaxHeight); return size; }
@Override public boolean hasContents() { return super.hasContents() && fMaxWidth > 0; }
Display display= fShell.getDisplay(); initializeColors(); fText.setBackground(fBackgroundColor); initializeFont(); fStatusTextForegroundColor= new Color(fStatusField.getDisplay(), blend(fBackgroundColor.getRGB(), javaDefaultColor, 0.56f)); fStatusField.setForeground(fStatusTextForegroundColor); fStatusField.setBackground(fBackgroundColor); addDisposeListener(this);
fShell.setBackground(display.getSystemColor(SWT.COLOR_BLACK)); initializeColors(); fText.setBackground(fBackgroundColor); initializeFont(); addDisposeListener(this);
@Override public IInformationControl createInformationControl(Shell parent) { return new SourceViewerInformationControl(parent, true, fOrientation, null); } };
public void setInput(Object input) { if (input instanceof String) setInformation((String)input); else setInformation(null); }
/** * {@inheritDoc} */ public final void dispose() { if (!fIsSystemBackgroundColor) fBackgroundColor.dispose(); if (fShell != null && !fShell.isDisposed()) fShell.dispose(); else widgetDisposed(null); }
/** * Initialize the font to the Java editor font. * * @since 3.2 */ private void initializeFont() { fTextFont= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT); StyledText styledText= getViewer().getTextWidget(); styledText.setFont(fTextFont); }
@Override public Rectangle computeTrim() { Rectangle trim= fShell.computeTrim(0, 0, 0, 0); addInternalTrim(trim); return trim; }
Display display= fShell.getDisplay(); initializeColors(); fText.setBackground(fBackgroundColor); initializeFont(); fStatusTextForegroundColor= new Color(fStatusField.getDisplay(), blend(fBackgroundColor.getRGB(), javaDefaultColor, 0.56f)); fStatusField.setForeground(fStatusTextForegroundColor); fStatusField.setBackground(fBackgroundColor); addDisposeListener(this);
@Override public IInformationControl createInformationControl(Shell parent) { return new SourceViewerInformationControl(parent, true, fOrientation, null); } };
public void setInput(Object input) { if (input instanceof String) setInformation((String)input); else setInformation(null); }
@Override public final void dispose() { if (!fIsSystemBackgroundColor) fBackgroundColor.dispose(); if (fShell != null && !fShell.isDisposed()) fShell.dispose(); else widgetDisposed(null); fKindToViewerConfiguration= null; }
/** * Initialize the font to the Java editor font. * * @since 3.2 */ private void initializeFont() { fTextFont= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT); StyledText styledText= getViewer().getTextWidget(); styledText.setFont(fTextFont); }
@Override public Rectangle computeTrim() { Rectangle trim= fShell.computeTrim(0, 0, 0, 0); addInternalTrim(trim); return trim; }
@Override public IInformationControl createInformationControl(Shell parent) { fControl= new SourceViewerInformationControl(parent, false, fOrientation, JavaPlugin.getAdditionalInfoAffordanceString()); fControl.addDisposeListener(new DisposeListener() { @Override public void widgetDisposed(DisposeEvent e) { fControl= null; } }); return fControl; }
@Override public IInformationControl createInformationControl(Shell shell) { return new SourceViewerInformationControl(shell, true, getOrientation(), 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); } }); } } }
@Override public Point computeSizeHint() { Point size= super.computeSizeHint(); size.x= Math.min(size.x, fMaxWidth); size.y= Math.min(size.y, fMaxHeight); return size; }