Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350231 - [Preferences] StringFieldEditor misses setter for widthInChars
Summary: [Preferences] StringFieldEditor misses setter for widthInChars
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-24 07:03 EDT by Daniel Krügler CLA
Modified: 2019-09-02 13:15 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Krügler CLA 2011-06-24 07:03:11 EDT
Build Identifier: M20100909-0800

The StringFieldEditor is often used as a base of refined editors, like
IntegerFieldEditor. We created our corresponding DoubleFieldEditor based on this class as well. These derived classes typically need to invoke the default constructor of StringFieldEditor because otherwise they can't properly override initialization code. To support this idiom, StringFieldEditor provides several setters that must be invoked very early, like

setValidateStrategy
setEmptyStringAllowed
setErrorMessage

Unfortunately, this editor misses to provide a setter for the internal property 'widthInChars' corresponding to the 'width' parameter of the non-default c'tors. This is a pitty, because these derived classes cannot take advantage of the default implementation of doFillIntoGrid where this parameter is used. On the other hand, sub-classes are *required* to invoke this super class method, so we are in a bad situation here.

It seems to me that a very simple fix would be that StringFieldEditor should provide a public or protected setter

setWidthInChars (alternatively: setTextWidthInChars)

that allows super classes to configure this customization point as well. 

Reproducible: Always
Comment 1 Eclipse Genie CLA 2019-09-02 13:04:43 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Daniel Krügler CLA 2019-09-02 13:15:21 EDT
(In reply to Eclipse Genie from comment #1)
> If you have further information on the current state of the bug, please add
> it. The information can be, for example, that the problem still occurs, that
> you still want the feature, that more information is needed, or that the bug
> is (for whatever reason) no longer relevant.

The issue still exists. I'm interested in providing a fix, but I'm now on vacations for two weeks.