|
|
|
|
Re: Hovers on keywors crashes [message #1786674 is a reply to message #1786673] |
Wed, 09 May 2018 08:30 |
Adrian Yankov Messages: 16 Registered: March 2018 |
Junior Member |
|
|
I do not have any Xbase classes.
Which one should I replace it with?
BTW,
I changed my manifest.file in the UI and added
Import-Package: com.google.inject;version="1.4.0",
com.google.inject.binder;version="1.4.0",
com.google.inject.internal,
com.google.inject.internal.util,
com.google.inject.matcher;version="1.4.0",
com.google.inject.name;version="1.4.0",
com.google.inject.spi;version="1.4.0",
com.google.inject.util;version="1.4.0",
Now I just get FrameworkError.
|
|
|
|
Re: Hovers on keywors crashes [message #1786678 is a reply to message #1786676] |
Wed, 09 May 2018 08:44 |
Adrian Yankov Messages: 16 Registered: March 2018 |
Junior Member |
|
|
The new instance runs.
However, I had to change the label provider to getLabelProvider()
public class MyXbaseHoverProvider extends DefaultEObjectHoverProvider {
/** Utility mapping keywords and hovertext. */
@Inject MyKeywordHovers keywordHovers;
@Override
protected XtextBrowserInformationControlInput getHoverInfo(EObject obj, IRegion region, XtextBrowserInformationControlInput prev) {
if (obj instanceof Keyword) {
String html = getHoverInfoAsHtml(obj);
if (html != null) {
StringBuffer buffer = new StringBuffer(html);
HTMLPrinter.insertPageProlog(buffer, 0, getStyleSheet());
HTMLPrinter.addPageEpilog(buffer);
return new XtextBrowserInformationControlInput(prev, obj, buffer.toString(),getLabelProvider());
}
}
return super.getHoverInfo(obj, region, prev);
}
@Override
protected String getHoverInfoAsHtml(EObject o){
if (o instanceof Keyword)
return keywordHovers.hoverText((Keyword) o);
return super.getHoverInfoAsHtml(o);
}
}
I will try and see if it works.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.43165 seconds