Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » FieldEditorPreferencePage(Label text does not wrap up in a FieldEditorPreferencePage window)
FieldEditorPreferencePage [message #1368527] Tue, 20 May 2014 06:53 Go to next message
Venkat Prithvi is currently offline Venkat PrithviFriend
Messages: 1
Registered: May 2014
Junior Member
I'm using a FieldEditorPreferencePage for my Preference Window. I'm also using FieldEditor Abstract base class for all my field editors in the Preference window.

I have 3 radio buttons and as the user clicks on the radio button a text will be displayed at the bottom of the window educating the user on the selected options, My problem is that, the text of the label is very long and does not fit into the Preference window. I want the label text to wrap up automatically as the size of the window grows or shrinks, I tried every possible thing to wrap up the text but instead the text gets lost, for example I have tried :

GridData g = new GridData(GridData.FILL_BOTH);
g.widthHint = 200;
Label l = new Label(getFieldEditorParent(), SWT.BEGINNING | SWT.WRAP);
l.setLayoutData(g);
l.setText("Long Msg");
getFieldEditorParent() returns a parent composite for a field editor.

Apart from the above code, I have also tried all the other possible combinations of parameters for GridData and the Label, but the result in the UI part remains the same(text will get lost if the size of the text exceeds the size of the window). I can set the size of the window to fit the text, but that is hard-coding.

How can I possibly wrap up the label text as the window's size grows and shrinks? Is this an issue with FieldEditorPreferencePage? Is there a conflict using a label in a preference page? Someone please explain in brief as to why this happens?
Re: FieldEditorPreferencePage [message #1396675 is a reply to message #1368527] Tue, 08 July 2014 16:28 Go to previous message
Brian de Alwis is currently offline Brian de AlwisFriend
Messages: 772
Registered: January 2012
Senior Member

See the SWT FAQ:

https://www.eclipse.org/swt/faq.php#relayout

Brian.


Eclipse Platform committer. Ask me about Eclipse support, training, and consulting.
Previous Topic:Modify the update strategy of a binding after creation
Next Topic:CommonViewer / CommonNavigator with default EditActions
Goto Forum:
  


Current Time: Tue Sep 18 23:29:06 GMT 2018

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

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

Back to the top