/** * Function that overrides SwingWorkers doInBackground() and performs search for files that suits * user's criteria. The search performed in dedicated thread that runs in background. * * @return string[] that contains file names that were found in search */ @Override @SuppressWarnings({"unchecked", "serial", "rawtypes"}) protected String[] doInBackground() { handlerFrame.disableButtons(); list.setModel( new javax.swing.AbstractListModel() { String[] strings = {"Searching..."}; public int getSize() { return 1; } public Object getElementAt(int i) { return strings[i]; } }); if (isCancelled()) { list.setModel( new javax.swing.AbstractListModel() { String[] strings = {"Search operation was canceled"}; public int getSize() { return 1; } public Object getElementAt(int i) { return strings[i]; } }); return fileList(); } else { list.setEnabled(false); searchDirectory(_source); return fileList(); } }