-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: Add lazy support to available items grid #145
Conversation
84774e4
to
199e613
Compare
b44de38
to
d5c58f6
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
I decline to review because there are numerous formatting changes and other refactors in the implementation of the feature that have merits of their own, regardless of whether the feature is implemented or not. As this is currently presented, it's difficult to asses the actual impact on the API or to current features. |
@coderabbitai review |
Actions PerformedReview triggered.
|
WalkthroughThe recent updates to the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 4
Outside diff range and nitpick comments (2)
src/test/java/com/flowingcode/vaadin/addons/twincolgrid/Book.java (1)
35-39
: Addition of theprice
field and update to thetoString
method are correctly implemented. Consider adding a comment describing the purpose of theprice
field.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java (1)
247-248
: Ensure data providers are refreshed only when necessary.The calls to
refreshAll
on data providers might be redundant if the data has not changed. Verify if these calls are necessary or if they can be conditionally executed.#!/bin/bash # Description: Check for other instances where data providers are refreshed unnecessarily. rg --type java "getDataProvider().refreshAll"
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (24)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/BaseLazyFilter.java (1 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/EagerFilterConfiguration.java (1 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/EagerFilterableColumn.java (1 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/EagerTwinColModel.java (1 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/FilterConfiguration.java (1 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/FilterableColumn.java (1 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/FilterableTwinColumn.java (2 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/LazyFilter.java (1 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/LazyFilterConfiguration.java (1 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/LazyFilterableColumn.java (1 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/LazyTwinColModel.java (1 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/LegacyTwinColGrid.java (4 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java (26 hunks)
- src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColModel.java (1 hunks)
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/Book.java (1 hunks)
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/BookFilter.java (1 hunks)
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/BookService.java (1 hunks)
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/BoundDemo.java (1 hunks)
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/DoubleClickDemo.java (1 hunks)
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/DragAndDropDemo.java (2 hunks)
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/FilterableDemo.java (3 hunks)
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/LazyFilterableDemo.java (1 hunks)
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/OrientationDemo.java (2 hunks)
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/TwincolDemoView.java (1 hunks)
Files skipped from review due to trivial changes (2)
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/BookFilter.java
- src/test/java/com/flowingcode/vaadin/addons/twincolgrid/TwincolDemoView.java
Additional comments not posted (39)
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/FilterableColumn.java (1)
6-12
: LGTM! The use of Lombok annotations for getters and the constructor simplifies the code and maintains clarity.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/BaseLazyFilter.java (1)
11-17
: Well implemented! The use of generic types and standard collections likeHashSet
andArrayList
ensures flexibility and performance.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/LazyFilter.java (1)
8-22
: Excellent documentation and interface design. This will facilitate the implementation of lazy loading features effectively.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/EagerFilterConfiguration.java (1)
10-24
: Good use of generics and method overrides. The implementation ofsupports
method ensures that the configuration is only applied in appropriate scenarios.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/EagerFilterableColumn.java (1)
12-23
: Well-designed class that extends filtering capabilities. The use ofSerializableBiPredicate
is appropriate for ensuring that filter conditions can be serialized in a distributed environment.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/LazyFilterConfiguration.java (1)
12-31
: Excellent implementation of lazy loading configurations. The class handles the lazy filter instance effectively and ensures that it is only applied in lazy mode scenarios.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/FilterConfiguration.java (2)
12-19
: Constructor andaddFilteredColumn
method are implemented correctly and efficiently.
26-34
: Abstract methodsapply
andsupports
are well-defined, promoting flexibility in subclass implementations.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/LazyFilterableColumn.java (1)
25-36
: Constructor andasEager
method are well-implemented, providing necessary functionality for lazy filtering and conversion to eager filtering.src/test/java/com/flowingcode/vaadin/addons/twincolgrid/DoubleClickDemo.java (1)
51-54
: Initialization of book data and setup ofTwinColGrid
with double-click functionality are correctly implemented and demonstrate the new features effectively.Also applies to: 61-74
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/EagerTwinColModel.java (1)
35-61
: Methods for adding, removing items, and handling filterable columns are correctly implemented, supporting the in-memory data provider model effectively.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/LazyTwinColModel.java (1)
41-69
: Methods for adding, removing items, setting filters, and handling filterable columns are correctly implemented, supporting the backend data provider model effectively.src/test/java/com/flowingcode/vaadin/addons/twincolgrid/OrientationDemo.java (2)
57-58
: LGTM! Setting columns as sortable enhances user interaction by allowing sorting on these fields.
73-86
: Ensure consistency in data representation. The addition of theprice
field should be reflected across all relevant parts of the application.Verification successful
The
price
field is consistently used in theBook
constructor across the application.
- Instances of the
Book
constructor in the following files include theprice
field:
OrientationDemo.java
FilterableDemo.java
DragAndDropDemo.java
DoubleClickDemo.java
BoundDemo.java
BookService.java
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `price` field is consistently used across the application. # Test: Search for the Book constructor usage. Expect: All occurrences should include the price field. rg --type java $'new Book\('Length of output: 8085
src/test/java/com/flowingcode/vaadin/addons/twincolgrid/BoundDemo.java (2)
56-57
: LGTM! Setting columns as sortable enhances user interaction by allowing sorting on these fields.
78-91
: Ensure consistency in data representation. The addition of theprice
field should be reflected across all relevant parts of the application.Verification successful
The
price
field is consistently used across all instances of theBook
constructor in the application.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `price` field is consistently used across the application. # Test: Search for the Book constructor usage. Expect: All occurrences should include the price field. rg --type java $'new Book\('Length of output: 8085
src/main/java/com/flowingcode/vaadin/addons/twincolgrid/FilterableTwinColumn.java (2)
25-26
: LGTM! Setting filter placeholders enhances user experience by providing context for the filter fields.
36-37
: LGTM! Allowing the visibility of the clear button to be toggled enhances user experience by providing a clear way to reset filters.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColModel.java (1)
18-120
: LGTM! The implementation ofTwinColModel
provides a robust foundation for managing grid behavior and data interactions.src/test/java/com/flowingcode/vaadin/addons/twincolgrid/BookService.java (1)
40-60
: LGTM! The method for fetching books applies filters and sorting correctly, enhancing the functionality of the service.src/test/java/com/flowingcode/vaadin/addons/twincolgrid/FilterableDemo.java (1)
52-70
: LGTM! The setup of filterable columns and the configuration of filters enhances the functionality of the TwinColGrid in the demo.src/test/java/com/flowingcode/vaadin/addons/twincolgrid/DragAndDropDemo.java (5)
51-58
: Ensure that the chaining of method calls ontwinColGrid
follows best practices for readability and maintainability.
60-61
: Setting columns as sortable is a good practice for user-friendly interfaces, especially in a demo that showcases capabilities.
66-67
: Adding a selection listener to update the count label dynamically enhances user interaction by providing immediate feedback.
77-90
: Adding a diverse set of books with different prices helps in demonstrating the sorting and filtering capabilities effectively in the demo.
98-107
: The implementation of the reordering toggle with a refresh function to update visibility based on grid state is a robust way to handle UI changes dynamically.src/test/java/com/flowingcode/vaadin/addons/twincolgrid/LazyFilterableDemo.java (6)
49-58
: Using a lambda expression for the data provider callbacks ensures that the grid can handle large datasets efficiently by fetching and counting data as needed.
66-72
: Configuring the grid with lazy loading, drag and drop support, and reordering capabilities demonstrates a comprehensive use of the TwinColGrid's features.
74-87
: The setup of lazy filterable columns with dynamic filtering conditions showcases an advanced use of grid functionalities, enhancing the demo's utility.
91-94
: Proper configuration of the filter with the addition of filtered columns ensures that the grid can be filtered dynamically based on user input.
104-107
: Utilizing a Binder to manage data binding between the TwinColGrid and a Library model is a clean and effective way to handle form-like data interactions.
109-115
: Adding buttons for fetching values and clearing the grid provides essential controls for interacting with the grid in the demo.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/LegacyTwinColGrid.java (2)
297-310
: Adding a method to create columns for both grids simultaneously with a TextRenderer simplifies the process of setting up grids in legacy systems.
464-485
: The method to control the creation of the first header row based on a boolean flag provides flexibility in configuring grid headers, which is crucial for legacy systems where UI consistency must be maintained.src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java (5)
191-191
: Ensure proper initialization of models inforEachSide
.The method
forEachSide
is used here without a clear indication of whatinit
does. Ensure that this method properly initializes all necessary aspects of the models.
126-129
: EnsureLinkedHashSet
is the appropriate choice for data handling.Using
LinkedHashSet
ensures order but might not be necessary or efficient depending on the data size and operations. Verify if this is the best choice for the use case.Verification successful
The
LinkedHashSet
is used in multiple places within theTwinColGrid
class and its adapter. To verify ifLinkedHashSet
is the appropriate choice, we need to understand the context and requirements for each usage. Specifically, we need to determine if the order-preserving nature ofLinkedHashSet
is necessary and if its performance characteristics are suitable for the use case.Let's examine the context of each usage of
LinkedHashSet
in theTwinColGrid
class and its adapter.
The
LinkedHashSet
is used in several places within theTwinColGrid
class and its adapter. Here are the contexts:
Constructor:
public TwinColGrid(final Collection<T> options) { this(); setDataProvider(DataProvider.ofCollection(new LinkedHashSet<>(options))); }
- Purpose: Initializes the data provider with a collection of options.
- Reasoning: Using
LinkedHashSet
ensures that the order of options is preserved, which might be important for the UI representation.Update Selection:
updateSelection(new LinkedHashSet<>(filteredItems), new HashSet<>(), true); updateSelection(new LinkedHashSet<>(getAvailableGrid().getSelectedItems()), new HashSet<>(), true);
- Purpose: Updates the selection with filtered items or selected items from the available grid.
- Reasoning: Preserving the order of selected items might be important for consistent user experience.
Set Value:
final Set<T> oldValues = new LinkedHashSet<>(selection.getItems());
- Purpose: Stores the old values of the selection.
- Reasoning: Order preservation might be necessary to compare old and new values accurately.
Drag and Drop Configuration:
final Set<T> draggedItems = new LinkedHashSet<>();
- Purpose: Initializes a set for dragged items.
- Reasoning: Order might be important to maintain the sequence of dragged items.
Adapter Set Value:
delegate.setValue(new LinkedHashSet<>(value));
- Purpose: Sets the value in the adapter.
- Reasoning: Ensures the order of values is preserved when setting them.
Given these contexts, it appears that the use of
LinkedHashSet
is intentional to preserve the order of elements, which is likely important for the functionality and user experience of theTwinColGrid
component.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for other instances where LinkedHashSet is used for similar purposes. rg --type java "new LinkedHashSet"Length of output: 933
Script:
#!/bin/bash # Extract the context around each usage of LinkedHashSet in the TwinColGrid class and its adapter rg --type java -A 5 -B 5 "new LinkedHashSet" src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGrid.java rg --type java -A 5 -B 5 "new LinkedHashSet" src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColGridListAdapter.javaLength of output: 2253
750-765
: Review the logic for handling double-click events.The method for handling double-click events to move items between grids should be carefully reviewed to ensure it behaves as expected, especially in edge cases.
Verification successful
To ensure the double-click event handling logic is consistent and behaves as expected, especially in edge cases, we need to review the instances found in
TwinColModel.java
.
Let's refine the pattern to ensure we capture the
addItemDoubleClickListener
method correctly fromTwinColModel.java
.
Let's use
rg
to search for theaddItemDoubleClickListener
method directly and extract the surrounding lines for context.
The
TwinColModel.java
file contains methods for adding and removing double-click listeners, as well as retrieving the current listener. The logic inTwinColGrid.java
for handling double-click events appears to be consistent with these methods.
addItemDoubleClickListener
adds a listener and stores the registration.removeItemDoubleClickListener
removes the listener if it exists.These methods ensure that double-click listeners are managed correctly, aligning with the logic in
TwinColGrid.java
.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for other instances where double-click events are handled. rg --type java "addItemDoubleClickListener"Length of output: 427
Script:
#!/bin/bash # Extract the relevant methods and context from TwinColModel.java ast-grep --lang java --pattern 'class TwinColModel { $$$ Registration addItemDoubleClickListener($_) { $$$ } $$$ }' > TwinColModel_methods.txt # Display the content of the extracted methods cat TwinColModel_methods.txtLength of output: 160
Script:
#!/bin/bash # Extract the relevant methods and context from TwinColModel.java ast-grep --lang java --pattern 'class TwinColModel { $$$ public Registration addItemDoubleClickListener($_) { $$$ } $$$ }' > TwinColModel_methods.txt # Display the content of the extracted methods cat TwinColModel_methods.txtLength of output: 167
Script:
#!/bin/bash # Search for the addItemDoubleClickListener method in TwinColModel.java and extract surrounding lines for context rg --context 10 "addItemDoubleClickListener" src/main/java/com/flowingcode/vaadin/addons/twincolgrid/TwinColModel.javaLength of output: 679
355-355
: Clarify the purpose offorEachSide
in this context.The use of
forEachSide
here is vague. Clarify its purpose and ensure it is used appropriately within the context of this method.Verification successful
To clarify the purpose of the
forEachSide
method, we need to examine theTwinColModel::init
method and thesetMoveItemsByDoubleClick
method in detail. This will help us understand the operations performed on each side (available
andselection
) whenforEachSide
is invoked.
To verify the existence and locate the correct patterns for the
init
method in theTwinColModel
class and thesetMoveItemsByDoubleClick
method in theTwinColGrid
class, we will list the methods in these classes.
To verify the existence of the
TwinColModel
andTwinColGrid
classes and locate their methods, we will search for these classes and list their methods.
To verify the existence of the
init
method in theTwinColModel
class and thesetMoveItemsByDoubleClick
method in theTwinColGrid
class, we will search for these methods directly.
The
forEachSide
method in theTwinColGrid
class is used to apply a givenConsumer
to both theavailable
andselection
models. Here are the key points regarding its usage:
- Initialization: The method
forEachSide(TwinColModel::init)
is used to initialize both models by setting their selection mode, visibility, and layout properties.- Double-Click Handling: In the
setMoveItemsByDoubleClick
method,forEachSide
is used to add double-click listeners to both models, enabling items to be moved between the grids upon double-click.These usages ensure that both sides of the grid are consistently configured and behave similarly in response to user interactions.
- Location in Code:
forEachSide(TwinColModel::init);
is used in the initialization section.forEachSide(side -> { ... });
is used within thesetMoveItemsByDoubleClick
method.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Search for documentation or comments explaining the use of `forEachSide`. rg --type java "forEachSide" -A 3 -B 3Length of output: 2287
Script:
#!/bin/bash # Description: Retrieve the implementation of the `init` method in the `TwinColModel` class. ast-grep --lang java --pattern $'class TwinColModel<T> { $$$ void init() { $$$ } $$$ }' # Description: Retrieve the full implementation of the `setMoveItemsByDoubleClick` method in the `TwinColGrid` class. ast-grep --lang java --pattern $'class TwinColGrid<T> { $$$ public void setMoveItemsByDoubleClick(boolean value) { $$$ } $$$ }'Length of output: 241
Script:
#!/bin/bash # Description: List all methods in the `TwinColModel` class. ast-grep --lang java --pattern $'class TwinColModel<T> { $$$ }' | grep -E 'void|public|private|protected' # Description: List all methods in the `TwinColGrid` class. ast-grep --lang java --pattern $'class TwinColGrid<T> { $$$ }' | grep -E 'void|public|private|protected'Length of output: 216
Script:
#!/bin/bash # Description: Search for the `TwinColModel` class and list its methods. rg --type java 'class TwinColModel' -A 20 # Description: Search for the `TwinColGrid` class and list its methods. rg --type java 'class TwinColGrid' -A 20Length of output: 6717
Script:
#!/bin/bash # Description: Search for the `init` method in the `TwinColModel` class. rg --type java 'void init' -A 10 # Description: Search for the `setMoveItemsByDoubleClick` method in the `TwinColGrid` class. rg --type java 'void setMoveItemsByDoubleClick' -A 10Length of output: 12013
143-145
: Validate the necessity of restricting toInMemoryDataProvider
.The restriction to
InMemoryDataProvider
might limit flexibility. Consider if other data providers could also be supported without compromising functionality.
import com.vaadin.flow.data.provider.DataProvider; | ||
import com.vaadin.flow.data.provider.InMemoryDataProvider; |
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.
Consider removing the unused import ListDataProvider
.
The import ListDataProvider
appears to be unused in this file. Removing unused imports can help keep the code clean and maintainable.
getAvailableGrid().setWidth("100%"); | ||
getSelectionGrid().setWidth("100%"); | ||
|
||
|
||
addAllButton.setVisible(addAllButton.isVisible() && available.supportsAddAll()); |
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.
Check the logic for visibility condition of addAllButton
.
The visibility condition for addAllButton
seems redundant as setVisible
is being called with its own visibility status. Simplify this by directly setting the visibility based on available.supportsAddAll()
.
- addAllButton.setVisible(addAllButton.isVisible() && available.supportsAddAll());
+ addAllButton.setVisible(available.supportsAddAll());
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
addAllButton.setVisible(addAllButton.isVisible() && available.supportsAddAll()); | |
addAllButton.setVisible(available.supportsAddAll()); |
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.
That visibility is not redundant. If addAllButton
is not visible I don't want to base the visibility on the result of available.supportsAddAll()
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.
@mlopezFC, thank you for the clarification. I understand now that the visibility of the addAllButton
might be controlled under different conditions elsewhere in your application, and thus, maintaining the current check ensures that it only becomes visible if it was already intended to be so. I'll consider this matter resolved based on your input. If there's anything else you need, feel free to let me know!
available.addAll(removedItems); | ||
available.removeAll(addedItems); | ||
|
||
selection.getItems().addAll(addedItems); | ||
selection.getItems().removeAll(removedItems); | ||
selection.addAll(addedItems); | ||
selection.removeAll(removedItems); | ||
|
||
forEachGrid( | ||
grid -> { | ||
grid.getDataProvider().refreshAll(); | ||
grid.getSelectionModel().deselectAll(); | ||
}); | ||
forEachGrid(grid -> { | ||
grid.getDataProvider().refreshAll(); | ||
grid.getSelectionModel().deselectAll(); | ||
}); |
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.
Optimize the updateSelection method for better performance.
The updateSelection
method could be optimized by reducing the number of calls to refreshAll
and deselectAll
. Consider batching these operations or checking conditions before making calls.
- available.addAll(removedItems);
- available.removeAll(addedItems);
- selection.addAll(addedItems);
- selection.removeAll(removedItems);
- forEachGrid(grid -> {
- grid.getDataProvider().refreshAll();
- grid.getSelectionModel().deselectAll();
- });
+ updateModel(available, removedItems, addedItems);
+ updateModel(selection, addedItems, removedItems);
Committable suggestion was skipped due low confidence.
private TwinColModel<T, ?> createModel(@NonNull Grid<T> grid, String className) { | ||
return grid.getDataProvider().isInMemory() ? new EagerTwinColModel<>(grid, className) | ||
: new LazyTwinColModel<>(grid, className); | ||
} |
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.
Refactor to improve the model creation logic.
The method createModel
could be refactored for clarity and to avoid repetition. Consider using a ternary operator for a more concise implementation.
- return grid.getDataProvider().isInMemory() ? new EagerTwinColModel<>(grid, className)
- : new LazyTwinColModel<>(grid, className);
+ return (grid.getDataProvider().isInMemory() ? EagerTwinColModel::new : LazyTwinColModel::new).apply(grid, className);
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
private TwinColModel<T, ?> createModel(@NonNull Grid<T> grid, String className) { | |
return grid.getDataProvider().isInMemory() ? new EagerTwinColModel<>(grid, className) | |
: new LazyTwinColModel<>(grid, className); | |
} | |
private TwinColModel<T, ?> createModel(@NonNull Grid<T> grid, String className) { | |
return (grid.getDataProvider().isInMemory() ? EagerTwinColModel::new : LazyTwinColModel::new).apply(grid, className); | |
} |
After trying to review this PR a lot of times, we are not sure how much it would affect the stability of the component given the amount of changes. So we're closing this for now and we will analyze if it is possible to create a simpler implementation in the future. |
Close #130
Summary by CodeRabbit
New Features
Enhancements
Bug Fixes
Documentation