use of org.python.pydev.editor.hover.PyEditorTextHoverDescriptor in project Pydev by fabioz.
the class PyEditConfiguration method getTextHover.
@Override
public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
/**
* Return the combining hover if the preferences are set accordingly and the state mask matches.
*/
if (PyHoverPreferencesPage.getCombineHoverInfo()) {
PyEditorTextHoverDescriptor combiningHover = PydevPlugin.getCombiningHoverDescriptor();
if (combiningHover.getStateMask() == stateMask) {
return new PyEditorTextHoverProxy(combiningHover, contentType);
}
}
/**
* We return the highest priority registered hover whose state mask matches. If two or more hovers
* have the highest priority, it is indeterminate which will be selected. The proper way to combine
* hover info is to select that option on the PyDev->Editor->Hover preference page. This will cause
* the combining hover to be returned by the code above.
*/
PyEditorTextHoverDescriptor[] hoverDescs = PydevPlugin.getDefault().getPyEditorTextHoverDescriptors();
int i = 0;
while (i < hoverDescs.length) {
if (hoverDescs[i].isEnabled() && hoverDescs[i].getStateMask() == stateMask) {
return new PyEditorTextHoverProxy(hoverDescs[i], contentType);
}
i++;
}
return null;
}
use of org.python.pydev.editor.hover.PyEditorTextHoverDescriptor in project Pydev by fabioz.
the class PydevPlugin method getCombiningHoverDescriptor.
public static PyEditorTextHoverDescriptor getCombiningHoverDescriptor() {
if (combiningHoverDescriptor == null) {
combiningHoverDescriptor = new PyEditorTextHoverDescriptor(new PydevCombiningHover());
initializeDefaultCombiningHoverPreferences();
PyEditorTextHoverDescriptor.initializeHoversFromPreferences(new PyEditorTextHoverDescriptor[] { combiningHoverDescriptor });
}
return combiningHoverDescriptor;
}
Aggregations