[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-ui-dev] About layout data in TableViewerEditor and CellEditor

Hi,
 
I want to define my CellEditor for tableviewer. To show the full content of my cell editor, the editor's size will be larger than the cell's size. I have tried to extend the CellEditor and use CellEditor#getLayoutData() to control the size of the cell editor, unfortunately, it seems that the org.eclipse.jface.viewers.CellEditor.LayoutData only allows setting the width of the cell editor (see below).

    package org.eclipse.jface.viewers
    class CellEditor{
       ...
        public static class LayoutData {
            public int horizontalAlignment = SWT.LEFT;
            public boolean grabHorizontal = true;
            public int minimumWidth = 50;
        }
       ...
    }

I was wondering, if it is possible to add another field say:
        public int minimumHeight = 0;
to control the height of the cell editor?

To make the above change work, it needs another change to org.eclipse.jface.viewers.TableViewerEditor#setLayoutData:

 protected void setLayoutData(LayoutData layoutData) {
  tableEditor.grabHorizontal = layoutData.grabHorizontal;
  tableEditor.horizontalAlignment = layoutData.horizontalAlignment;
  tableEditor.minimumWidth = layoutData.minimumWidth;
  tableEditor.minimumHeight = layoutData.minimumHeight; // Add this line
 }

The changes are based on the I20070828-0010 build of org.eclipse.jface, and it works well for my cell editor. Not sure if there is any other reason why LayoutData should not have the minimumHeight of the editor. Otherwise, should this change be commited to next build?

Thanks for your comments.
--
Chengdong Li