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

Use static imports instead of inheriting interfaces for ElementsFactory, SVGFactory and DominoCss #884

Closed
vegegoku opened this issue Nov 16, 2023 · 1 comment
Assignees
Labels
breaking-change A change that breaks the api enhancement New feature or request version 2.x.x Version 2.x.x issues
Milestone

Comments

@vegegoku
Copy link
Member

Following up with the discussion here #879
We are going to switch to the new static import style instead of implementing the interfaces ElementsFactory and DominoCss

This means that the components now needs to at least add the following imports statement

import static org.dominokit.domino.ui.utils.Domino.*;

Or add individual static imports.

At the same time for any custom component that inherits the interfaces will still function, and anyone who still prefers the old style for their own custom component they can still use the interfaces since they will remain untouched by themselves.

@vegegoku vegegoku added enhancement New feature or request breaking-change A change that breaks the api labels Nov 16, 2023
@vegegoku vegegoku added this to the 2.0.0-RC5 milestone Nov 16, 2023
@vegegoku vegegoku self-assigned this Nov 16, 2023
vegegoku added a commit that referenced this issue Nov 16, 2023
@vegegoku vegegoku added the version 2.x.x Version 2.x.x issues label Nov 16, 2023
@jhickman
Copy link

If you're like me and don't like star imports, you may have intellij configured to automatically expand out the star imports.

However, there are certain ones that I prefer to stay as star imports such as

  • org.mockito.Mockito.*
  • org.junit.jupiter.api.Assertions.*

You can add org.dominokit.domino.ui.utils.Domino to your star import whitelist in Intellij. This way, when you 'organize imports' it won't expand out and you lose access to the other methods available in the Domino class.
This is under Settings > Editor > Code Style > Java > Imports

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change A change that breaks the api enhancement New feature or request version 2.x.x Version 2.x.x issues
Projects
Status: Done
Development

No branches or pull requests

2 participants