title: Change row height in SWT Table/Tree
body: <p>I have a Tree, which is populated with TreeItems that may have an image (a row with a thumbnail). I resize the row height with MeasureItem listener, and everything is good.</p>
  
  <p>But, now I want to make this change dynamic. I check if a row should have an image, and if any row in the currently listed rows has an image that should be displayed, I set the row height to 180px, and all the rows have that height. If there is no row with an image, then the row height should be 25px.</p>
  
  <p>The issue is, if at any point the row height is set to 180px, I can't change it back to 25px.
  My code looks like this (simplified):</p>
  
  <pre><code>//this check is run on each page of paginated results fetched from DB
  rowHeight=25;
  for(Result r : results){
      if(r.hasImage()){
          rowHeight=180;
          break;
      }
  }
  
  
      // resize the row height using a MeasureItem listener
      tree.addListener(SWT.MeasureItem, new Listener() {
          public void handleEvent(Event event) {
              event.height = rowHeight;
          }
      });
  
      //added 'event.height=rowHeight' here just to check if it will draw as I want
      tree.addListener(SWT.EraseItem, new Listener() {
          public void handleEvent(Event event) {
              if(event.index!=ColumnType.SCREENSHOT.toIndexNum()){
                  event.detail &amp;= ~SWT.FOREGROUND;
              }
              event.height=rowHeight;
          }
      });
  </code></pre>
  
  <p>The rowHeight variable is set as it should, and also the 'event.height' in the MeasureListener is set to the same value. But still doesn't want to reduce the height. On every page of results I'm clearing the items with <code>tree.removeAll()</code>. Maybe I should dispose and recreate the table/tree (which I don't want to do)?</p>
  
  <p><strong>So, any idea how to do it?</strong></p>
  
  <p><em>P.S.
  Not to be confused, I don't need various heights on the rows, I know that it's not possible under Windows/Mac. I just need a way to reset the height.</em></p>