Search code examples
eclipsenattable

NatTable Custom Spanning Data Provider, Cell will be only span if they are part of parent group


I have used AutomaticSpanningDataProvider to spanning the columns, its perfectly spanning for repeated columns.

enter image description here

  1. But i want to extend an AutomaticSpanningDataProvider to customize the implementation to looks like in the above pic (Expected Custom Spanning). In this case cell will be span if they are part of parent group.

  2. One more observation I made, there is an thin lines in the spanned cells.
    Is it would be possible to change the thin lines to no line and the thick line to thin line?

enter image description here


Solution

  • It is not clear to me where those thin lines are coming from. What painters are you using? Maybe it is because you are using the BeveledBorderDecorator in a non-header region. And IIRC the grid line rendering should be disabled in combination with the BeveledBorderDecorator.

    And if you need a custom spanning behavior, well then implement it. The AutomaticSpanningDataProvider is just one default implementation that handles the same data to span automatically. You can implement your own ISpanningDataProvider with your custom logic and use that instead of the defaults. Actually that is the most common usage of spanning. Not sure what the question is.