Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] How to right align the buttons created in createButtonsForButtonB ar()?

Steve

The buttonBar is returned to you from createButtonBar - just override 
createButtonBar  and set the GridData how you like. This forum is used for 
the developers on the UI team for design issues and not for support - if 
you ask this kind of question on eclipse.org you can get help from the 
entire community.

Tod Creasey
Desktop Team





"Jin, Steve" <sjin@xxxxxxxxxxxx>
Sent by: platform-ui-dev-admin@xxxxxxxxxxx
01/14/2003 08:00 PM
Please respond to platform-ui-dev

 
        To:     "'platform-ui-dev@xxxxxxxxxxx'" <platform-ui-dev@xxxxxxxxxxx>
        cc: 
        Subject:        [platform-ui-dev] How to right align the buttons created in 
createButtonsForButtonB ar()?



I have a subclass of org.eclipse.jface.dialogs.Dialog, in which I 
overwrite the createButtonsForButtonBar() method to create my own buttons. For some 
reason, the buttons are left aligned, but I want them to be right aligned. 
Here is a code snippet. 
        protected void createButtonsForButtonBar(Composite parent) 
        { 
                Button button1 = createButton(parent, 1, "Button1", true); 
                Button button2 = createButton(parent, 2, "Button2", false); 
        } 
Since it doesn't work as I expected, I add a little more to change the 
parent's grid data like this before buttons are created.

                GridData pGridData = (GridData) parent.getLayoutData(); 
                pGridData.horizontalAlignment = GridData.HORIZONTAL_ALIGN_END; 
                parent.setLayoutData(pGridData); 
Still the same. Could anyone help? Thanks! 




Back to the top