|
Re: TextObjectEditor - setMultiLine(true) not working as expected? [message #1690175 is a reply to message #1690062] |
Wed, 25 March 2015 14:56 |
|
Hey Ralph,
Yep, looks like you're right (as usual ) I don't know what the heck I was thinking when I wrote that code. It looks like the test for multiline in createControl() is at fault:
@Override
protected Control createControl(Composite composite, String label, int style) {
createLabel(composite,label);
if (testMultiLine && super.isMultiLineText()) {
multiLine = true;
style |= SWT.MULTI | SWT.V_SCROLL;
}
I think it should look more like this:
@Override
protected Control createControl(Composite composite, String label, int style) {
createLabel(composite,label);
if (multiLine || (testMultiLine && super.isMultiLineText())) {
multiLine = true;
style |= SWT.MULTI | SWT.V_SCROLL;
}
because of the setMultiLine() method:
public void setMultiLine(boolean multiLine) {
testMultiLine = false;
this.multiLine = multiLine;
}
What I wanted to accomplish was to allow custom property tabs to override the multiline setting from the ExtendedPropertiesAdapter's isMultiLine(), hence the use of the "testMultiLine" flag here.
Please create a bugzilla to track this issue.
Thanks!
Bob
|
|
|
|
Powered by
FUDForum. Page generated in 0.04868 seconds