-
Notifications
You must be signed in to change notification settings - Fork 1
Eclipse Contribution
CodeLens are displayed in a view zone (virtual lines). StyledText doesn't support this kind of features, that's why I had to fork StyledText. The fork of StyledText is done with Javassist (by updating at runtime orginal behaviour of StyledTextRenderer), but the best thing is that Eclipse change their code to support view zones (virtual lines).
This section explains the idea of view zone and explains which code of Eclipse should be updated.
Each line of StyledText are managed with an ITextLayout instance. This layout instance manage width, height of line. The StyledTextRenderer manage a pool of ITextLayout and each line have the same line spacing.
To support view zone, the idea is to give the capability to set a line spacing for a given line.
package org.eclipse.swt.custom.provisional;
public interface ILineSpacingProvider {
Integer getLineSpacing(int lineIndex);
}
To initialize line spacing provider, StyledText should provide an new setLineSpacingProvider method like this:
public void setLineSpacingProvider() {
}
StyledText#setLineSpacingProvider(ILineSpacingProvider lineSpacingProvider) like this: