refactor: Move HasOrderedComponents methods to HasComponents and deprecate HasOrderedComponents#23773
Conversation
…recate HasOrderedComponents
The interface HasOrderedComponents is marked as deprecated and its methods have been moved to HasComponents for backward compatibility. The replace, indexOf, getComponentCount, getComponentAt, and getChildren methods have been removed.
|
Why should this be done? |
Consider building e.g. framework or set of generic utilities on top of Vaadin. It would be clearer if we have just HasComponents, which offer the necessary methods, e.g. to replace a component. The division of these interfaces is I think inherited from Vaadin 8, but in Flow the implementation is done via Element API anyway, which already offers the needed mechanisms, so the division is purely arbitrary. Quote from the customer: "And for our specific issue: |
Added a method to retrieve child components from a parent component, ensuring proper handling of wrapped components.
Refactor getChildren method to check if instance is Component.
Removed unused import for Stream.Builder.
Removed unnecessary Javadoc reference to Id.
|
…ecate HasOrderedComponents (#23773) * refactor: Move HasOrderedComponents methods to HasComponents and derprecate HasOrderedComponents * Deprecate HasOrderedComponents interface and remove methods The interface HasOrderedComponents is marked as deprecated and its methods have been moved to HasComponents for backward compatibility. The replace, indexOf, getComponentCount, getComponentAt, and getChildren methods have been removed. * Implement getChildren method for Component Added a method to retrieve child components from a parent component, ensuring proper handling of wrapped components. * Refactor getChildren method to use ComponentUtil * Refactor getChildren method in HasComponents Refactor getChildren method to check if instance is Component. * Remove unused import for Stream.Builder Removed unused import for Stream.Builder. * Remove Javadoc reference to Id in getChildren method Removed unnecessary Javadoc reference to Id.
|
Hi @TatuLund and @mshabarov, when i performed cherry-pick to this commit to 24.10, i have encountered the following issue. Can you take a look and pick it manually? |
…ecate HasOrderedComponents (#23773) (#23823) * refactor: Move HasOrderedComponents methods to HasComponents and derprecate HasOrderedComponents * Deprecate HasOrderedComponents interface and remove methods The interface HasOrderedComponents is marked as deprecated and its methods have been moved to HasComponents for backward compatibility. The replace, indexOf, getComponentCount, getComponentAt, and getChildren methods have been removed. * Implement getChildren method for Component Added a method to retrieve child components from a parent component, ensuring proper handling of wrapped components. * Refactor getChildren method to use ComponentUtil * Refactor getChildren method in HasComponents Refactor getChildren method to check if instance is Component. * Remove unused import for Stream.Builder Removed unused import for Stream.Builder. * Remove Javadoc reference to Id in getChildren method Removed unnecessary Javadoc reference to Id. Co-authored-by: Tatu Lund <tatu@vaadin.com>



fixes #23687