I just created a new class that extends TitleAreaDialog.
I overrode the method createButtonsForButtonBar and I was able to add new buttons. But placing one on the LEFT?? (Default is the right, besids OK and CANCEL).
Thanks very much!!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In this case, don’t override
createButtonsForButtonBar, that will have already set up theGridLayoutsuch that the buttons are on the right side. Instead, overridecreateButtonBar, which will let you have control over the entire composite there.It’s easy to add something to the left side and then let SWT place the OK / Cancel buttons for you – which I recommend, since you would otherwise have to duplicate the logic of where the “default” button gets placed (far-right on Mac OS and recent GNOME, to the left of the Cancel button on Win32 and older GNOME.) In this case, you can set up a composite that spans the entirety of the button bar and then let SWT draw its button bar in the far right.
For example: