* Correctly resizes the table so no phantom columns appear
*/
protected void configureTableResizing(final Composite parent,
final Composite buttons, final Table table, final TableColumn column1,
final TableColumn column2, final TableColumn column3) {
parent.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
resizeTable(parent, buttons, table, column1, column2, column3);
}
});
table.addListener(SWT.Paint, new Listener() {
@Override
public void handleEvent(final Event event) {
table.removeListener(SWT.Paint, this);
resizeTable(parent, buttons, table, column1, column2, column3);
}
});
column1.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
if (column1.getWidth() > 0 && !fResizingTable) {
fWeight1 = getColumnWeight(0);
}
}
});
column2.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
if (column2.getWidth() > 0 && !fResizingTable) {
fWeight2 = getColumnWeight(1);