RFR: 8314482: TextFlow: TabStopPolicy [v2]

Kevin Rushforth kcr at openjdk.org
Tue Jul 8 23:17:43 UTC 2025


On Wed, 18 Jun 2025 18:34:59 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> This doesn't read like a proper English sentence to me. In Microsoft Word, there's a spinner control titled "Default tab stops:", which I suppose should be read as, for example: "Default tab stops every 0.5 cm".
>> 
>> As for naming the API, I suggest something like `defaultTabWidth` or `defaultWidth` (the word "tab" doesn't need to be repeated, as it's declared in a class named `TabStopPolicy`).
>
> Not sure if defaultTabWidth is a good choice here though, because it's not, it's actually tab stops - think of the typewriter (I know, referring to an ancient technology like floppy disk for the 'save' icon does not age well)
> 
> I am open to suggestions.  I am used to "default tab stops", perhaps we could just explain it better?

Getting back to this, there are two naming questions here. First, should "tab" be in the name (it does seem a bit redundant, since the name of the class is TabStopPolicy)? Second, what is the best name for the value that defines a repeating set of stops?

If we drop the word "tab" the list of tab stops would just be named "stops", which seems fine. Here are some possible names for the default:

- defaultStop
- defaultStops
- defaultStopInterval
- Something Else?

I kind of like the last of these, `defaultStopInterval`, as it is the most descriptive. Whatever we do will need to be documented well.

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1744#discussion_r2193588491


More information about the openjfx-dev mailing list