use of com.liferay.ide.xml.search.ui.editor.LiferayCustomXmlHover in project liferay-ide by liferay.
the class PortletJSPSourceViewerConfiguration method getTextHover.
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
ITextHover textHover = null;
TextHoverManager textHoverManager = SSEUIPlugin.getDefault().getTextHoverManager();
TextHoverManager.TextHoverDescriptor[] hoverDescs = textHoverManager.getTextHovers();
int i = 0;
while ((i < hoverDescs.length) && (textHover == null)) {
if (hoverDescs[i].isEnabled() && (computeStateMask(hoverDescs[i].getModifierString()) == stateMask)) {
String hoverType = hoverDescs[i].getId();
if (TextHoverManager.PROBLEM_HOVER.equalsIgnoreCase(hoverType)) {
textHover = new ProblemAnnotationHoverProcessor();
} else if (TextHoverManager.ANNOTATION_HOVER.equalsIgnoreCase(hoverType)) {
textHover = new AnnotationHoverProcessor();
} else if (TextHoverManager.COMBINATION_HOVER.equalsIgnoreCase(hoverType)) {
textHover = (ITextHover) new LiferayCustomXmlHover();
} else if (TextHoverManager.DOCUMENTATION_HOVER.equalsIgnoreCase(hoverType)) {
ITextHover[] hovers = createDocumentationHovers(contentType);
if (ListUtil.isNotEmpty(hovers)) {
textHover = hovers[0];
}
}
}
i++;
}
return textHover;
}
Aggregations