title: jface tableviewer tooltip text cut
body: <p>I am using the jface tableviewer in an eclipse rcp application to display some values.</p>
  
  <p>Therefore I have written the following snipped ...</p>
  
  <pre><code>    tableviewer = new TableViewer(container, SWT.FULL_SELECTION | SWT.BORDER | SWT.SINGLE);
      tableviewer.setContentProvider(new ArrayContentProvider());
  
      ColumnViewerToolTipSupport.enableFor(tableviewer, ToolTip.RECREATE);
  
      final Table table = tableviewer.getTable();
      table.setHeaderVisible(true);
      table.setLinesVisible(true);
  
      TableViewerColumn column = new TableViewerColumn(tableviewer, SWT.NONE);
      column.getColumn().setText("col1");
      column.getColumn().setResizable(true);
      column.setLabelProvider(new ConfigLabelProvider("col1"));
  </code></pre>
  
  <p>And here here ConfigLabelProvider definition</p>
  
  <pre><code>private class ConfigLabelProvider extends StyledCellLabelProvider {
  
      private String property;
  
      public ConfigLabelProvider(String property) {
          this.property = property;
      }
  
      @Override
      public void update(ViewerCell cell) {
  
          GenericConfigInterfaceEntity config = (GenericConfigInterfaceEntity) cell.getElement();
  
          switch (property) {
          case "col1":
              cell.setText(AppHelper.preventNull("col1Text col1Text col1Text col1Text col1Text"));
              break;
          case ...
          }
  
          super.update(cell);
  
      }
  
  }
  </code></pre>
  
  <p>Now my problem is if the column is too small, the default tooltip is displayed trying to show the full cell text value.</p>
  
  <p>BUT I get a tooltip box that is large enough for the whole text but the text isn't shown outside the cell rectange.</p>
  
  <p><img src="https://i.stack.imgur.com/NcxvV.png" alt=""></p>
  
  <p>If I extend the ConfigLabelProvider from CellLabelProvider the Tooltip is showing up like expected ...</p>
  
  <p><img src="https://i.stack.imgur.com/Pstis.png" alt=""></p>
  
  <p>But I need the paint method of the StyledCellLabelProvider.</p>
  
  <p>Any ideas?</p>
  
  <hr>
  
  <h2>Edit 1</h2>
  
  <p>I have written a small Java Example Project using SWT and JFACE, because my problems still remain.</p>
  
  <p>My goal is to have an table with a cell-Background without the mousehover (because its looking ugly together) and a custom tooltip.</p>
  
  <p>Here's my TestTable implementation</p>
  
  <pre><code>package main;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import model.TestModel;
  
  import org.eclipse.jface.dialogs.Dialog;
  import org.eclipse.jface.viewers.ArrayContentProvider;
  import org.eclipse.jface.viewers.ColumnViewer;
  import org.eclipse.jface.viewers.ColumnViewerToolTipSupport;
  import org.eclipse.jface.viewers.StyledCellLabelProvider;
  import org.eclipse.jface.viewers.TableViewer;
  import org.eclipse.jface.viewers.TableViewerColumn;
  import org.eclipse.jface.viewers.ViewerCell;
  import org.eclipse.jface.viewers.ViewerColumn;
  import org.eclipse.swt.SWT;
  import org.eclipse.swt.layout.FillLayout;
  import org.eclipse.swt.layout.GridData;
  import org.eclipse.swt.widgets.Composite;
  import org.eclipse.swt.widgets.Control;
  import org.eclipse.swt.widgets.Display;
  import org.eclipse.swt.widgets.Shell;
  import org.eclipse.swt.widgets.Table;
  import org.eclipse.swt.widgets.TableColumn;
  
  public class TestTable extends Dialog {
  
      private TableViewer tableviewer;
      private List&lt;TestModel&gt; entities;
  
      protected TestTable(Shell parentShell) {
          super(parentShell);
      }
  
      @Override
      public void create() {
  
          super.create();
  
          loadData();
  
      }
  
      @Override
      protected Control createDialogArea(Composite parent) {
  
          GridData dataLayout;
  
          Composite area = (Composite) super.createDialogArea(parent);
  
          dataLayout = new GridData(GridData.FILL_BOTH);
          dataLayout.heightHint = 150;
          dataLayout.widthHint = 500;
  
          Composite wrapper = new Composite(area, SWT.NONE);
          wrapper.setLayoutData(dataLayout);
          wrapper.setLayout(new FillLayout());
  
          tableviewer = new TableViewer(wrapper, SWT.BORDER | SWT.MULTI);
          tableviewer.setContentProvider(new ArrayContentProvider());
  
          ColumnViewerToolTipSupport.enableFor(tableviewer);
  
          final Table table = tableviewer.getTable();
          table.setLinesVisible(true);
          table.setHeaderVisible(true);
  
          createColumns(wrapper);
  
          return area;
  
      }
  
      private void createColumns(Composite wrapper) {
  
          TableViewerColumn firstnameColumn = new TableViewerColumn(tableviewer, SWT.NONE);
          firstnameColumn.getColumn().setText("Vorname");
          firstnameColumn.setLabelProvider(new StyledCellLabelProvider(StyledCellLabelProvider.COLORS_ON_SELECTION) {
  
              @Override
              public void initialize(ColumnViewer viewer, ViewerColumn column) {
                  super.initialize(viewer, column);
                  this.setOwnerDrawEnabled(false);
              }
  
              @Override
              public void update(ViewerCell cell) {
                  TestModel model = (TestModel) cell.getElement();
                  cell.setText(model.getFirstname());
                  cell.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_DARK_GREEN));
              }
  
              @Override
              public String getToolTipText(Object element) {
                  TestModel model = (TestModel) element;
                  return "USE THIS AS TOOLTIP";
              }
  
          });
  
          TableViewerColumn lastnameColumn = new TableViewerColumn(tableviewer, SWT.NONE);
          lastnameColumn.getColumn().setText("Nachname");
          lastnameColumn.setLabelProvider(new StyledCellLabelProvider(StyledCellLabelProvider.COLORS_ON_SELECTION) {
  
              @Override
              public void initialize(ColumnViewer viewer, ViewerColumn column) {
                  super.initialize(viewer, column);
                  this.setOwnerDrawEnabled(false);
              }
  
              @Override
              public void update(ViewerCell cell) {
                  TestModel model = (TestModel) cell.getElement();
                  cell.setText(model.getLastname());
                  cell.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_DARK_GREEN));
              }
  
              @Override
              public String getToolTipText(Object element) {
                  TestModel model = (TestModel) element;
                  return "USE THIS AS TOOLTIP";
              }
  
          });
  
          for (TableColumn c : tableviewer.getTable().getColumns()) {
              c.pack();
          }
  
      }
  
      private void loadData() {
  
          entities = new ArrayList&lt;TestModel&gt;();
  
          entities.add(new TestModel("___Firstname1___", "Lastname1", "Username1", "Kommentar"));
          entities.add(new TestModel("___Firstname2___", "Lastname2", "Username2", "Kommentar"));
          entities.add(new TestModel("___Firstname3___", "Lastname3", "Username3", "Kommentar"));
          entities.add(new TestModel("___Firstname4___", "Lastname4", "Username4", "Kommentar"));
          entities.add(new TestModel("___Firstname5___", "Lastname5", "Username5", "Kommentar"));
  
          tableviewer.setInput(entities);
          tableviewer.refresh();
  
      }
  
  }
  </code></pre>
  
  <p>And here are some faulty pictures</p>
  
  <p>Here the native TableViewer Tooltip and my custom ToolTip is shown, also the row gets selected (COLORS_ON_SELECTION should prevent that)</p>
  
  <p><img src="https://i.stack.imgur.com/dLi5Y.png" alt="tooltip bug 1"></p>
  
  <p>Here no tooltip is shown on the second column</p>
  
  <p><img src="https://i.stack.imgur.com/KZOfd.png" alt="tooltip bug 2"></p>
  
  <p>And here no tooltip is shown and as you can see the first cell isn't filled up</p>
  
  <p><img src="https://i.stack.imgur.com/n69fU.png" alt="tooltip bug 3"></p>
  
  <p>If I add SWT.FULL_SELECTION the tooltip on column 2 appears but the other issues remain.</p>
  
  <p>I think it's a kind of buggy that Tooltip Support or I am doing it totally wrong.</p>