right align status in statusdialog [message #329757] |
Wed, 02 July 2008 21:26 |
|
I am using a statusdialog. When the user makes some choices on the dialog,
I wante to use the status line at the bottom of the dialog to display
warning/error messages to the user. It all works well. I was wondering if
it is possible to display the status message above the ok/cancel button -
right aligned instead of left aligned. I saw the following code in status
dialog:
private MessageLine fStatusLine;
protected Control createButtonBar(Composite parent) {
...
fStatusLine = new MessageLine(composite);
fStatusLine.setAlignment(SWT.LEFT);
...
}
Is there a way to change the alignment to right without overriding the
whole createButtonBar?
Thanks,
Upkar.
|
|
|
Re: right align status in statusdialog [message #329775 is a reply to message #329757] |
Thu, 03 July 2008 13:57 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Upkar Lidder wrote:
> I am using a statusdialog. When the user makes some choices on the
> dialog, I wante to use the status line at the bottom of the dialog to
> display warning/error messages to the user. It all works well. I was
> wondering if it is possible to display the status message above the
> ok/cancel button - right aligned instead of left aligned. I saw the
> following code in status dialog:
>
> private MessageLine fStatusLine;
>
> protected Control createButtonBar(Composite parent) {
> ...
> fStatusLine = new MessageLine(composite);
> fStatusLine.setAlignment(SWT.LEFT);
> ...
> }
>
> Is there a way to change the alignment to right without overriding the
> whole createButtonBar?
The class MessageLine extends CLabel, so one option (an ugly one) would
be to override createButtonBar(), call super and then walk the widget
tree from parent until you find an instance of CLabel. Then you can call
setAlignment() on it.
It is ugly, but I don't see any other option other than lots of
copy+paste coding.
You should also enter an enhancement request in Bugzilla to add API to
control the alignment. If you submit a patch to the code that implements
it, it seems likely it would be accepted.
Eric
|
|
|
Powered by
FUDForum. Page generated in 0.02706 seconds