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

Tom,

Line range is a nice idea and it would work in bot cases )single and multiple/range lines). What I've been suggesting is to abstract user from the dealing with canvas, so user just have to provide the text for a line range this new annotation ruler would render a multilined text (e.g. \n delimited) on ruler's canvas. Then redraw might not be needed because rulr can either subscribe to the nification on changes in line ranges and/or annotation text.

As of ordering, I believe that in most of the cases it would be enough to show a single annotation ruler at a time and if user would need to see different info he can switch to the different annotation data provider. That would be similar to how you have to change quick diff provider (which is actually very annoying if you work with both CVS and SVN and have to jump back and worth all the time and makes me wonder why it does not allow to autodetect the quickdif providers based on the resource sharing/team configuration?).

 regards,
 Eugene


Tom Eicher wrote:

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
_______________________________________________
platform-text-dev mailing list
platform-text-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-text-dev




Back to the top