Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » right align status in statusdialog
right align status in statusdialog [message #329757] Wed, 02 July 2008 21:26 Go to next message
Lidder is currently offline LidderFriend
Messages: 46
Registered: July 2009
Member
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Widget disposed error in Progress monitor
Next Topic:Refactoring in eclipse
Goto Forum:
  


Current Time: Sat Nov 02 16:59:59 GMT 2024

Powered by FUDForum. Page generated in 0.02706 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top