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

Enhancement Request : Find a label using it's text #102

Closed
badari412 opened this issue Jan 31, 2018 · 2 comments
Closed

Enhancement Request : Find a label using it's text #102

badari412 opened this issue Jan 31, 2018 · 2 comments
Milestone

Comments

@badari412
Copy link
Contributor

badari412 commented Jan 31, 2018

Currently (swinglibrary 1.9.7), finding a label is possible using only it's index or name. But usually SwingUI developers tend to forget or not give any names to the most of the components for e.g. buttons, labels etc. So wouldn't be nice to add an ability to look for a label using it's text similar to the way we find buttons? This will help with the keywords Label Should Exist, Label Should Not Exist etc. Using text is more reliable than using index.

Changing LabelOperatorFactory.java from
public LabelOperator createOperatorByName(String name) { return new LabelOperator((ContainerOperator) Context.getContext(), new ByNameComponentChooser(name)); } }

to

public LabelOperator createOperatorByName(String name) { return new LabelOperator((ContainerOperator) Context.getContext(), new ByNameOrTextComponentChooser(name)); } }

will do the trick. If my request makes any sense to you people, let me know I will work on it.

@mihaiparvu
Copy link
Contributor

mihaiparvu commented Jul 3, 2018

Sounds like a very good enhancement and I don't see any problems that could arise by doing this change.
Are you still interested, @badari412 in providing a pull-request?

@badari412
Copy link
Contributor Author

Thanks for responding @mihaiparvu . Will submit the pull request in a day or so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants