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

AdvisedCellLabelProvider adds space to labels #31

Open
jesperes opened this issue Aug 30, 2016 · 3 comments
Open

AdvisedCellLabelProvider adds space to labels #31

jesperes opened this issue Aug 30, 2016 · 3 comments

Comments

@jesperes
Copy link

The class AdvisedCellLabelProvider has a "workaround" which looks like this:

            String s = columnAdvisor.getString(element, index);
            if(s != null && !s.isEmpty()) {
            // workaround: append space to the text to avoid last character truncation the cells
                s += ' ';
            }
            cell.setText(s);

This workaround causes widespread breakage in out SWTBot tests, which presumes that the cell text is unmodified.

The workaround feels very kludgy, maybe there is a better way to make JFace measure the text extent correctly?

@edriouk
Copy link
Contributor

edriouk commented Aug 30, 2016

We need to investigate why it has been done. As far as I remember it was not the extent calculation, but a JFace drawing problem on one of the platforms. The very last letter in a cell was truncated in the middle even if the cell width was wide enough, for instance R you could be seen as I.

Could you modify your tests to truncate trailing spaces?

@jesperes
Copy link
Author

I have disabled the workaround in our local fork, so this is not a critical issue at the moment.

@edriouk
Copy link
Contributor

edriouk commented Dec 20, 2016

We have had the similar problems with SWTBot and solved the problem by modifying tests.

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

3 participants