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

feat: add WhiteSpace setter and getter methods #11919

Merged
merged 3 commits into from
Oct 5, 2021
Merged

Conversation

denis-anisimov
Copy link
Contributor

@denis-anisimov denis-anisimov commented Sep 23, 2021

fixes #4577

Description

Please list all relevant dependencies in this section and provide summary of the change, motivation and context.

Fixes # (issue)

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

@knoobie
Copy link
Contributor

knoobie commented Sep 24, 2021

Personally, I don't really see the need of this addition; it bloats the HasText interface and the getWhiteSpace does not really give the precise value (somebody would expect; calculated from the browser) instead it returns the value that was given by set or a default value that could even be wrong if styled with CSS.

@mshabarov mshabarov self-requested a review September 27, 2021 11:10
@mshabarov
Copy link
Contributor

the getWhiteSpace does not really give the precise value (somebody would expect; calculated from the browser) instead it returns the value that was given by set or a default value that could even be wrong if styled with CSS.

If it behaves like this, then maybe better to not add getWhiteSpace at all, or describe it's limitation in javadoc.

Copy link
Contributor

@mshabarov mshabarov left a comment

Choose a reason for hiding this comment

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

I'm not familiar with the white-space CSS properties that much, but the new API look good to me.

@mshabarov mshabarov requested a review from Legioth October 1, 2021 12:18
@mshabarov
Copy link
Contributor

Added Leif as he was the author of this enhancement.

@mshabarov mshabarov added +0.1.0 and removed +1.0.0 labels Oct 1, 2021
@Legioth
Copy link
Member

Legioth commented Oct 4, 2021

The implementation seems to be in line with what I have expected. My only remark is that there's some new API in the enum that is implicitly public that doesn't have javadocs, but that's up to the team do decide what policy you have for such cases.

@vaadin-bot
Copy link
Collaborator

SonarQube analysis reported 1 issue

  1. CRITICAL HasText.java#L97: Document this public method by adding an explicit description. rule

@vaadin-bot vaadin-bot added +1.0.0 and removed +0.1.0 labels Oct 5, 2021
@denis-anisimov denis-anisimov merged commit 7a540e2 into master Oct 5, 2021
@denis-anisimov denis-anisimov deleted the 4577-white-space branch October 5, 2021 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Java API for configuring white-space styles
5 participants