Note that there are some explanatory texts on larger screens.

plurals
  1. POSWT: Table with cells that span columns
    primarykey
    data
    text
    <p>In a Java desktop app with SWT-based GUI, we have a table in which some rows must span multiple columns. This was solved with the approach shown in this official SWT Snippet: <a href="http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet239.java" rel="nofollow noreferrer">Snippet239.java</a></p> <p>However, much later it was discovered that there's a major problem with this approach on Ubuntu with the default Ambiance/Radiance theme: There are always vertical lines between the columns, even for cells that span multiple columns. This is shown in the following screenshots:</p> <p><img src="https://i.stack.imgur.com/VyOvj.png" alt="Ubuntu with Ambiance/Radiance theme"></p> <p><img src="https://i.stack.imgur.com/UkjsO.png" alt="Ubuntu with Clearlooks theme"></p> <p>As you can see, in the first screenshot there's a vertical line between Column 1 and Column 2. Does anybody have an idea how to get rid of these lines?</p> <p>We've already tried the following:</p> <ul> <li><code>Table.setLinesVisible(false)</code>: Doesn't work, the vertical lines don't go away.</li> <li>Use owner-draw-based label providers to draw over those vertical lines: Doesn't work, the vertical lines seem to be drawn on top of everything that is drawn by the label providers.</li> <li>Attach paint listener to table to draw over the vertical lines: Doesn't work, because there are lots of glitches whenever the table is scrolled or otherwise updated.</li> <li>The <a href="http://www.eclipse.org/nebula/" rel="nofollow noreferrer">Nebula project</a> has a Grid widget where cells can span multiple columns, and it doesn't have a problem with vertical lines, because the entire table is drawn non-natively. However, we can't justify the effort to replace our table with a Grid widget just to fix the vertical lines problem on a particular platform with certain themes. Also, the Grid widget seems to be a pre-release alpha version.</li> </ul> <p>Based on the things we've already tried, I assume the only way left is to muck around in the platform-specific internals of SWT, but I don't even know where to start with something like that.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload