Changeset 32699

Show
Ignore:
Timestamp:
16.12.2018 22:43:31 (5 weeks ago)
Author:
ak19
Message:

This fixes another EDT (Event Dispatch Thread) access violation instance where the opening a collection dialog despite being GUI stuff was not done in the Swing EDT thread. The AssertJ Swing test I'm working on at present detected this and fixing it here got me through the test as well.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/gui/GUIManager.java

    r32695 r32699  
    204204    } 
    205205    else if (esrc == menu_bar.file_open) { 
    206         new OpenCollectionTask().start(); 
     206        //new OpenCollectionTask().start(); // will cause an EDT access violation exception 
     207        // since the GUI stuff of opening a collection is not done in a Swing thread 
     208        SwingUtilities.invokeLater(new OpenCollectionTask()); 
    207209    } 
    208210    else if (esrc == menu_bar.file_options) { 
     
    379381        menu_bar = new MenuBar(new MenuListenerImpl()); 
    380382            menu_bar.setComponentOrientation(Dictionary.getOrientation()); 
    381  
     383         
    382384        //feedback changes 
    383385        //content_pane.add(menu_bar, BorderLayout.NORTH); 
     
    935937 
    936938    private class OpenCollectionTask 
    937         extends Thread 
     939    implements Runnable //extends Thread -> If this extends Thread, it will cause an EDT access 
     940           // violation since the GUI stuff in run() is not done in the Swing Event Dispatch Thread/EDT. 
    938941    { 
    939942    public void run()