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
Add data communicator API for disabling data provider interactions #9070
Conversation
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 the implementation is done in a way that it will leak to the users (when using e.g. data view API) and causes errors that can confuse them. It should be basically about the component to be able to "delay" the first fetch to a certain point, but not cause errors for users.
countCallback = null; | ||
skipCountIncreaseUntilReset = false; | ||
this.countCallback = null; | ||
this.skipCountIncreaseUntilReset = false; |
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.
Unrelated unnecessary changes
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.
Reverted
@@ -496,7 +537,7 @@ public void setItemCountEstimateIncrease(int itemCountEstimateIncrease) { | |||
} | |||
this.itemCountEstimateIncrease = itemCountEstimateIncrease; | |||
this.countCallback = null; | |||
definedSize = false; | |||
this.definedSize = false; |
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.
Unrelated unnecessary change (yes the this.
for countCallback is unnecessary too)
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.
Reverted
} else if (index >= itemCount) { | ||
throw new IndexOutOfBoundsException(String.format( | ||
"Given index %d is outside of the accepted range '0 - %d'", | ||
index, itemCount - 1)); | ||
} | ||
} | ||
|
||
if (fetchDisabled) { |
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.
Why should this be blocked ??? Since this API is not directly exposed to users, like it should not, it feels weird to me that for some components I can do
Component listing = createListing();
listing.setItems(query -> getStuff(query));
listing.getItem(0);
but not for all. So for Grid this would work and not for combobox (I guess) ??? That is confusing.
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.
Excluded
* @return the size of data provider with current filter | ||
*/ | ||
@SuppressWarnings({ "unchecked", "rawtypes" }) | ||
protected int getDataProviderSize() { | ||
if (fetchDisabled) { |
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.
Again, it would be weird for a data view API user that the same things work for another component, but not for another.
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.
Excluded
6a021a0
to
ec18d31
Compare
I was thinking whether it's better to use the data communicator as a listener for 'switch to normal mode', but I think it is a over-complication and basically limited to 1 component so far, so I simply left it as it is (CTOR arg + getter and setter). Curious users could of course try them randomly, but I have no elegant protection for that. |
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.
It seems to me this PR has more unnecessary white space changes than the actual changes. I will not review it as such as it wastes my time
https://www.jetbrains.com/help/idea/reformat-file-dialog.html
|
SonarQube analysis reported 2 issues Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:
|
No description provided.