Skip to main content

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 11:21 Go to next message
Kapil Gambhir is currently offline Kapil GambhirFriend
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 12:08 Go to previous message
Thorsten Schlathölter is currently offline Thorsten SchlathölterFriend
Messages: 309
Registered: February 2012
Location: Düsseldorf
Senior Member
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.


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

Report message to a moderator

Previous Topic:TreeViewer, how to jump say what element to show on top?
Next Topic:JFace Treviewer: How to handle a "Post"-Collapse/-Expand in TreeViewer
Goto Forum:

Current Time: Wed Dec 11 23:44:32 GMT 2019

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

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

Back to the top