Skip to content

More access to the line numbers #127

@balage1551

Description

@balage1551

I would like to extend the functionality of the line number column by decorators (like in Eclipse, indicating errors, warnings or bookmarks, etc).

My first idea was to simply inherit from the LineNumberFactory and modify the apply method to add the additional control to. (Using, for example, a HBox to encapsulate the original control (returned by super.apply(idx)) and the decorator.

But LineNumberFactory is well hidden, which restricts to be overridden.

For one, it has no public constructor, so inheriting is impossible (If the intention was this, mark the class final to be more obvious).
So my only option would be:
(1) Use decorator pattern: encapsulating an original LineNumberFactory instance and delegating all the non-private methods.
(2) Copy the whole source of LineNumberFactory and add the code to it.

Both solution would generate a huge amount of unnecessary boiler code, and would be fragile to future implementation changes on the original class.

It would be most welcome to have better support for this. It also would raise the need to provide mechanism to be able to attach additional information to the paragraphs (lines): this additional model data could be used to pass the required information for the decorators, such as error messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions