title: SWT Table with variable row height: Working on Linux, but not Mac/Windows
body: <p>Problem: I need an SWT Table (JFace TableViewer) with variable row height.  In fact, I solved this on my development machine (running Ubuntu 10.10).  Unfortunately, this doesn't work on Windows nor on Mac.</p>
  
  <p>Initially, I thought I didn't use the libraries correctly.  But by now I fear that what I want to do is simply not possible on Windows.  I hope someone here convinces me otherwise.</p>
  
  <p>To reproduce: rather than providing my code here, I built a minimal program to reproduce the problem.  I started with the following Snipplet:</p>
  
  <p><a href="http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet049StyledCellLabelProvider.java" rel="nofollow noreferrer">http://git.eclipse.org/c/platform/eclipse.platform.ui.git/tree/examples/org.eclipse.jface.snippets/Eclipse%20JFace%20Snippets/org/eclipse/jface/snippets/viewers/Snippet049StyledCellLabelProvider.java</a></p>
  
  <p>I modified the update() method to produce two lines of text for directories and one line for files (to simulate an environment with variable row heights):</p>
  
  <pre>...
  if (file.isDirectory()) {
      cell.setText(styledString.toString() + "\n"
          + styledString.toString());
      cell.setImage(IMAGE1);
  } else {
      cell.setImage(IMAGE2);
  }
  ...</pre>
  
  <p>This works as intended on Linux, but on Windows all rows have the same height.  Specifically, only one line is visible.</p>
  
  <p>Next, I was trying to help SWT by making measure() more intelligent.  So I rewrote measure() like this:</p>
  
  <pre>protected void measure(Event event, Object element) {
      if (((File) element).isDirectory()) {
          event.height = 32;
      } else {
          event.height = 16;
      }
      super.measure(event, element);
  }</pre>
  
  <p>The result: All rows have the height 32.  Again, this works as intended on Linux.</p>
  
  <p>My fear is, that on Windows simply all rows must be the same height.  This would be a showstopper for me.  Can anybody confirm this, or even better, provide a workaround?</p>
  
  <p>Thanks!</p>