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

Collapsible does not share common class structure with HorizontalCollapsible #253

Open
czyzby opened this issue Apr 2, 2017 · 2 comments

Comments

@czyzby
Copy link
Collaborator

czyzby commented Apr 2, 2017

These two widgets share similar overall API, but do not implement a common interface or extend an abstract class. Joining these two with a common interface could shorten both of their implementations (no code duplication) and simplify tools like LML.

@kotcrab
Copy link
Owner

kotcrab commented Apr 5, 2017

I agree. It's kind of messy now because there is CollapsibleWidget (since 0.3.1) and HorizontalCollapsibleWidget (since 1.2.5). Not sure what to do, I could either:

  • break API; rename CollapsibleWidget to VerticalCollapsibleWidget and add CollapsibleWidget interface. If we do renaming we can also consider dropping Widget suffix, not sure if it servers any purpose here
  • do not rename and add Collapsible interface. I would rather avoid I prefix for interfaces

What do you think would be better?

@czyzby
Copy link
Collaborator Author

czyzby commented Apr 5, 2017

There's always abstract class AbstractCollapsibleWidget, where you could move the common code. You wouldn't break the API (although this might make sense for naming consistence) and would only slightly affect both of their class hierarchies. This shouldn't be an issue for most users.

But yeah, if you're not afraid to break the API - or keep the classes deprecated for the next release - I'd probably go with Collapsible interface, AbstractCollapsible providing basic method implementations (because we all love Java 6 and lack of default methods) and the actual widgets named HorizontalCollapsible/VerticalCollapsible for code conciseness.

kotcrab added a commit that referenced this issue Apr 14, 2017
Breking API changes will be made, see #253
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants