dataBrowserButton = new JButton(MESSAGES.getString("Action.OpenDataBrowser"), dataBrowserIcon);
dataBrowserButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (dataBrowserFrame == null) {
DataBrowser dataBrowser = new DataBrowser();
dataBrowserFrame = DataBrowser.getDataBrowserFrame(dataBrowser, false);
// use this to allow only one dataBrowser
dataBrowserFrame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
dataBrowserFrame = null;
}
});
dataBrowserFrame.setVisible(true);
List<String> textToTransferts = dataStorageBean.getDataRecorderBean().getDataRecorderDetailsBean()
.getPathToCurrentFiles();
if ((textToTransferts != null) && !textToTransferts.isEmpty()) {
List<LoadParameter> paramList = new ArrayList<LoadParameter>();
for (String textToTransfert : textToTransferts) {
LoadParameter param = new PathParameter(textToTransfert);
paramList.add(param);
}
dataBrowser.loadSources(paramList);
}
} else {
// deiconify the frame and send it back to front
dataBrowserFrame.setExtendedState(Frame.NORMAL);
dataBrowserFrame.toFront();