You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 theapply
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.
The text was updated successfully, but these errors were encountered: