Wednesday, March 24, 2010

make the table resized when the window size is changed

In Elcipse RCP, the code below can make the table resized when the window size is changed. Make sure the method is called after all controls are created.
        private void refreshTableLayout() {
GridData layoutData = new GridData(GridData.FILL, GridData.FILL, true, true);
layoutData.heightHint = TABLE_HEIGHT_HINT;
couponUsageTableViewer.getSwtTableViewer().getTable().getParent().setLayoutData(layoutData);
}


screenshot



tableResize01



After resize



tableResize02

No comments:

Post a Comment