-
Notifications
You must be signed in to change notification settings - Fork 27
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
Chooser - Update Selected Value #6
Chooser - Update Selected Value #6
Conversation
250494d
to
056b912
Compare
|
||
if (source.getString(SELECTED) == null) { | ||
source.putString(SELECTED, source.getString(DEFAULT, choices.get(0))); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to use the getString(key, defaultValue) override. The robot by default does not set the key, so this would end up throwing an exception. source.getString(SELECTED, null) == null
should work.
Also the intellij changes should be a separate PR. |
When you do move the intellij changes, just ignore all of .idea/, not just parts of it. No IDE-specific configs should be making it into our repos. |
056b912
to
a6376f5
Compare
This is ready for review. |
Code looks good to me, other then we are going to want all these commits squashed into 1 before merging. I don't have a Rio to test with however, but this should work. |
Do you want me to squash or is the GitHub squash ok? Tested on a RIO -- works as expected. |
closes #2
If the selected value in networktables is null and we have a selected value. Update networktables. If we do not have a selected value, use the default. If there is no default, use the first option.