Revision 41122
trunk/org.gvsig.desktop/org.gvsig.desktop.plugin/org.gvsig.app/org.gvsig.app.mainplugin/src/main/java/org/gvsig/fmap/dal/serverexplorer/filesystem/swing/FilesystemExplorerWizardPanel.java | ||
---|---|---|
37 | 37 |
|
38 | 38 |
import javax.swing.AbstractListModel; |
39 | 39 |
import javax.swing.JButton; |
40 |
import javax.swing.JComponent; |
|
40 | 41 |
import javax.swing.JList; |
41 | 42 |
import javax.swing.JPanel; |
42 | 43 |
import javax.swing.JScrollPane; |
43 | 44 |
import javax.swing.ScrollPaneConstants; |
45 |
import javax.swing.SwingUtilities; |
|
44 | 46 |
import javax.swing.event.ListSelectionEvent; |
45 | 47 |
import javax.swing.event.ListSelectionListener; |
46 | 48 |
import javax.swing.filechooser.FileFilter; |
... | ... | |
423 | 425 |
try { |
424 | 426 |
DynObjectEditor editor = new DynObjectEditor(dynObject); |
425 | 427 |
editor.editObject(true); |
428 |
|
|
429 |
RefreshThread st = new RefreshThread(getFileList(), 500); |
|
430 |
st.start(); |
|
431 |
|
|
426 | 432 |
} catch (ServiceException ex) { |
427 | 433 |
LOG.error( |
428 | 434 |
"Error creating a Swing component for the DynObject: " |
... | ... | |
670 | 676 |
filters = null; |
671 | 677 |
} |
672 | 678 |
} |
679 |
|
|
680 |
|
|
681 |
|
|
682 |
class RefreshThread extends Thread { |
|
683 |
|
|
684 |
private int waitt = 0; |
|
685 |
private JList comp = null; |
|
686 |
|
|
687 |
public RefreshThread(JList c, int t) { |
|
688 |
waitt = t; |
|
689 |
comp = c; |
|
690 |
} |
|
691 |
public void run() { |
|
692 |
|
|
693 |
try { |
|
694 |
/* |
|
695 |
* We might need to wait a bit because the GUI thread needs |
|
696 |
* some time to update (this is because we have used a modal dialog |
|
697 |
* and we refresh after that dialog is closed) |
|
698 |
*/ |
|
699 |
Thread.sleep(waitt); |
|
700 |
} catch (Exception exc) { |
|
701 |
|
|
702 |
} |
|
703 |
|
|
704 |
SwingUtilities.invokeLater(new Runnable() { |
|
705 |
public void run() { |
|
706 |
try { |
|
707 |
// System.out.println("REFRESH"); |
|
708 |
comp.clearSelection(); |
|
709 |
} catch (Exception exc) { |
|
710 |
LOG.info("Error while refreshing components.", exc); |
|
711 |
} |
|
712 |
} |
|
713 |
}); |
|
714 |
} |
|
715 |
} |
|
716 |
|
|
673 | 717 |
} |
Also available in: Unified diff