Skip to content

Commit

Permalink
fix helper for availability calls fix ##253
Browse files Browse the repository at this point in the history
  • Loading branch information
amattioc committed Mar 19, 2024
1 parent 115665c commit cd8a20b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20240315-1525
20240319-1514
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ public Collection<String> getCheckedCodes()
return codes;
}

public void updateCheckedCodes(Collection<String> codes)
{
for (int i = 0; i < items.length; i++)
// 1 => key column
if (codes.contains(((String) items[i][1])))
// 0 => checkbox column
items[i][0] = new Boolean(true);
}

public int getCheckedCodesCount()
{
int c = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.util.AbstractMap.SimpleEntry;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
Expand Down Expand Up @@ -964,9 +965,9 @@ private void dimSelListener(ListSelectionEvent e)
codes -> {
// Create new checkbox for codes given the selectedDimension
// the new checkbox is stored in codelistSorterMap using the String selectedDimension as key.
// If the checkbox is not found in codelistSorterMap, it gets instantiated and put into it.
// If the checkbox is already present, the selected codes are updated and set to true
CheckboxListTableModel<String> model = null;
if (!codelistSortersMap.containsKey(selectedDimension)){
//if (!codelistSortersMap.containsKey(selectedDimension)){
model = new CheckboxListTableModel<String>();
model.addTableModelListener(event -> {
tfSdmxQuery.setText(createQuery(dimsTableModel.getSource()));
Expand All @@ -975,9 +976,14 @@ private void dimSelListener(ListSelectionEvent e)
model.addTableModelListener(event -> formatQueryButton(selectedDataflow, dimsTableModel.getSource()));
}
model.setItems(codes);
if(codelistSortersMap.get(selectedDimension) != null){
Collection<String> checkedCodes = codelistSortersMap.get(selectedDimension).getModel().getCheckedCodes();
model.updateCheckedCodes(checkedCodes);
}
TableRowSorter<CheckboxListTableModel<String>> sorter = new TableRowSorter<>(model);
codelistSortersMap.put(selectedDimension, sorter);
}

//}
},
ex -> {
interrupted.set(true);
Expand Down
Binary file modified RJSDMX/inst/java/SDMX.jar
Binary file not shown.
Binary file modified STATA/jar/SDMX.jar
Binary file not shown.

0 comments on commit cd8a20b

Please sign in to comment.