Summary: | [Preferences] StringFieldEditor claims to allow subclassing, but prevents it | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Paul E. Keyser <rolarenfan> | ||||||||
Component: | UI | Assignee: | Platform UI Triaged <platform-ui-triaged> | ||||||||
Status: | NEW --- | QA Contact: | |||||||||
Severity: | enhancement | ||||||||||
Priority: | P5 | CC: | pwebster, Tod_Creasey | ||||||||
Version: | 3.1.2 | Keywords: | helpwanted | ||||||||
Target Milestone: | --- | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows XP | ||||||||||
Whiteboard: | hasPatch | ||||||||||
Attachments: |
|
Description
Paul E. Keyser
2006-07-21 16:59:15 EDT
I see 10 protected methods + a number of public ... it can be subclassed. This is an enhancement request to try provide different validation strategies over the provided VALIDATE_ON_KEY_STROKE and VALIDATE_ON_FOCUS_LOST. PW There are currently no plans to work on this however I would be happy to look over a contribution (In reply to comment #2) > There are currently no plans to work on this however I would be happy to look > over a contribution > I am currently on vacation, but could work on this in July/August. There are indeed a bunch of protected methods etc., but some of them use *private* members... My contribution would deal with that. If that sounds good to you, I will provide more details and re-open in July/Aug? Paul K Sure. (In reply to comment #4) > Sure. > How important is it that I keep to the coding style implied by the current state of StringFieldEditor? (E.g., it gives all but one of its methods in alpha order -- but other Eclipse code follows other conventions.) The order was not a convention - just someone hitting sort. Not to worry. Tod -- Sooner than I expected, I have this ready -- (1) modified StringFieldEditor, plus (2) two example extensions (InetAddress.. and Regex...) showing how/why to allow subclasses to "extend" the validation-scheme. So -- how to submit? reopen the bug (and perhaps rename in some way), and attach the java files? (They are stuffed in some random package-of-convenience in one of my projects.) Please feel free to reopen and attach your patch. I'll try and get to it in the milestone you attach it in. Created attachment 72750 [details]
proposed patch for StringFieldEditor
NOTE: the class was created in my own package (since I do not have the Eclipse code checked out) -- you'll need to change the package (and perhaps organize imports).
Created attachment 72752 [details]
test-case #1 (example subclass) for patch
This subclass allows the user to enter a regex, but does not validate until the user presses ENTER or UP or DOWN (since validating on each keystroke would be intrusive/annoying, as most partial regex's are invalid).
Created attachment 72753 [details]
test-case #2 (example subclass) for patch
This subclass allows the user to enter an InetAddress, either numerical or textual, but does not validate until the user presses ENTER or UP or DOWN -- since valdation is usually lengthy and validating on each keystroke would be annoying; validating on loss-of-focus would also be annoying, since the error-message would not appear until the user re-focussed. (One might think of placing a "wait" message as a temporary error-message, or else asking that pref-pages be like wizards and have a progress-mon available.)
Paul comment #9 isn't a patch - it is a whole class. Could you attach a patch against HEAD please? As this bug is against 3.1.2 I need to see it as compared to the current codebase. (In reply to comment #12) > Paul comment #9 isn't a patch - it is a whole class. Could you attach a patch > against HEAD please? As this bug is against 3.1.2 I need to see it as compared > to the current codebase. > Oops, didn't think of patch as in the special file. My problem with that is that I do not have the code checked out -- can you give me a pointer to how to do that? (I dunno the values I should enter in the "Define Repository" dialog, nor how to find that data on the Eclipse.org webpage.) I presume I need an id/pwd which I also lack. There is a CVS HOWTO off of http://www.eclipse.org/ but basically you want dev.eclipse.org anonymous /cvsroot/eclipse pserver If you go to the bottom of HEAD, there is a module called platform-ui that you can check out that will give you most of the Platform UI plugins. From there you can make your changes, self host, and create a patch. PW The StringFieldEditor code is now in http://git.eclipse.org/c/platform/eclipse.platform.ui.git I tried to just overwrite the StringFieldEditor with the class from comment #9 but it looks like the methods have been re-sorted so I can't consume that. PW |