scrollTo(int Row, ...) in Tree doesn't expose necessary fields
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
(This affects Vaadin version 8.2.0.rc1)
To use the scrollTo method with the tree, the method implementing it needs to be aware of the current integer value of the row being scrolled to, but this isn't exposed by the Tree class.
The necessary information seems to be contained in the com.vaadin.data.provider.HierarchyMapper used by com.vaadin.data.provider.HierarchicalDataCommunicator. This HierarchyMapper field is logically set to private but the getter method is set to protected. As a workaround I created the following class in my project:
package com.vaadin.data.provider;
public class ThesTreeDataCommunicator<T> extends HierarchicalDataCommunicator<T> {
/**
*
*/
private static final long serialVersionUID = 1L;
HierarchicalDataCommunicator<T> hier;
public ThesTreeDataCommunicator(HierarchicalDataCommunicator<T> hier) {
this.hier = hier;
}
public HierarchyMapper<T,?> getHierarchyMapper(){
return hier.getHierarchyMapper();
}
}
Further complicating the issue, the DataCommunicator for the Tree class doesn't have a getter either, so to get at the DataCommunicator the Tree has to be cast to a TreeGrid. Having to do this to use a provided method seems a bit counter-intuitive from an implementation standpoint.
As always thanks for your time and effort.
Regards,
Jeffrey
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading Tree, TreeGrid, DataCommunicator, HierarchicalDataCommunicator, and HierarchyMapper, focusing on how scrollTo accesses the current row and how the communicator is exposed. Reproduce the limitation against Vaadin 8.2.0.rc1 and determine the supported API needed for Tree scrolling; done means the necessary fields can be accessed without the workaround described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100