下面列出了org.eclipse.jface.text.DefaultInformationControl#org.eclipse.jface.text.source.IAnnotationHover 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
IAnnotationHover hover = annotationHoverProvider.get();
if (hover instanceof ISourceViewerAware) {
((ISourceViewerAware) hover).setSourceViewer(sourceViewer);
}
return hover;
}
public IAnnotationHover getHover() {
int activeLine= getParentRuler().getLineOfLastMouseButtonActivity();
if (fRevisionPainter.hasHover(activeLine))
return fRevisionPainter.getHover();
if (fDiffPainter.hasHover(activeLine))
return fDiffPainter.getHover();
return null;
}
@Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer)
{
return new CommonAnnotationHover(false)
{
protected boolean isIncluded(Annotation annotation)
{
return isShowInVerticalRuler(annotation);
}
};
}
@Override
public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer)
{
return new CommonAnnotationHover(true)
{
protected boolean isIncluded(Annotation annotation)
{
return isShowInOverviewRuler(annotation);
}
};
}
@Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return new HTMLAnnotationHover(false) {
@Override
protected boolean isIncluded(Annotation annotation) {
return isShowInVerticalRuler(annotation);
}
};
}
@Override
public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
return new HTMLAnnotationHover(true) {
@Override
protected boolean isIncluded(Annotation annotation) {
return isShowInOverviewRuler(annotation);
}
};
}
@Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return new HTMLAnnotationHover(false) {
@Override
protected boolean isIncluded(Annotation annotation) {
return isShowInVerticalRuler(annotation);
}
};
}
@Override
public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
return new HTMLAnnotationHover(true) {
@Override
protected boolean isIncluded(Annotation annotation) {
return isShowInOverviewRuler(annotation);
}
};
}
@Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return new HTMLAnnotationHover(false) {
@Override
protected boolean isIncluded(Annotation annotation) {
return isShowInVerticalRuler(annotation);
}
};
}
@Override
public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
return new HTMLAnnotationHover(true) {
@Override
protected boolean isIncluded(Annotation annotation) {
return isShowInOverviewRuler(annotation);
}
};
}
/**
* @Override
*/
public IAnnotationHover getAnnotationHover( ISourceViewer sourceViewer){
return new MyAnnotationHover();
}
@Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return null;
}
@Override
public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
return null;
}
public Class<? extends IAnnotationHover> bindIAnnotationHover() {
return ProblemAnnotationHover.class;
}
/**
* @return The annotation hover text provider for this editor
*/
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return annotationHover;
}
/**
* @return the annotation hover text provider for this editor
*/
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return annotationHover;
}
@Override
public void setAnnotationHover(IAnnotationHover annotationHover) {
throw new UnsupportedOperationException();
}
@Override
public Class<? extends IAnnotationHover> bindIAnnotationHover() {
return XtendAnnotationHover.class;
}
/**
* Ruler annotation
*/
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer)
{
return new TLAAnnotationHover();
}
public void setHover(IAnnotationHover hover) {
fRevisionPainter.setHover(hover);
fDiffPainter.setHover(hover);
}
@Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return null;
}
@Override
public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
return null;
}
public Class<? extends IAnnotationHover> bindIAnnotationHover() {
return XtendAnnotationHover.class;
}
@Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return new PyAnnotationHover(sourceViewer);
}
public void setAnnotationHover(IAnnotationHover annotationHover) {
viewer.setAnnotationHover(annotationHover);
}
public void setOverviewRulerAnnotationHover(IAnnotationHover annotationHover) {
viewer.setOverviewRulerAnnotationHover(annotationHover);
}
public IAnnotationHover getCurrentAnnotationHover() {
return viewer.getCurrentAnnotationHover();
}
@Override
public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
return null;
}
@Override
public IAnnotationHover getOverviewRulerAnnotationHover(ISourceViewer sourceViewer) {
return null;
}