Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » [Preferences] StringFieldEditor misses setter for widthInChars
[Preferences] StringFieldEditor misses setter for widthInChars [message #651028] Thu, 27 January 2011 13:50
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member

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


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 pity, 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.

Any thoughts?

Greetings from Bremen,

Daniel Krügler
Previous Topic:[Preferences] Why does applyFont() FOR FieldEditor and FieldEditorPreferencePage?
Next Topic:how to sort ComboBoxCellEditor in a table
Goto Forum:

Current Time: Wed Jun 20 09:51:15 GMT 2018

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

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

Back to the top