How do you wrap text for an RTC extension UI without excess white space?
![]() I've been following Lab 5 in the RTC Extension workshop trying to create an aspect editor for m extension. I've got all the functionality working but when I try to create long text or labels to describe sections of the ui for the user, I've been having trouble with the text wrapping.
Section textSection = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR);
Composite textComp = toolkit.createComposite(textSection);
textSection.setClient(textComp);
textSection.setText("Text Title");
Text textLine = new Text(textComp, SWT.SINGLE);
textLine.setText(Long text entry);
GridLayoutFactory layoutFactory = GridLayoutFactory.fillDefaults().spacing(HORZ_SPAC, VERT_SPAC).numColumns(1);
layoutFactory.generateLayout(textComp);
This previous code got me one line that extended off screen,
Text textLine = new Text(textComp, SWT.WRAP);
textLine.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
textLine.setText(Long text entry);
With this, I still got one line, but I could scroll horizontally to see all the text. When I removed the GridData line, the text would wrap normally like I want it to, but it has twice the height as needed with a ton of extra white space between the text and the next UI object. How can I wrap this text without having extra white space between the UI objects?
|
One answer
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.