Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public abstract class FilteredAndGroupedExplorerPanel< AS extends SpimData2 >
private static final List<List<BasicViewDescription<?>>> selectionHistory = new ArrayList<>();
private static int historyIndex = -1;
private static boolean navigatingHistory = false;
private static boolean bulkSelecting = false;

static
{
Expand Down Expand Up @@ -291,6 +292,11 @@ protected ListSelectionListener getSelectionListener()
@Override
public void valueChanged(final ListSelectionEvent arg0)
{
// Skip intermediate selection changes while user is still adjusting
// (e.g., shift-clicking multiple rows). Only process when finalized.
if ( arg0.getValueIsAdjusting() )
return;

BDVPopup b = bdvPopup();

selectedRows.clear();
Expand Down Expand Up @@ -695,8 +701,14 @@ protected void openSelectionDialog()
final List<BasicViewDescription<?>> selectedViews = dialog.getSelectedViews();
if ( selectedViews != null && !selectedViews.isEmpty() )
{
// Select the views in the table
// Select the views in the table (disable history saving during bulk selection)
bulkSelecting = true;
selectViews( selectedViews );
bulkSelecting = false;

// Save the final selection to history once
saveSelectionToHistory();

IOFunctions.println( "Selected " + selectedViews.size() + " views based on criteria." );
}
}
Expand Down Expand Up @@ -724,7 +736,7 @@ protected void selectViews( final List<BasicViewDescription<?>> views )

protected void saveSelectionToHistory()
{
if ( navigatingHistory )
if ( navigatingHistory || bulkSelecting )
return;

// Get current selection
Expand Down