PreferencesFX icon indicating copy to clipboard operation
PreferencesFX copied to clipboard

Let Setting support additional description

Open aalmiray opened this issue 6 years ago • 7 comments

As of 2.0.2 the Setting class holds a simple description and a value. It would be great if an additional description could be added to a particular Setting, see attached screenshot from IntelliJ

section-description

aalmiray avatar Jun 28 '18 11:06 aalmiray

100% agree on this. We discussed this already before making PreferencesFX public and due to the limited time we had, we decided to not implement it in favor of other, more important features. Feel free to implement it and submit a PR!

martinfrancois avatar Jul 09 '18 16:07 martinfrancois

Very well, I'd suggest an API similar to what's provided at https://github.com/dlemmermann/formsfx/pull/21, that is, description should accept String or Node as arguments. If it's a String, then it'll be wrapped with a Label.

aalmiray avatar Jul 09 '18 16:07 aalmiray

It's unfortunate that Setting uses description for what looks more like a name. Wouldn't make much sense to s/description/name/ as it breaks behavior.

I guess I'll choose explanation for this "additional description".

aalmiray avatar Jul 09 '18 17:07 aalmiray

It makes sense for https://github.com/dlemmermann/formsfx/pull/21 to be reviewed and hopefully merged, then wait for the next release of FormsFX as Setting uses the Field API as is.

aalmiray avatar Jul 09 '18 17:07 aalmiray

I think since description is an internal name anyways and refactoring that would not result in any signature changes, resulting in only non-breaking API changes I would even propose to refactor description to title or name and then you could use description, as it would make more sense. What do you think?

martinfrancois avatar Jul 09 '18 20:07 martinfrancois

Thats somethink I ask me for myself. Why are the parameters in Setting, Group and Category spelled description when in the JavaDoc they promounced as name, title... One possibility is that the text in the label describes the functionality from the component on the right side, but why isn't that terminology used in the JavaDoc?

Naoghuman avatar Dec 13 '18 19:12 Naoghuman

@Naoghuman like I mentioned, the name description may not be ideal. As proposed in my previous comment, I would happily merge a PR that implements such a change if it benefits the readability.

martinfrancois avatar Dec 14 '18 21:12 martinfrancois