Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 242719 add SpinnerFieldEditor #2179

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sebthom
Copy link
Contributor

@sebthom sebthom commented Aug 11, 2024

This is a follow-up PR for https://bugs.eclipse.org/bugs/show_bug.cgi?id=242719

Similar to the approach in that issue I created the SpinnerFieldEditor based on the latest code of ScaleFieldEditor.

@sebthom sebthom changed the title add SpinnerFieldEditor, SpinnerFieldEditorTest, ScaleFieldEditorTest, add SpinnerFieldEditor, SpinnerFieldEditorTest, ScaleFieldEditorTest Aug 12, 2024
@sebthom sebthom force-pushed the spinner-field-editor branch 5 times, most recently from ba50234 to 6d7d98c Compare August 12, 2024 13:01
Copy link
Contributor

github-actions bot commented Aug 12, 2024

Test Results

 1 813 files   -  2   1 813 suites   - 2   1h 32m 39s ⏱️ - 1m 21s
 7 696 tests ± 0   7 468 ✅ ± 0  228 💤 ±0  0 ❌ ±0 
24 231 runs   - 18  23 482 ✅  - 18  749 💤 ±0  0 ❌ ±0 

Results for commit d60b19f. ± Comparison against base commit a801237.

♻️ This comment has been updated with latest results.

@sebthom sebthom force-pushed the spinner-field-editor branch 4 times, most recently from da489ce to f03795a Compare August 12, 2024 15:31
@sebthom sebthom changed the title add SpinnerFieldEditor, SpinnerFieldEditorTest, ScaleFieldEditorTest Bug 242719 add SpinnerFieldEditor Aug 12, 2024
@sebthom sebthom force-pushed the spinner-field-editor branch 2 times, most recently from 2b2fed3 to 2d0a7af Compare August 12, 2024 20:11
@HannesWell
Copy link
Member

Thank you for this enhancement.

Can anyone of the committers that is more involved into UI topics review this?
Then we can consider this for submission in the beginning of the next release cycle.

Copy link
Contributor

@Wittmaxi Wittmaxi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!
Since adding this PR means increasing API, I think it is extra important to make sure the comments for all methods are speaking.

In particular, many of the javadoc-comments refer to another method instead of "just telling me what the method does".

The code looks sound, so do the test.

Is there any use for this componet? It would be great to see this component as a real component used in some follow-up-down-the-line-PR

* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* IBM Corporation - initial API and implementation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this file copied from somewhere? The copyright header looks off somehow.

public class SpinnerFieldEditor extends FieldEditor {

/**
* Value that will feed {@link Spinner#setDigits(int)}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These comments don't help me understand the code.

Suggested change
* Value that will feed {@link Spinner#setDigits(int)}.
* amount of digits to display (?) by default (?)

* @param min the value used for {@link Spinner#setMinimum(int)}.
* @param max the value used for {@link Spinner#setMaximum(int)}.
*/
public SpinnerFieldEditor(final String name, final String labelText, final Composite parent, final int min,
Copy link
Contributor

@Wittmaxi Wittmaxi Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like an oddly specific constructor. Maybe consider providing a builder here?

return incrementValue;
}

/**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of these javadoc comments seem redundant. In particular, I am talking about comments referring to the setter of a getter.

Suggested change
/**
/** {@return the maximum value this spinner may take on (10 by default) }

}

/**
* Set the value to be used for Spinner.setDigits(int) and update the spinner.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Set the value to be used for Spinner.setDigits(int) and update the spinner.
* Sets the number of decimal places used by the receiver.
* @see Spinner#setDigits(int)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants