Bug 20242 TVT2: Buttons not resizing in Java prefs (truncation)
Build F2 In Window>Preferences, Java>Templates all of the buttons on the right side of the prefs page are not resizing with translated text. This is a critical issue for TVT, since there are translations that cannot be shortened to accomodate a particular button size.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/TemplatePreferencePage.java
*/
    private static void configureTableResizing(final Composite parent, final Composite buttons, final Table table, final TableColumn column1, final TableColumn column2, final TableColumn column3) {
        parent.addControlListener(new ControlAdapter() {
            public void controlResized(ControlEvent e) {
                Rectangle area = parent.getClientArea();
                Point preferredSize = table.computeSize(SWT.DEFAULT, SWT.DEFAULT);
                int width = area.width - 2 * table.getBorderWidth();
                if (preferredSize.y > area.height) {
                    
                    
                    Point vBarSize = table.getVerticalBar().getSize();
                    width -= vBarSize.x;
                }
                width-= buttons.getSize().x;
                Point oldSize = table.getSize();
                if (oldSize.x > width) {
                    
                    
                    
                    column1.setWidth(width/4);
                    column2.setWidth(width/4);
                    column3.setWidth(width - (column1.getWidth() + column2.getWidth()));
                    table.setSize(width, area.height);
                } else {
                    
                    
                    
                    table.setSize(width, area.height);
                    column1.setWidth(width/4);
                    column2.setWidth(width/4);