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

JBIDE-18413: Refreshing CheckboxTableControlBuilder choices when value choices change #108

Closed
wants to merge 2 commits into from

Conversation

gastaldi
Copy link
Contributor

No description provided.

@gastaldi
Copy link
Contributor Author

@fbricon can you review this PR? Thanks

Iterable<Object> defaultValues = selectMany.getValue();
if (defaultValues != null) {
for (Object object : defaultValues) {
data.add(converter.convert(object));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can the converter return null values?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, only if object is null. But nevertheless I'll add a check here

@gastaldi
Copy link
Contributor Author

@fbricon I applied your suggested fixes. Please review this PR again

Iterable<Object> valueChoices = selectMany.getValueChoices();
if (valueChoices == null)
return;
List<String> newItems = new ArrayList<String>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you can, assign the expected size directly. But that's me nitpicking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The expected size of what exactly?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of newItems. Can we know the size of selectMany without iterating it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, it's an Iterable

@fbricon
Copy link
Member

fbricon commented Sep 23, 2014

+1 to apply

@gastaldi
Copy link
Contributor Author

Merged, thanks!

@gastaldi gastaldi closed this Sep 23, 2014
@gastaldi gastaldi deleted the JBIDE-18413 branch September 23, 2014 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants