Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-text-dev] RevisionRulerColumn in textViewer

Eugene Kuleshov wrote:

So, what I am suggesting is to have some sort of simplier UI that would take care of all the canvas rendering, etc and can be extended in the future to provide more high level API.

If I understand correctly, you suggest an AbstractRulerColumn base class that would call a method similar to the following for every line that needs painting:

/**
* Paint the ruler representation for the given document line on the GC.
* * @param documentLine a line in the document displayed in the text viewer
* @param gc the graphics context to draw on
* @param y_offset the y offset on the GC corresponding
*        to the document line in the text viewer.
*/
protected abstract void paintLine(int documentLine, GC gc, int y_offset);


It should also allow the contributor to trigger redrawing of a line range based on its UI model (for example to render focus or to react to model changes):

/**
* Triggers a redraw of a certain line range.
*/
protected final void redraw(ILineRange range);


This would be enough for most line-based ruler columns (such as the line number column) but would limit contributions that want to do more. The Quick Diff and Revision columns for example have a notion of contiguous line ranges (ChangeRegions or 'Hunks') that are painted as a whole, not line based. It would be possible to adapt them to line based painting, though.

Of course, the other open questions (ordering etc.) still remain.

-tom


Back to the top