Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » How to wrap the description on the first page of wizard (Challenged to wrap a long description on the first page of the wizard..)
How to wrap the description on the first page of wizard [message #1128130] Mon, 07 October 2013 07:21 Go to next message
Kapil Gambhir is currently offline Kapil Gambhir
Messages: 5
Registered: March 2013
Junior Member
JFace Wizard lays out its size depending on various controls, in my case the description of the first wizard page is a long one causing the horizontal size of the wizard to be unnecessary long.
Is there a way to programmatically make it wrap, basically not have the description size taken into account for the horizontal size of the wizard. I see if i have a message (not description) set on this wizard it wraps well but description doesnt behave the same way.

I want to avoid any hard coding on the size because then it looks ugly on different 'resolution/text size' setting of the system.

Any relevant help will be greatly appreciated.
Re: How to wrap the description on the first page of wizard [message #1128165 is a reply to message #1128130] Mon, 07 October 2013 08:08 Go to previous message
Thorsten Schlathölter is currently offline Thorsten Schlathölter
Messages: 208
Registered: February 2012
Location: Düsseldorf
Senior Member
Hi,
I'd say it is not possible to achieve this with the standard WizardDialog as it extends TitleAreaDialog which creates a Label for the Title and a Text for the message:

You can just check the respective code of TitleAreaDialog:
   ...
   titleLabel = new Label(parent, SWT.LEFT);
   ...
   messageLabel = new Text(parent, SWT.WRAP | SWT.READ_ONLY);
   ...


That's why the message is wrapped whereas the title is not.

You might want to override the getInitialSize() method of TitleAreaDialog and introduce a MAX_DIALOG_WIDTH. But that would then be a hardcoded approach which you want to avoid.

After all you might be better off thinking about a shorter title.

Regards,
Thorsten

[Updated on: Mon, 07 October 2013 08:08]

Report message to a moderator

Previous Topic:Open a JFace Dialog over another JFace Dialog
Next Topic:TreeViewer, how to jump say what element to show on top?
Goto Forum:
  


Current Time: Thu Aug 28 19:23:21 EDT 2014

Powered by FUDForum. Page generated in 0.09732 seconds