Skip to content

Commit

Permalink
CAUSEWAY-2297: typo 'binable'
Browse files Browse the repository at this point in the history
  • Loading branch information
andi-huber committed Nov 22, 2024
1 parent e72d3ea commit cf2cb96
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public Optional<Comparator<ManagedObject>> asComparator(final Can<? extends Data

// -- SORTING

Bindable<ColumnSort> columnSortBinable();
Bindable<ColumnSort> columnSortBindable();

// -- SELECTION

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static DataTableInternal forAction(
@Getter private final @NonNull LazyObservable<Can<DataRow>> dataRowsSelectedObservable;

@Accessors(fluent=true)
@Getter private final _BindableAbstract<ColumnSort> columnSortBinable;
@Getter private final _BindableAbstract<ColumnSort> columnSortBindable;

@Accessors(fluent=true)
@Getter private final @NonNull LazyObservable<Can<DataColumn>> dataColumnsObservable;
Expand Down Expand Up @@ -151,7 +151,7 @@ private DataTableInternal(
this.filterHandler = _FilterUtils.createFilterHandler(elementType);

this.searchArgumentBindable = _Bindables.forValue("");
this.columnSortBinable = _Bindables.forValue(null);
this.columnSortBindable = _Bindables.forValue(null);

this.dataElementsObservable = _Observables.lazy(()->elements
//.map(mmc::injectServicesInto) // I believe is redundant, has major performance impact
Expand Down Expand Up @@ -180,7 +180,7 @@ private DataTableInternal(
dataRowsFilteredAndSortedObservable.invalidate();
});

this.columnSortBinable.addListener((e,o,n)->{
this.columnSortBindable.addListener((e,o,n)->{
dataRowsFilteredAndSortedObservable.invalidate();
});

Expand Down Expand Up @@ -267,7 +267,7 @@ private CollectionFilterService.Tokens tokens(final ManagedObject element){
// -- SORTING

private Optional<Comparator<DataRow>> sortingComparator() {
return Optional.ofNullable(columnSortBinable.getValue())
return Optional.ofNullable(columnSortBindable.getValue())
.flatMap(sort->sort.asComparator(dataColumnsObservable.getValue()))
.or(()->managedMember.getMetaModel().getElementComparator())
.map(elementComparator->(rowA, rowB)->elementComparator.compare(rowA.rowElement(), rowB.rowElement()));
Expand Down Expand Up @@ -430,7 +430,7 @@ static Memento create(
tableInteractive.exportAll(),
tableInteractive.searchArgumentBindable.getValue(),
tableInteractive.getSelectedRowIndexes(),
tableInteractive.columnSortBinable().getValue());
tableInteractive.columnSortBindable().getValue());
}

private final @NonNull Identifier featureId;
Expand Down Expand Up @@ -468,7 +468,7 @@ public DataTableInternal getDataTableModel(final ManagedObject owner) {
.collect(Can.toCan()));

if(columnSort!=null) {
dataTableInteractive.columnSortBinable.setValue(columnSort);
dataTableInteractive.columnSortBindable.setValue(columnSort);
}
dataTableInteractive.searchArgumentBindable.setValue(searchArgument);
dataTableInteractive.doProgrammaticToggle(()->{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ private DataTableInteractive dataTableModelInternal() {
private DataTableInteractive applyColumnSortTo(final DataTableInteractive dataTableInteractive) {
// honor (single) column sort (if any)
// optimization: set only, if value actually changes
var oldColumnSort = dataTableInteractive.columnSortBinable().getValue();
var oldColumnSort = dataTableInteractive.columnSortBindable().getValue();
var newColumnSort = columnSort().orElse(null);
if(!Objects.equals(oldColumnSort, newColumnSort)) {
dataTableInteractive.columnSortBinable().setValue(newColumnSort);
dataTableInteractive.columnSortBindable().setValue(newColumnSort);
}
return dataTableInteractive;
}
Expand Down

0 comments on commit cf2cb96

Please sign in to comment.